mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-10-13 08:52:13 -05:00
Fix param name and add example.
This commit is contained in:
1 parent
b0b725d66b
commit
404625e718
1 file changed
+11
-1
+11
-1
@@ -59,7 +59,7 @@ the following public API:
|
|||||||
.. versionchanged:: 0.5
|
.. versionchanged:: 0.5
|
||||||
Added the support for keyword arguments giving visit functions.
|
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
|
Register a Docutils directive. *name* must be the prospective directive
|
||||||
name, *func* the directive function for details about the signature and
|
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
|
options, respectively. For their exact meaning, please consult the Docutils
|
||||||
documentation.
|
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
|
.. XXX once we target docutils 0.5, update this
|
||||||
|
|
||||||
.. method:: Sphinx.add_role(name, role)
|
.. method:: Sphinx.add_role(name, role)
|
||||||
|
|||||||
Reference in new issue
Block a user