diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-03-29 23:52:32 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-03-30 14:50:37 +0900 |
commit | 61098a0ae2e696a804459d36bd74ca57db76eda5 (patch) | |
tree | 2d71c39d199fec7366a013e0b48c1b2fb4bc83ee /sphinx/ext/mathbase.py | |
parent | c1a254f2491436ac304f1f169aa488438abe4193 (diff) | |
download | sphinx-git-61098a0ae2e696a804459d36bd74ca57db76eda5.tar.gz |
Drop features and APIs deprecated in 1.8
Diffstat (limited to 'sphinx/ext/mathbase.py')
-rw-r--r-- | sphinx/ext/mathbase.py | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/sphinx/ext/mathbase.py b/sphinx/ext/mathbase.py deleted file mode 100644 index 0c89fd1ed..000000000 --- a/sphinx/ext/mathbase.py +++ /dev/null @@ -1,84 +0,0 @@ -""" - sphinx.ext.mathbase - ~~~~~~~~~~~~~~~~~~~ - - Set up math support in source files and LaTeX/text output. - - :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -import warnings - -from docutils import nodes -from docutils.parsers.rst.roles import math_role as math_role_base - -from sphinx.addnodes import math, math_block as displaymath # NOQA # to keep compatibility -from sphinx.builders.latex.nodes import math_reference as eqref # NOQA # to keep compatibility -from sphinx.deprecation import RemovedInSphinx30Warning -from sphinx.directives.patches import MathDirective as MathDirectiveBase -from sphinx.domains.math import MathDomain # NOQA # to keep compatibility -from sphinx.domains.math import MathReferenceRole as EqXRefRole # NOQA # to keep compatibility - -if False: - # For type annotation - from typing import Callable, Tuple # NOQA - from sphinx.application import Sphinx # NOQA - from sphinx.writers.html import HTMLTranslator # NOQA - - -class MathDirective(MathDirectiveBase): - def run(self): - warnings.warn('sphinx.ext.mathbase.MathDirective is moved to ' - 'sphinx.directives.patches package.', - RemovedInSphinx30Warning, stacklevel=2) - return super().run() - - -def math_role(role, rawtext, text, lineno, inliner, options={}, content=[]): - warnings.warn('sphinx.ext.mathbase.math_role() is deprecated. ' - 'Please use docutils.parsers.rst.roles.math_role() instead.', - RemovedInSphinx30Warning, stacklevel=2) - return math_role_base(role, rawtext, text, lineno, inliner, options, content) - - -def get_node_equation_number(writer, node): - # type: (HTMLTranslator, nodes.math_block) -> str - warnings.warn('sphinx.ext.mathbase.get_node_equation_number() is moved to ' - 'sphinx.util.math package.', - RemovedInSphinx30Warning, stacklevel=2) - from sphinx.util.math import get_node_equation_number - return get_node_equation_number(writer, node) - - -def wrap_displaymath(text, label, numbering): - # type: (str, str, bool) -> str - warnings.warn('sphinx.ext.mathbase.wrap_displaymath() is moved to ' - 'sphinx.util.math package.', - RemovedInSphinx30Warning, stacklevel=2) - from sphinx.util.math import wrap_displaymath - return wrap_displaymath(text, label, numbering) - - -def is_in_section_title(node): - # type: (nodes.Element) -> bool - """Determine whether the node is in a section title""" - from sphinx.util.nodes import traverse_parent - - warnings.warn('is_in_section_title() is deprecated.', - RemovedInSphinx30Warning, stacklevel=2) - - for ancestor in traverse_parent(node): - if isinstance(ancestor, nodes.title) and \ - isinstance(ancestor.parent, nodes.section): - return True - return False - - -def setup_math(app, htmlinlinevisitors, htmldisplayvisitors): - # type: (Sphinx, Tuple[Callable, Callable], Tuple[Callable, Callable]) -> None - warnings.warn('setup_math() is deprecated. ' - 'Please use app.add_html_math_renderer() instead.', - RemovedInSphinx30Warning, stacklevel=2) - - app.add_html_math_renderer('unknown', htmlinlinevisitors, htmldisplayvisitors) |