summaryrefslogtreecommitdiff
path: root/sphinx/ext/mathbase.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2011-06-30 09:08:21 +0200
committerGeorg Brandl <georg@python.org>2011-06-30 09:08:21 +0200
commit66c2bc7b9cd9fecd47528490d1ec4d3672c0a51e (patch)
treeafa34594463eb6bd8e0f8721bda861d68f7ca4a7 /sphinx/ext/mathbase.py
parent485e1e0d373e052b5117f52b149e33d50aaf4604 (diff)
downloadsphinx-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.py5
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]