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 | 66c2bc7b9cd9fecd47528490d1ec4d3672c0a51e (patch) | |
tree | afa34594463eb6bd8e0f8721bda861d68f7ca4a7 /sphinx/ext/mathbase.py | |
parent | 485e1e0d373e052b5117f52b149e33d50aaf4604 (diff) | |
download | sphinx-git-66c2bc7b9cd9fecd47528490d1ec4d3672c0a51e.tar.gz |
The math extension displaymath directives now support ``name`` in
addition to ``label`` for giving the equation label, for compatibility
with Docutils.
Diffstat (limited to 'sphinx/ext/mathbase.py')
-rw-r--r-- | sphinx/ext/mathbase.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sphinx/ext/mathbase.py b/sphinx/ext/mathbase.py index b5473449e..1a2ca6afe 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] |