summaryrefslogtreecommitdiff
path: root/sphinx/util/math.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/util/math.py')
-rw-r--r--sphinx/util/math.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/sphinx/util/math.py b/sphinx/util/math.py
index b960613c0..a474a83f7 100644
--- a/sphinx/util/math.py
+++ b/sphinx/util/math.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
"""
sphinx.util.math
~~~~~~~~~~~~~~~~
@@ -13,31 +12,29 @@
if False:
# For type annotation
from docutils import nodes # NOQA
- from docutils.writers.html4css1 import Writer # NOQA
+ from sphinx.builders.html import HTMLTranslator # NOQA
def get_node_equation_number(writer, node):
- # type: (Writer, nodes.Node) -> unicode
+ # type: (HTMLTranslator, nodes.math_block) -> str
if writer.builder.config.math_numfig and writer.builder.config.numfig:
figtype = 'displaymath'
if writer.builder.name == 'singlehtml':
- key = u"%s/%s" % (writer.docnames[-1], figtype)
+ key = "%s/%s" % (writer.docnames[-1], figtype)
else:
key = figtype
id = node['ids'][0]
number = writer.builder.fignumbers.get(key, {}).get(id, ())
- number = '.'.join(map(str, number))
+ return '.'.join(map(str, number))
else:
- number = node['number']
-
- return number
+ return node['number']
def wrap_displaymath(text, label, numbering):
- # type: (unicode, unicode, bool) -> unicode
+ # type: (str, str, bool) -> str
def is_equation(part):
- # type: (unicode) -> unicode
+ # type: (str) -> str
return part.strip()
if label is None: