mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add add_generic_role().
This commit is contained in:
3
CHANGES
3
CHANGES
@@ -81,6 +81,9 @@ New features added
|
||||
- There is now a ``Sphinx.add_lexer()`` method to be able to use
|
||||
custom Pygments lexers easily.
|
||||
|
||||
- There is now ``Sphinx.add_generic_rol()`` to mirror the docutils'
|
||||
own function.
|
||||
|
||||
* Other changes:
|
||||
|
||||
- Config overrides for single dict keys can now be given on the
|
||||
|
||||
@@ -86,6 +86,13 @@ the following public API:
|
||||
source, *role* the role function (see the `Docutils documentation
|
||||
<http://docutils.sourceforge.net/docs/howto/rst-roles.html>`_ on details).
|
||||
|
||||
.. method:: Sphinx.add_generic_role(name, nodeclass)
|
||||
|
||||
Register a Docutils role that does nothing but wrap its contents in the
|
||||
node given by *nodeclass*.
|
||||
|
||||
.. versionadded:: 0.6
|
||||
|
||||
.. method:: Sphinx.add_description_unit(directivename, rolename, indextemplate='', parse_node=None, ref_nodeclass=None)
|
||||
|
||||
This method is a very convenient way to add a new type of information that
|
||||
|
||||
@@ -279,6 +279,9 @@ class Sphinx(object):
|
||||
def add_role(self, name, role):
|
||||
roles.register_canonical_role(name, role)
|
||||
|
||||
def add_generic_role(self, name, nodeclass):
|
||||
roles.register_generic_role(name, nodeclass)
|
||||
|
||||
def add_description_unit(self, directivename, rolename, indextemplate='',
|
||||
parse_node=None, ref_nodeclass=None):
|
||||
additional_xref_types[directivename] = (rolename, indextemplate, parse_node)
|
||||
|
||||
Reference in New Issue
Block a user