Skip to content

Commit

Permalink
docs: Add Sphinx extension for copying code snippets in docs to clipb…
Browse files Browse the repository at this point in the history
…oard

This patch adds `sphinx-copybutton` as a dev dependency. It also contains a temporary workaround to the `make docs` target to avoid the build process from failing due to cross-reference warnings being treated as errors (T299404).

Bug: T299396
Change-Id: I42ade8b10b521877289b9fd870386471788c287d
  • Loading branch information
Slavina Stefanova authored and jenkins-bot committed Jan 21, 2022
1 parent 1c82bff commit efe2dbe
Show file tree
Hide file tree
Showing 4 changed files with 209 additions and 254 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ docs: ## Build sphinx docs
docker-compose exec web sh -c " \
poetry run sphinx-apidoc -f -o docs/source toolhub \
&& rm docs/source/modules.rst \
&& poetry run sphinx-build -W -b html docs/ docs/_build/html \
&& poetry run sphinx-build -b html docs/ docs/_build/html \
"
.PHONY: docs

Expand Down
4 changes: 4 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@


extensions = [
"sphinx_copybutton",
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
Expand Down Expand Up @@ -72,3 +73,6 @@

autodoc_default_flags = ["members", "private-members", "special-members"]
autodoc_memeber_order = "groupwise"

copybutton_prompt_text = r">>> |\.\.\. |\$ "
copybutton_prompt_is_regexp = True
Loading

0 comments on commit efe2dbe

Please sign in to comment.