diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-01-07 19:23:17 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-01-07 19:23:17 +0300 |
commit | 5460ea103bd91ce910e50e11e05c1e5340c2a9e0 (patch) | |
tree | 2009eec87f4ef7442cd29158c000bd12be17b999 /sphinx/domains | |
parent | 5ba5602d7173d0da7adfb4f1e6279ff40c56ef47 (diff) | |
parent | d9569a84a28b4720f9adf69ef9778961585ea19a (diff) |
Merge branch '3.x'
Diffstat (limited to 'sphinx/domains')
-rw-r--r-- | sphinx/domains/c.py | 2 | ||||
-rw-r--r-- | sphinx/domains/cpp.py | 2 | ||||
-rw-r--r-- | sphinx/domains/javascript.py | 2 | ||||
-rw-r--r-- | sphinx/domains/math.py | 7 | ||||
-rw-r--r-- | sphinx/domains/python.py | 2 | ||||
-rw-r--r-- | sphinx/domains/rst.py | 2 | ||||
-rw-r--r-- | sphinx/domains/std.py | 4 |
7 files changed, 12 insertions, 9 deletions
diff --git a/sphinx/domains/c.py b/sphinx/domains/c.py index 87f115c4a..fb4da502d 100644 --- a/sphinx/domains/c.py +++ b/sphinx/domains/c.py @@ -3099,7 +3099,7 @@ def _make_phony_error_name() -> ASTNestedName: return ASTNestedName([ASTIdentifier("PhonyNameDueToError")], rooted=False) -class CObject(ObjectDescription): +class CObject(ObjectDescription[ASTDeclaration]): """ Description of a C language object. """ diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py index 389630a32..f6e746809 100644 --- a/sphinx/domains/cpp.py +++ b/sphinx/domains/cpp.py @@ -6670,7 +6670,7 @@ def _make_phony_error_name() -> ASTNestedName: return ASTNestedName([nne], [False], rooted=False) -class CPPObject(ObjectDescription): +class CPPObject(ObjectDescription[ASTDeclaration]): """Description of a C++ language object.""" doc_field_types = [ diff --git a/sphinx/domains/javascript.py b/sphinx/domains/javascript.py index a4b2eca2e..f612fb914 100644 --- a/sphinx/domains/javascript.py +++ b/sphinx/domains/javascript.py @@ -32,7 +32,7 @@ from sphinx.util.nodes import make_id, make_refnode logger = logging.getLogger(__name__) -class JSObject(ObjectDescription): +class JSObject(ObjectDescription[Tuple[str, str]]): """ Description of a JavaScript object. """ diff --git a/sphinx/domains/math.py b/sphinx/domains/math.py index 4f9638ab0..70a27e642 100644 --- a/sphinx/domains/math.py +++ b/sphinx/domains/math.py @@ -136,8 +136,11 @@ class MathDomain(Domain): def get_objects(self) -> List: return [] - def has_equations(self) -> bool: - return any(self.data['has_equations'].values()) + def has_equations(self, docname: str = None) -> bool: + if docname: + return self.data['has_equations'].get(docname, False) + else: + return any(self.data['has_equations'].values()) def setup(app: "Sphinx") -> Dict[str, Any]: diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py index 5afe2993a..c07c31e87 100644 --- a/sphinx/domains/python.py +++ b/sphinx/domains/python.py @@ -333,7 +333,7 @@ class PyTypedField(PyXrefMixin, TypedField): return super().make_xref(rolename, domain, target, innernode, contnode, env) -class PyObject(ObjectDescription): +class PyObject(ObjectDescription[Tuple[str, str]]): """ Description of a general Python object. diff --git a/sphinx/domains/rst.py b/sphinx/domains/rst.py index 0539197bc..07bf46b75 100644 --- a/sphinx/domains/rst.py +++ b/sphinx/domains/rst.py @@ -31,7 +31,7 @@ logger = logging.getLogger(__name__) dir_sig_re = re.compile(r'\.\. (.+?)::(.*)$') -class ReSTMarkup(ObjectDescription): +class ReSTMarkup(ObjectDescription[str]): """ Description of generic reST markup. """ diff --git a/sphinx/domains/std.py b/sphinx/domains/std.py index 57b5796ac..18e62c3cb 100644 --- a/sphinx/domains/std.py +++ b/sphinx/domains/std.py @@ -46,7 +46,7 @@ option_desc_re = re.compile(r'((?:/|--|-|\+)?[^\s=]+)(=?\s*.*)') token_re = re.compile(r'`(\w+)`', re.U) -class GenericObject(ObjectDescription): +class GenericObject(ObjectDescription[str]): """ A generic x-ref directive registered with Sphinx.add_object_type(). """ @@ -176,7 +176,7 @@ class Target(SphinxDirective): return self.name + '-' + name -class Cmdoption(ObjectDescription): +class Cmdoption(ObjectDescription[str]): """ Description of a command-line option (.. option). """ |