summaryrefslogtreecommitdiff
path: root/doc/markup/code.rst
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-12-30 15:45:02 +0100
committerGeorg Brandl <georg@python.org>2008-12-30 15:45:02 +0100
commitc80dc58ac12e7ec585bf88fe7c328ef31a14ddfe (patch)
treea1967015d2937d9b771ddc9f9139db08b3cf8627 /doc/markup/code.rst
parentddee927c466689c88847499da579694bf0cc10c9 (diff)
downloadsphinx-git-c80dc58ac12e7ec585bf88fe7c328ef31a14ddfe.tar.gz
Rename "object" to "pyobject" and document it.
Diffstat (limited to 'doc/markup/code.rst')
-rw-r--r--doc/markup/code.rst12
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/markup/code.rst b/doc/markup/code.rst
index 299ab0bc0..2fd51c84b 100644
--- a/doc/markup/code.rst
+++ b/doc/markup/code.rst
@@ -113,8 +113,20 @@ Includes
.. literalinclude:: example.py
:encoding: latin-1
+ The directive also supports including only parts of the file. If it is a
+ Python module, you can select a class, function or method to include using
+ the ``pyobject`` option::
+
+ .. literalinclude:: example.py
+ :pyobject: Timer.start
+
+ This would only include the code lines belonging to the ``start()`` method in
+ the ``Timer`` class within the file.
+
.. versionadded:: 0.4.3
The ``encoding`` option.
+ .. versionadded:: 0.6
+ The ``pyobject`` option.
.. rubric:: Footnotes