Sphinx 7.3.7__py3-none-any.whl → 7.4.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 +5 -6
- sphinx/_cli/__init__.py +296 -0
- sphinx/_cli/util/__init__.py +0 -0
- sphinx/_cli/util/colour.py +103 -0
- sphinx/_cli/util/errors.py +165 -0
- sphinx/application.py +78 -43
- sphinx/builders/__init__.py +59 -15
- sphinx/builders/_epub_base.py +11 -5
- sphinx/builders/changes.py +2 -2
- sphinx/builders/epub3.py +2 -2
- sphinx/builders/gettext.py +10 -10
- sphinx/builders/html/__init__.py +56 -54
- sphinx/builders/latex/__init__.py +5 -5
- sphinx/builders/latex/constants.py +5 -0
- sphinx/builders/linkcheck.py +73 -38
- sphinx/builders/texinfo.py +1 -1
- sphinx/cmd/build.py +1 -1
- sphinx/cmd/quickstart.py +11 -11
- sphinx/config.py +57 -38
- sphinx/directives/__init__.py +7 -9
- sphinx/directives/code.py +12 -15
- sphinx/directives/other.py +12 -15
- sphinx/directives/patches.py +26 -0
- sphinx/domains/__init__.py +1 -1
- sphinx/domains/c/__init__.py +5 -5
- sphinx/domains/c/_ast.py +436 -12
- sphinx/domains/c/_symbol.py +89 -134
- sphinx/domains/changeset.py +3 -4
- sphinx/domains/cpp/__init__.py +5 -6
- sphinx/domains/cpp/_ast.py +822 -25
- sphinx/domains/cpp/_symbol.py +3 -0
- sphinx/domains/javascript.py +3 -6
- sphinx/domains/math.py +3 -2
- sphinx/domains/python/__init__.py +44 -6
- sphinx/domains/python/_object.py +7 -5
- sphinx/domains/rst.py +2 -2
- sphinx/domains/std/__init__.py +95 -14
- sphinx/environment/__init__.py +35 -15
- sphinx/environment/adapters/indexentries.py +71 -24
- sphinx/environment/adapters/toctree.py +1 -1
- sphinx/environment/collectors/__init__.py +18 -4
- sphinx/environment/collectors/asset.py +4 -4
- sphinx/environment/collectors/toctree.py +27 -14
- sphinx/events.py +7 -6
- sphinx/ext/apidoc.py +377 -170
- sphinx/ext/autodoc/__init__.py +13 -13
- sphinx/ext/autodoc/directive.py +10 -13
- sphinx/ext/autodoc/mock.py +10 -7
- sphinx/ext/autodoc/preserve_defaults.py +1 -1
- sphinx/ext/autodoc/typehints.py +2 -2
- sphinx/ext/autosummary/__init__.py +15 -9
- sphinx/ext/autosummary/generate.py +270 -154
- sphinx/ext/coverage.py +108 -18
- sphinx/ext/duration.py +10 -3
- sphinx/ext/extlinks.py +3 -2
- sphinx/ext/graphviz.py +3 -3
- sphinx/ext/ifconfig.py +1 -2
- sphinx/ext/imgconverter.py +1 -0
- sphinx/ext/imgmath.py +7 -6
- sphinx/ext/inheritance_diagram.py +3 -3
- sphinx/ext/intersphinx/__init__.py +81 -0
- sphinx/ext/intersphinx/__main__.py +10 -0
- sphinx/ext/intersphinx/_cli.py +44 -0
- sphinx/ext/intersphinx/_load.py +253 -0
- sphinx/ext/{intersphinx.py → intersphinx/_resolve.py} +17 -368
- sphinx/ext/intersphinx/_shared.py +53 -0
- sphinx/ext/mathjax.py +1 -1
- sphinx/ext/todo.py +2 -2
- sphinx/io.py +2 -6
- sphinx/locale/__init__.py +1 -5
- sphinx/locale/ar/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/ar/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ar/LC_MESSAGES/sphinx.po +678 -471
- sphinx/locale/bg/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/bg/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/bg/LC_MESSAGES/sphinx.po +684 -476
- sphinx/locale/bn/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/bn/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/bn/LC_MESSAGES/sphinx.po +679 -472
- sphinx/locale/ca/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/ca/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ca/LC_MESSAGES/sphinx.po +681 -474
- sphinx/locale/cak/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/cak/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/cak/LC_MESSAGES/sphinx.po +678 -471
- sphinx/locale/cs/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/cs/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/cs/LC_MESSAGES/sphinx.po +679 -472
- sphinx/locale/cy/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/cy/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/cy/LC_MESSAGES/sphinx.po +679 -472
- sphinx/locale/da/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/da/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/da/LC_MESSAGES/sphinx.po +679 -472
- sphinx/locale/de/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/de/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/de/LC_MESSAGES/sphinx.po +679 -472
- sphinx/locale/de_DE/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/de_DE/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/de_DE/LC_MESSAGES/sphinx.po +678 -471
- sphinx/locale/el/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/el/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/el/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/en_DE/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/en_DE/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/en_DE/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/en_FR/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/en_FR/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/en_FR/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/en_GB/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/en_GB/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/en_GB/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/en_HK/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/en_HK/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/en_HK/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/eo/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/eo/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/eo/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/es/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/es/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/es/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/es_CO/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/es_CO/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/es_CO/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/et/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/et/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/et/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/eu/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/eu/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/eu/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/fa/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/fa/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/fa/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/fi/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/fi/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/fi/LC_MESSAGES/sphinx.po +700 -493
- 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 +725 -518
- sphinx/locale/fr_FR/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/fr_FR/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/fr_FR/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/gl/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/gl/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/gl/LC_MESSAGES/sphinx.po +701 -494
- 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 +700 -493
- sphinx/locale/hi/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/hi/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/hi/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/hi_IN/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/hi_IN/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/hi_IN/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/hr/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/hr/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/hr/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/hu/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/hu/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/hu/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/id/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/id/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/id/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/is/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/is/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/is/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/it/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/it/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/it/LC_MESSAGES/sphinx.po +708 -500
- sphinx/locale/ja/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/ja/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ja/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/ka/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/ka/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ka/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/ko/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/ko/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ko/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/lt/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/lt/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/lt/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/lv/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/lv/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/lv/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/mk/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/mk/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/mk/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/nb_NO/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/nb_NO/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/nb_NO/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/ne/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/ne/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ne/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/nl/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/nl/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/nl/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/pl/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/pl/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/pl/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/pt/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/pt/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/pt/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/pt_BR/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po +705 -498
- sphinx/locale/pt_PT/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/pt_PT/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/pt_PT/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/ro/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/ro/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ro/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/ru/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/ru/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ru/LC_MESSAGES/sphinx.po +890 -680
- sphinx/locale/si/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/si/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/si/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/sk/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/sk/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sk/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/sl/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/sl/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sl/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/sphinx.pot +702 -494
- 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 +704 -497
- sphinx/locale/sr/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/sr/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sr/LC_MESSAGES/sphinx.po +700 -493
- 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.js +1 -1
- sphinx/locale/sv/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sv/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/ta/LC_MESSAGES/sphinx.po +1016 -808
- sphinx/locale/te/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/te/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/te/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/tr/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/tr/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/tr/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/uk_UA/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/uk_UA/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/uk_UA/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/ur/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/ur/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ur/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/vi/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/vi/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/vi/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/yue/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/yue/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/yue/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/zh_CN/LC_MESSAGES/sphinx.po +704 -496
- sphinx/locale/zh_HK/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/zh_HK/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/zh_HK/LC_MESSAGES/sphinx.po +700 -493
- 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 +729 -522
- sphinx/locale/zh_TW.Big5/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/zh_TW.Big5/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/zh_TW.Big5/LC_MESSAGES/sphinx.po +700 -493
- sphinx/roles.py +1 -1
- sphinx/search/__init__.py +17 -9
- sphinx/templates/quickstart/{root_doc.rst_t → root_doc.rst.jinja} +7 -10
- sphinx/testing/fixtures.py +22 -20
- sphinx/testing/path.py +6 -2
- sphinx/testing/util.py +8 -13
- sphinx/texinputs/sphinx.sty +449 -332
- sphinx/texinputs/sphinxlatexadmonitions.sty +209 -66
- sphinx/texinputs/sphinxlatexliterals.sty +9 -16
- sphinx/texinputs/sphinxlatexstyletext.sty +4 -38
- sphinx/texinputs/sphinxlatextables.sty +6 -14
- sphinx/texinputs/sphinxpackageboxes.sty +15 -42
- sphinx/texinputs/sphinxpackagefootnote.sty +4 -3
- sphinx/themes/agogo/layout.html +3 -3
- sphinx/themes/basic/genindex-single.html +2 -1
- sphinx/themes/basic/layout.html +3 -6
- sphinx/themes/basic/static/searchtools.js +4 -3
- sphinx/themes/haiku/layout.html +4 -4
- sphinx/themes/pyramid/layout.html +1 -1
- sphinx/themes/scrolls/layout.html +2 -2
- sphinx/theming.py +3 -3
- sphinx/transforms/__init__.py +34 -20
- sphinx/transforms/i18n.py +8 -7
- sphinx/transforms/post_transforms/__init__.py +1 -1
- sphinx/transforms/post_transforms/images.py +7 -10
- sphinx/util/_pathlib.py +2 -2
- sphinx/util/cfamily.py +52 -30
- sphinx/util/console.py +1 -1
- sphinx/util/display.py +16 -11
- sphinx/util/docutils.py +88 -40
- sphinx/util/fileutil.py +15 -3
- sphinx/util/images.py +1 -0
- sphinx/util/inspect.py +66 -22
- sphinx/util/inventory.py +15 -0
- sphinx/util/logging.py +14 -21
- sphinx/util/math.py +3 -1
- sphinx/util/nodes.py +9 -12
- sphinx/util/osutil.py +5 -5
- sphinx/util/parsing.py +93 -0
- sphinx/util/tags.py +71 -47
- sphinx/util/typing.py +261 -143
- sphinx/versioning.py +17 -17
- sphinx/writers/html5.py +26 -19
- sphinx/writers/latex.py +58 -28
- sphinx/writers/manpage.py +4 -3
- sphinx/writers/texinfo.py +19 -14
- {sphinx-7.3.7.dist-info → sphinx-7.4.0.dist-info}/METADATA +21 -20
- sphinx-7.4.0.dist-info/RECORD +591 -0
- sphinx-7.3.7.dist-info/RECORD +0 -581
- /sphinx/templates/apidoc/{module.rst_t → module.rst.jinja} +0 -0
- /sphinx/templates/apidoc/{package.rst_t → package.rst.jinja} +0 -0
- /sphinx/templates/apidoc/{toc.rst_t → toc.rst.jinja} +0 -0
- /sphinx/templates/epub3/{content.opf_t → content.opf.jinja} +0 -0
- /sphinx/templates/epub3/{nav.xhtml_t → nav.xhtml.jinja} +0 -0
- /sphinx/templates/epub3/{toc.ncx_t → toc.ncx.jinja} +0 -0
- /sphinx/templates/gettext/{message.pot_t → message.pot.jinja} +0 -0
- /sphinx/templates/imgmath/{preview.tex_t → preview.tex.jinja} +0 -0
- /sphinx/templates/imgmath/{template.tex_t → template.tex.jinja} +0 -0
- /sphinx/templates/latex/{latex.tex_t → latex.tex.jinja} +0 -0
- /sphinx/templates/latex/{longtable.tex_t → longtable.tex.jinja} +0 -0
- /sphinx/templates/latex/{sphinxmessages.sty_t → sphinxmessages.sty.jinja} +0 -0
- /sphinx/templates/latex/{tabular.tex_t → tabular.tex.jinja} +0 -0
- /sphinx/templates/latex/{tabulary.tex_t → tabulary.tex.jinja} +0 -0
- /sphinx/templates/quickstart/{Makefile_t → Makefile.jinja} +0 -0
- /sphinx/templates/quickstart/{Makefile.new_t → Makefile.new.jinja} +0 -0
- /sphinx/templates/quickstart/{conf.py_t → conf.py.jinja} +0 -0
- /sphinx/templates/quickstart/{make.bat_t → make.bat.jinja} +0 -0
- /sphinx/templates/quickstart/{make.bat.new_t → make.bat.new.jinja} +0 -0
- /sphinx/texinputs/{Makefile_t → Makefile.jinja} +0 -0
- /sphinx/texinputs/{latexmkjarc_t → latexmkjarc.jinja} +0 -0
- /sphinx/texinputs/{latexmkrc_t → latexmkrc.jinja} +0 -0
- /sphinx/texinputs/{make.bat_t → make.bat.jinja} +0 -0
- /sphinx/texinputs_win/{Makefile_t → Makefile.jinja} +0 -0
- /sphinx/themes/agogo/static/{agogo.css_t → agogo.css.jinja} +0 -0
- /sphinx/themes/basic/static/{basic.css_t → basic.css.jinja} +0 -0
- /sphinx/themes/basic/static/{documentation_options.js_t → documentation_options.js.jinja} +0 -0
- /sphinx/themes/basic/static/{language_data.js_t → language_data.js.jinja} +0 -0
- /sphinx/themes/bizstyle/static/{bizstyle.css_t → bizstyle.css.jinja} +0 -0
- /sphinx/themes/bizstyle/static/{bizstyle.js_t → bizstyle.js.jinja} +0 -0
- /sphinx/themes/classic/static/{classic.css_t → classic.css.jinja} +0 -0
- /sphinx/themes/classic/static/{sidebar.js_t → sidebar.js.jinja} +0 -0
- /sphinx/themes/epub/static/{epub.css_t → epub.css.jinja} +0 -0
- /sphinx/themes/haiku/static/{haiku.css_t → haiku.css.jinja} +0 -0
- /sphinx/themes/nature/static/{nature.css_t → nature.css.jinja} +0 -0
- /sphinx/themes/nonav/static/{nonav.css_t → nonav.css.jinja} +0 -0
- /sphinx/themes/pyramid/static/{epub.css_t → epub.css.jinja} +0 -0
- /sphinx/themes/pyramid/static/{pyramid.css_t → pyramid.css.jinja} +0 -0
- /sphinx/themes/scrolls/static/{scrolls.css_t → scrolls.css.jinja} +0 -0
- /sphinx/themes/sphinxdoc/static/{sphinxdoc.css_t → sphinxdoc.css.jinja} +0 -0
- /sphinx/themes/traditional/static/{traditional.css_t → traditional.css.jinja} +0 -0
- {sphinx-7.3.7.dist-info → sphinx-7.4.0.dist-info}/LICENSE.rst +0 -0
- {sphinx-7.3.7.dist-info → sphinx-7.4.0.dist-info}/WHEEL +0 -0
- {sphinx-7.3.7.dist-info → sphinx-7.4.0.dist-info}/entry_points.txt +0 -0
sphinx/themes/agogo/layout.html
CHANGED
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
<div class="header">
|
|
16
16
|
{%- if logo_url %}
|
|
17
17
|
<p class="logo"><a href="{{ pathto(root_doc)|e }}">
|
|
18
|
-
<img class="logo" src="{{ logo_url|e }}" alt="
|
|
18
|
+
<img class="logo" src="{{ logo_url|e }}" alt="{{ logo_alt|e }}"/>
|
|
19
19
|
</a></p>
|
|
20
20
|
{%- endif %}
|
|
21
21
|
{%- block headertitle %}
|
|
22
22
|
<div class="headertitle"><a
|
|
23
23
|
href="{{ pathto(root_doc)|e }}">{{ shorttitle|e }}</a></div>
|
|
24
24
|
{%- endblock %}
|
|
25
|
-
<div class="rel" role="navigation" aria-label="
|
|
25
|
+
<div class="rel" role="navigation" aria-label="Related">
|
|
26
26
|
{%- for rellink in rellinks|reverse %}
|
|
27
27
|
<a href="{{ pathto(rellink[0])|e }}" title="{{ rellink[1]|striptags|e }}"
|
|
28
28
|
{{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a>
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
<div class="footer-wrapper">
|
|
77
77
|
<div class="footer">
|
|
78
78
|
<div class="left">
|
|
79
|
-
<div role="navigation" aria-label="
|
|
79
|
+
<div role="navigation" aria-label="Related">
|
|
80
80
|
{%- for rellink in rellinks|reverse %}
|
|
81
81
|
<a href="{{ pathto(rellink[0])|e }}" title="{{ rellink[1]|striptags|e }}"
|
|
82
82
|
{{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a>
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
{% set title = _('Index') %}
|
|
31
31
|
{% block body %}
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
{# We use ``–`` instead of ``–`` for XHTML compatibility #}
|
|
34
|
+
<h1 id="index">{% trans key=key %}Index – {{ key }}{% endtrans %}</h1>
|
|
34
35
|
|
|
35
36
|
<table style="width: 100%" class="indextable"><tr>
|
|
36
37
|
{%- for column in entries|slice(2) if column %}
|
sphinx/themes/basic/layout.html
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
{%- endif %}
|
|
23
23
|
|
|
24
24
|
{%- macro relbar() %}
|
|
25
|
-
<div class="related" role="navigation" aria-label="
|
|
25
|
+
<div class="related" role="navigation" aria-label="Related">
|
|
26
26
|
<h3>{{ _('Navigation') }}</h3>
|
|
27
27
|
<ul>
|
|
28
28
|
{%- for rellink in rellinks %}
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
|
|
46
46
|
{%- macro sidebar() %}
|
|
47
47
|
{%- if render_sidebar %}
|
|
48
|
-
<div class="sphinxsidebar" role="navigation" aria-label="
|
|
48
|
+
<div class="sphinxsidebar" role="navigation" aria-label="Main">
|
|
49
49
|
<div class="sphinxsidebarwrapper">
|
|
50
50
|
{%- block sidebarlogo %}
|
|
51
51
|
{%- if logo_url %}
|
|
52
52
|
<p class="logo"><a href="{{ pathto(root_doc)|e }}">
|
|
53
|
-
<img class="logo" src="{{ logo_url|e }}" alt="
|
|
53
|
+
<img class="logo" src="{{ logo_url|e }}" alt="{{ logo_alt|e }}"/>
|
|
54
54
|
</a></p>
|
|
55
55
|
{%- endif %}
|
|
56
56
|
{%- endblock %}
|
|
@@ -70,9 +70,6 @@
|
|
|
70
70
|
{%- block sidebarsourcelink %}
|
|
71
71
|
{%- include "sourcelink.html" %}
|
|
72
72
|
{%- endblock %}
|
|
73
|
-
{%- if customsidebar %}
|
|
74
|
-
{%- include customsidebar %}
|
|
75
|
-
{%- endif %}
|
|
76
73
|
{%- block sidebarsearch %}
|
|
77
74
|
{%- include "searchbox.html" %}
|
|
78
75
|
{%- endblock %}
|
|
@@ -178,7 +178,7 @@ const Search = {
|
|
|
178
178
|
|
|
179
179
|
htmlToText: (htmlString, anchor) => {
|
|
180
180
|
const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html');
|
|
181
|
-
for (const removalQuery of [".
|
|
181
|
+
for (const removalQuery of [".headerlink", "script", "style"]) {
|
|
182
182
|
htmlElement.querySelectorAll(removalQuery).forEach((el) => { el.remove() });
|
|
183
183
|
}
|
|
184
184
|
if (anchor) {
|
|
@@ -328,13 +328,14 @@ const Search = {
|
|
|
328
328
|
for (const [title, foundTitles] of Object.entries(allTitles)) {
|
|
329
329
|
if (title.toLowerCase().trim().includes(queryLower) && (queryLower.length >= title.length/2)) {
|
|
330
330
|
for (const [file, id] of foundTitles) {
|
|
331
|
-
|
|
331
|
+
const score = Math.round(Scorer.title * queryLower.length / title.length);
|
|
332
|
+
const boost = titles[file] === title ? 1 : 0; // add a boost for document titles
|
|
332
333
|
normalResults.push([
|
|
333
334
|
docNames[file],
|
|
334
335
|
titles[file] !== title ? `${titles[file]} > ${title}` : title,
|
|
335
336
|
id !== null ? "#" + id : "",
|
|
336
337
|
null,
|
|
337
|
-
score,
|
|
338
|
+
score + boost,
|
|
338
339
|
filenames[file],
|
|
339
340
|
]);
|
|
340
341
|
}
|
sphinx/themes/haiku/layout.html
CHANGED
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
{%- block haikuheader %}
|
|
37
37
|
{%- if theme_full_logo != "false" %}
|
|
38
38
|
<a href="{{ pathto(root_doc)|e }}">
|
|
39
|
-
<img class="logo" src="{{ logo_url|e }}" alt="
|
|
39
|
+
<img class="logo" src="{{ logo_url|e }}" alt="{{ logo_alt|e }}"/>
|
|
40
40
|
</a>
|
|
41
41
|
{%- else %}
|
|
42
42
|
{%- if logo -%}
|
|
43
|
-
<img class="rightlogo" src="{{ logo_url|e }}" alt="
|
|
43
|
+
<img class="rightlogo" src="{{ logo_url|e }}" alt="{{ logo_alt|e }}"/>
|
|
44
44
|
{%- endif -%}
|
|
45
45
|
<h1 class="heading"><a href="{{ pathto(root_doc)|e }}">
|
|
46
46
|
<span>{{ shorttitle|e }}</span></a></h1>
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
{%- endif %}
|
|
49
49
|
{%- endblock %}
|
|
50
50
|
</div>
|
|
51
|
-
<div class="topnav" role="navigation" aria-label="
|
|
51
|
+
<div class="topnav" role="navigation" aria-label="Top">
|
|
52
52
|
{{ nav() }}
|
|
53
53
|
</div>
|
|
54
54
|
<div class="content" role="main">
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
{%- endif %}#}
|
|
61
61
|
{% block body %}{% endblock %}
|
|
62
62
|
</div>
|
|
63
|
-
<div class="bottomnav" role="navigation" aria-label="
|
|
63
|
+
<div class="bottomnav" role="navigation" aria-label="Bottom">
|
|
64
64
|
{{ nav() }}
|
|
65
65
|
</div>
|
|
66
66
|
{% endblock %}
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
<h1 class="heading"><a href="{{ pathto(root_doc)|e }}"
|
|
27
27
|
title="back to the documentation overview"><span>{{ title|striptags|e }}</span></a></h1>
|
|
28
28
|
</div>
|
|
29
|
-
<div class="relnav" role="navigation" aria-label="
|
|
29
|
+
<div class="relnav" role="navigation" aria-label="Related">
|
|
30
30
|
{%- if prev %}
|
|
31
31
|
<a href="{{ prev.link|e }}">« {{ prev.title }}</a> |
|
|
32
32
|
{%- endif %}
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
</div>
|
|
38
38
|
<div id="contentwrapper">
|
|
39
39
|
{%- if display_toc %}
|
|
40
|
-
<div id="toc" role="navigation" aria-label="
|
|
40
|
+
<div id="toc" role="navigation" aria-label="Table of contents">
|
|
41
41
|
<h3>{{ _('Table of Contents') }}</h3>
|
|
42
42
|
{{ toc }}
|
|
43
43
|
</div>
|
sphinx/theming.py
CHANGED
|
@@ -130,7 +130,7 @@ class Theme:
|
|
|
130
130
|
'are not supported, returning the default value instead '
|
|
131
131
|
'(tried to get a value from %r)'
|
|
132
132
|
)
|
|
133
|
-
logger.info(msg
|
|
133
|
+
logger.info(msg, section)
|
|
134
134
|
value = default
|
|
135
135
|
if value is _NO_DEFAULT:
|
|
136
136
|
msg = __('setting %s.%s occurs in none of the searched theme configs') % (
|
|
@@ -148,7 +148,7 @@ class Theme:
|
|
|
148
148
|
options = self._options.copy()
|
|
149
149
|
for option, value in overrides.items():
|
|
150
150
|
if option not in options:
|
|
151
|
-
logger.warning(__('unsupported theme option %r given')
|
|
151
|
+
logger.warning(__('unsupported theme option %r given'), option)
|
|
152
152
|
else:
|
|
153
153
|
options[option] = value
|
|
154
154
|
|
|
@@ -179,7 +179,7 @@ class HTMLThemeFactory:
|
|
|
179
179
|
for name, theme in themes.items():
|
|
180
180
|
self._themes[name] = theme
|
|
181
181
|
|
|
182
|
-
def _load_additional_themes(self, theme_paths: str) -> None:
|
|
182
|
+
def _load_additional_themes(self, theme_paths: list[str]) -> None:
|
|
183
183
|
"""Load additional themes placed at specified directories."""
|
|
184
184
|
for theme_path in theme_paths:
|
|
185
185
|
abs_theme_path = path.abspath(path.join(self._app.confdir, theme_path))
|
sphinx/transforms/__init__.py
CHANGED
|
@@ -22,8 +22,10 @@ from sphinx.util.nodes import apply_source_workaround, is_smartquotable
|
|
|
22
22
|
|
|
23
23
|
if TYPE_CHECKING:
|
|
24
24
|
from collections.abc import Iterator
|
|
25
|
+
from typing import Literal
|
|
25
26
|
|
|
26
27
|
from docutils.nodes import Node, Text
|
|
28
|
+
from typing_extensions import TypeAlias, TypeIs
|
|
27
29
|
|
|
28
30
|
from sphinx.application import Sphinx
|
|
29
31
|
from sphinx.config import Config
|
|
@@ -31,15 +33,22 @@ if TYPE_CHECKING:
|
|
|
31
33
|
from sphinx.environment import BuildEnvironment
|
|
32
34
|
from sphinx.util.typing import ExtensionMetadata
|
|
33
35
|
|
|
36
|
+
_DEFAULT_SUBSTITUTION_NAMES: TypeAlias = Literal[
|
|
37
|
+
'version',
|
|
38
|
+
'release',
|
|
39
|
+
'today',
|
|
40
|
+
'translation progress',
|
|
41
|
+
]
|
|
42
|
+
|
|
34
43
|
|
|
35
44
|
logger = logging.getLogger(__name__)
|
|
36
45
|
|
|
37
|
-
|
|
46
|
+
_DEFAULT_SUBSTITUTIONS = frozenset({
|
|
38
47
|
'version',
|
|
39
48
|
'release',
|
|
40
49
|
'today',
|
|
41
50
|
'translation progress',
|
|
42
|
-
}
|
|
51
|
+
})
|
|
43
52
|
|
|
44
53
|
|
|
45
54
|
class SphinxTransform(Transform):
|
|
@@ -105,20 +114,25 @@ class DefaultSubstitutions(SphinxTransform):
|
|
|
105
114
|
|
|
106
115
|
def apply(self, **kwargs: Any) -> None:
|
|
107
116
|
# only handle those not otherwise defined in the document
|
|
108
|
-
to_handle =
|
|
117
|
+
to_handle = _DEFAULT_SUBSTITUTIONS - set(self.document.substitution_defs)
|
|
109
118
|
for ref in self.document.findall(nodes.substitution_reference):
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
if (name := ref['refname']) in to_handle:
|
|
120
|
+
ref.replace_self(self._handle_default_substitution(name))
|
|
121
|
+
|
|
122
|
+
def _handle_default_substitution(self, name: _DEFAULT_SUBSTITUTION_NAMES) -> nodes.Text:
|
|
123
|
+
if name == 'translation progress':
|
|
124
|
+
# special handling: calculate translation progress
|
|
125
|
+
return nodes.Text(_calculate_translation_progress(self.document))
|
|
126
|
+
if name == 'today':
|
|
127
|
+
if text := self.config.today:
|
|
128
|
+
return nodes.Text(text)
|
|
129
|
+
# special handling: can also specify a strftime format
|
|
130
|
+
return nodes.Text(format_date(
|
|
131
|
+
self.config.today_fmt or _('%b %d, %Y'),
|
|
132
|
+
language=self.config.language,
|
|
133
|
+
))
|
|
134
|
+
# config.version and config.release
|
|
135
|
+
return nodes.Text(getattr(self.config, name))
|
|
122
136
|
|
|
123
137
|
|
|
124
138
|
def _calculate_translation_progress(document: nodes.document) -> str:
|
|
@@ -263,15 +277,15 @@ class ExtraTranslatableNodes(SphinxTransform):
|
|
|
263
277
|
default_priority = 10
|
|
264
278
|
|
|
265
279
|
def apply(self, **kwargs: Any) -> None:
|
|
266
|
-
targets = self.config.gettext_additional_targets
|
|
267
|
-
target_nodes =
|
|
280
|
+
targets = frozenset(self.config.gettext_additional_targets)
|
|
281
|
+
target_nodes = tuple(v for k, v in TRANSLATABLE_NODES.items() if k in targets)
|
|
268
282
|
if not target_nodes:
|
|
269
283
|
return
|
|
270
284
|
|
|
271
|
-
def is_translatable_node(node: Node) ->
|
|
272
|
-
return isinstance(node,
|
|
285
|
+
def is_translatable_node(node: Node) -> TypeIs[nodes.Element]:
|
|
286
|
+
return isinstance(node, target_nodes)
|
|
273
287
|
|
|
274
|
-
for node in self.document.findall(is_translatable_node):
|
|
288
|
+
for node in self.document.findall(is_translatable_node):
|
|
275
289
|
node['translatable'] = True
|
|
276
290
|
|
|
277
291
|
|
sphinx/transforms/i18n.py
CHANGED
|
@@ -64,7 +64,7 @@ def publish_msgstr(app: Sphinx, source: str, source_path: str, source_line: int,
|
|
|
64
64
|
try:
|
|
65
65
|
# clear rst_prolog temporarily
|
|
66
66
|
rst_prolog = config.rst_prolog
|
|
67
|
-
config.rst_prolog = None
|
|
67
|
+
config.rst_prolog = None
|
|
68
68
|
|
|
69
69
|
from sphinx.io import SphinxI18nReader
|
|
70
70
|
reader = SphinxI18nReader()
|
|
@@ -81,7 +81,7 @@ def publish_msgstr(app: Sphinx, source: str, source_path: str, source_line: int,
|
|
|
81
81
|
return doc[0]
|
|
82
82
|
return doc
|
|
83
83
|
finally:
|
|
84
|
-
config.rst_prolog = rst_prolog
|
|
84
|
+
config.rst_prolog = rst_prolog
|
|
85
85
|
|
|
86
86
|
|
|
87
87
|
def parse_noqa(source: str) -> tuple[str, bool]:
|
|
@@ -364,9 +364,9 @@ class Locale(SphinxTransform):
|
|
|
364
364
|
for node, msg in extract_messages(self.document):
|
|
365
365
|
msgstr = merged.get(msg, '')
|
|
366
366
|
|
|
367
|
-
# There is no point in having
|
|
367
|
+
# There is no point in having noqa on literal blocks because
|
|
368
368
|
# they cannot contain references. Recognizing it would just
|
|
369
|
-
# completely prevent escaping the
|
|
369
|
+
# completely prevent escaping the noqa. Outside of literal
|
|
370
370
|
# blocks, one can always write \#noqa.
|
|
371
371
|
if not isinstance(node, LITERAL_TYPE_NODES):
|
|
372
372
|
msgstr, _ = parse_noqa(msgstr)
|
|
@@ -406,12 +406,13 @@ class Locale(SphinxTransform):
|
|
|
406
406
|
# glossary terms update refid
|
|
407
407
|
if isinstance(node, nodes.term):
|
|
408
408
|
for _id in node['ids']:
|
|
409
|
-
|
|
409
|
+
term, first_classifier = split_term_classifiers(msgstr)
|
|
410
410
|
patch = publish_msgstr(
|
|
411
|
-
self.app,
|
|
411
|
+
self.app, term or '', source, node.line, self.config, settings, # type: ignore[arg-type]
|
|
412
412
|
)
|
|
413
413
|
updater.patch = make_glossary_term(
|
|
414
|
-
self.env, patch,
|
|
414
|
+
self.env, patch, first_classifier,
|
|
415
|
+
source, node.line, _id, self.document, # type: ignore[arg-type]
|
|
415
416
|
)
|
|
416
417
|
processed = True
|
|
417
418
|
|
|
@@ -98,7 +98,7 @@ class ReferencesResolver(SphinxPostTransform):
|
|
|
98
98
|
node, contnode,
|
|
99
99
|
allowed_exceptions=(NoUri,))
|
|
100
100
|
# still not found? warn if node wishes to be warned about or
|
|
101
|
-
# we are in
|
|
101
|
+
# we are in nitpicky mode
|
|
102
102
|
if newnode is None:
|
|
103
103
|
self.warn_missing_reference(refdoc, typ, target, node, domain)
|
|
104
104
|
except NoUri:
|
|
@@ -80,8 +80,8 @@ class ImageDownloader(BaseImageConverter):
|
|
|
80
80
|
_tls_info=(config.tls_verify, config.tls_cacerts),
|
|
81
81
|
)
|
|
82
82
|
if r.status_code >= 400:
|
|
83
|
-
logger.warning(__('Could not fetch remote image: %s [%d]')
|
|
84
|
-
|
|
83
|
+
logger.warning(__('Could not fetch remote image: %s [%d]'),
|
|
84
|
+
node['uri'], r.status_code)
|
|
85
85
|
else:
|
|
86
86
|
self.app.env.original_image_uri[path] = node['uri']
|
|
87
87
|
|
|
@@ -108,17 +108,15 @@ class ImageDownloader(BaseImageConverter):
|
|
|
108
108
|
node['uri'] = path
|
|
109
109
|
self.app.env.images.add_file(self.env.docname, path)
|
|
110
110
|
except Exception as exc:
|
|
111
|
-
logger.warning(__('Could not fetch remote image: %s [%s]')
|
|
111
|
+
logger.warning(__('Could not fetch remote image: %s [%s]'), node['uri'], exc)
|
|
112
112
|
|
|
113
113
|
|
|
114
114
|
class DataURIExtractor(BaseImageConverter):
|
|
115
115
|
default_priority = 150
|
|
116
116
|
|
|
117
117
|
def match(self, node: nodes.image) -> bool:
|
|
118
|
-
if not self.app.builder.supported_remote_images:
|
|
119
|
-
return False
|
|
120
118
|
if self.app.builder.supported_data_uri_images is True:
|
|
121
|
-
return False
|
|
119
|
+
return False # do not transform the image; data URIs are valid in the build output
|
|
122
120
|
return node['uri'].startswith('data:')
|
|
123
121
|
|
|
124
122
|
def handle(self, node: nodes.image) -> None:
|
|
@@ -192,9 +190,6 @@ class ImageConverter(BaseImageConverter):
|
|
|
192
190
|
#: ]
|
|
193
191
|
conversion_rules: list[tuple[str, str]] = []
|
|
194
192
|
|
|
195
|
-
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
196
|
-
super().__init__(*args, **kwargs)
|
|
197
|
-
|
|
198
193
|
def match(self, node: nodes.image) -> bool:
|
|
199
194
|
if not self.app.builder.supported_image_types:
|
|
200
195
|
return False
|
|
@@ -232,10 +227,12 @@ class ImageConverter(BaseImageConverter):
|
|
|
232
227
|
raise NotImplementedError
|
|
233
228
|
|
|
234
229
|
def guess_mimetypes(self, node: nodes.image) -> list[str]:
|
|
230
|
+
# The special key ? is set for nonlocal URIs.
|
|
235
231
|
if '?' in node['candidates']:
|
|
236
232
|
return []
|
|
237
233
|
elif '*' in node['candidates']:
|
|
238
|
-
|
|
234
|
+
path = os.path.join(self.app.srcdir, node['uri'])
|
|
235
|
+
guessed = guess_mimetype(path)
|
|
239
236
|
return [guessed] if guessed is not None else []
|
|
240
237
|
else:
|
|
241
238
|
return node['candidates'].keys()
|
sphinx/util/_pathlib.py
CHANGED
|
@@ -28,7 +28,7 @@ if sys.platform == 'win32':
|
|
|
28
28
|
# replace exists in both Path and str;
|
|
29
29
|
# in Path it makes filesystem changes, so we use the safer str version
|
|
30
30
|
warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2)
|
|
31
|
-
return self.__str__().replace(old, new, count)
|
|
31
|
+
return self.__str__().replace(old, new, count) # NoQA: PLC2801
|
|
32
32
|
|
|
33
33
|
def __getattr__(self, item: str) -> Any:
|
|
34
34
|
if item in _STR_METHODS:
|
|
@@ -77,7 +77,7 @@ else:
|
|
|
77
77
|
# replace exists in both Path and str;
|
|
78
78
|
# in Path it makes filesystem changes, so we use the safer str version
|
|
79
79
|
warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2)
|
|
80
|
-
return self.__str__().replace(old, new, count)
|
|
80
|
+
return self.__str__().replace(old, new, count) # NoQA: PLC2801
|
|
81
81
|
|
|
82
82
|
def __getattr__(self, item: str) -> Any:
|
|
83
83
|
if item in _STR_METHODS:
|
sphinx/util/cfamily.py
CHANGED
|
@@ -90,17 +90,11 @@ class NoOldIdError(Exception):
|
|
|
90
90
|
class ASTBaseBase:
|
|
91
91
|
def __eq__(self, other: object) -> bool:
|
|
92
92
|
if type(self) is not type(other):
|
|
93
|
-
return
|
|
93
|
+
return NotImplemented
|
|
94
94
|
try:
|
|
95
|
-
|
|
96
|
-
if value != getattr(other, key):
|
|
97
|
-
return False
|
|
95
|
+
return self.__dict__ == other.__dict__
|
|
98
96
|
except AttributeError:
|
|
99
97
|
return False
|
|
100
|
-
return True
|
|
101
|
-
|
|
102
|
-
# Defining __hash__ = None is not strictly needed when __eq__ is defined.
|
|
103
|
-
__hash__ = None # type: ignore[assignment]
|
|
104
98
|
|
|
105
99
|
def clone(self) -> Any:
|
|
106
100
|
return deepcopy(self)
|
|
@@ -115,7 +109,7 @@ class ASTBaseBase:
|
|
|
115
109
|
return self._stringify(lambda ast: ast.get_display_string())
|
|
116
110
|
|
|
117
111
|
def __repr__(self) -> str:
|
|
118
|
-
return '
|
|
112
|
+
return f'<{self.__class__.__name__}: {self._stringify(repr)}>'
|
|
119
113
|
|
|
120
114
|
|
|
121
115
|
################################################################################
|
|
@@ -131,8 +125,16 @@ class ASTCPPAttribute(ASTAttribute):
|
|
|
131
125
|
def __init__(self, arg: str) -> None:
|
|
132
126
|
self.arg = arg
|
|
133
127
|
|
|
128
|
+
def __eq__(self, other: object) -> bool:
|
|
129
|
+
if not isinstance(other, ASTCPPAttribute):
|
|
130
|
+
return NotImplemented
|
|
131
|
+
return self.arg == other.arg
|
|
132
|
+
|
|
133
|
+
def __hash__(self) -> int:
|
|
134
|
+
return hash(self.arg)
|
|
135
|
+
|
|
134
136
|
def _stringify(self, transform: StringifyTransform) -> str:
|
|
135
|
-
return "[[
|
|
137
|
+
return f"[[{self.arg}]]"
|
|
136
138
|
|
|
137
139
|
def describe_signature(self, signode: TextElement) -> None:
|
|
138
140
|
signode.append(addnodes.desc_sig_punctuation('[[', '[['))
|
|
@@ -146,35 +148,37 @@ class ASTGnuAttribute(ASTBaseBase):
|
|
|
146
148
|
self.args = args
|
|
147
149
|
|
|
148
150
|
def __eq__(self, other: object) -> bool:
|
|
149
|
-
if
|
|
151
|
+
if not isinstance(other, ASTGnuAttribute):
|
|
150
152
|
return NotImplemented
|
|
151
153
|
return self.name == other.name and self.args == other.args
|
|
152
154
|
|
|
155
|
+
def __hash__(self) -> int:
|
|
156
|
+
return hash((self.name, self.args))
|
|
157
|
+
|
|
153
158
|
def _stringify(self, transform: StringifyTransform) -> str:
|
|
154
|
-
res = [self.name]
|
|
155
159
|
if self.args:
|
|
156
|
-
|
|
157
|
-
return
|
|
160
|
+
return self.name + transform(self.args)
|
|
161
|
+
return self.name
|
|
158
162
|
|
|
159
163
|
|
|
160
164
|
class ASTGnuAttributeList(ASTAttribute):
|
|
161
165
|
def __init__(self, attrs: list[ASTGnuAttribute]) -> None:
|
|
162
166
|
self.attrs = attrs
|
|
163
167
|
|
|
168
|
+
def __eq__(self, other: object) -> bool:
|
|
169
|
+
if not isinstance(other, ASTGnuAttributeList):
|
|
170
|
+
return NotImplemented
|
|
171
|
+
return self.attrs == other.attrs
|
|
172
|
+
|
|
173
|
+
def __hash__(self) -> int:
|
|
174
|
+
return hash(self.attrs)
|
|
175
|
+
|
|
164
176
|
def _stringify(self, transform: StringifyTransform) -> str:
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
for attr in self.attrs:
|
|
168
|
-
if not first:
|
|
169
|
-
res.append(', ')
|
|
170
|
-
first = False
|
|
171
|
-
res.append(transform(attr))
|
|
172
|
-
res.append('))')
|
|
173
|
-
return ''.join(res)
|
|
177
|
+
attrs = ', '.join(map(transform, self.attrs))
|
|
178
|
+
return f'__attribute__(({attrs}))'
|
|
174
179
|
|
|
175
180
|
def describe_signature(self, signode: TextElement) -> None:
|
|
176
|
-
|
|
177
|
-
signode.append(nodes.Text(txt))
|
|
181
|
+
signode.append(nodes.Text(str(self)))
|
|
178
182
|
|
|
179
183
|
|
|
180
184
|
class ASTIdAttribute(ASTAttribute):
|
|
@@ -183,6 +187,14 @@ class ASTIdAttribute(ASTAttribute):
|
|
|
183
187
|
def __init__(self, id: str) -> None:
|
|
184
188
|
self.id = id
|
|
185
189
|
|
|
190
|
+
def __eq__(self, other: object) -> bool:
|
|
191
|
+
if not isinstance(other, ASTIdAttribute):
|
|
192
|
+
return NotImplemented
|
|
193
|
+
return self.id == other.id
|
|
194
|
+
|
|
195
|
+
def __hash__(self) -> int:
|
|
196
|
+
return hash(self.id)
|
|
197
|
+
|
|
186
198
|
def _stringify(self, transform: StringifyTransform) -> str:
|
|
187
199
|
return self.id
|
|
188
200
|
|
|
@@ -197,12 +209,19 @@ class ASTParenAttribute(ASTAttribute):
|
|
|
197
209
|
self.id = id
|
|
198
210
|
self.arg = arg
|
|
199
211
|
|
|
212
|
+
def __eq__(self, other: object) -> bool:
|
|
213
|
+
if not isinstance(other, ASTParenAttribute):
|
|
214
|
+
return NotImplemented
|
|
215
|
+
return self.id == other.id and self.arg == other.arg
|
|
216
|
+
|
|
217
|
+
def __hash__(self) -> int:
|
|
218
|
+
return hash((self.id, self.arg))
|
|
219
|
+
|
|
200
220
|
def _stringify(self, transform: StringifyTransform) -> str:
|
|
201
|
-
return self.id
|
|
221
|
+
return f'{self.id}({self.arg})'
|
|
202
222
|
|
|
203
223
|
def describe_signature(self, signode: TextElement) -> None:
|
|
204
|
-
|
|
205
|
-
signode.append(nodes.Text(txt))
|
|
224
|
+
signode.append(nodes.Text(str(self)))
|
|
206
225
|
|
|
207
226
|
|
|
208
227
|
class ASTAttributeList(ASTBaseBase):
|
|
@@ -210,10 +229,13 @@ class ASTAttributeList(ASTBaseBase):
|
|
|
210
229
|
self.attrs = attrs
|
|
211
230
|
|
|
212
231
|
def __eq__(self, other: object) -> bool:
|
|
213
|
-
if
|
|
232
|
+
if not isinstance(other, ASTAttributeList):
|
|
214
233
|
return NotImplemented
|
|
215
234
|
return self.attrs == other.attrs
|
|
216
235
|
|
|
236
|
+
def __hash__(self) -> int:
|
|
237
|
+
return hash(self.attrs)
|
|
238
|
+
|
|
217
239
|
def __len__(self) -> int:
|
|
218
240
|
return len(self.attrs)
|
|
219
241
|
|
|
@@ -221,7 +243,7 @@ class ASTAttributeList(ASTBaseBase):
|
|
|
221
243
|
return ASTAttributeList(self.attrs + other.attrs)
|
|
222
244
|
|
|
223
245
|
def _stringify(self, transform: StringifyTransform) -> str:
|
|
224
|
-
return ' '.join(transform
|
|
246
|
+
return ' '.join(map(transform, self.attrs))
|
|
225
247
|
|
|
226
248
|
def describe_signature(self, signode: TextElement) -> None:
|
|
227
249
|
if len(self.attrs) == 0:
|
sphinx/util/console.py
CHANGED
sphinx/util/display.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import functools
|
|
4
|
-
from typing import Any, Callable, TypeVar
|
|
5
4
|
|
|
6
5
|
from sphinx.locale import __
|
|
7
6
|
from sphinx.util import logging
|
|
@@ -10,6 +9,13 @@ from sphinx.util.console import bold, color_terminal
|
|
|
10
9
|
if False:
|
|
11
10
|
from collections.abc import Iterable, Iterator
|
|
12
11
|
from types import TracebackType
|
|
12
|
+
from typing import Any, Callable, TypeVar
|
|
13
|
+
|
|
14
|
+
from typing_extensions import ParamSpec
|
|
15
|
+
|
|
16
|
+
T = TypeVar('T')
|
|
17
|
+
P = ParamSpec('P')
|
|
18
|
+
R = TypeVar('R')
|
|
13
19
|
|
|
14
20
|
logger = logging.getLogger(__name__)
|
|
15
21
|
|
|
@@ -22,9 +28,6 @@ def display_chunk(chunk: Any) -> str:
|
|
|
22
28
|
return str(chunk)
|
|
23
29
|
|
|
24
30
|
|
|
25
|
-
T = TypeVar('T')
|
|
26
|
-
|
|
27
|
-
|
|
28
31
|
def status_iterator(
|
|
29
32
|
iterable: Iterable[T],
|
|
30
33
|
summary: str,
|
|
@@ -62,11 +65,12 @@ class SkipProgressMessage(Exception):
|
|
|
62
65
|
|
|
63
66
|
|
|
64
67
|
class progress_message:
|
|
65
|
-
def __init__(self, message: str) -> None:
|
|
68
|
+
def __init__(self, message: str, *, nonl: bool = True) -> None:
|
|
66
69
|
self.message = message
|
|
70
|
+
self.nonl = nonl
|
|
67
71
|
|
|
68
72
|
def __enter__(self) -> None:
|
|
69
|
-
logger.info(bold(self.message + '... '), nonl=
|
|
73
|
+
logger.info(bold(self.message + '... '), nonl=self.nonl)
|
|
70
74
|
|
|
71
75
|
def __exit__(
|
|
72
76
|
self,
|
|
@@ -74,21 +78,22 @@ class progress_message:
|
|
|
74
78
|
val: BaseException | None,
|
|
75
79
|
tb: TracebackType | None,
|
|
76
80
|
) -> bool:
|
|
81
|
+
prefix = "" if self.nonl else bold(self.message + ': ')
|
|
77
82
|
if isinstance(val, SkipProgressMessage):
|
|
78
|
-
logger.info(__('skipped'))
|
|
83
|
+
logger.info(prefix + __('skipped'))
|
|
79
84
|
if val.args:
|
|
80
85
|
logger.info(*val.args)
|
|
81
86
|
return True
|
|
82
87
|
elif val:
|
|
83
|
-
logger.info(__('failed'))
|
|
88
|
+
logger.info(prefix + __('failed'))
|
|
84
89
|
else:
|
|
85
|
-
logger.info(__('done'))
|
|
90
|
+
logger.info(prefix + __('done'))
|
|
86
91
|
|
|
87
92
|
return False
|
|
88
93
|
|
|
89
|
-
def __call__(self, f: Callable) -> Callable:
|
|
94
|
+
def __call__(self, f: Callable[P, R]) -> Callable[P, R]:
|
|
90
95
|
@functools.wraps(f)
|
|
91
|
-
def wrapper(*args:
|
|
96
|
+
def wrapper(*args: P.args, **kwargs: P.kwargs) -> R: # type: ignore[return]
|
|
92
97
|
with self:
|
|
93
98
|
return f(*args, **kwargs)
|
|
94
99
|
|