diff options
| author | Georg Brandl <georg@python.org> | 2008-11-23 17:08:19 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2008-11-23 17:08:19 +0100 |
| commit | a26f2a028f8f54463d0a29ee6fd383891dc77adf (patch) | |
| tree | 09d93667332e9fbb5d858155ebe7bd1319713813 /doc/ext/appapi.rst | |
| parent | 050c3b0acb34f66d46a4139b59284aa2057338b6 (diff) | |
| download | sphinx-a26f2a028f8f54463d0a29ee6fd383891dc77adf.tar.gz | |
Fix param name and add example.
Diffstat (limited to 'doc/ext/appapi.rst')
| -rw-r--r-- | doc/ext/appapi.rst | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/doc/ext/appapi.rst b/doc/ext/appapi.rst index c4f3ee10..fcc29e38 100644 --- a/doc/ext/appapi.rst +++ b/doc/ext/appapi.rst @@ -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) |
