diff options
Diffstat (limited to 'sphinx/application.py')
-rw-r--r-- | sphinx/application.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sphinx/application.py b/sphinx/application.py index 0f887b2a5..5da89dd31 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -1221,6 +1221,20 @@ class Sphinx(object): logger.debug('[app] adding HTML theme: %r, %r', name, theme_path) self.html_themes[name] = theme_path + def add_html_math_renderer(self, name, inline_renderers=None, block_renderers=None): + # type: (unicode, Tuple[Callable, Callable], Tuple[Callable, Callable]) -> None + """Register a math renderer for HTML. + + The *name* is a name of the math renderer. Both *inline_renderers* and + *block_renderes* are used as visitor functions for HTML writer. + *inline_renderers* is used for inline math node (``nodes.math`)). The + another is used for block math node (``nodes.math_block``). About + visitor functions, see :meth:`add_node` for more details. + + .. versionadded:: 1.8 + """ + self.registry.add_html_math_renderer(name, inline_renderers, block_renderers) + def add_message_catalog(self, catalog, locale_dir): # type: (unicode, unicode) -> None """Register a message catalog. |