diff --git a/doc/requirements.txt b/doc/requirements.txt index 0181c1a37d..a3d763c662 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -5,6 +5,7 @@ # this is required for the docs build jobs sphinx>=2.0.0,!=2.1.0 # BSD sphinxcontrib-svg2pdfconverter>=0.1.0 # BSD +sphinx-copybutton>=0.5.2 # MIT openstackdocstheme>=2.2.1 # Apache-2.0 reno>=3.1.0 # Apache-2.0 doc8>=0.8.1 # Apache-2.0 diff --git a/doc/source/conf.py b/doc/source/conf.py index c5894af233..ffdf69ecb6 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -123,9 +123,13 @@ extensions = [ 'openstackdocstheme', 'sphinx.ext.autodoc', 'sphinx.ext.extlinks', - 'sphinxcontrib.rsvgconverter' + 'sphinxcontrib.rsvgconverter', + 'sphinx_copybutton' ] +# Remove the prompt text from lines +copybutton_prompt_text = "# " + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/doc/source/deploy-guide/source/conf.py b/doc/source/deploy-guide/source/conf.py index c5a64e7fcf..f3ea99b4a4 100644 --- a/doc/source/deploy-guide/source/conf.py +++ b/doc/source/deploy-guide/source/conf.py @@ -100,8 +100,11 @@ sys.path.insert(0, os.path.abspath('../../inventory/')) extensions = [ 'openstackdocstheme', 'sphinx.ext.autodoc', - 'sphinx.ext.extlinks' + 'sphinx.ext.extlinks', + 'sphinx_copybutton' ] +# Remove the prompt text from lines +copybutton_prompt_text = "# " # Add any paths that contain templates here, relative to this directory. # templates_path = ['_templates']