summaryrefslogtreecommitdiff
path: root/sphinx/domains/math.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/domains/math.py')
-rw-r--r--sphinx/domains/math.py24
1 files changed, 2 insertions, 22 deletions
diff --git a/sphinx/domains/math.py b/sphinx/domains/math.py
index e77bd0ed7..02c93433a 100644
--- a/sphinx/domains/math.py
+++ b/sphinx/domains/math.py
@@ -8,15 +8,14 @@
:license: BSD, see LICENSE for details.
"""
-import warnings
from typing import Any, Dict, Iterable, List, Tuple
+from typing import TYPE_CHECKING
from docutils import nodes
from docutils.nodes import Element, Node, system_message
from docutils.nodes import make_id
from sphinx.addnodes import pending_xref
-from sphinx.deprecation import RemovedInSphinx40Warning
from sphinx.domains import Domain
from sphinx.environment import BuildEnvironment
from sphinx.locale import __
@@ -24,8 +23,7 @@ from sphinx.roles import XRefRole
from sphinx.util import logging
from sphinx.util.nodes import make_refnode
-if False:
- # For type annotation
+if TYPE_CHECKING:
from sphinx.application import Sphinx
from sphinx.builders import Builder
@@ -140,24 +138,6 @@ class MathDomain(Domain):
def get_objects(self) -> List:
return []
- def add_equation(self, env: BuildEnvironment, docname: str, labelid: str) -> int:
- warnings.warn('MathDomain.add_equation() is deprecated.',
- RemovedInSphinx40Warning, stacklevel=2)
- if labelid in self.equations:
- path = env.doc2path(self.equations[labelid][0])
- msg = __('duplicate label of equation %s, other instance in %s') % (labelid, path)
- raise UserWarning(msg)
- else:
- eqno = self.get_next_equation_number(docname)
- self.equations[labelid] = (docname, eqno)
- return eqno
-
- def get_next_equation_number(self, docname: str) -> int:
- warnings.warn('MathDomain.get_next_equation_number() is deprecated.',
- RemovedInSphinx40Warning, stacklevel=2)
- targets = [eq for eq in self.equations.values() if eq[0] == docname]
- return len(targets) + 1
-
def has_equations(self) -> bool:
return any(self.data['has_equations'].values())