mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
The math extension displaymath directives now support `name
` in
addition to ``label`` for giving the equation label, for compatibility with Docutils.
This commit is contained in:
parent
485e1e0d37
commit
66c2bc7b9c
3
CHANGES
3
CHANGES
@ -91,6 +91,9 @@ Features added
|
|||||||
- #367: Added automatic exclusion of hidden members in inheritance
|
- #367: Added automatic exclusion of hidden members in inheritance
|
||||||
diagrams, and an option to selectively enable it.
|
diagrams, and an option to selectively enable it.
|
||||||
- Added :confval:`pngmath_add_tooltips`.
|
- 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:
|
* New locales:
|
||||||
|
|
||||||
|
@ -56,6 +56,7 @@ class MathDirective(Directive):
|
|||||||
final_argument_whitespace = True
|
final_argument_whitespace = True
|
||||||
option_spec = {
|
option_spec = {
|
||||||
'label': directives.unchanged,
|
'label': directives.unchanged,
|
||||||
|
'name': directives.unchanged,
|
||||||
'nowrap': directives.flag,
|
'nowrap': directives.flag,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,7 +66,9 @@ class MathDirective(Directive):
|
|||||||
latex = self.arguments[0] + '\n\n' + latex
|
latex = self.arguments[0] + '\n\n' + latex
|
||||||
node = displaymath()
|
node = displaymath()
|
||||||
node['latex'] = latex
|
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['nowrap'] = 'nowrap' in self.options
|
||||||
node['docname'] = self.state.document.settings.env.docname
|
node['docname'] = self.state.document.settings.env.docname
|
||||||
ret = [node]
|
ret = [node]
|
||||||
|
Loading…
Reference in New Issue
Block a user