Sphinx 7.2.6__py3-none-any.whl → 7.3.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 +8 -9
- sphinx/addnodes.py +31 -28
- sphinx/application.py +9 -15
- sphinx/builders/__init__.py +5 -6
- sphinx/builders/_epub_base.py +17 -9
- sphinx/builders/changes.py +10 -5
- sphinx/builders/dirhtml.py +4 -2
- sphinx/builders/dummy.py +3 -2
- sphinx/builders/epub3.py +5 -3
- sphinx/builders/gettext.py +24 -7
- sphinx/builders/html/__init__.py +88 -96
- sphinx/builders/html/_assets.py +16 -16
- sphinx/builders/html/transforms.py +4 -2
- sphinx/builders/latex/__init__.py +40 -33
- sphinx/builders/latex/nodes.py +6 -2
- sphinx/builders/latex/transforms.py +17 -8
- sphinx/builders/latex/util.py +1 -1
- sphinx/builders/linkcheck.py +86 -27
- sphinx/builders/manpage.py +8 -6
- sphinx/builders/singlehtml.py +5 -4
- sphinx/builders/texinfo.py +18 -14
- sphinx/builders/text.py +3 -2
- sphinx/builders/xml.py +5 -2
- sphinx/cmd/build.py +119 -76
- sphinx/cmd/make_mode.py +4 -9
- sphinx/cmd/quickstart.py +13 -16
- sphinx/config.py +432 -250
- sphinx/deprecation.py +23 -13
- sphinx/directives/__init__.py +8 -8
- sphinx/directives/code.py +7 -7
- sphinx/directives/other.py +23 -13
- sphinx/directives/patches.py +7 -6
- sphinx/domains/__init__.py +2 -2
- sphinx/domains/c/__init__.py +796 -0
- sphinx/domains/c/_ast.py +1421 -0
- sphinx/domains/c/_ids.py +65 -0
- sphinx/domains/c/_parser.py +1048 -0
- sphinx/domains/c/_symbol.py +700 -0
- sphinx/domains/changeset.py +11 -7
- sphinx/domains/citation.py +5 -2
- sphinx/domains/cpp/__init__.py +1089 -0
- sphinx/domains/cpp/_ast.py +3635 -0
- sphinx/domains/cpp/_ids.py +537 -0
- sphinx/domains/cpp/_parser.py +2117 -0
- sphinx/domains/cpp/_symbol.py +1092 -0
- sphinx/domains/index.py +6 -4
- sphinx/domains/javascript.py +16 -13
- sphinx/domains/math.py +9 -4
- sphinx/domains/python/__init__.py +890 -0
- sphinx/domains/python/_annotations.py +507 -0
- sphinx/domains/python/_object.py +426 -0
- sphinx/domains/rst.py +12 -7
- sphinx/domains/{std.py → std/__init__.py} +19 -16
- sphinx/environment/__init__.py +21 -19
- sphinx/environment/adapters/indexentries.py +2 -2
- sphinx/environment/adapters/toctree.py +10 -9
- sphinx/environment/collectors/__init__.py +6 -3
- sphinx/environment/collectors/asset.py +4 -3
- sphinx/environment/collectors/dependencies.py +3 -2
- sphinx/environment/collectors/metadata.py +6 -5
- sphinx/environment/collectors/title.py +3 -2
- sphinx/environment/collectors/toctree.py +5 -4
- sphinx/errors.py +13 -2
- sphinx/events.py +14 -9
- sphinx/ext/apidoc.py +9 -11
- sphinx/ext/autodoc/__init__.py +105 -71
- sphinx/ext/autodoc/directive.py +7 -6
- sphinx/ext/autodoc/importer.py +102 -36
- sphinx/ext/autodoc/mock.py +7 -5
- sphinx/ext/autodoc/preserve_defaults.py +4 -3
- sphinx/ext/autodoc/type_comment.py +2 -1
- sphinx/ext/autodoc/typehints.py +5 -4
- sphinx/ext/autosectionlabel.py +3 -2
- sphinx/ext/autosummary/__init__.py +21 -17
- sphinx/ext/autosummary/generate.py +9 -9
- sphinx/ext/coverage.py +26 -20
- sphinx/ext/doctest.py +38 -33
- sphinx/ext/duration.py +1 -0
- sphinx/ext/extlinks.py +4 -3
- sphinx/ext/githubpages.py +3 -2
- sphinx/ext/graphviz.py +10 -7
- sphinx/ext/ifconfig.py +5 -5
- sphinx/ext/imgconverter.py +6 -5
- sphinx/ext/imgmath.py +9 -8
- sphinx/ext/inheritance_diagram.py +31 -31
- sphinx/ext/intersphinx.py +140 -23
- sphinx/ext/linkcode.py +3 -2
- sphinx/ext/mathjax.py +2 -1
- sphinx/ext/napoleon/__init__.py +12 -7
- sphinx/ext/napoleon/docstring.py +34 -32
- sphinx/ext/todo.py +10 -7
- sphinx/ext/viewcode.py +12 -11
- sphinx/extension.py +18 -8
- sphinx/highlighting.py +39 -20
- sphinx/io.py +17 -8
- sphinx/jinja2glue.py +16 -15
- sphinx/locale/__init__.py +30 -23
- sphinx/locale/ar/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ar/LC_MESSAGES/sphinx.po +818 -761
- sphinx/locale/bg/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/bg/LC_MESSAGES/sphinx.po +811 -754
- sphinx/locale/bn/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/bn/LC_MESSAGES/sphinx.po +835 -778
- sphinx/locale/ca/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ca/LC_MESSAGES/sphinx.po +864 -807
- sphinx/locale/cak/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/cak/LC_MESSAGES/sphinx.po +816 -759
- sphinx/locale/cs/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/cs/LC_MESSAGES/sphinx.po +837 -780
- sphinx/locale/cy/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/cy/LC_MESSAGES/sphinx.po +819 -762
- sphinx/locale/da/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/da/LC_MESSAGES/sphinx.po +838 -781
- sphinx/locale/de/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/de/LC_MESSAGES/sphinx.po +838 -781
- sphinx/locale/de_DE/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/de_DE/LC_MESSAGES/sphinx.po +811 -754
- sphinx/locale/el/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/el/LC_MESSAGES/sphinx.po +853 -796
- sphinx/locale/en_DE/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/en_DE/LC_MESSAGES/sphinx.po +811 -754
- sphinx/locale/en_FR/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/en_FR/LC_MESSAGES/sphinx.po +811 -754
- sphinx/locale/en_GB/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/en_GB/LC_MESSAGES/sphinx.po +856 -799
- sphinx/locale/en_HK/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/en_HK/LC_MESSAGES/sphinx.po +811 -754
- sphinx/locale/eo/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/eo/LC_MESSAGES/sphinx.po +820 -763
- sphinx/locale/es/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/es/LC_MESSAGES/sphinx.po +856 -799
- sphinx/locale/es_CO/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/es_CO/LC_MESSAGES/sphinx.po +811 -754
- sphinx/locale/et/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/et/LC_MESSAGES/sphinx.po +845 -788
- sphinx/locale/eu/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/eu/LC_MESSAGES/sphinx.po +837 -780
- sphinx/locale/fa/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/fa/LC_MESSAGES/sphinx.po +854 -797
- sphinx/locale/fi/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/fi/LC_MESSAGES/sphinx.po +816 -759
- sphinx/locale/fr/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/fr/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/fr/LC_MESSAGES/sphinx.po +904 -847
- sphinx/locale/fr_FR/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/fr_FR/LC_MESSAGES/sphinx.po +811 -754
- sphinx/locale/gl/LC_MESSAGES/sphinx.js +54 -54
- sphinx/locale/gl/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/gl/LC_MESSAGES/sphinx.po +1506 -1449
- sphinx/locale/he/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/he/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/he/LC_MESSAGES/sphinx.po +823 -766
- sphinx/locale/hi/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/hi/LC_MESSAGES/sphinx.po +853 -796
- sphinx/locale/hi_IN/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/hi_IN/LC_MESSAGES/sphinx.po +811 -754
- sphinx/locale/hr/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/hr/LC_MESSAGES/sphinx.po +844 -787
- sphinx/locale/hu/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/hu/LC_MESSAGES/sphinx.po +837 -780
- sphinx/locale/id/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/id/LC_MESSAGES/sphinx.po +854 -797
- sphinx/locale/is/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/is/LC_MESSAGES/sphinx.po +811 -754
- sphinx/locale/it/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/it/LC_MESSAGES/sphinx.po +837 -780
- sphinx/locale/ja/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ja/LC_MESSAGES/sphinx.po +853 -796
- sphinx/locale/ka/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ka/LC_MESSAGES/sphinx.po +848 -791
- sphinx/locale/ko/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ko/LC_MESSAGES/sphinx.po +855 -798
- sphinx/locale/lt/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/lt/LC_MESSAGES/sphinx.po +837 -780
- sphinx/locale/lv/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/lv/LC_MESSAGES/sphinx.po +837 -780
- sphinx/locale/mk/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/mk/LC_MESSAGES/sphinx.po +825 -768
- sphinx/locale/nb_NO/LC_MESSAGES/sphinx.js +27 -27
- sphinx/locale/nb_NO/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/nb_NO/LC_MESSAGES/sphinx.po +876 -818
- sphinx/locale/ne/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ne/LC_MESSAGES/sphinx.po +837 -780
- sphinx/locale/nl/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/nl/LC_MESSAGES/sphinx.po +844 -787
- sphinx/locale/pl/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/pl/LC_MESSAGES/sphinx.po +845 -788
- sphinx/locale/pt/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/pt/LC_MESSAGES/sphinx.po +811 -754
- sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po +908 -851
- sphinx/locale/pt_PT/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/pt_PT/LC_MESSAGES/sphinx.po +837 -780
- sphinx/locale/ro/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ro/LC_MESSAGES/sphinx.po +837 -780
- sphinx/locale/ru/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ru/LC_MESSAGES/sphinx.po +838 -781
- sphinx/locale/si/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/si/LC_MESSAGES/sphinx.po +823 -766
- sphinx/locale/sk/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sk/LC_MESSAGES/sphinx.po +854 -797
- sphinx/locale/sl/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sl/LC_MESSAGES/sphinx.po +832 -775
- sphinx/locale/sphinx.pot +813 -755
- sphinx/locale/sq/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/sq/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sq/LC_MESSAGES/sphinx.po +865 -808
- sphinx/locale/sr/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sr/LC_MESSAGES/sphinx.po +835 -778
- sphinx/locale/sr@latin/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sr_RS/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sv/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sv/LC_MESSAGES/sphinx.po +837 -780
- sphinx/locale/ta/LC_MESSAGES/sphinx.js +54 -54
- sphinx/locale/ta/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ta/LC_MESSAGES/sphinx.po +1530 -1473
- sphinx/locale/te/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/te/LC_MESSAGES/sphinx.po +811 -754
- sphinx/locale/tr/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/tr/LC_MESSAGES/sphinx.po +853 -796
- sphinx/locale/uk_UA/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/uk_UA/LC_MESSAGES/sphinx.po +833 -776
- sphinx/locale/ur/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ur/LC_MESSAGES/sphinx.po +811 -754
- sphinx/locale/vi/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/vi/LC_MESSAGES/sphinx.po +837 -780
- sphinx/locale/yue/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/yue/LC_MESSAGES/sphinx.po +811 -754
- sphinx/locale/zh_CN/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/zh_CN/LC_MESSAGES/sphinx.po +855 -798
- sphinx/locale/zh_HK/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/zh_HK/LC_MESSAGES/sphinx.po +811 -754
- sphinx/locale/zh_TW/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/zh_TW/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po +879 -822
- sphinx/locale/zh_TW.Big5/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/zh_TW.Big5/LC_MESSAGES/sphinx.po +811 -754
- sphinx/parsers.py +7 -5
- sphinx/project.py +18 -11
- sphinx/pycode/__init__.py +6 -5
- sphinx/pycode/ast.py +23 -8
- sphinx/pycode/parser.py +6 -5
- sphinx/registry.py +12 -6
- sphinx/roles.py +103 -57
- sphinx/search/__init__.py +17 -18
- sphinx/search/da.py +2 -2
- sphinx/search/de.py +2 -2
- sphinx/search/en.py +1 -1
- sphinx/search/es.py +2 -2
- sphinx/search/fi.py +2 -2
- sphinx/search/fr.py +2 -2
- sphinx/search/hu.py +2 -2
- sphinx/search/it.py +2 -2
- sphinx/search/ja.py +13 -22
- sphinx/search/nl.py +2 -2
- sphinx/search/no.py +2 -2
- sphinx/search/pt.py +2 -2
- sphinx/search/ro.py +1 -1
- sphinx/search/ru.py +2 -2
- sphinx/search/sv.py +2 -2
- sphinx/search/tr.py +1 -1
- sphinx/search/zh.py +2 -3
- sphinx/templates/graphviz/graphviz.css +1 -1
- sphinx/testing/fixtures.py +41 -24
- sphinx/testing/path.py +1 -1
- sphinx/testing/util.py +142 -53
- sphinx/texinputs/sphinx.xdy +1 -1
- sphinx/texinputs/sphinxlatextables.sty +1 -1
- sphinx/texinputs/sphinxpackagesubstitutefont.sty +21 -0
- sphinx/themes/agogo/layout.html +4 -4
- sphinx/themes/agogo/static/agogo.css_t +1 -1
- sphinx/themes/agogo/theme.toml +22 -0
- sphinx/themes/basic/defindex.html +1 -1
- sphinx/themes/basic/domainindex.html +1 -1
- sphinx/themes/basic/genindex-single.html +1 -1
- sphinx/themes/basic/genindex-split.html +1 -1
- sphinx/themes/basic/genindex.html +1 -1
- sphinx/themes/basic/globaltoc.html +1 -1
- sphinx/themes/basic/layout.html +1 -1
- sphinx/themes/basic/localtoc.html +1 -1
- sphinx/themes/basic/page.html +1 -1
- sphinx/themes/basic/relations.html +1 -1
- sphinx/themes/basic/search.html +5 -20
- sphinx/themes/basic/searchbox.html +3 -3
- sphinx/themes/basic/searchfield.html +3 -3
- sphinx/themes/basic/sourcelink.html +1 -1
- sphinx/themes/basic/static/basic.css_t +1 -1
- sphinx/themes/basic/static/doctools.js +1 -1
- sphinx/themes/basic/static/language_data.js_t +2 -2
- sphinx/themes/basic/static/searchtools.js +105 -60
- sphinx/themes/basic/theme.toml +23 -0
- sphinx/themes/bizstyle/layout.html +1 -6
- sphinx/themes/bizstyle/static/bizstyle.css_t +1 -1
- sphinx/themes/bizstyle/static/bizstyle.js_t +1 -1
- sphinx/themes/bizstyle/static/css3-mediaqueries_src.js +3 -3
- sphinx/themes/bizstyle/theme.toml +12 -0
- sphinx/themes/classic/layout.html +1 -1
- sphinx/themes/classic/static/classic.css_t +1 -1
- sphinx/themes/classic/static/sidebar.js_t +1 -1
- sphinx/themes/classic/theme.toml +34 -0
- sphinx/themes/default/theme.toml +2 -0
- sphinx/themes/epub/epub-cover.html +1 -1
- sphinx/themes/epub/layout.html +1 -1
- sphinx/themes/epub/static/epub.css_t +1 -1
- sphinx/themes/epub/theme.toml +10 -0
- sphinx/themes/haiku/layout.html +3 -3
- sphinx/themes/haiku/static/haiku.css_t +2 -2
- sphinx/themes/haiku/theme.toml +16 -0
- sphinx/themes/nature/static/nature.css_t +1 -1
- sphinx/themes/nature/theme.toml +6 -0
- sphinx/themes/nonav/layout.html +1 -1
- sphinx/themes/nonav/static/nonav.css_t +1 -1
- sphinx/themes/nonav/theme.toml +10 -0
- sphinx/themes/pyramid/static/epub.css_t +1 -1
- sphinx/themes/pyramid/static/pyramid.css_t +1 -1
- sphinx/themes/pyramid/theme.toml +6 -0
- sphinx/themes/scrolls/artwork/logo.svg +1 -1
- sphinx/themes/scrolls/layout.html +2 -2
- sphinx/themes/scrolls/static/scrolls.css_t +1 -1
- sphinx/themes/scrolls/theme.toml +15 -0
- sphinx/themes/sphinxdoc/static/sphinxdoc.css_t +1 -1
- sphinx/themes/sphinxdoc/theme.toml +6 -0
- sphinx/themes/traditional/static/traditional.css_t +1 -1
- sphinx/themes/traditional/theme.toml +9 -0
- sphinx/theming.py +427 -131
- sphinx/transforms/__init__.py +21 -24
- sphinx/transforms/compact_bullet_list.py +5 -5
- sphinx/transforms/i18n.py +30 -28
- sphinx/transforms/post_transforms/__init__.py +9 -7
- sphinx/transforms/post_transforms/code.py +4 -1
- sphinx/transforms/post_transforms/images.py +17 -13
- sphinx/transforms/references.py +3 -1
- sphinx/util/__init__.py +15 -11
- sphinx/util/_io.py +34 -0
- sphinx/util/_pathlib.py +23 -18
- sphinx/util/build_phase.py +1 -0
- sphinx/util/cfamily.py +19 -11
- sphinx/util/console.py +101 -21
- sphinx/util/display.py +3 -2
- sphinx/util/docfields.py +12 -8
- sphinx/util/docutils.py +21 -35
- sphinx/util/exceptions.py +3 -2
- sphinx/util/fileutil.py +5 -5
- sphinx/util/http_date.py +9 -2
- sphinx/util/i18n.py +40 -9
- sphinx/util/inspect.py +317 -245
- sphinx/util/inventory.py +22 -5
- sphinx/util/logging.py +81 -7
- sphinx/util/matching.py +2 -1
- sphinx/util/math.py +1 -2
- sphinx/util/nodes.py +39 -29
- sphinx/util/osutil.py +25 -6
- sphinx/util/parallel.py +6 -1
- sphinx/util/requests.py +8 -5
- sphinx/util/rst.py +8 -6
- sphinx/util/tags.py +3 -3
- sphinx/util/template.py +8 -3
- sphinx/util/typing.py +76 -42
- sphinx/versioning.py +6 -2
- sphinx/writers/html.py +1 -1
- sphinx/writers/html5.py +17 -13
- sphinx/writers/latex.py +12 -12
- sphinx/writers/manpage.py +13 -7
- sphinx/writers/texinfo.py +13 -10
- sphinx/writers/text.py +13 -23
- sphinx/writers/xml.py +1 -1
- sphinx-7.2.6.dist-info/LICENSE → sphinx-7.3.0.dist-info/LICENSE.rst +1 -1
- {sphinx-7.2.6.dist-info → sphinx-7.3.0.dist-info}/METADATA +13 -12
- sphinx-7.3.0.dist-info/RECORD +581 -0
- sphinx/domains/c.py +0 -3906
- sphinx/domains/cpp.py +0 -8233
- sphinx/domains/python.py +0 -1769
- sphinx/themes/agogo/theme.conf +0 -20
- sphinx/themes/basic/theme.conf +0 -16
- sphinx/themes/bizstyle/theme.conf +0 -10
- sphinx/themes/classic/theme.conf +0 -32
- sphinx/themes/default/theme.conf +0 -2
- sphinx/themes/epub/theme.conf +0 -8
- sphinx/themes/haiku/theme.conf +0 -14
- sphinx/themes/nature/theme.conf +0 -4
- sphinx/themes/nonav/theme.conf +0 -8
- sphinx/themes/pyramid/theme.conf +0 -4
- sphinx/themes/scrolls/theme.conf +0 -13
- sphinx/themes/sphinxdoc/theme.conf +0 -4
- sphinx/themes/traditional/theme.conf +0 -7
- sphinx-7.2.6.dist-info/RECORD +0 -569
- {sphinx-7.2.6.dist-info → sphinx-7.3.0.dist-info}/WHEEL +0 -0
- {sphinx-7.2.6.dist-info → sphinx-7.3.0.dist-info}/entry_points.txt +0 -0
sphinx/builders/html/_assets.py
CHANGED
|
@@ -3,7 +3,7 @@ from __future__ import annotations
|
|
|
3
3
|
import os
|
|
4
4
|
import warnings
|
|
5
5
|
import zlib
|
|
6
|
-
from typing import TYPE_CHECKING
|
|
6
|
+
from typing import TYPE_CHECKING, Any, NoReturn
|
|
7
7
|
|
|
8
8
|
from sphinx.deprecation import RemovedInSphinx90Warning
|
|
9
9
|
from sphinx.errors import ThemeError
|
|
@@ -27,15 +27,15 @@ class _CascadingStyleSheet:
|
|
|
27
27
|
) -> None:
|
|
28
28
|
object.__setattr__(self, 'filename', filename)
|
|
29
29
|
object.__setattr__(self, 'priority', priority)
|
|
30
|
-
object.__setattr__(self, 'attributes', {'rel': rel, 'type': type
|
|
30
|
+
object.__setattr__(self, 'attributes', {'rel': rel, 'type': type} | attributes)
|
|
31
31
|
|
|
32
|
-
def __str__(self):
|
|
32
|
+
def __str__(self) -> str:
|
|
33
33
|
attr = ', '.join(f'{k}={v!r}' for k, v in self.attributes.items())
|
|
34
34
|
return (f'{self.__class__.__name__}({self.filename!r}, '
|
|
35
35
|
f'priority={self.priority}, '
|
|
36
36
|
f'{attr})')
|
|
37
37
|
|
|
38
|
-
def __eq__(self, other):
|
|
38
|
+
def __eq__(self, other: object) -> bool:
|
|
39
39
|
if isinstance(other, str):
|
|
40
40
|
warnings.warn('The str interface for _CascadingStyleSheet objects is deprecated. '
|
|
41
41
|
'Use css.filename instead.', RemovedInSphinx90Warning, stacklevel=2)
|
|
@@ -46,23 +46,23 @@ class _CascadingStyleSheet:
|
|
|
46
46
|
and self.priority == other.priority
|
|
47
47
|
and self.attributes == other.attributes)
|
|
48
48
|
|
|
49
|
-
def __hash__(self):
|
|
49
|
+
def __hash__(self) -> int:
|
|
50
50
|
return hash((self.filename, self.priority, *sorted(self.attributes.items())))
|
|
51
51
|
|
|
52
|
-
def __setattr__(self, key, value):
|
|
52
|
+
def __setattr__(self, key: str, value: Any) -> NoReturn:
|
|
53
53
|
msg = f'{self.__class__.__name__} is immutable'
|
|
54
54
|
raise AttributeError(msg)
|
|
55
55
|
|
|
56
|
-
def __delattr__(self, key):
|
|
56
|
+
def __delattr__(self, key: str) -> NoReturn:
|
|
57
57
|
msg = f'{self.__class__.__name__} is immutable'
|
|
58
58
|
raise AttributeError(msg)
|
|
59
59
|
|
|
60
|
-
def __getattr__(self, key):
|
|
60
|
+
def __getattr__(self, key: str) -> str:
|
|
61
61
|
warnings.warn('The str interface for _CascadingStyleSheet objects is deprecated. '
|
|
62
62
|
'Use css.filename instead.', RemovedInSphinx90Warning, stacklevel=2)
|
|
63
63
|
return getattr(os.fspath(self.filename), key)
|
|
64
64
|
|
|
65
|
-
def __getitem__(self, key):
|
|
65
|
+
def __getitem__(self, key: int | slice) -> str:
|
|
66
66
|
warnings.warn('The str interface for _CascadingStyleSheet objects is deprecated. '
|
|
67
67
|
'Use css.filename instead.', RemovedInSphinx90Warning, stacklevel=2)
|
|
68
68
|
return os.fspath(self.filename)[key]
|
|
@@ -83,7 +83,7 @@ class _JavaScript:
|
|
|
83
83
|
object.__setattr__(self, 'priority', priority)
|
|
84
84
|
object.__setattr__(self, 'attributes', attributes)
|
|
85
85
|
|
|
86
|
-
def __str__(self):
|
|
86
|
+
def __str__(self) -> str:
|
|
87
87
|
attr = ''
|
|
88
88
|
if self.attributes:
|
|
89
89
|
attr = ', ' + ', '.join(f'{k}={v!r}' for k, v in self.attributes.items())
|
|
@@ -91,7 +91,7 @@ class _JavaScript:
|
|
|
91
91
|
f'priority={self.priority}'
|
|
92
92
|
f'{attr})')
|
|
93
93
|
|
|
94
|
-
def __eq__(self, other):
|
|
94
|
+
def __eq__(self, other: object) -> bool:
|
|
95
95
|
if isinstance(other, str):
|
|
96
96
|
warnings.warn('The str interface for _JavaScript objects is deprecated. '
|
|
97
97
|
'Use js.filename instead.', RemovedInSphinx90Warning, stacklevel=2)
|
|
@@ -102,23 +102,23 @@ class _JavaScript:
|
|
|
102
102
|
and self.priority == other.priority
|
|
103
103
|
and self.attributes == other.attributes)
|
|
104
104
|
|
|
105
|
-
def __hash__(self):
|
|
105
|
+
def __hash__(self) -> int:
|
|
106
106
|
return hash((self.filename, self.priority, *sorted(self.attributes.items())))
|
|
107
107
|
|
|
108
|
-
def __setattr__(self, key, value):
|
|
108
|
+
def __setattr__(self, key: str, value: Any) -> NoReturn:
|
|
109
109
|
msg = f'{self.__class__.__name__} is immutable'
|
|
110
110
|
raise AttributeError(msg)
|
|
111
111
|
|
|
112
|
-
def __delattr__(self, key):
|
|
112
|
+
def __delattr__(self, key: str) -> NoReturn:
|
|
113
113
|
msg = f'{self.__class__.__name__} is immutable'
|
|
114
114
|
raise AttributeError(msg)
|
|
115
115
|
|
|
116
|
-
def __getattr__(self, key):
|
|
116
|
+
def __getattr__(self, key: str) -> str:
|
|
117
117
|
warnings.warn('The str interface for _JavaScript objects is deprecated. '
|
|
118
118
|
'Use js.filename instead.', RemovedInSphinx90Warning, stacklevel=2)
|
|
119
119
|
return getattr(os.fspath(self.filename), key)
|
|
120
120
|
|
|
121
|
-
def __getitem__(self, key):
|
|
121
|
+
def __getitem__(self, key: int | slice) -> str:
|
|
122
122
|
warnings.warn('The str interface for _JavaScript objects is deprecated. '
|
|
123
123
|
'Use js.filename instead.', RemovedInSphinx90Warning, stacklevel=2)
|
|
124
124
|
return os.fspath(self.filename)[key]
|
|
@@ -12,6 +12,7 @@ from sphinx.util.nodes import NodeMatcher
|
|
|
12
12
|
|
|
13
13
|
if TYPE_CHECKING:
|
|
14
14
|
from sphinx.application import Sphinx
|
|
15
|
+
from sphinx.util.typing import ExtensionMetadata
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
class KeyboardTransform(SphinxPostTransform):
|
|
@@ -31,6 +32,7 @@ class KeyboardTransform(SphinxPostTransform):
|
|
|
31
32
|
<literal class="kbd">
|
|
32
33
|
x
|
|
33
34
|
"""
|
|
35
|
+
|
|
34
36
|
default_priority = 400
|
|
35
37
|
formats = ('html',)
|
|
36
38
|
pattern = re.compile(r'(?<=.)(-|\+|\^|\s+)(?=.)')
|
|
@@ -46,7 +48,7 @@ class KeyboardTransform(SphinxPostTransform):
|
|
|
46
48
|
matcher = NodeMatcher(nodes.literal, classes=["kbd"])
|
|
47
49
|
# this list must be pre-created as during iteration new nodes
|
|
48
50
|
# are added which match the condition in the NodeMatcher.
|
|
49
|
-
for node in list(self.document
|
|
51
|
+
for node in list(matcher.findall(self.document)):
|
|
50
52
|
parts = self.pattern.split(node[-1].astext())
|
|
51
53
|
if len(parts) == 1 or self.is_multiwords_key(parts):
|
|
52
54
|
continue
|
|
@@ -76,7 +78,7 @@ class KeyboardTransform(SphinxPostTransform):
|
|
|
76
78
|
return False
|
|
77
79
|
|
|
78
80
|
|
|
79
|
-
def setup(app: Sphinx) ->
|
|
81
|
+
def setup(app: Sphinx) -> ExtensionMetadata:
|
|
80
82
|
app.add_post_transform(KeyboardTransform)
|
|
81
83
|
|
|
82
84
|
return {
|
|
@@ -9,7 +9,7 @@ from typing import TYPE_CHECKING, Any
|
|
|
9
9
|
|
|
10
10
|
from docutils.frontend import OptionParser
|
|
11
11
|
|
|
12
|
-
import sphinx.builders.latex.nodes #
|
|
12
|
+
import sphinx.builders.latex.nodes # NoQA: F401,E501 # Workaround: import this before writer to avoid ImportError
|
|
13
13
|
from sphinx import addnodes, highlighting, package_dir
|
|
14
14
|
from sphinx.builders import Builder
|
|
15
15
|
from sphinx.builders.latex.constants import ADDITIONAL_SETTINGS, DEFAULT_SETTINGS, SHORTHANDOFF
|
|
@@ -20,7 +20,7 @@ from sphinx.environment.adapters.asset import ImageAdapter
|
|
|
20
20
|
from sphinx.errors import NoUri, SphinxError
|
|
21
21
|
from sphinx.locale import _, __
|
|
22
22
|
from sphinx.util import logging, texescape
|
|
23
|
-
from sphinx.util.console import bold, darkgreen
|
|
23
|
+
from sphinx.util.console import bold, darkgreen
|
|
24
24
|
from sphinx.util.display import progress_message, status_iterator
|
|
25
25
|
from sphinx.util.docutils import SphinxFileOutput, new_document
|
|
26
26
|
from sphinx.util.fileutil import copy_asset_file
|
|
@@ -39,6 +39,7 @@ if TYPE_CHECKING:
|
|
|
39
39
|
from docutils.nodes import Node
|
|
40
40
|
|
|
41
41
|
from sphinx.application import Sphinx
|
|
42
|
+
from sphinx.util.typing import ExtensionMetadata
|
|
42
43
|
|
|
43
44
|
XINDY_LANG_OPTIONS = {
|
|
44
45
|
# language codes from docutils.writers.latex2e.Babel
|
|
@@ -108,6 +109,7 @@ class LaTeXBuilder(Builder):
|
|
|
108
109
|
"""
|
|
109
110
|
Builds LaTeX output to create PDF.
|
|
110
111
|
"""
|
|
112
|
+
|
|
111
113
|
name = 'latex'
|
|
112
114
|
format = 'latex'
|
|
113
115
|
epilog = __('The LaTeX files are in %(outdir)s.')
|
|
@@ -215,15 +217,18 @@ class LaTeXBuilder(Builder):
|
|
|
215
217
|
if self.context['latex_engine'] == 'pdflatex':
|
|
216
218
|
if not self.babel.uses_cyrillic():
|
|
217
219
|
if 'X2' in self.context['fontenc']:
|
|
218
|
-
self.context['substitutefont'] = '\\usepackage
|
|
220
|
+
self.context['substitutefont'] = ('\\usepackage'
|
|
221
|
+
'{sphinxpackagesubstitutefont}')
|
|
219
222
|
self.context['textcyrillic'] = ('\\usepackage[Xtwo]'
|
|
220
223
|
'{sphinxpackagecyrillic}')
|
|
221
224
|
elif 'T2A' in self.context['fontenc']:
|
|
222
|
-
self.context['substitutefont'] = '\\usepackage
|
|
225
|
+
self.context['substitutefont'] = ('\\usepackage'
|
|
226
|
+
'{sphinxpackagesubstitutefont}')
|
|
223
227
|
self.context['textcyrillic'] = ('\\usepackage[TtwoA]'
|
|
224
228
|
'{sphinxpackagecyrillic}')
|
|
225
229
|
if 'LGR' in self.context['fontenc']:
|
|
226
|
-
self.context['substitutefont'] = '\\usepackage
|
|
230
|
+
self.context['substitutefont'] = ('\\usepackage'
|
|
231
|
+
'{sphinxpackagesubstitutefont}')
|
|
227
232
|
else:
|
|
228
233
|
self.context['textgreek'] = ''
|
|
229
234
|
if self.context['substitutefont'] == '':
|
|
@@ -338,7 +343,7 @@ class LaTeXBuilder(Builder):
|
|
|
338
343
|
def assemble_doctree(
|
|
339
344
|
self, indexfile: str, toctree_only: bool, appendices: list[str],
|
|
340
345
|
) -> nodes.document:
|
|
341
|
-
self.docnames =
|
|
346
|
+
self.docnames = {indexfile, *appendices}
|
|
342
347
|
logger.info(darkgreen(indexfile) + " ", nonl=True)
|
|
343
348
|
tree = self.env.get_doctree(indexfile)
|
|
344
349
|
tree['docname'] = indexfile
|
|
@@ -371,9 +376,11 @@ class LaTeXBuilder(Builder):
|
|
|
371
376
|
newnodes: list[Node] = [nodes.emphasis(sectname, sectname)]
|
|
372
377
|
for subdir, title in self.titles:
|
|
373
378
|
if docname.startswith(subdir):
|
|
374
|
-
newnodes.
|
|
375
|
-
|
|
376
|
-
|
|
379
|
+
newnodes.extend((
|
|
380
|
+
nodes.Text(_(' (in ')),
|
|
381
|
+
nodes.emphasis(title, title),
|
|
382
|
+
nodes.Text(')'),
|
|
383
|
+
))
|
|
377
384
|
break
|
|
378
385
|
else:
|
|
379
386
|
pass
|
|
@@ -386,7 +393,7 @@ class LaTeXBuilder(Builder):
|
|
|
386
393
|
|
|
387
394
|
@progress_message(__('copying TeX support files'))
|
|
388
395
|
def copy_support_files(self) -> None:
|
|
389
|
-
"""
|
|
396
|
+
"""Copy TeX support files from texinputs."""
|
|
390
397
|
# configure usage of xindy (impacts Makefile and latexmkrc)
|
|
391
398
|
# FIXME: convert this rather to a confval with suitable default
|
|
392
399
|
# according to language ? but would require extra documentation
|
|
@@ -476,7 +483,7 @@ def install_packages_for_ja(app: Sphinx) -> None:
|
|
|
476
483
|
|
|
477
484
|
|
|
478
485
|
def default_latex_engine(config: Config) -> str:
|
|
479
|
-
"""
|
|
486
|
+
"""Better default latex_engine settings for specific languages."""
|
|
480
487
|
if config.language == 'ja':
|
|
481
488
|
return 'uplatex'
|
|
482
489
|
if config.language.startswith('zh'):
|
|
@@ -487,7 +494,7 @@ def default_latex_engine(config: Config) -> str:
|
|
|
487
494
|
|
|
488
495
|
|
|
489
496
|
def default_latex_docclass(config: Config) -> dict[str, str]:
|
|
490
|
-
"""
|
|
497
|
+
"""Better default latex_docclass settings for specific languages."""
|
|
491
498
|
if config.language == 'ja':
|
|
492
499
|
if config.latex_engine == 'uplatex':
|
|
493
500
|
return {'manual': 'ujbook',
|
|
@@ -500,12 +507,12 @@ def default_latex_docclass(config: Config) -> dict[str, str]:
|
|
|
500
507
|
|
|
501
508
|
|
|
502
509
|
def default_latex_use_xindy(config: Config) -> bool:
|
|
503
|
-
"""
|
|
510
|
+
"""Better default latex_use_xindy settings for specific engines."""
|
|
504
511
|
return config.latex_engine in {'xelatex', 'lualatex'}
|
|
505
512
|
|
|
506
513
|
|
|
507
514
|
def default_latex_documents(config: Config) -> list[tuple[str, str, str, str, str]]:
|
|
508
|
-
"""
|
|
515
|
+
"""Better default latex_documents settings."""
|
|
509
516
|
project = texescape.escape(config.project, config.latex_engine)
|
|
510
517
|
author = texescape.escape(config.author, config.latex_engine)
|
|
511
518
|
return [(config.root_doc,
|
|
@@ -515,7 +522,7 @@ def default_latex_documents(config: Config) -> list[tuple[str, str, str, str, st
|
|
|
515
522
|
config.latex_theme)]
|
|
516
523
|
|
|
517
524
|
|
|
518
|
-
def setup(app: Sphinx) ->
|
|
525
|
+
def setup(app: Sphinx) -> ExtensionMetadata:
|
|
519
526
|
app.setup_extension('sphinx.builders.latex.transforms')
|
|
520
527
|
|
|
521
528
|
app.add_builder(LaTeXBuilder)
|
|
@@ -523,26 +530,26 @@ def setup(app: Sphinx) -> dict[str, Any]:
|
|
|
523
530
|
app.connect('config-inited', validate_latex_theme_options, priority=800)
|
|
524
531
|
app.connect('builder-inited', install_packages_for_ja)
|
|
525
532
|
|
|
526
|
-
app.add_config_value('latex_engine', default_latex_engine,
|
|
533
|
+
app.add_config_value('latex_engine', default_latex_engine, '',
|
|
527
534
|
ENUM('pdflatex', 'xelatex', 'lualatex', 'platex', 'uplatex'))
|
|
528
|
-
app.add_config_value('latex_documents', default_latex_documents,
|
|
529
|
-
app.add_config_value('latex_logo', None,
|
|
530
|
-
app.add_config_value('latex_appendices', [],
|
|
531
|
-
app.add_config_value('latex_use_latex_multicolumn', False,
|
|
532
|
-
app.add_config_value('latex_use_xindy', default_latex_use_xindy,
|
|
533
|
-
app.add_config_value('latex_toplevel_sectioning', None,
|
|
535
|
+
app.add_config_value('latex_documents', default_latex_documents, '')
|
|
536
|
+
app.add_config_value('latex_logo', None, '', str)
|
|
537
|
+
app.add_config_value('latex_appendices', [], '')
|
|
538
|
+
app.add_config_value('latex_use_latex_multicolumn', False, '')
|
|
539
|
+
app.add_config_value('latex_use_xindy', default_latex_use_xindy, '', bool)
|
|
540
|
+
app.add_config_value('latex_toplevel_sectioning', None, '',
|
|
534
541
|
ENUM(None, 'part', 'chapter', 'section'))
|
|
535
|
-
app.add_config_value('latex_domain_indices', True,
|
|
536
|
-
app.add_config_value('latex_show_urls', 'no',
|
|
537
|
-
app.add_config_value('latex_show_pagerefs', False,
|
|
538
|
-
app.add_config_value('latex_elements', {},
|
|
539
|
-
app.add_config_value('latex_additional_files', [],
|
|
540
|
-
app.add_config_value('latex_table_style', ['booktabs', 'colorrows'],
|
|
541
|
-
app.add_config_value('latex_theme', 'manual',
|
|
542
|
-
app.add_config_value('latex_theme_options', {},
|
|
543
|
-
app.add_config_value('latex_theme_path', [],
|
|
544
|
-
|
|
545
|
-
app.add_config_value('latex_docclass', default_latex_docclass,
|
|
542
|
+
app.add_config_value('latex_domain_indices', True, '', list)
|
|
543
|
+
app.add_config_value('latex_show_urls', 'no', '')
|
|
544
|
+
app.add_config_value('latex_show_pagerefs', False, '')
|
|
545
|
+
app.add_config_value('latex_elements', {}, '')
|
|
546
|
+
app.add_config_value('latex_additional_files', [], '')
|
|
547
|
+
app.add_config_value('latex_table_style', ['booktabs', 'colorrows'], '', list)
|
|
548
|
+
app.add_config_value('latex_theme', 'manual', '', str)
|
|
549
|
+
app.add_config_value('latex_theme_options', {}, '')
|
|
550
|
+
app.add_config_value('latex_theme_path', [], '', list)
|
|
551
|
+
|
|
552
|
+
app.add_config_value('latex_docclass', default_latex_docclass, '')
|
|
546
553
|
|
|
547
554
|
return {
|
|
548
555
|
'version': 'builtin',
|
sphinx/builders/latex/nodes.py
CHANGED
|
@@ -5,26 +5,30 @@ from docutils import nodes
|
|
|
5
5
|
|
|
6
6
|
class captioned_literal_block(nodes.container):
|
|
7
7
|
"""A node for a container of literal_block having a caption."""
|
|
8
|
+
|
|
8
9
|
pass
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class footnotemark(nodes.Inline, nodes.Referential, nodes.TextElement):
|
|
12
|
-
"""A node represents ``\footnotemark``."""
|
|
13
|
+
r"""A node represents ``\footnotemark``."""
|
|
14
|
+
|
|
13
15
|
pass
|
|
14
16
|
|
|
15
17
|
|
|
16
18
|
class footnotetext(nodes.General, nodes.BackLinkable, nodes.Element,
|
|
17
19
|
nodes.Labeled, nodes.Targetable):
|
|
18
|
-
"""A node represents ``\footnotetext``."""
|
|
20
|
+
r"""A node represents ``\footnotetext``."""
|
|
19
21
|
|
|
20
22
|
|
|
21
23
|
class math_reference(nodes.Inline, nodes.Referential, nodes.TextElement):
|
|
22
24
|
"""A node for a reference for equation."""
|
|
25
|
+
|
|
23
26
|
pass
|
|
24
27
|
|
|
25
28
|
|
|
26
29
|
class thebibliography(nodes.container):
|
|
27
30
|
"""A node for wrapping bibliographies."""
|
|
31
|
+
|
|
28
32
|
pass
|
|
29
33
|
|
|
30
34
|
|
|
@@ -25,18 +25,20 @@ if TYPE_CHECKING:
|
|
|
25
25
|
from docutils.nodes import Element, Node
|
|
26
26
|
|
|
27
27
|
from sphinx.application import Sphinx
|
|
28
|
+
from sphinx.util.typing import ExtensionMetadata
|
|
28
29
|
|
|
29
30
|
URI_SCHEMES = ('mailto:', 'http:', 'https:', 'ftp:')
|
|
30
31
|
|
|
31
32
|
|
|
32
33
|
class FootnoteDocnameUpdater(SphinxTransform):
|
|
33
34
|
"""Add docname to footnote and footnote_reference nodes."""
|
|
35
|
+
|
|
34
36
|
default_priority = 700
|
|
35
37
|
TARGET_NODES = (nodes.footnote, nodes.footnote_reference)
|
|
36
38
|
|
|
37
39
|
def apply(self, **kwargs: Any) -> None:
|
|
38
40
|
matcher = NodeMatcher(*self.TARGET_NODES)
|
|
39
|
-
for node in self.document
|
|
41
|
+
for node in matcher.findall(self.document):
|
|
40
42
|
node['docname'] = self.env.docname
|
|
41
43
|
|
|
42
44
|
|
|
@@ -59,6 +61,7 @@ class ShowUrlsTransform(SphinxPostTransform):
|
|
|
59
61
|
|
|
60
62
|
.. note:: This transform is used for integrated doctree
|
|
61
63
|
"""
|
|
64
|
+
|
|
62
65
|
default_priority = 400
|
|
63
66
|
formats = ('latex',)
|
|
64
67
|
|
|
@@ -112,7 +115,7 @@ class ShowUrlsTransform(SphinxPostTransform):
|
|
|
112
115
|
node = node.parent
|
|
113
116
|
|
|
114
117
|
try:
|
|
115
|
-
source = node['source']
|
|
118
|
+
source = node['source']
|
|
116
119
|
except TypeError:
|
|
117
120
|
raise ValueError(__('Failed to get a docname!')) from None
|
|
118
121
|
raise ValueError(__('Failed to get a docname '
|
|
@@ -509,6 +512,7 @@ class BibliographyTransform(SphinxPostTransform):
|
|
|
509
512
|
<citation>
|
|
510
513
|
...
|
|
511
514
|
"""
|
|
515
|
+
|
|
512
516
|
default_priority = 750
|
|
513
517
|
formats = ('latex',)
|
|
514
518
|
|
|
@@ -519,7 +523,7 @@ class BibliographyTransform(SphinxPostTransform):
|
|
|
519
523
|
citations += node
|
|
520
524
|
|
|
521
525
|
if len(citations) > 0:
|
|
522
|
-
self.document += citations
|
|
526
|
+
self.document += citations # type: ignore[attr-defined]
|
|
523
527
|
|
|
524
528
|
|
|
525
529
|
class CitationReferenceTransform(SphinxPostTransform):
|
|
@@ -528,13 +532,14 @@ class CitationReferenceTransform(SphinxPostTransform):
|
|
|
528
532
|
To handle citation reference easily on LaTeX writer, this converts
|
|
529
533
|
pending_xref nodes to citation_reference.
|
|
530
534
|
"""
|
|
535
|
+
|
|
531
536
|
default_priority = 5 # before ReferencesResolver
|
|
532
537
|
formats = ('latex',)
|
|
533
538
|
|
|
534
539
|
def run(self, **kwargs: Any) -> None:
|
|
535
540
|
domain = cast(CitationDomain, self.env.get_domain('citation'))
|
|
536
541
|
matcher = NodeMatcher(addnodes.pending_xref, refdomain='citation', reftype='ref')
|
|
537
|
-
for node in self.document
|
|
542
|
+
for node in matcher.findall(self.document):
|
|
538
543
|
docname, labelid, _ = domain.citations.get(node['reftarget'], ('', '', 0))
|
|
539
544
|
if docname:
|
|
540
545
|
citation_ref = nodes.citation_reference('', '', *node.children,
|
|
@@ -548,6 +553,7 @@ class MathReferenceTransform(SphinxPostTransform):
|
|
|
548
553
|
To handle math reference easily on LaTeX writer, this converts pending_xref
|
|
549
554
|
nodes to math_reference.
|
|
550
555
|
"""
|
|
556
|
+
|
|
551
557
|
default_priority = 5 # before ReferencesResolver
|
|
552
558
|
formats = ('latex',)
|
|
553
559
|
|
|
@@ -563,18 +569,20 @@ class MathReferenceTransform(SphinxPostTransform):
|
|
|
563
569
|
|
|
564
570
|
class LiteralBlockTransform(SphinxPostTransform):
|
|
565
571
|
"""Replace container nodes for literal_block by captioned_literal_block."""
|
|
572
|
+
|
|
566
573
|
default_priority = 400
|
|
567
574
|
formats = ('latex',)
|
|
568
575
|
|
|
569
576
|
def run(self, **kwargs: Any) -> None:
|
|
570
577
|
matcher = NodeMatcher(nodes.container, literal_block=True)
|
|
571
|
-
for node in self.document
|
|
578
|
+
for node in matcher.findall(self.document):
|
|
572
579
|
newnode = captioned_literal_block('', *node.children, **node.attributes)
|
|
573
580
|
node.replace_self(newnode)
|
|
574
581
|
|
|
575
582
|
|
|
576
583
|
class DocumentTargetTransform(SphinxPostTransform):
|
|
577
584
|
"""Add :doc label to the first section of each document."""
|
|
585
|
+
|
|
578
586
|
default_priority = 400
|
|
579
587
|
formats = ('latex',)
|
|
580
588
|
|
|
@@ -586,10 +594,10 @@ class DocumentTargetTransform(SphinxPostTransform):
|
|
|
586
594
|
|
|
587
595
|
|
|
588
596
|
class IndexInSectionTitleTransform(SphinxPostTransform):
|
|
589
|
-
"""Move index nodes in section title to outside of the title.
|
|
597
|
+
r"""Move index nodes in section title to outside of the title.
|
|
590
598
|
|
|
591
599
|
LaTeX index macro is not compatible with some handling of section titles
|
|
592
|
-
such as uppercasing done on LaTeX side (cf. fncychap handling of
|
|
600
|
+
such as uppercasing done on LaTeX side (cf. fncychap handling of ``\chapter``).
|
|
593
601
|
Moving the index node to after the title node fixes that.
|
|
594
602
|
|
|
595
603
|
Before::
|
|
@@ -611,6 +619,7 @@ class IndexInSectionTitleTransform(SphinxPostTransform):
|
|
|
611
619
|
blah blah blah
|
|
612
620
|
...
|
|
613
621
|
"""
|
|
622
|
+
|
|
614
623
|
default_priority = 400
|
|
615
624
|
formats = ('latex',)
|
|
616
625
|
|
|
@@ -623,7 +632,7 @@ class IndexInSectionTitleTransform(SphinxPostTransform):
|
|
|
623
632
|
node.parent.insert(i + 1, index)
|
|
624
633
|
|
|
625
634
|
|
|
626
|
-
def setup(app: Sphinx) ->
|
|
635
|
+
def setup(app: Sphinx) -> ExtensionMetadata:
|
|
627
636
|
app.add_transform(FootnoteDocnameUpdater)
|
|
628
637
|
app.add_post_transform(SubstitutionDefinitionsRemover)
|
|
629
638
|
app.add_post_transform(BibliographyTransform)
|
sphinx/builders/latex/util.py
CHANGED
|
@@ -35,7 +35,7 @@ class ExtBabel(Babel):
|
|
|
35
35
|
return 'english' # fallback to english
|
|
36
36
|
|
|
37
37
|
def get_mainlanguage_options(self) -> str | None:
|
|
38
|
-
"""Return options for polyglossia's
|
|
38
|
+
r"""Return options for polyglossia's ``\setmainlanguage``."""
|
|
39
39
|
if self.use_polyglossia is False:
|
|
40
40
|
return None
|
|
41
41
|
elif self.language == 'german':
|