Sphinx 7.2.5__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 +21 -20
- 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 +132 -52
- 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.5.dist-info/LICENSE → sphinx-7.3.0.dist-info/LICENSE.rst +1 -1
- {sphinx-7.2.5.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.5.dist-info/RECORD +0 -569
- {sphinx-7.2.5.dist-info → sphinx-7.3.0.dist-info}/WHEEL +0 -0
- {sphinx-7.2.5.dist-info → sphinx-7.3.0.dist-info}/entry_points.txt +0 -0
sphinx/__init__.py
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"""The Sphinx documentation toolchain."""
|
|
2
2
|
|
|
3
|
+
__version__ = '7.3.0'
|
|
4
|
+
__display_version__ = __version__ # used for command line version
|
|
5
|
+
|
|
3
6
|
# Keep this file executable as-is in Python 3!
|
|
4
7
|
# (Otherwise getting the version out of it when packaging is impossible.)
|
|
5
8
|
|
|
@@ -13,14 +16,9 @@ from .deprecation import RemovedInNextVersionWarning
|
|
|
13
16
|
# Users can avoid this by using environment variable: PYTHONWARNINGS=
|
|
14
17
|
if 'PYTHONWARNINGS' not in os.environ:
|
|
15
18
|
warnings.filterwarnings('default', category=RemovedInNextVersionWarning)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
warnings.filterwarnings('ignore', 'The frontend.Option class .*',
|
|
20
|
-
DeprecationWarning, module='docutils.frontend')
|
|
21
|
-
|
|
22
|
-
__version__ = '7.2.5'
|
|
23
|
-
__display_version__ = __version__ # used for command line version
|
|
19
|
+
warnings.filterwarnings(
|
|
20
|
+
'ignore', 'The frontend.Option class .*', DeprecationWarning, module='docutils.frontend'
|
|
21
|
+
)
|
|
24
22
|
|
|
25
23
|
#: Version info for better programmatic use.
|
|
26
24
|
#:
|
|
@@ -30,7 +28,7 @@ __display_version__ = __version__ # used for command line version
|
|
|
30
28
|
#:
|
|
31
29
|
#: .. versionadded:: 1.2
|
|
32
30
|
#: Before version 1.2, check the string ``sphinx.__version__``.
|
|
33
|
-
version_info = (7,
|
|
31
|
+
version_info = (7, 3, 0, 'final', 0)
|
|
34
32
|
|
|
35
33
|
package_dir = path.abspath(path.dirname(__file__))
|
|
36
34
|
|
|
@@ -44,6 +42,7 @@ if _in_development:
|
|
|
44
42
|
['git', 'rev-parse', '--short', 'HEAD'],
|
|
45
43
|
cwd=package_dir,
|
|
46
44
|
capture_output=True,
|
|
45
|
+
check=False,
|
|
47
46
|
encoding='ascii',
|
|
48
47
|
errors='surrogateescape',
|
|
49
48
|
).stdout:
|
sphinx/addnodes.py
CHANGED
|
@@ -12,24 +12,7 @@ if TYPE_CHECKING:
|
|
|
12
12
|
from docutils.nodes import Element
|
|
13
13
|
|
|
14
14
|
from sphinx.application import Sphinx
|
|
15
|
-
|
|
16
|
-
# deprecated name -> (object to return, canonical path or empty string)
|
|
17
|
-
_DEPRECATED_OBJECTS = {
|
|
18
|
-
'meta': (nodes.meta, 'docutils.nodes.meta'), # type: ignore[attr-defined]
|
|
19
|
-
'docutils_meta': (nodes.meta, 'docutils.nodes.meta'), # type: ignore[attr-defined]
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
def __getattr__(name):
|
|
24
|
-
if name not in _DEPRECATED_OBJECTS:
|
|
25
|
-
msg = f'module {__name__!r} has no attribute {name!r}'
|
|
26
|
-
raise AttributeError(msg)
|
|
27
|
-
|
|
28
|
-
from sphinx.deprecation import _deprecation_warning
|
|
29
|
-
|
|
30
|
-
deprecated_object, canonical_name = _DEPRECATED_OBJECTS[name]
|
|
31
|
-
_deprecation_warning(__name__, name, canonical_name, remove=(7, 0))
|
|
32
|
-
return deprecated_object
|
|
15
|
+
from sphinx.util.typing import ExtensionMetadata
|
|
33
16
|
|
|
34
17
|
|
|
35
18
|
class document(nodes.document):
|
|
@@ -44,7 +27,7 @@ class document(nodes.document):
|
|
|
44
27
|
|
|
45
28
|
def set_id(self, node: Element, msgnode: Element | None = None,
|
|
46
29
|
suggested_prefix: str = '') -> str:
|
|
47
|
-
return super().set_id(node, msgnode, suggested_prefix)
|
|
30
|
+
return super().set_id(node, msgnode, suggested_prefix)
|
|
48
31
|
|
|
49
32
|
|
|
50
33
|
class translatable(nodes.Node):
|
|
@@ -79,6 +62,7 @@ class translatable(nodes.Node):
|
|
|
79
62
|
|
|
80
63
|
class not_smartquotable:
|
|
81
64
|
"""A node which does not support smart-quotes."""
|
|
65
|
+
|
|
82
66
|
support_smartquotes = False
|
|
83
67
|
|
|
84
68
|
|
|
@@ -87,7 +71,7 @@ class toctree(nodes.General, nodes.Element, translatable):
|
|
|
87
71
|
|
|
88
72
|
def preserve_original_messages(self) -> None:
|
|
89
73
|
# toctree entries
|
|
90
|
-
rawentries = self.setdefault('rawentries', [])
|
|
74
|
+
rawentries: list[str] = self.setdefault('rawentries', [])
|
|
91
75
|
for title, _docname in self['entries']:
|
|
92
76
|
if title:
|
|
93
77
|
rawentries.append(title)
|
|
@@ -163,11 +147,12 @@ class desc_signature(_desc_classes_injector, nodes.Part, nodes.Inline, nodes.Tex
|
|
|
163
147
|
|
|
164
148
|
This node always has the classes ``sig``, ``sig-object``, and the domain it belongs to.
|
|
165
149
|
"""
|
|
150
|
+
|
|
166
151
|
# Note: the domain name is being added through a post-transform DescSigAddDomainAsClass
|
|
167
152
|
classes = ['sig', 'sig-object']
|
|
168
153
|
|
|
169
154
|
@property
|
|
170
|
-
def child_text_separator(self):
|
|
155
|
+
def child_text_separator(self) -> str: # type: ignore[override]
|
|
171
156
|
if self.get('is_multiline'):
|
|
172
157
|
return ' '
|
|
173
158
|
else:
|
|
@@ -181,6 +166,7 @@ class desc_signature_line(nodes.Part, nodes.Inline, nodes.FixedTextElement):
|
|
|
181
166
|
with ``is_multiline`` set to ``True``.
|
|
182
167
|
Set ``add_permalink = True`` for the line that should get the permalink.
|
|
183
168
|
"""
|
|
169
|
+
|
|
184
170
|
sphinx_line_type = ''
|
|
185
171
|
|
|
186
172
|
|
|
@@ -199,6 +185,7 @@ class desc_inline(_desc_classes_injector, nodes.Inline, nodes.TextElement):
|
|
|
199
185
|
This node always has the classes ``sig``, ``sig-inline``,
|
|
200
186
|
and the name of the domain it belongs to.
|
|
201
187
|
"""
|
|
188
|
+
|
|
202
189
|
classes = ['sig', 'sig-inline']
|
|
203
190
|
|
|
204
191
|
def __init__(self, domain: str, *args: Any, **kwargs: Any) -> None:
|
|
@@ -219,6 +206,7 @@ class desc_name(_desc_classes_injector, nodes.Part, nodes.Inline, nodes.FixedTex
|
|
|
219
206
|
|
|
220
207
|
This node always has the class ``sig-name``.
|
|
221
208
|
"""
|
|
209
|
+
|
|
222
210
|
classes = ['sig-name', 'descname'] # 'descname' is for backwards compatibility
|
|
223
211
|
|
|
224
212
|
|
|
@@ -230,6 +218,7 @@ class desc_addname(_desc_classes_injector, nodes.Part, nodes.Inline, nodes.Fixed
|
|
|
230
218
|
|
|
231
219
|
This node always has the class ``sig-prename``.
|
|
232
220
|
"""
|
|
221
|
+
|
|
233
222
|
# 'descclassname' is for backwards compatibility
|
|
234
223
|
classes = ['sig-prename', 'descclassname']
|
|
235
224
|
|
|
@@ -256,9 +245,10 @@ class desc_parameterlist(nodes.Part, nodes.Inline, nodes.FixedTextElement):
|
|
|
256
245
|
Set ``multi_line_parameter_list = True`` to describe a multi-line parameter list.
|
|
257
246
|
In that case each parameter will then be written on its own, indented line.
|
|
258
247
|
"""
|
|
248
|
+
|
|
259
249
|
child_text_separator = ', '
|
|
260
250
|
|
|
261
|
-
def astext(self):
|
|
251
|
+
def astext(self) -> str:
|
|
262
252
|
return f'({super().astext()})'
|
|
263
253
|
|
|
264
254
|
|
|
@@ -269,9 +259,10 @@ class desc_type_parameter_list(nodes.Part, nodes.Inline, nodes.FixedTextElement)
|
|
|
269
259
|
Set ``multi_line_parameter_list = True`` to describe a multi-line type parameters list.
|
|
270
260
|
In that case each type parameter will then be written on its own, indented line.
|
|
271
261
|
"""
|
|
262
|
+
|
|
272
263
|
child_text_separator = ', '
|
|
273
264
|
|
|
274
|
-
def astext(self):
|
|
265
|
+
def astext(self) -> str:
|
|
275
266
|
return f'[{super().astext()}]'
|
|
276
267
|
|
|
277
268
|
|
|
@@ -285,6 +276,7 @@ class desc_type_parameter(nodes.Part, nodes.Inline, nodes.FixedTextElement):
|
|
|
285
276
|
|
|
286
277
|
class desc_optional(nodes.Part, nodes.Inline, nodes.FixedTextElement):
|
|
287
278
|
"""Node for marking optional parts of the parameter list."""
|
|
279
|
+
|
|
288
280
|
child_text_separator = ', '
|
|
289
281
|
|
|
290
282
|
def astext(self) -> str:
|
|
@@ -315,6 +307,7 @@ SIG_ELEMENTS: set[type[desc_sig_element]] = set()
|
|
|
315
307
|
|
|
316
308
|
class desc_sig_element(nodes.inline, _desc_classes_injector):
|
|
317
309
|
"""Common parent class of nodes for inline text of a signature."""
|
|
310
|
+
|
|
318
311
|
classes: list[str] = []
|
|
319
312
|
|
|
320
313
|
def __init__(self, rawsource: str = '', text: str = '',
|
|
@@ -322,7 +315,7 @@ class desc_sig_element(nodes.inline, _desc_classes_injector):
|
|
|
322
315
|
super().__init__(rawsource, text, *children, **attributes)
|
|
323
316
|
self['classes'].extend(self.classes)
|
|
324
317
|
|
|
325
|
-
def __init_subclass__(cls, *, _sig_element=False, **kwargs):
|
|
318
|
+
def __init_subclass__(cls, *, _sig_element: bool = False, **kwargs: Any) -> None:
|
|
326
319
|
super().__init_subclass__(**kwargs)
|
|
327
320
|
if _sig_element:
|
|
328
321
|
# add the class to the SIG_ELEMENTS set if asked
|
|
@@ -334,6 +327,7 @@ class desc_sig_element(nodes.inline, _desc_classes_injector):
|
|
|
334
327
|
|
|
335
328
|
class desc_sig_space(desc_sig_element, _sig_element=True):
|
|
336
329
|
"""Node for a space in a signature."""
|
|
330
|
+
|
|
337
331
|
classes = ["w"]
|
|
338
332
|
|
|
339
333
|
def __init__(self, rawsource: str = '', text: str = ' ',
|
|
@@ -343,41 +337,49 @@ class desc_sig_space(desc_sig_element, _sig_element=True):
|
|
|
343
337
|
|
|
344
338
|
class desc_sig_name(desc_sig_element, _sig_element=True):
|
|
345
339
|
"""Node for an identifier in a signature."""
|
|
340
|
+
|
|
346
341
|
classes = ["n"]
|
|
347
342
|
|
|
348
343
|
|
|
349
344
|
class desc_sig_operator(desc_sig_element, _sig_element=True):
|
|
350
345
|
"""Node for an operator in a signature."""
|
|
346
|
+
|
|
351
347
|
classes = ["o"]
|
|
352
348
|
|
|
353
349
|
|
|
354
350
|
class desc_sig_punctuation(desc_sig_element, _sig_element=True):
|
|
355
351
|
"""Node for punctuation in a signature."""
|
|
352
|
+
|
|
356
353
|
classes = ["p"]
|
|
357
354
|
|
|
358
355
|
|
|
359
356
|
class desc_sig_keyword(desc_sig_element, _sig_element=True):
|
|
360
357
|
"""Node for a general keyword in a signature."""
|
|
358
|
+
|
|
361
359
|
classes = ["k"]
|
|
362
360
|
|
|
363
361
|
|
|
364
362
|
class desc_sig_keyword_type(desc_sig_element, _sig_element=True):
|
|
365
363
|
"""Node for a keyword which is a built-in type in a signature."""
|
|
364
|
+
|
|
366
365
|
classes = ["kt"]
|
|
367
366
|
|
|
368
367
|
|
|
369
368
|
class desc_sig_literal_number(desc_sig_element, _sig_element=True):
|
|
370
369
|
"""Node for a numeric literal in a signature."""
|
|
370
|
+
|
|
371
371
|
classes = ["m"]
|
|
372
372
|
|
|
373
373
|
|
|
374
374
|
class desc_sig_literal_string(desc_sig_element, _sig_element=True):
|
|
375
375
|
"""Node for a string literal in a signature."""
|
|
376
|
+
|
|
376
377
|
classes = ["s"]
|
|
377
378
|
|
|
378
379
|
|
|
379
380
|
class desc_sig_literal_char(desc_sig_element, _sig_element=True):
|
|
380
381
|
"""Node for a character literal in a signature."""
|
|
382
|
+
|
|
381
383
|
classes = ["sc"]
|
|
382
384
|
|
|
383
385
|
|
|
@@ -387,8 +389,8 @@ class desc_sig_literal_char(desc_sig_element, _sig_element=True):
|
|
|
387
389
|
class versionmodified(nodes.Admonition, nodes.TextElement):
|
|
388
390
|
"""Node for version change entries.
|
|
389
391
|
|
|
390
|
-
Currently used for "versionadded", "versionchanged"
|
|
391
|
-
directives.
|
|
392
|
+
Currently used for "versionadded", "versionchanged", "deprecated"
|
|
393
|
+
and "versionremoved" directives.
|
|
392
394
|
"""
|
|
393
395
|
|
|
394
396
|
|
|
@@ -425,7 +427,7 @@ class index(nodes.Invisible, nodes.Inline, nodes.TextElement):
|
|
|
425
427
|
|
|
426
428
|
|
|
427
429
|
class centered(nodes.Part, nodes.TextElement):
|
|
428
|
-
"""
|
|
430
|
+
"""Deprecated."""
|
|
429
431
|
|
|
430
432
|
|
|
431
433
|
class acks(nodes.Element):
|
|
@@ -479,6 +481,7 @@ class pending_xref(nodes.Inline, nodes.Element):
|
|
|
479
481
|
These nodes are resolved before writing output, in
|
|
480
482
|
BuildEnvironment.resolve_references.
|
|
481
483
|
"""
|
|
484
|
+
|
|
482
485
|
child_text_separator = ''
|
|
483
486
|
|
|
484
487
|
|
|
@@ -553,7 +556,7 @@ class manpage(nodes.Inline, nodes.FixedTextElement):
|
|
|
553
556
|
"""Node for references to manpages."""
|
|
554
557
|
|
|
555
558
|
|
|
556
|
-
def setup(app: Sphinx) ->
|
|
559
|
+
def setup(app: Sphinx) -> ExtensionMetadata:
|
|
557
560
|
app.add_node(toctree)
|
|
558
561
|
|
|
559
562
|
app.add_node(desc)
|
sphinx/application.py
CHANGED
|
@@ -10,10 +10,10 @@ import os
|
|
|
10
10
|
import pickle
|
|
11
11
|
import sys
|
|
12
12
|
from collections import deque
|
|
13
|
-
from collections.abc import Sequence # NoQA: TCH003
|
|
13
|
+
from collections.abc import Collection, Sequence # NoQA: TCH003
|
|
14
14
|
from io import StringIO
|
|
15
15
|
from os import path
|
|
16
|
-
from typing import IO, TYPE_CHECKING, Any, Callable
|
|
16
|
+
from typing import IO, TYPE_CHECKING, Any, Callable, Literal
|
|
17
17
|
|
|
18
18
|
from docutils.nodes import TextElement # NoQA: TCH002
|
|
19
19
|
from docutils.parsers.rst import Directive, roles
|
|
@@ -22,7 +22,7 @@ from pygments.lexer import Lexer # NoQA: TCH002
|
|
|
22
22
|
|
|
23
23
|
import sphinx
|
|
24
24
|
from sphinx import locale, package_dir
|
|
25
|
-
from sphinx.config import Config
|
|
25
|
+
from sphinx.config import ENUM, Config, _ConfigRebuild
|
|
26
26
|
from sphinx.environment import BuildEnvironment
|
|
27
27
|
from sphinx.errors import ApplicationError, ConfigError, VersionRequirementError
|
|
28
28
|
from sphinx.events import EventManager
|
|
@@ -33,7 +33,7 @@ from sphinx.registry import SphinxComponentRegistry
|
|
|
33
33
|
from sphinx.util import docutils, logging
|
|
34
34
|
from sphinx.util._pathlib import _StrPath
|
|
35
35
|
from sphinx.util.build_phase import BuildPhase
|
|
36
|
-
from sphinx.util.console import bold
|
|
36
|
+
from sphinx.util.console import bold
|
|
37
37
|
from sphinx.util.display import progress_message
|
|
38
38
|
from sphinx.util.i18n import CatalogRepository
|
|
39
39
|
from sphinx.util.logging import prefixed_warnings
|
|
@@ -210,10 +210,6 @@ class Sphinx:
|
|
|
210
210
|
self.confdir = _StrPath(confdir).resolve()
|
|
211
211
|
self.config = Config.read(self.confdir, confoverrides or {}, self.tags)
|
|
212
212
|
|
|
213
|
-
# initialize some limited config variables before initialize i18n and loading
|
|
214
|
-
# extensions
|
|
215
|
-
self.config.pre_init_values()
|
|
216
|
-
|
|
217
213
|
# set up translation infrastructure
|
|
218
214
|
self._init_i18n()
|
|
219
215
|
|
|
@@ -252,8 +248,8 @@ class Sphinx:
|
|
|
252
248
|
"This is needed for conf.py to behave as a Sphinx extension."),
|
|
253
249
|
)
|
|
254
250
|
|
|
255
|
-
#
|
|
256
|
-
self.config.
|
|
251
|
+
# Report any warnings for overrides.
|
|
252
|
+
self.config._report_override_warnings()
|
|
257
253
|
self.events.emit('config-inited', self.config)
|
|
258
254
|
|
|
259
255
|
# create the project
|
|
@@ -507,8 +503,8 @@ class Sphinx:
|
|
|
507
503
|
self.registry.add_builder(builder, override=override)
|
|
508
504
|
|
|
509
505
|
# TODO(stephenfin): Describe 'types' parameter
|
|
510
|
-
def add_config_value(self, name: str, default: Any, rebuild:
|
|
511
|
-
types:
|
|
506
|
+
def add_config_value(self, name: str, default: Any, rebuild: _ConfigRebuild,
|
|
507
|
+
types: type | Collection[type] | ENUM = ()) -> None:
|
|
512
508
|
"""Register a configuration value.
|
|
513
509
|
|
|
514
510
|
This is necessary for Sphinx to recognize new values and set default
|
|
@@ -542,8 +538,6 @@ class Sphinx:
|
|
|
542
538
|
converted internally.
|
|
543
539
|
"""
|
|
544
540
|
logger.debug('[app] adding config value: %r', (name, default, rebuild, types))
|
|
545
|
-
if rebuild in (False, True):
|
|
546
|
-
rebuild = 'env' if rebuild else ''
|
|
547
541
|
self.config.add(name, default, rebuild, types)
|
|
548
542
|
|
|
549
543
|
def add_event(self, name: str) -> None:
|
|
@@ -1313,7 +1307,7 @@ class Sphinx:
|
|
|
1313
1307
|
|
|
1314
1308
|
return True
|
|
1315
1309
|
|
|
1316
|
-
def set_html_assets_policy(self, policy):
|
|
1310
|
+
def set_html_assets_policy(self, policy: Literal['always', 'per_page']) -> None:
|
|
1317
1311
|
"""Set the policy to include assets in HTML pages.
|
|
1318
1312
|
|
|
1319
1313
|
- always: include the assets in all the pages
|
sphinx/builders/__init__.py
CHANGED
|
@@ -17,7 +17,7 @@ from sphinx.errors import SphinxError
|
|
|
17
17
|
from sphinx.locale import __
|
|
18
18
|
from sphinx.util import UnicodeDecodeErrorHandler, get_filetype, import_object, logging, rst
|
|
19
19
|
from sphinx.util.build_phase import BuildPhase
|
|
20
|
-
from sphinx.util.console import bold
|
|
20
|
+
from sphinx.util.console import bold
|
|
21
21
|
from sphinx.util.display import progress_message, status_iterator
|
|
22
22
|
from sphinx.util.docutils import sphinx_domains
|
|
23
23
|
from sphinx.util.i18n import CatalogInfo, CatalogRepository, docname_to_domain
|
|
@@ -25,8 +25,8 @@ from sphinx.util.osutil import SEP, ensuredir, relative_uri, relpath
|
|
|
25
25
|
from sphinx.util.parallel import ParallelTasks, SerialTasks, make_chunks, parallel_available
|
|
26
26
|
|
|
27
27
|
# side effect: registers roles and directives
|
|
28
|
-
from sphinx import directives #
|
|
29
|
-
from sphinx import roles #
|
|
28
|
+
from sphinx import directives # NoQA: F401 isort:skip
|
|
29
|
+
from sphinx import roles # NoQA: F401 isort:skip
|
|
30
30
|
|
|
31
31
|
if TYPE_CHECKING:
|
|
32
32
|
from collections.abc import Iterable, Sequence
|
|
@@ -314,8 +314,7 @@ class Builder:
|
|
|
314
314
|
|
|
315
315
|
doccount = len(updated_docnames)
|
|
316
316
|
logger.info(bold(__('looking for now-outdated files... ')), nonl=True)
|
|
317
|
-
|
|
318
|
-
updated_docnames.add(docname)
|
|
317
|
+
updated_docnames.update(self.env.check_dependents(self.app, updated_docnames))
|
|
319
318
|
outdated = len(updated_docnames) - doccount
|
|
320
319
|
if outdated:
|
|
321
320
|
logger.info(__('%d found'), outdated)
|
|
@@ -520,7 +519,7 @@ class Builder:
|
|
|
520
519
|
doctree.settings = doctree.settings.copy()
|
|
521
520
|
doctree.settings.warning_stream = None
|
|
522
521
|
doctree.settings.env = None
|
|
523
|
-
doctree.settings.record_dependencies = None
|
|
522
|
+
doctree.settings.record_dependencies = None
|
|
524
523
|
|
|
525
524
|
doctree_filename = path.join(self.doctreedir, docname + '.doctree')
|
|
526
525
|
ensuredir(path.dirname(doctree_filename))
|
sphinx/builders/_epub_base.py
CHANGED
|
@@ -168,7 +168,7 @@ class EpubBuilder(StandaloneHTMLBuilder):
|
|
|
168
168
|
self.refnodes: list[dict[str, Any]] = []
|
|
169
169
|
|
|
170
170
|
def create_build_info(self) -> BuildInfo:
|
|
171
|
-
return BuildInfo(self.config, self.tags,
|
|
171
|
+
return BuildInfo(self.config, self.tags, frozenset({'html', 'epub'}))
|
|
172
172
|
|
|
173
173
|
def get_theme_config(self) -> tuple[str, dict]:
|
|
174
174
|
return self.config.epub_theme, self.config.epub_theme_options
|
|
@@ -317,7 +317,8 @@ class EpubBuilder(StandaloneHTMLBuilder):
|
|
|
317
317
|
def footnote_spot(tree: nodes.document) -> tuple[Element, int]:
|
|
318
318
|
"""Find or create a spot to place footnotes.
|
|
319
319
|
|
|
320
|
-
The function returns the tuple (parent, index).
|
|
320
|
+
The function returns the tuple (parent, index).
|
|
321
|
+
"""
|
|
321
322
|
# The code uses the following heuristic:
|
|
322
323
|
# a) place them after the last existing footnote
|
|
323
324
|
# b) place them after an (empty) Footnotes rubric
|
|
@@ -417,7 +418,7 @@ class EpubBuilder(StandaloneHTMLBuilder):
|
|
|
417
418
|
path.join(self.srcdir, src), err)
|
|
418
419
|
continue
|
|
419
420
|
if self.config.epub_fix_images:
|
|
420
|
-
if img.mode
|
|
421
|
+
if img.mode == 'P':
|
|
421
422
|
# See the Pillow documentation for Image.convert()
|
|
422
423
|
# https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.convert
|
|
423
424
|
img = img.convert()
|
|
@@ -480,7 +481,6 @@ class EpubBuilder(StandaloneHTMLBuilder):
|
|
|
480
481
|
"""Create a dictionary with all metadata for the content.opf
|
|
481
482
|
file properly escaped.
|
|
482
483
|
"""
|
|
483
|
-
|
|
484
484
|
if (source_date_epoch := os.getenv('SOURCE_DATE_EPOCH')) is not None:
|
|
485
485
|
time_tuple = time.gmtime(int(source_date_epoch))
|
|
486
486
|
else:
|
|
@@ -510,11 +510,19 @@ class EpubBuilder(StandaloneHTMLBuilder):
|
|
|
510
510
|
|
|
511
511
|
# files
|
|
512
512
|
self.files: list[str] = []
|
|
513
|
-
self.ignored_files = [
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
513
|
+
self.ignored_files = [
|
|
514
|
+
'.buildinfo',
|
|
515
|
+
'mimetype',
|
|
516
|
+
'content.opf',
|
|
517
|
+
'toc.ncx',
|
|
518
|
+
'META-INF/container.xml',
|
|
519
|
+
'Thumbs.db',
|
|
520
|
+
'ehthumbs.db',
|
|
521
|
+
'.DS_Store',
|
|
522
|
+
'nav.xhtml',
|
|
523
|
+
self.config.epub_basename + '.epub',
|
|
524
|
+
*self.config.epub_exclude_files,
|
|
525
|
+
]
|
|
518
526
|
if not self.use_index:
|
|
519
527
|
self.ignored_files.append('genindex' + self.out_suffix)
|
|
520
528
|
for root, dirs, files in os.walk(self.outdir):
|
sphinx/builders/changes.py
CHANGED
|
@@ -12,20 +12,22 @@ from sphinx.domains.changeset import ChangeSetDomain
|
|
|
12
12
|
from sphinx.locale import _, __
|
|
13
13
|
from sphinx.theming import HTMLThemeFactory
|
|
14
14
|
from sphinx.util import logging
|
|
15
|
-
from sphinx.util.console import bold
|
|
15
|
+
from sphinx.util.console import bold
|
|
16
16
|
from sphinx.util.fileutil import copy_asset_file
|
|
17
17
|
from sphinx.util.osutil import ensuredir, os_path
|
|
18
18
|
|
|
19
19
|
if TYPE_CHECKING:
|
|
20
20
|
from sphinx.application import Sphinx
|
|
21
|
+
from sphinx.util.typing import ExtensionMetadata
|
|
21
22
|
|
|
22
23
|
logger = logging.getLogger(__name__)
|
|
23
24
|
|
|
24
25
|
|
|
25
26
|
class ChangesBuilder(Builder):
|
|
26
27
|
"""
|
|
27
|
-
Write a summary with all versionadded/changed directives.
|
|
28
|
+
Write a summary with all versionadded/changed/deprecated/removed directives.
|
|
28
29
|
"""
|
|
30
|
+
|
|
29
31
|
name = 'changes'
|
|
30
32
|
epilog = __('The overview file is in %(outdir)s.')
|
|
31
33
|
|
|
@@ -42,6 +44,7 @@ class ChangesBuilder(Builder):
|
|
|
42
44
|
'versionadded': 'added',
|
|
43
45
|
'versionchanged': 'changed',
|
|
44
46
|
'deprecated': 'deprecated',
|
|
47
|
+
'versionremoved': 'removed',
|
|
45
48
|
}
|
|
46
49
|
|
|
47
50
|
def write(self, *ignored: Any) -> None:
|
|
@@ -105,7 +108,9 @@ class ChangesBuilder(Builder):
|
|
|
105
108
|
|
|
106
109
|
hltext = ['.. versionadded:: %s' % version,
|
|
107
110
|
'.. versionchanged:: %s' % version,
|
|
108
|
-
'.. deprecated:: %s' % version
|
|
111
|
+
'.. deprecated:: %s' % version,
|
|
112
|
+
'.. versionremoved:: %s' % version,
|
|
113
|
+
]
|
|
109
114
|
|
|
110
115
|
def hl(no: int, line: str) -> str:
|
|
111
116
|
line = '<a name="L%s"> </a>' % no + html.escape(line)
|
|
@@ -142,7 +147,7 @@ class ChangesBuilder(Builder):
|
|
|
142
147
|
|
|
143
148
|
def hl(self, text: str, version: str) -> str:
|
|
144
149
|
text = html.escape(text)
|
|
145
|
-
for directive in ('versionchanged', 'versionadded', 'deprecated'):
|
|
150
|
+
for directive in ('versionchanged', 'versionadded', 'deprecated', 'versionremoved'):
|
|
146
151
|
text = text.replace(f'.. {directive}:: {version}',
|
|
147
152
|
f'<b>.. {directive}:: {version}</b>')
|
|
148
153
|
return text
|
|
@@ -151,7 +156,7 @@ class ChangesBuilder(Builder):
|
|
|
151
156
|
pass
|
|
152
157
|
|
|
153
158
|
|
|
154
|
-
def setup(app: Sphinx) ->
|
|
159
|
+
def setup(app: Sphinx) -> ExtensionMetadata:
|
|
155
160
|
app.add_builder(ChangesBuilder)
|
|
156
161
|
|
|
157
162
|
return {
|
sphinx/builders/dirhtml.py
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
from os import path
|
|
6
|
-
from typing import TYPE_CHECKING
|
|
6
|
+
from typing import TYPE_CHECKING
|
|
7
7
|
|
|
8
8
|
from sphinx.builders.html import StandaloneHTMLBuilder
|
|
9
9
|
from sphinx.util import logging
|
|
@@ -11,6 +11,7 @@ from sphinx.util.osutil import SEP, os_path
|
|
|
11
11
|
|
|
12
12
|
if TYPE_CHECKING:
|
|
13
13
|
from sphinx.application import Sphinx
|
|
14
|
+
from sphinx.util.typing import ExtensionMetadata
|
|
14
15
|
|
|
15
16
|
logger = logging.getLogger(__name__)
|
|
16
17
|
|
|
@@ -21,6 +22,7 @@ class DirectoryHTMLBuilder(StandaloneHTMLBuilder):
|
|
|
21
22
|
a directory given by their pagename, so that generated URLs don't have
|
|
22
23
|
``.html`` in them.
|
|
23
24
|
"""
|
|
25
|
+
|
|
24
26
|
name = 'dirhtml'
|
|
25
27
|
|
|
26
28
|
def get_target_uri(self, docname: str, typ: str | None = None) -> str:
|
|
@@ -41,7 +43,7 @@ class DirectoryHTMLBuilder(StandaloneHTMLBuilder):
|
|
|
41
43
|
return outfilename
|
|
42
44
|
|
|
43
45
|
|
|
44
|
-
def setup(app: Sphinx) ->
|
|
46
|
+
def setup(app: Sphinx) -> ExtensionMetadata:
|
|
45
47
|
app.setup_extension('sphinx.builders.html')
|
|
46
48
|
|
|
47
49
|
app.add_builder(DirectoryHTMLBuilder)
|
sphinx/builders/dummy.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import TYPE_CHECKING
|
|
5
|
+
from typing import TYPE_CHECKING
|
|
6
6
|
|
|
7
7
|
from sphinx.builders import Builder
|
|
8
8
|
from sphinx.locale import __
|
|
@@ -11,6 +11,7 @@ if TYPE_CHECKING:
|
|
|
11
11
|
from docutils.nodes import Node
|
|
12
12
|
|
|
13
13
|
from sphinx.application import Sphinx
|
|
14
|
+
from sphinx.util.typing import ExtensionMetadata
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
class DummyBuilder(Builder):
|
|
@@ -38,7 +39,7 @@ class DummyBuilder(Builder):
|
|
|
38
39
|
pass
|
|
39
40
|
|
|
40
41
|
|
|
41
|
-
def setup(app: Sphinx) ->
|
|
42
|
+
def setup(app: Sphinx) -> ExtensionMetadata:
|
|
42
43
|
app.add_builder(DummyBuilder)
|
|
43
44
|
|
|
44
45
|
return {
|
sphinx/builders/epub3.py
CHANGED
|
@@ -22,6 +22,7 @@ from sphinx.util.osutil import make_filename
|
|
|
22
22
|
|
|
23
23
|
if TYPE_CHECKING:
|
|
24
24
|
from sphinx.application import Sphinx
|
|
25
|
+
from sphinx.util.typing import ExtensionMetadata
|
|
25
26
|
|
|
26
27
|
logger = logging.getLogger(__name__)
|
|
27
28
|
|
|
@@ -75,6 +76,7 @@ class Epub3Builder(_epub_base.EpubBuilder):
|
|
|
75
76
|
and META-INF/container.xml. Afterwards, all necessary files are zipped to
|
|
76
77
|
an epub file.
|
|
77
78
|
"""
|
|
79
|
+
|
|
78
80
|
name = 'epub'
|
|
79
81
|
epilog = __('The ePub file is in %(outdir)s.')
|
|
80
82
|
|
|
@@ -240,7 +242,7 @@ def validate_config_values(app: Sphinx) -> None:
|
|
|
240
242
|
|
|
241
243
|
|
|
242
244
|
def convert_epub_css_files(app: Sphinx, config: Config) -> None:
|
|
243
|
-
"""
|
|
245
|
+
"""Convert string styled epub_css_files to tuple styled one."""
|
|
244
246
|
epub_css_files: list[tuple[str, dict[str, Any]]] = []
|
|
245
247
|
for entry in config.epub_css_files:
|
|
246
248
|
if isinstance(entry, str):
|
|
@@ -256,11 +258,11 @@ def convert_epub_css_files(app: Sphinx, config: Config) -> None:
|
|
|
256
258
|
config.epub_css_files = epub_css_files # type: ignore[attr-defined]
|
|
257
259
|
|
|
258
260
|
|
|
259
|
-
def setup(app: Sphinx) ->
|
|
261
|
+
def setup(app: Sphinx) -> ExtensionMetadata:
|
|
260
262
|
app.add_builder(Epub3Builder)
|
|
261
263
|
|
|
262
264
|
# config values
|
|
263
|
-
app.add_config_value('epub_basename', lambda self: make_filename(self.project),
|
|
265
|
+
app.add_config_value('epub_basename', lambda self: make_filename(self.project), '')
|
|
264
266
|
app.add_config_value('epub_version', 3.0, 'epub') # experimental
|
|
265
267
|
app.add_config_value('epub_theme', 'epub', 'epub')
|
|
266
268
|
app.add_config_value('epub_theme_options', {}, 'epub')
|