Sphinx 7.1.2__py3-none-any.whl → 7.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of Sphinx might be problematic. Click here for more details.
- sphinx/__init__.py +6 -6
- sphinx/__main__.py +3 -1
- sphinx/addnodes.py +35 -22
- sphinx/application.py +40 -38
- sphinx/builders/__init__.py +16 -12
- sphinx/builders/_epub_base.py +15 -11
- sphinx/builders/changes.py +6 -4
- sphinx/builders/dirhtml.py +4 -2
- sphinx/builders/dummy.py +6 -4
- sphinx/builders/epub3.py +16 -8
- sphinx/builders/gettext.py +40 -43
- sphinx/builders/html/__init__.py +166 -196
- sphinx/builders/html/_assets.py +116 -0
- sphinx/builders/html/transforms.py +4 -2
- sphinx/builders/latex/__init__.py +12 -7
- sphinx/builders/latex/theming.py +5 -2
- sphinx/builders/latex/transforms.py +6 -3
- sphinx/builders/linkcheck.py +18 -11
- sphinx/builders/manpage.py +6 -4
- sphinx/builders/singlehtml.py +16 -9
- sphinx/builders/texinfo.py +11 -6
- sphinx/builders/text.py +8 -3
- sphinx/builders/xml.py +9 -4
- sphinx/cmd/build.py +27 -14
- sphinx/cmd/make_mode.py +13 -4
- sphinx/cmd/quickstart.py +13 -4
- sphinx/config.py +17 -14
- sphinx/deprecation.py +4 -2
- sphinx/directives/__init__.py +44 -12
- sphinx/directives/code.py +5 -4
- sphinx/directives/other.py +92 -44
- sphinx/directives/patches.py +1 -1
- sphinx/domains/__init__.py +11 -8
- sphinx/domains/c.py +67 -57
- sphinx/domains/changeset.py +3 -2
- sphinx/domains/citation.py +2 -1
- sphinx/domains/cpp.py +136 -93
- sphinx/domains/index.py +9 -5
- sphinx/domains/javascript.py +32 -19
- sphinx/domains/math.py +5 -3
- sphinx/domains/python.py +69 -57
- sphinx/domains/rst.py +20 -11
- sphinx/domains/std.py +21 -15
- sphinx/environment/__init__.py +97 -65
- sphinx/environment/adapters/indexentries.py +13 -10
- sphinx/environment/adapters/toctree.py +485 -308
- sphinx/environment/collectors/__init__.py +3 -4
- sphinx/environment/collectors/asset.py +10 -4
- sphinx/environment/collectors/dependencies.py +7 -4
- sphinx/environment/collectors/metadata.py +7 -5
- sphinx/environment/collectors/title.py +5 -3
- sphinx/environment/collectors/toctree.py +13 -8
- sphinx/errors.py +1 -1
- sphinx/events.py +5 -5
- sphinx/ext/apidoc.py +49 -27
- sphinx/ext/autodoc/__init__.py +179 -161
- sphinx/ext/autodoc/directive.py +10 -6
- sphinx/ext/autodoc/importer.py +22 -13
- sphinx/ext/autodoc/mock.py +4 -1
- sphinx/ext/autodoc/preserve_defaults.py +80 -12
- sphinx/ext/autodoc/type_comment.py +14 -10
- sphinx/ext/autodoc/typehints.py +7 -3
- sphinx/ext/autosectionlabel.py +6 -3
- sphinx/ext/autosummary/__init__.py +21 -15
- sphinx/ext/autosummary/generate.py +176 -126
- sphinx/ext/coverage.py +93 -8
- sphinx/ext/doctest.py +28 -17
- sphinx/ext/duration.py +19 -17
- sphinx/ext/extlinks.py +11 -6
- sphinx/ext/githubpages.py +8 -7
- sphinx/ext/graphviz.py +61 -17
- sphinx/ext/ifconfig.py +7 -4
- sphinx/ext/imgconverter.py +4 -2
- sphinx/ext/imgmath.py +29 -23
- sphinx/ext/inheritance_diagram.py +41 -27
- sphinx/ext/intersphinx.py +45 -38
- sphinx/ext/linkcode.py +8 -5
- sphinx/ext/mathjax.py +13 -9
- sphinx/ext/napoleon/__init__.py +3 -3
- sphinx/ext/napoleon/docstring.py +40 -31
- sphinx/ext/todo.py +10 -7
- sphinx/ext/viewcode.py +46 -25
- sphinx/extension.py +1 -1
- sphinx/highlighting.py +20 -12
- sphinx/io.py +5 -4
- sphinx/jinja2glue.py +24 -19
- sphinx/locale/__init__.py +8 -2
- sphinx/locale/ar/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ar/LC_MESSAGES/sphinx.po +756 -740
- sphinx/locale/bg/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/bg/LC_MESSAGES/sphinx.po +754 -738
- sphinx/locale/bn/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/bn/LC_MESSAGES/sphinx.po +755 -739
- sphinx/locale/ca/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ca/LC_MESSAGES/sphinx.po +768 -752
- sphinx/locale/cak/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/cak/LC_MESSAGES/sphinx.po +754 -738
- sphinx/locale/cs/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/cs/LC_MESSAGES/sphinx.po +758 -742
- sphinx/locale/cy/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/cy/LC_MESSAGES/sphinx.po +759 -743
- sphinx/locale/da/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/da/LC_MESSAGES/sphinx.po +760 -744
- sphinx/locale/de/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/de/LC_MESSAGES/sphinx.po +759 -743
- sphinx/locale/de_DE/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/de_DE/LC_MESSAGES/sphinx.po +754 -738
- sphinx/locale/el/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/el/LC_MESSAGES/sphinx.po +763 -747
- sphinx/locale/en_DE/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/en_DE/LC_MESSAGES/sphinx.po +754 -738
- sphinx/locale/en_FR/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/en_FR/LC_MESSAGES/sphinx.po +754 -738
- sphinx/locale/en_GB/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/en_GB/LC_MESSAGES/sphinx.po +768 -752
- sphinx/locale/en_HK/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/en_HK/LC_MESSAGES/sphinx.po +754 -738
- sphinx/locale/eo/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/eo/LC_MESSAGES/sphinx.po +754 -738
- sphinx/locale/es/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/es/LC_MESSAGES/sphinx.po +767 -751
- sphinx/locale/es_CO/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/es_CO/LC_MESSAGES/sphinx.po +754 -738
- sphinx/locale/et/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/et/LC_MESSAGES/sphinx.po +762 -746
- sphinx/locale/eu/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/eu/LC_MESSAGES/sphinx.po +755 -739
- sphinx/locale/fa/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/fa/LC_MESSAGES/sphinx.po +766 -750
- sphinx/locale/fi/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/fi/LC_MESSAGES/sphinx.po +754 -738
- sphinx/locale/fr/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/fr/LC_MESSAGES/sphinx.po +768 -752
- sphinx/locale/fr_FR/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/fr_FR/LC_MESSAGES/sphinx.po +754 -738
- sphinx/locale/gl/LC_MESSAGES/sphinx.js +60 -0
- sphinx/locale/gl/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/gl/LC_MESSAGES/sphinx.po +3695 -0
- sphinx/locale/he/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/he/LC_MESSAGES/sphinx.po +755 -739
- sphinx/locale/hi/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/hi/LC_MESSAGES/sphinx.po +763 -747
- sphinx/locale/hi_IN/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/hi_IN/LC_MESSAGES/sphinx.po +754 -738
- sphinx/locale/hr/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/hr/LC_MESSAGES/sphinx.po +760 -744
- sphinx/locale/hu/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/hu/LC_MESSAGES/sphinx.po +759 -743
- sphinx/locale/id/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/id/LC_MESSAGES/sphinx.po +765 -749
- sphinx/locale/is/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/is/LC_MESSAGES/sphinx.po +760 -744
- sphinx/locale/it/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/it/LC_MESSAGES/sphinx.po +760 -744
- sphinx/locale/ja/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ja/LC_MESSAGES/sphinx.po +767 -751
- sphinx/locale/ka/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ka/LC_MESSAGES/sphinx.po +759 -743
- sphinx/locale/ko/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ko/LC_MESSAGES/sphinx.po +767 -751
- sphinx/locale/lt/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/lt/LC_MESSAGES/sphinx.po +755 -739
- sphinx/locale/lv/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/lv/LC_MESSAGES/sphinx.po +755 -739
- sphinx/locale/mk/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/mk/LC_MESSAGES/sphinx.po +754 -738
- sphinx/locale/nb_NO/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/nb_NO/LC_MESSAGES/sphinx.po +755 -739
- sphinx/locale/ne/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ne/LC_MESSAGES/sphinx.po +755 -739
- sphinx/locale/nl/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/nl/LC_MESSAGES/sphinx.po +760 -744
- sphinx/locale/pl/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/pl/LC_MESSAGES/sphinx.po +762 -745
- sphinx/locale/pt/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/pt/LC_MESSAGES/sphinx.po +754 -738
- sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po +768 -752
- sphinx/locale/pt_PT/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/pt_PT/LC_MESSAGES/sphinx.po +755 -739
- sphinx/locale/ro/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ro/LC_MESSAGES/sphinx.po +759 -743
- sphinx/locale/ru/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ru/LC_MESSAGES/sphinx.po +760 -744
- sphinx/locale/si/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/si/LC_MESSAGES/sphinx.po +754 -738
- sphinx/locale/sk/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sk/LC_MESSAGES/sphinx.po +765 -749
- sphinx/locale/sl/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sl/LC_MESSAGES/sphinx.po +755 -739
- sphinx/locale/sphinx.pot +748 -740
- sphinx/locale/sq/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sq/LC_MESSAGES/sphinx.po +768 -752
- sphinx/locale/sr/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sr/LC_MESSAGES/sphinx.po +754 -738
- sphinx/locale/sr@latin/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sr@latin/LC_MESSAGES/sphinx.po +754 -738
- sphinx/locale/sr_RS/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sr_RS/LC_MESSAGES/sphinx.po +754 -738
- sphinx/locale/sv/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sv/LC_MESSAGES/sphinx.po +755 -739
- sphinx/locale/ta/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ta/LC_MESSAGES/sphinx.po +754 -738
- sphinx/locale/te/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/te/LC_MESSAGES/sphinx.po +754 -738
- sphinx/locale/tr/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/tr/LC_MESSAGES/sphinx.po +763 -747
- sphinx/locale/uk_UA/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/uk_UA/LC_MESSAGES/sphinx.po +760 -749
- sphinx/locale/ur/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ur/LC_MESSAGES/sphinx.po +759 -748
- sphinx/locale/vi/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/vi/LC_MESSAGES/sphinx.po +754 -738
- sphinx/locale/yue/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/yue/LC_MESSAGES/sphinx.po +754 -738
- sphinx/locale/zh_CN/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/zh_CN/LC_MESSAGES/sphinx.po +768 -752
- sphinx/locale/zh_HK/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/zh_HK/LC_MESSAGES/sphinx.po +754 -738
- sphinx/locale/zh_TW/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po +767 -751
- sphinx/locale/zh_TW.Big5/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/zh_TW.Big5/LC_MESSAGES/sphinx.po +754 -738
- sphinx/parsers.py +5 -4
- sphinx/project.py +52 -34
- sphinx/pycode/__init__.py +2 -1
- sphinx/pycode/ast.py +7 -13
- sphinx/pycode/parser.py +42 -38
- sphinx/registry.py +35 -29
- sphinx/roles.py +9 -4
- sphinx/search/__init__.py +5 -17
- sphinx/search/da.py +1 -1
- sphinx/search/de.py +1 -1
- sphinx/search/en.py +1 -1
- sphinx/search/es.py +1 -1
- sphinx/search/fi.py +1 -1
- sphinx/search/fr.py +1 -1
- sphinx/search/hu.py +1 -1
- sphinx/search/it.py +1 -1
- sphinx/search/ja.py +1 -1
- sphinx/search/nl.py +1 -1
- sphinx/search/no.py +1 -1
- sphinx/search/pt.py +1 -1
- sphinx/search/ro.py +1 -1
- sphinx/search/ru.py +1 -1
- sphinx/search/sv.py +1 -1
- sphinx/search/tr.py +1 -1
- sphinx/search/zh.py +1 -1
- sphinx/testing/fixtures.py +23 -30
- sphinx/testing/path.py +9 -0
- sphinx/testing/restructuredtext.py +13 -5
- sphinx/testing/util.py +20 -63
- sphinx/texinputs/sphinxlatexobjects.sty +15 -15
- sphinx/themes/agogo/static/agogo.css_t +10 -4
- sphinx/themes/basic/layout.html +1 -1
- sphinx/themes/basic/static/basic.css_t +4 -0
- sphinx/themes/basic/static/documentation_options.js_t +1 -2
- sphinx/themes/basic/static/searchtools.js +17 -9
- sphinx/themes/basic/static/sphinx_highlight.js +13 -3
- sphinx/themes/bizstyle/static/bizstyle.css_t +4 -0
- sphinx/themes/classic/theme.conf +1 -1
- sphinx/themes/epub/static/epub.css_t +6 -1
- sphinx/themes/haiku/theme.conf +1 -1
- sphinx/themes/nature/static/nature.css_t +4 -0
- sphinx/themes/nonav/static/nonav.css_t +6 -1
- sphinx/themes/pyramid/static/pyramid.css_t +4 -0
- sphinx/themes/scrolls/static/scrolls.css_t +4 -0
- sphinx/themes/scrolls/theme.conf +1 -1
- sphinx/themes/sphinxdoc/static/sphinxdoc.css_t +4 -0
- sphinx/theming.py +9 -7
- sphinx/transforms/__init__.py +79 -3
- sphinx/transforms/compact_bullet_list.py +6 -3
- sphinx/transforms/i18n.py +26 -10
- sphinx/transforms/post_transforms/__init__.py +21 -8
- sphinx/transforms/post_transforms/code.py +6 -3
- sphinx/transforms/post_transforms/images.py +13 -9
- sphinx/util/__init__.py +21 -92
- sphinx/util/cfamily.py +7 -4
- sphinx/util/display.py +3 -2
- sphinx/util/docfields.py +7 -6
- sphinx/util/docstrings.py +1 -1
- sphinx/util/docutils.py +41 -31
- sphinx/util/fileutil.py +9 -6
- sphinx/util/i18n.py +21 -18
- sphinx/util/images.py +2 -1
- sphinx/util/index_entries.py +27 -0
- sphinx/util/inspect.py +83 -67
- sphinx/util/inventory.py +4 -2
- sphinx/util/logging.py +9 -6
- sphinx/util/matching.py +5 -2
- sphinx/util/math.py +6 -3
- sphinx/util/nodes.py +70 -31
- sphinx/util/osutil.py +22 -40
- sphinx/util/parallel.py +4 -1
- sphinx/util/rst.py +7 -3
- sphinx/util/tags.py +11 -4
- sphinx/util/template.py +17 -14
- sphinx/util/typing.py +61 -20
- sphinx/versioning.py +6 -4
- sphinx/writers/html.py +1 -1
- sphinx/writers/html5.py +32 -24
- sphinx/writers/latex.py +67 -53
- sphinx/writers/manpage.py +9 -5
- sphinx/writers/texinfo.py +11 -9
- sphinx/writers/text.py +14 -9
- sphinx/writers/xml.py +3 -2
- {sphinx-7.1.2.dist-info → sphinx-7.2.0.dist-info}/METADATA +7 -5
- sphinx-7.2.0.dist-info/RECORD +568 -0
- sphinx/testing/comparer.py +0 -97
- sphinx-7.1.2.dist-info/RECORD +0 -564
- {sphinx-7.1.2.dist-info → sphinx-7.2.0.dist-info}/LICENSE +0 -0
- {sphinx-7.1.2.dist-info → sphinx-7.2.0.dist-info}/WHEEL +0 -0
- {sphinx-7.1.2.dist-info → sphinx-7.2.0.dist-info}/entry_points.txt +0 -0
sphinx/domains/c.py
CHANGED
|
@@ -3,19 +3,14 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import re
|
|
6
|
-
from typing import Any, Callable,
|
|
6
|
+
from typing import TYPE_CHECKING, Any, Callable, TypeVar, Union, cast
|
|
7
7
|
|
|
8
8
|
from docutils import nodes
|
|
9
|
-
from docutils.nodes import Element, Node, TextElement, system_message
|
|
10
9
|
from docutils.parsers.rst import directives
|
|
11
10
|
|
|
12
11
|
from sphinx import addnodes
|
|
13
|
-
from sphinx.addnodes import pending_xref
|
|
14
|
-
from sphinx.application import Sphinx
|
|
15
|
-
from sphinx.builders import Builder
|
|
16
12
|
from sphinx.directives import ObjectDescription
|
|
17
13
|
from sphinx.domains import Domain, ObjType
|
|
18
|
-
from sphinx.environment import BuildEnvironment
|
|
19
14
|
from sphinx.locale import _, __
|
|
20
15
|
from sphinx.roles import SphinxRole, XRefRole
|
|
21
16
|
from sphinx.transforms import SphinxTransform
|
|
@@ -45,7 +40,17 @@ from sphinx.util.cfamily import (
|
|
|
45
40
|
from sphinx.util.docfields import Field, GroupedField, TypedField
|
|
46
41
|
from sphinx.util.docutils import SphinxDirective
|
|
47
42
|
from sphinx.util.nodes import make_refnode
|
|
48
|
-
|
|
43
|
+
|
|
44
|
+
if TYPE_CHECKING:
|
|
45
|
+
from collections.abc import Generator, Iterator
|
|
46
|
+
|
|
47
|
+
from docutils.nodes import Element, Node, TextElement, system_message
|
|
48
|
+
|
|
49
|
+
from sphinx.addnodes import pending_xref
|
|
50
|
+
from sphinx.application import Sphinx
|
|
51
|
+
from sphinx.builders import Builder
|
|
52
|
+
from sphinx.environment import BuildEnvironment
|
|
53
|
+
from sphinx.util.typing import OptionSpec
|
|
49
54
|
|
|
50
55
|
logger = logging.getLogger(__name__)
|
|
51
56
|
T = TypeVar('T')
|
|
@@ -72,7 +77,7 @@ _macroKeywords = [
|
|
|
72
77
|
'thread_local',
|
|
73
78
|
]
|
|
74
79
|
|
|
75
|
-
# these are ordered by
|
|
80
|
+
# these are ordered by precedence
|
|
76
81
|
_expression_bin_ops = [
|
|
77
82
|
['||', 'or'],
|
|
78
83
|
['&&', 'and'],
|
|
@@ -211,11 +216,13 @@ class ASTNestedName(ASTBase):
|
|
|
211
216
|
# just print the name part, with template args, not template params
|
|
212
217
|
if mode == 'noneIsName':
|
|
213
218
|
if self.rooted:
|
|
214
|
-
|
|
219
|
+
unreachable = "Can this happen?"
|
|
220
|
+
raise AssertionError(unreachable) # TODO
|
|
215
221
|
signode += nodes.Text('.')
|
|
216
222
|
for i in range(len(self.names)):
|
|
217
223
|
if i != 0:
|
|
218
|
-
|
|
224
|
+
unreachable = "Can this happen?"
|
|
225
|
+
raise AssertionError(unreachable) # TODO
|
|
219
226
|
signode += nodes.Text('.')
|
|
220
227
|
n = self.names[i]
|
|
221
228
|
n.describe_signature(signode, mode, env, '', symbol)
|
|
@@ -1508,7 +1515,7 @@ class ASTDeclaration(ASTBaseBase):
|
|
|
1508
1515
|
mainDeclNode += addnodes.desc_sig_keyword(prefix, prefix)
|
|
1509
1516
|
mainDeclNode += addnodes.desc_sig_space()
|
|
1510
1517
|
else:
|
|
1511
|
-
raise AssertionError
|
|
1518
|
+
raise AssertionError
|
|
1512
1519
|
self.declaration.describe_signature(mainDeclNode, mode, env, self.symbol)
|
|
1513
1520
|
if self.semicolon:
|
|
1514
1521
|
mainDeclNode += addnodes.desc_sig_punctuation(';', ';')
|
|
@@ -1538,18 +1545,18 @@ class Symbol:
|
|
|
1538
1545
|
debug_show_tree = False
|
|
1539
1546
|
|
|
1540
1547
|
def __copy__(self):
|
|
1541
|
-
raise AssertionError
|
|
1548
|
+
raise AssertionError # shouldn't happen
|
|
1542
1549
|
|
|
1543
1550
|
def __deepcopy__(self, memo):
|
|
1544
1551
|
if self.parent:
|
|
1545
|
-
raise AssertionError
|
|
1552
|
+
raise AssertionError # shouldn't happen
|
|
1546
1553
|
# the domain base class makes a copy of the initial data, which is fine
|
|
1547
1554
|
return Symbol(None, None, None, None, None)
|
|
1548
1555
|
|
|
1549
1556
|
@staticmethod
|
|
1550
1557
|
def debug_print(*args: Any) -> None:
|
|
1551
|
-
|
|
1552
|
-
|
|
1558
|
+
logger.debug(Symbol.debug_indent_string * Symbol.debug_indent, end="")
|
|
1559
|
+
logger.debug(*args)
|
|
1553
1560
|
|
|
1554
1561
|
def _assert_invariants(self) -> None:
|
|
1555
1562
|
if not self.parent:
|
|
@@ -1562,7 +1569,7 @@ class Symbol:
|
|
|
1562
1569
|
|
|
1563
1570
|
def __setattr__(self, key: str, value: Any) -> None:
|
|
1564
1571
|
if key == "children":
|
|
1565
|
-
raise AssertionError
|
|
1572
|
+
raise AssertionError
|
|
1566
1573
|
return super().__setattr__(key, value)
|
|
1567
1574
|
|
|
1568
1575
|
def __init__(
|
|
@@ -1726,7 +1733,7 @@ class Symbol:
|
|
|
1726
1733
|
Symbol.debug_print("_find_named_symbols:")
|
|
1727
1734
|
Symbol.debug_indent += 1
|
|
1728
1735
|
Symbol.debug_print("self:")
|
|
1729
|
-
|
|
1736
|
+
logger.debug(self.to_string(Symbol.debug_indent + 1), end="")
|
|
1730
1737
|
Symbol.debug_print("ident: ", ident)
|
|
1731
1738
|
Symbol.debug_print("matchSelf: ", matchSelf)
|
|
1732
1739
|
Symbol.debug_print("recurseInAnon: ", recurseInAnon)
|
|
@@ -1736,7 +1743,7 @@ class Symbol:
|
|
|
1736
1743
|
s = self
|
|
1737
1744
|
if Symbol.debug_lookup:
|
|
1738
1745
|
Symbol.debug_print("searching in self:")
|
|
1739
|
-
|
|
1746
|
+
logger.debug(s.to_string(Symbol.debug_indent + 1), end="")
|
|
1740
1747
|
while True:
|
|
1741
1748
|
if matchSelf:
|
|
1742
1749
|
yield s
|
|
@@ -1750,12 +1757,12 @@ class Symbol:
|
|
|
1750
1757
|
s = s.siblingAbove
|
|
1751
1758
|
if Symbol.debug_lookup:
|
|
1752
1759
|
Symbol.debug_print("searching in sibling:")
|
|
1753
|
-
|
|
1760
|
+
logger.debug(s.to_string(Symbol.debug_indent + 1), end="")
|
|
1754
1761
|
|
|
1755
1762
|
for s in candidates():
|
|
1756
1763
|
if Symbol.debug_lookup:
|
|
1757
1764
|
Symbol.debug_print("candidate:")
|
|
1758
|
-
|
|
1765
|
+
logger.debug(s.to_string(Symbol.debug_indent + 1), end="")
|
|
1759
1766
|
if s.ident == ident:
|
|
1760
1767
|
if Symbol.debug_lookup:
|
|
1761
1768
|
Symbol.debug_indent += 1
|
|
@@ -1783,7 +1790,7 @@ class Symbol:
|
|
|
1783
1790
|
Symbol.debug_print("_symbol_lookup:")
|
|
1784
1791
|
Symbol.debug_indent += 1
|
|
1785
1792
|
Symbol.debug_print("self:")
|
|
1786
|
-
|
|
1793
|
+
logger.debug(self.to_string(Symbol.debug_indent + 1), end="")
|
|
1787
1794
|
Symbol.debug_print("nestedName: ", nestedName)
|
|
1788
1795
|
Symbol.debug_print("ancestorLookupType:", ancestorLookupType)
|
|
1789
1796
|
Symbol.debug_print("matchSelf: ", matchSelf)
|
|
@@ -1810,7 +1817,7 @@ class Symbol:
|
|
|
1810
1817
|
|
|
1811
1818
|
if Symbol.debug_lookup:
|
|
1812
1819
|
Symbol.debug_print("starting point:")
|
|
1813
|
-
|
|
1820
|
+
logger.debug(parentSymbol.to_string(Symbol.debug_indent + 1), end="")
|
|
1814
1821
|
|
|
1815
1822
|
# and now the actual lookup
|
|
1816
1823
|
for ident in names[:-1]:
|
|
@@ -1830,7 +1837,7 @@ class Symbol:
|
|
|
1830
1837
|
|
|
1831
1838
|
if Symbol.debug_lookup:
|
|
1832
1839
|
Symbol.debug_print("handle last name from:")
|
|
1833
|
-
|
|
1840
|
+
logger.debug(parentSymbol.to_string(Symbol.debug_indent + 1), end="")
|
|
1834
1841
|
|
|
1835
1842
|
# handle the last name
|
|
1836
1843
|
ident = names[-1]
|
|
@@ -1840,7 +1847,7 @@ class Symbol:
|
|
|
1840
1847
|
recurseInAnon=recurseInAnon,
|
|
1841
1848
|
searchInSiblings=searchInSiblings)
|
|
1842
1849
|
if Symbol.debug_lookup:
|
|
1843
|
-
symbols = list(symbols) # type: ignore
|
|
1850
|
+
symbols = list(symbols) # type: ignore[assignment]
|
|
1844
1851
|
Symbol.debug_indent -= 2
|
|
1845
1852
|
return SymbolLookupResult(symbols, parentSymbol, ident)
|
|
1846
1853
|
|
|
@@ -2081,14 +2088,14 @@ class Symbol:
|
|
|
2081
2088
|
Symbol.debug_print("matchSelf: ", matchSelf)
|
|
2082
2089
|
Symbol.debug_print("recurseInAnon: ", recurseInAnon)
|
|
2083
2090
|
Symbol.debug_print("searchInSiblings:", searchInSiblings)
|
|
2084
|
-
|
|
2091
|
+
logger.debug(self.to_string(Symbol.debug_indent + 1), end="")
|
|
2085
2092
|
Symbol.debug_indent -= 2
|
|
2086
2093
|
current = self
|
|
2087
2094
|
while current is not None:
|
|
2088
2095
|
if Symbol.debug_lookup:
|
|
2089
2096
|
Symbol.debug_indent += 2
|
|
2090
2097
|
Symbol.debug_print("trying:")
|
|
2091
|
-
|
|
2098
|
+
logger.debug(current.to_string(Symbol.debug_indent + 1), end="")
|
|
2092
2099
|
Symbol.debug_indent -= 2
|
|
2093
2100
|
if matchSelf and current.ident == ident:
|
|
2094
2101
|
return current
|
|
@@ -2118,7 +2125,7 @@ class Symbol:
|
|
|
2118
2125
|
Symbol.debug_print("name: ", name)
|
|
2119
2126
|
Symbol.debug_print("id: ", id_)
|
|
2120
2127
|
if s is not None:
|
|
2121
|
-
|
|
2128
|
+
logger.debug(s.to_string(Symbol.debug_indent + 1), end="")
|
|
2122
2129
|
else:
|
|
2123
2130
|
Symbol.debug_print("not found")
|
|
2124
2131
|
if s is None:
|
|
@@ -3110,7 +3117,7 @@ class DefinitionParser(BaseParser):
|
|
|
3110
3117
|
elif objectType == 'type':
|
|
3111
3118
|
declaration = self._parse_type(named=True, outer='type')
|
|
3112
3119
|
else:
|
|
3113
|
-
raise AssertionError
|
|
3120
|
+
raise AssertionError
|
|
3114
3121
|
if objectType != 'macro':
|
|
3115
3122
|
self.skip_ws()
|
|
3116
3123
|
semicolon = self.skip_string(';')
|
|
@@ -3161,6 +3168,9 @@ class CObject(ObjectDescription[ASTDeclaration]):
|
|
|
3161
3168
|
"""
|
|
3162
3169
|
|
|
3163
3170
|
option_spec: OptionSpec = {
|
|
3171
|
+
'no-index-entry': directives.flag,
|
|
3172
|
+
'no-contents-entry': directives.flag,
|
|
3173
|
+
'no-typesetting': directives.flag,
|
|
3164
3174
|
'noindexentry': directives.flag,
|
|
3165
3175
|
'nocontentsentry': directives.flag,
|
|
3166
3176
|
'single-line-parameter-list': directives.flag,
|
|
@@ -3231,13 +3241,13 @@ class CObject(ObjectDescription[ASTDeclaration]):
|
|
|
3231
3241
|
|
|
3232
3242
|
self.state.document.note_explicit_target(signode)
|
|
3233
3243
|
|
|
3234
|
-
if '
|
|
3244
|
+
if 'no-index-entry' not in self.options:
|
|
3235
3245
|
indexText = self.get_index_text(name)
|
|
3236
3246
|
self.indexnode['entries'].append(('single', indexText, newestId, '', None))
|
|
3237
3247
|
|
|
3238
3248
|
@property
|
|
3239
3249
|
def object_type(self) -> str:
|
|
3240
|
-
raise NotImplementedError
|
|
3250
|
+
raise NotImplementedError
|
|
3241
3251
|
|
|
3242
3252
|
@property
|
|
3243
3253
|
def display_object_type(self) -> str:
|
|
@@ -3538,7 +3548,7 @@ class AliasTransform(SphinxTransform):
|
|
|
3538
3548
|
desc['domain'] = 'c'
|
|
3539
3549
|
# 'desctype' is a backwards compatible attribute
|
|
3540
3550
|
desc['objtype'] = desc['desctype'] = 'alias'
|
|
3541
|
-
desc['
|
|
3551
|
+
desc['no-index'] = True
|
|
3542
3552
|
childContainer = desc
|
|
3543
3553
|
|
|
3544
3554
|
for sChild in s.children:
|
|
@@ -3577,9 +3587,9 @@ class AliasTransform(SphinxTransform):
|
|
|
3577
3587
|
rootSymbol: Symbol = self.env.domains['c'].data['root_symbol']
|
|
3578
3588
|
parentSymbol: Symbol = rootSymbol.direct_lookup(parentKey)
|
|
3579
3589
|
if not parentSymbol:
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3590
|
+
logger.debug("Target: %s", sig)
|
|
3591
|
+
logger.debug("ParentKey: %s", parentKey)
|
|
3592
|
+
logger.debug(rootSymbol.dump(1))
|
|
3583
3593
|
assert parentSymbol # should be there
|
|
3584
3594
|
|
|
3585
3595
|
s = parentSymbol.find_declaration(
|
|
@@ -3639,7 +3649,7 @@ class CAliasObject(ObjectDescription):
|
|
|
3639
3649
|
node['domain'] = self.domain
|
|
3640
3650
|
# 'desctype' is a backwards compatible attribute
|
|
3641
3651
|
node['objtype'] = node['desctype'] = self.objtype
|
|
3642
|
-
node['
|
|
3652
|
+
node['no-index'] = True
|
|
3643
3653
|
|
|
3644
3654
|
self.names: list[str] = []
|
|
3645
3655
|
aliasOptions = {
|
|
@@ -3768,40 +3778,40 @@ class CDomain(Domain):
|
|
|
3768
3778
|
|
|
3769
3779
|
def clear_doc(self, docname: str) -> None:
|
|
3770
3780
|
if Symbol.debug_show_tree:
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3781
|
+
logger.debug("clear_doc: %s", docname)
|
|
3782
|
+
logger.debug("\tbefore:")
|
|
3783
|
+
logger.debug(self.data['root_symbol'].dump(1))
|
|
3784
|
+
logger.debug("\tbefore end")
|
|
3775
3785
|
|
|
3776
3786
|
rootSymbol = self.data['root_symbol']
|
|
3777
3787
|
rootSymbol.clear_doc(docname)
|
|
3778
3788
|
|
|
3779
3789
|
if Symbol.debug_show_tree:
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3790
|
+
logger.debug("\tafter:")
|
|
3791
|
+
logger.debug(self.data['root_symbol'].dump(1))
|
|
3792
|
+
logger.debug("\tafter end")
|
|
3793
|
+
logger.debug("clear_doc end: %s", docname)
|
|
3784
3794
|
|
|
3785
3795
|
def process_doc(self, env: BuildEnvironment, docname: str,
|
|
3786
3796
|
document: nodes.document) -> None:
|
|
3787
3797
|
if Symbol.debug_show_tree:
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3798
|
+
logger.debug("process_doc: %s", docname)
|
|
3799
|
+
logger.debug(self.data['root_symbol'].dump(0))
|
|
3800
|
+
logger.debug("process_doc end: %s", docname)
|
|
3791
3801
|
|
|
3792
3802
|
def process_field_xref(self, pnode: pending_xref) -> None:
|
|
3793
3803
|
pnode.attributes.update(self.env.ref_context)
|
|
3794
3804
|
|
|
3795
3805
|
def merge_domaindata(self, docnames: list[str], otherdata: dict) -> None:
|
|
3796
3806
|
if Symbol.debug_show_tree:
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3807
|
+
logger.debug("merge_domaindata:")
|
|
3808
|
+
logger.debug("\tself:")
|
|
3809
|
+
logger.debug(self.data['root_symbol'].dump(1))
|
|
3810
|
+
logger.debug("\tself end")
|
|
3811
|
+
logger.debug("\tother:")
|
|
3812
|
+
logger.debug(otherdata['root_symbol'].dump(1))
|
|
3813
|
+
logger.debug("\tother end")
|
|
3814
|
+
logger.debug("merge_domaindata end")
|
|
3805
3815
|
|
|
3806
3816
|
self.data['root_symbol'].merge_with(otherdata['root_symbol'],
|
|
3807
3817
|
docnames, self.env)
|
|
@@ -3827,9 +3837,9 @@ class CDomain(Domain):
|
|
|
3827
3837
|
if parentKey:
|
|
3828
3838
|
parentSymbol: Symbol = rootSymbol.direct_lookup(parentKey)
|
|
3829
3839
|
if not parentSymbol:
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3840
|
+
logger.debug("Target: %s", target)
|
|
3841
|
+
logger.debug("ParentKey: %s", parentKey)
|
|
3842
|
+
logger.debug(rootSymbol.dump(1))
|
|
3833
3843
|
assert parentSymbol # should be there
|
|
3834
3844
|
else:
|
|
3835
3845
|
parentSymbol = rootSymbol
|
sphinx/domains/changeset.py
CHANGED
|
@@ -5,17 +5,18 @@ from __future__ import annotations
|
|
|
5
5
|
from typing import TYPE_CHECKING, Any, NamedTuple, cast
|
|
6
6
|
|
|
7
7
|
from docutils import nodes
|
|
8
|
-
from docutils.nodes import Node
|
|
9
8
|
|
|
10
9
|
from sphinx import addnodes
|
|
11
10
|
from sphinx.domains import Domain
|
|
12
11
|
from sphinx.locale import _
|
|
13
12
|
from sphinx.util.docutils import SphinxDirective
|
|
14
|
-
from sphinx.util.typing import OptionSpec
|
|
15
13
|
|
|
16
14
|
if TYPE_CHECKING:
|
|
15
|
+
from docutils.nodes import Node
|
|
16
|
+
|
|
17
17
|
from sphinx.application import Sphinx
|
|
18
18
|
from sphinx.environment import BuildEnvironment
|
|
19
|
+
from sphinx.util.typing import OptionSpec
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
versionlabels = {
|
sphinx/domains/citation.py
CHANGED
|
@@ -5,7 +5,6 @@ from __future__ import annotations
|
|
|
5
5
|
from typing import TYPE_CHECKING, Any, cast
|
|
6
6
|
|
|
7
7
|
from docutils import nodes
|
|
8
|
-
from docutils.nodes import Element
|
|
9
8
|
|
|
10
9
|
from sphinx.addnodes import pending_xref
|
|
11
10
|
from sphinx.domains import Domain
|
|
@@ -15,6 +14,8 @@ from sphinx.util import logging
|
|
|
15
14
|
from sphinx.util.nodes import copy_source_info, make_refnode
|
|
16
15
|
|
|
17
16
|
if TYPE_CHECKING:
|
|
17
|
+
from docutils.nodes import Element
|
|
18
|
+
|
|
18
19
|
from sphinx.application import Sphinx
|
|
19
20
|
from sphinx.builders import Builder
|
|
20
21
|
from sphinx.environment import BuildEnvironment
|