mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add the "viewcode" extension.
This commit is contained in:
@@ -7,7 +7,7 @@ import sys, os, re
|
||||
# Add any Sphinx extension module names here, as strings. They can be extensions
|
||||
# coming with Sphinx (named 'sphinx.addons.*') or your custom ones.
|
||||
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo',
|
||||
'sphinx.ext.autosummary']
|
||||
'sphinx.ext.autosummary', 'sphinx.ext.viewcode']
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
19
doc/ext/viewcode.rst
Normal file
19
doc/ext/viewcode.rst
Normal file
@@ -0,0 +1,19 @@
|
||||
:mod:`sphinx.ext.viewcode` -- Add links to highlighted source code
|
||||
==================================================================
|
||||
|
||||
.. module:: sphinx.ext.viewcode
|
||||
:synopsis: Add links to a highlighted version of the source code.
|
||||
.. moduleauthor:: Georg Brandl
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
|
||||
This extension looks at your Python object descriptions (``.. class::``,
|
||||
``.. function::`` etc.) and tries to find the source files where the objects are
|
||||
contained. When found, a separate HTML page will be output for each module with
|
||||
a highlighted version of the source code, and a link will be added to all object
|
||||
descriptions that leads to the source code of the described object. A link back
|
||||
from the source to the description will also be inserted.
|
||||
|
||||
There are currently no configuration values for this extension; you just need to
|
||||
add ``'sphinx.ext.viewcode'`` to your :confval:`extensions` value for it to work.
|
||||
@@ -52,6 +52,7 @@ These extensions are built in and can be activated by respective entries in the
|
||||
ext/coverage
|
||||
ext/todo
|
||||
ext/extlinks
|
||||
ext/viewcode
|
||||
|
||||
|
||||
Third-party extensions
|
||||
|
||||
Reference in New Issue
Block a user