Skip to content

Commit

Permalink
Add copybutton extension to template docs. (#429)
Browse files Browse the repository at this point in the history
* Add copybutton extension to template docs.

* Formatting.
  • Loading branch information
delucchi-cmu authored Feb 16, 2024
1 parent d395883 commit d2331ae
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ extensions.append("autoapi.extension")
extensions.append("nbsphinx")
{%- endif %}

# -- sphinx-copybutton configuration ----------------------------------------
extensions.append("sphinx_copybutton")
## sets up the expected prompt text from console blocks, and excludes it from
## the text that goes into the clipboard.
copybutton_exclude = ".linenos, .gp"
copybutton_prompt_text = ">> "

## lets us suppress the copy button on select code blocks.
copybutton_selector = "div:not(.no-copybutton) > div.highlight > pre"

templates_path = []
exclude_patterns = ["_build", "**.ipynb_checkpoints"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ virtual environment. LINCC-Frameworks engineers primarily use `conda` to manage
environments. If you have conda installed locally, you can run the following to
create and activate a new environment.

.. code-block:: bash
.. code-block:: console

>> conda create env -n <env_name> python=3.10
>> conda activate <env_name>
Expand All @@ -22,7 +22,7 @@ create and activate a new environment.
Once you have created a new environment, you can install this project for local
development using the following commands:

.. code-block:: bash
.. code-block:: console

>> pip install -e .'[dev]'
>> pre-commit install
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
sphinx
sphinx-rtd-theme
sphinx-autoapi
sphinx-copybutton
{%- if include_notebooks %}
nbsphinx
ipython
Expand Down

0 comments on commit d2331ae

Please sign in to comment.