Jelajahi Sumber

Merge pull request #6662 from danielballan/add-sphinx-copybutton

Add sphinx-copybutton extension.
Saul Shanabrook 5 tahun lalu
induk
melakukan
275892e585
4 mengubah file dengan 6 tambahan dan 3 penghapusan
  1. 1 0
      docs/environment.yml
  2. 2 1
      docs/source/conf.py
  3. 1 1
      scripts/travis_script.sh
  4. 2 1
      setup.py

+ 1 - 0
docs/environment.yml

@@ -4,5 +4,6 @@ channels:
 dependencies:
 - python=3.5
 - sphinx>=1.8
+- sphinx-copybutton
 - sphinx_rtd_theme
 - recommonmark

+ 2 - 1
docs/source/conf.py

@@ -36,7 +36,8 @@ from recommonmark.transform import AutoStructify
 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
 # ones.
 extensions = ['sphinx.ext.intersphinx',
-    'sphinx.ext.mathjax']
+    'sphinx.ext.mathjax',
+    'sphinx_copybutton']
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']

+ 1 - 1
scripts/travis_script.sh

@@ -36,7 +36,7 @@ if [[ $GROUP == docs ]]; then
 
     # Verify tutorial docs build
     pushd docs
-    pip install sphinx sphinx_rtd_theme recommonmark
+    pip install sphinx sphinx-copybutton sphinx_rtd_theme recommonmark
     make linkcheck
     make html
     popd

+ 2 - 1
setup.py

@@ -145,7 +145,8 @@ setup_args['extras_require'] = {
     'docs': [
         'sphinx',
         'recommonmark',
-        'sphinx_rtd_theme'
+        'sphinx_rtd_theme',
+        'sphinx-copybutton'
     ],
 }