mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch '2.1.3' into 2.0
This commit is contained in:
commit
fd5b3c47b6
2
setup.py
2
setup.py
@ -47,7 +47,7 @@ extras_require = {
|
||||
'html5lib',
|
||||
'flake8>=3.5.0',
|
||||
'flake8-import-order',
|
||||
'mypy>=0.590',
|
||||
'mypy>=0.710',
|
||||
'docutils-stubs',
|
||||
],
|
||||
}
|
||||
|
@ -910,12 +910,13 @@ class StandardDomain(Domain):
|
||||
# type: (nodes.Node) -> str
|
||||
"""Get the title of enumerable nodes to refer them using its title"""
|
||||
if self.is_enumerable_node(node):
|
||||
_, title_getter = self.enumerable_nodes.get(node.__class__, (None, None))
|
||||
elem = cast(nodes.Element, node)
|
||||
_, title_getter = self.enumerable_nodes.get(elem.__class__, (None, None))
|
||||
if title_getter:
|
||||
return title_getter(node)
|
||||
return title_getter(elem)
|
||||
else:
|
||||
for subnode in node:
|
||||
if subnode.tagname in ('caption', 'title'):
|
||||
for subnode in elem:
|
||||
if isinstance(subnode, (nodes.caption, nodes.title)):
|
||||
return clean_astext(subnode)
|
||||
|
||||
return None
|
||||
|
@ -123,7 +123,7 @@ def isenumattribute(x: Any) -> bool:
|
||||
|
||||
def ispartial(obj: Any) -> bool:
|
||||
"""Check if the object is partial."""
|
||||
return isinstance(obj, (partial, partialmethod))
|
||||
return isinstance(obj, (partial, partialmethod)) # type: ignore
|
||||
|
||||
|
||||
def isclassmethod(obj: Any) -> bool:
|
||||
|
@ -30,7 +30,7 @@ class PyStemmer(BaseStemmer):
|
||||
return self.stemmer.stemWord(word)
|
||||
|
||||
|
||||
class StandardStemmer(PorterStemmer, BaseStemmer): # type: ignore
|
||||
class StandardStemmer(PorterStemmer, BaseStemmer):
|
||||
"""All those porter stemmer implementations look hideous;
|
||||
make at least the stem method nicer.
|
||||
"""
|
||||
|
@ -2598,7 +2598,7 @@ class LaTeXTranslator(SphinxTranslator):
|
||||
RemovedInSphinx30Warning)
|
||||
|
||||
def visit_admonition(self, node):
|
||||
# type: (nodes.Element) -> None
|
||||
# type: (LaTeXTranslator, nodes.Element) -> None
|
||||
self.body.append('\n\\begin{sphinxadmonition}{%s}{%s:}' %
|
||||
(name, admonitionlabels[name]))
|
||||
return visit_admonition
|
||||
|
@ -1752,6 +1752,6 @@ class TexinfoTranslator(SphinxTranslator):
|
||||
RemovedInSphinx30Warning)
|
||||
|
||||
def visit(self, node):
|
||||
# type: (nodes.Element) -> None
|
||||
# type: (TexinfoTranslator, nodes.Element) -> None
|
||||
self.visit_admonition(node, admonitionlabels[name])
|
||||
return visit
|
||||
|
@ -1375,6 +1375,6 @@ class TextTranslator(SphinxTranslator):
|
||||
RemovedInSphinx30Warning)
|
||||
|
||||
def depart_admonition(self, node):
|
||||
# type: (nodes.Element) -> None
|
||||
# type: (TextTranslator, nodes.Element) -> None
|
||||
self.end_state(first=admonitionlabels[name] + ': ')
|
||||
return depart_admonition
|
||||
|
Loading…
Reference in New Issue
Block a user