mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
`math
directive does not support
:class:
` option
``:class:`` option is a common options for all directives. But our implementation does not support it so far. This adds support for the option.
This commit is contained in:
parent
86f0336693
commit
3d4fc8c47c
1
CHANGES
1
CHANGES
@ -49,6 +49,7 @@ Features added
|
|||||||
* Add a helper class ``sphinx.transforms.post_transforms.SphinxPostTransform``
|
* Add a helper class ``sphinx.transforms.post_transforms.SphinxPostTransform``
|
||||||
* Add a helper method ``SphinxDirective.set_source_info()``
|
* Add a helper method ``SphinxDirective.set_source_info()``
|
||||||
* #6180: Support ``--keep-going`` with BuildDoc setup command
|
* #6180: Support ``--keep-going`` with BuildDoc setup command
|
||||||
|
* ``math`` directive now supports ``:class:`` option
|
||||||
|
|
||||||
Bugs fixed
|
Bugs fixed
|
||||||
----------
|
----------
|
||||||
|
@ -165,6 +165,7 @@ class MathDirective(SphinxDirective):
|
|||||||
option_spec = {
|
option_spec = {
|
||||||
'label': directives.unchanged,
|
'label': directives.unchanged,
|
||||||
'name': directives.unchanged,
|
'name': directives.unchanged,
|
||||||
|
'class': directives.class_option,
|
||||||
'nowrap': directives.flag,
|
'nowrap': directives.flag,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,6 +176,7 @@ class MathDirective(SphinxDirective):
|
|||||||
latex = self.arguments[0] + '\n\n' + latex
|
latex = self.arguments[0] + '\n\n' + latex
|
||||||
label = self.options.get('label', self.options.get('name'))
|
label = self.options.get('label', self.options.get('name'))
|
||||||
node = nodes.math_block(latex, latex,
|
node = nodes.math_block(latex, latex,
|
||||||
|
classes=self.options.get('class', []),
|
||||||
docname=self.env.docname,
|
docname=self.env.docname,
|
||||||
number=None,
|
number=None,
|
||||||
label=label,
|
label=label,
|
||||||
|
Loading…
Reference in New Issue
Block a user