diff --git a/python-project-template/{% if include_docs %}docs{% endif %}/conf.py.jinja b/python-project-template/{% if include_docs %}docs{% endif %}/conf.py.jinja index 4fcc74c7..05e255ea 100644 --- a/python-project-template/{% if include_docs %}docs{% endif %}/conf.py.jinja +++ b/python-project-template/{% if include_docs %}docs{% endif %}/conf.py.jinja @@ -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"] diff --git a/python-project-template/{% if include_docs %}docs{% endif %}/index.rst.jinja b/python-project-template/{% if include_docs %}docs{% endif %}/index.rst.jinja index 60595ba6..4c2dc087 100644 --- a/python-project-template/{% if include_docs %}docs{% endif %}/index.rst.jinja +++ b/python-project-template/{% if include_docs %}docs{% endif %}/index.rst.jinja @@ -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 python=3.10 >> conda activate @@ -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 diff --git a/python-project-template/{% if include_docs %}docs{% endif %}/requirements.txt.jinja b/python-project-template/{% if include_docs %}docs{% endif %}/requirements.txt.jinja index 645c536c..7ae704e3 100644 --- a/python-project-template/{% if include_docs %}docs{% endif %}/requirements.txt.jinja +++ b/python-project-template/{% if include_docs %}docs{% endif %}/requirements.txt.jinja @@ -1,6 +1,7 @@ sphinx sphinx-rtd-theme sphinx-autoapi +sphinx-copybutton {%- if include_notebooks %} nbsphinx ipython