Fix param name and add example.

This commit is contained in:
Georg Brandl
2008-11-23 17:08:19 +01:00
parent b0b725d66b
commit 404625e718

View File

@@ -59,7 +59,7 @@ the following public API:
.. versionchanged:: 0.5
Added the support for keyword arguments giving visit functions.
.. method:: Sphinx.add_directive(name, cls, content, arguments, **options)
.. method:: Sphinx.add_directive(name, func, content, arguments, **options)
Register a Docutils directive. *name* must be the prospective directive
name, *func* the directive function for details about the signature and
@@ -68,6 +68,16 @@ the following public API:
options, respectively. For their exact meaning, please consult the Docutils
documentation.
For example, the (already existing) :dir:`literalinclude` directive would be
added like this::
from docutils.parsers.rst import directives
add_directive('literalinclude', literalinclude_directive,
content = 0, arguments = (1, 0, 0),
linenos = directives.flag,
language = direcitves.unchanged,
encoding = directives.encoding)
.. XXX once we target docutils 0.5, update this
.. method:: Sphinx.add_role(name, role)