summaryrefslogtreecommitdiff
path: root/doc/ext/viewcode.rst
diff options
context:
space:
mode:
Diffstat (limited to 'doc/ext/viewcode.rst')
-rw-r--r--doc/ext/viewcode.rst23
1 files changed, 22 insertions, 1 deletions
diff --git a/doc/ext/viewcode.rst b/doc/ext/viewcode.rst
index ba6c8f86..f2b6c928 100644
--- a/doc/ext/viewcode.rst
+++ b/doc/ext/viewcode.rst
@@ -16,4 +16,25 @@ 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.
+add ``'sphinx.ext.viewcode'`` to your :confval:`extensions` value for it to
+work.
+
+There is also an additional config value:
+
+.. confval:: viewcode_import
+
+ If this is ``True``, viewcode extension will follow alias objects that
+ imported from another module such as functions, classes and attributes.
+ As side effects, this option
+ else they produce nothing. The default is ``True``.
+
+ .. warning::
+
+ :confval:`viewcode_import` **imports** the modules to be followed real
+ location. If any modules have side effects on import, these will be
+ executed by ``viewcode`` when ``sphinx-build`` is run.
+
+ If you document scripts (as opposed to library modules), make sure their
+ main routine is protected by a ``if __name__ == '__main__'`` condition.
+
+ .. versionadded:: 1.3