From e9c79382e51d6aca7600addf51c53c4bb0344196 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 29 Nov 2008 20:04:11 +0100 Subject: Some more fixes after the great renaming. --- doc/ext/appapi.rst | 2 +- doc/ext/builderapi.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/ext') diff --git a/doc/ext/appapi.rst b/doc/ext/appapi.rst index fcc29e38..355e42bd 100644 --- a/doc/ext/appapi.rst +++ b/doc/ext/appapi.rst @@ -13,7 +13,7 @@ the following public API: .. method:: Sphinx.add_builder(builder) Register a new builder. *builder* must be a class that inherits from - :class:`~sphinx.builder.Builder`. + :class:`~sphinx.builders.Builder`. .. method:: Sphinx.add_config_value(name, default, rebuild_env) diff --git a/doc/ext/builderapi.rst b/doc/ext/builderapi.rst index adc41016..72c388fb 100644 --- a/doc/ext/builderapi.rst +++ b/doc/ext/builderapi.rst @@ -5,7 +5,7 @@ Writing new builders .. todo:: Expand this. -.. currentmodule:: sphinx.builder +.. currentmodule:: sphinx.builders .. class:: Builder -- cgit v1.2.1 From 0647cdecb439fa4dfd9bbdf094409e262cf33483 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 30 Nov 2008 19:58:29 +0100 Subject: Add Sphinx.add_lexer(). --- doc/ext/appapi.rst | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'doc/ext') diff --git a/doc/ext/appapi.rst b/doc/ext/appapi.rst index 355e42bd..3dd5282b 100644 --- a/doc/ext/appapi.rst +++ b/doc/ext/appapi.rst @@ -167,6 +167,13 @@ the following public API: :confval:`the docs for the config value `. .. versionadded:: 0.5 + +.. method:: Sphinx.add_lexer(alias, lexer) + + Use *lexer*, which must be an instance of a Pygments lexer class, to + highlight code blocks with the given language *alias*. + + .. versionadded:: 0.6 .. method:: Sphinx.connect(event, callback) -- cgit v1.2.1 From c0ee529e88d68c1564b96b525c8ec225a1525282 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Mon, 15 Dec 2008 12:33:13 +0100 Subject: Add "doctest_global_setup" conf val. --- doc/ext/doctest.rst | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'doc/ext') diff --git a/doc/ext/doctest.rst b/doc/ext/doctest.rst index 9de6ba9e..7117f6a9 100644 --- a/doc/ext/doctest.rst +++ b/doc/ext/doctest.rst @@ -149,6 +149,14 @@ There are also these config values for customizing the doctest extension: A list of directories that will be added to :data:`sys.path` when the doctest builder is used. (Make sure it contains absolute paths.) +.. confval:: doctest_global_setup + + Python code that is treated like it were put in a ``testsetup`` directive for + *every* file that is tested, and for every group. You can use this to + e.g. import modules you will always need in your doctests. + + .. versionadded:: 0.6 + .. confval:: doctest_test_doctest_blocks If this is a nonempty string (the default is ``'default'``), standard reST -- cgit v1.2.1 From 9a4dd190774d8a2db1d7ab2979b2d473ac5150c2 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Fri, 26 Dec 2008 20:17:59 +0100 Subject: Improve builder docs a bit. --- doc/ext/builderapi.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'doc/ext') diff --git a/doc/ext/builderapi.rst b/doc/ext/builderapi.rst index 72c388fb..5c671f2d 100644 --- a/doc/ext/builderapi.rst +++ b/doc/ext/builderapi.rst @@ -20,7 +20,7 @@ Writing new builders .. automethod:: build_update .. automethod:: build - These methods must be overridden in concrete builder classes: + These methods can be overridden in concrete builder classes: .. automethod:: init .. automethod:: get_outdated_docs @@ -28,3 +28,7 @@ Writing new builders .. automethod:: prepare_writing .. automethod:: write_doc .. automethod:: finish + + Useful helpers: + + .. automethod:: init_templates -- cgit v1.2.1 From cb999405797a73ccf02eed249bfe628b3f305699 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 6 Jan 2009 00:28:29 +0100 Subject: Document how autodoc with attributes works. --- doc/ext/autodoc.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'doc/ext') diff --git a/doc/ext/autodoc.rst b/doc/ext/autodoc.rst index 993f971a..e0766938 100644 --- a/doc/ext/autodoc.rst +++ b/doc/ext/autodoc.rst @@ -135,12 +135,30 @@ directive. .. directive:: autofunction + autodata automethod autoattribute These work exactly like :dir:`autoclass` etc., but do not offer the options used for automatic member documentation. + For module data members and class attributes, documentation can either be put + into a special-formatted comment *before* the attribute definition, or in a + docstring *after* the definition. This means that in the following class + definition, both attributes can be autodocumented:: + + class Foo: + """Docstring for class Foo.""" + + #: Doc comment for attribute Foo.bar. + bar = 1 + + baz = 2 + """Docstring for attribute Foo.baz.""" + + .. versionchanged:: 0.6 + :dir:`autodata` and :dir:`autoattribute` can now extract docstrings. + .. note:: If you document decorated functions or methods, keep in mind that autodoc -- cgit v1.2.1