Merge pull request #2797 from shibukawa/fix/sphinxdoc

fix document download roles. download roles works only on html.
This commit is contained in:
Takeshi KOMIYA 2016-07-20 23:24:38 +09:00 committed by GitHub
commit 8d8e35a043
3 changed files with 12 additions and 2 deletions

View File

@ -9,7 +9,9 @@ Example Google Style Python Docstrings
:ref:`example_numpy`
Download: :download:`example_google.py <example_google.py>`
.. only:: builder_html
Download: :download:`example_google.py <example_google.py>`
.. literalinclude:: example_google.py
:language: python

View File

@ -9,7 +9,9 @@ Example NumPy Style Python Docstrings
:ref:`example_google`
Download: :download:`example_numpy.py <example_numpy.py>`
.. only:: builder_html
Download: :download:`example_numpy.py <example_numpy.py>`
.. literalinclude:: example_numpy.py
:language: python

View File

@ -200,6 +200,12 @@ Referencing downloadable files
The ``example.py`` file will be copied to the output directory, and a
suitable link generated to it.
Not to show unavailable download links, you should wrap whole paragraphs that
have this role::
.. only:: builder_html
See :download:`this example script <../example.py>`.
Cross-referencing figures by figure number
------------------------------------------