diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-03-02 22:52:39 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-05-17 00:42:22 +0900 |
commit | e675ad2ec91407d516a51304f6bd7fd683f2371c (patch) | |
tree | d33c289de66b22d0e9c5ea133afc3b15e8f91712 /sphinx/addnodes.py | |
parent | 4e04bff4f50bc382251437d5faafff9c34c492cb (diff) | |
download | sphinx-git-e675ad2ec91407d516a51304f6bd7fd683f2371c.tar.gz |
Enable math_block node rendering by default (without HTML builders)
Diffstat (limited to 'sphinx/addnodes.py')
-rw-r--r-- | sphinx/addnodes.py | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/sphinx/addnodes.py b/sphinx/addnodes.py index 56f23bba3..37e54cfc7 100644 --- a/sphinx/addnodes.py +++ b/sphinx/addnodes.py @@ -187,7 +187,7 @@ class production(nodes.Part, nodes.Inline, nodes.FixedTextElement): """Node for a single grammar production rule.""" -# math node +# math nodes class math(nodes.math): @@ -208,6 +208,29 @@ class math(nodes.math): return nodes.math.__getitem__(self, key) +class math_block(nodes.math_block): + """Node for block level equations. + + .. deprecated:: 1.8 + """ + + def __getitem__(self, key): + if key == 'latex' and 'latex' not in self.attributes: + warnings.warn("displaymath node for Sphinx was replaced by docutils'. " + "Therefore please use ``node.astext()`` to get an equation instead.", + RemovedInSphinx30Warning) + return self.astext() + else: + return nodes.math_block.__getitem__(self, key) + + +class displaymath(math_block): + """Node for block level equations. + + .. deprecated:: 1.8 + """ + + # other directive-level nodes class index(nodes.Invisible, nodes.Inline, nodes.TextElement): |