diff options
author | Georg Brandl <georg@python.org> | 2011-06-30 09:08:21 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2011-06-30 09:08:21 +0200 |
commit | 381b3abead74f0308cadfae35e3ce73a165a546d (patch) | |
tree | afa34594463eb6bd8e0f8721bda861d68f7ca4a7 | |
parent | 86e7c7d071cd0fcb33b7a5ea22e436df2248575e (diff) | |
download | sphinx-381b3abead74f0308cadfae35e3ce73a165a546d.tar.gz |
The math extension displaymath directives now support ``name`` in
addition to ``label`` for giving the equation label, for compatibility
with Docutils.
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | sphinx/ext/mathbase.py | 5 |
2 files changed, 7 insertions, 1 deletions
@@ -91,6 +91,9 @@ Features added - #367: Added automatic exclusion of hidden members in inheritance diagrams, and an option to selectively enable it. - Added :confval:`pngmath_add_tooltips`. + - The math extension displaymath directives now support ``name`` in + addition to ``label`` for giving the equation label, for compatibility + with Docutils. * New locales: diff --git a/sphinx/ext/mathbase.py b/sphinx/ext/mathbase.py index b5473449..1a2ca6af 100644 --- a/sphinx/ext/mathbase.py +++ b/sphinx/ext/mathbase.py @@ -56,6 +56,7 @@ class MathDirective(Directive): final_argument_whitespace = True option_spec = { 'label': directives.unchanged, + 'name': directives.unchanged, 'nowrap': directives.flag, } @@ -65,7 +66,9 @@ class MathDirective(Directive): latex = self.arguments[0] + '\n\n' + latex node = displaymath() node['latex'] = latex - node['label'] = self.options.get('label', None) + node['label'] = self.options.get('name', None) + if node['label'] is None: + node['label'] = self.options.get('label', None) node['nowrap'] = 'nowrap' in self.options node['docname'] = self.state.document.settings.env.docname ret = [node] |