Skip to content

Commit 2d2088c

Browse files
committed
Merge branch 'refs/heads/master' into pr-11916-followup/rename-template-files
# Conflicts: # sphinx/ext/apidoc.py
2 parents f2be104 + 778013f commit 2d2088c

File tree

140 files changed

+3813
-1630
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+3813
-1630
lines changed

.github/workflows/nodejs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ on:
55
paths:
66
- ".github/workflows/nodejs.yml"
77
- "sphinx/themes/**.js"
8-
- "tests/js"
8+
- "tests/js/**"
99
- "karma.conf.js"
1010
- "package.json"
1111
- "package-lock.json"
1212
pull_request:
1313
paths:
1414
- ".github/workflows/nodejs.yml"
1515
- "sphinx/themes/**.js"
16-
- "tests/js"
16+
- "tests/js/**"
1717
- "karma.conf.js"
1818
- "package.json"
1919
- "package-lock.json"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ doc/_build/
3131
doc/locale/
3232
tests/.coverage
3333
tests/build/
34+
tests/js/roots/*/_build
3435
tests/test-server.lock
3536
utils/regression_test.js
3637

.ruff.toml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ output-format = "full"
44

55
extend-exclude = [
66
"tests/roots/*",
7+
"tests/js/roots/*",
78
"build/*",
89
"doc/_build/*",
910
"sphinx/search/*",
@@ -221,7 +222,6 @@ select = [
221222
# "PLR0912", # Too many branches ({branches} > {max_branches})
222223
# "PLR0913", # Too many arguments to function call ({c_args} > {max_args})
223224
# "PLR0915", # Too many statements ({statements} > {max_statements})
224-
"PLR1701", # Merge `isinstance` calls: `{expr}`
225225
"PLR1711", # Useless `return` statement at end of function
226226
# "PLR1714", # Consider merging multiple comparisons: `{expr}`. Use a `set` if the elements are hashable.
227227
"PLR1722", # Use `sys.exit()` instead of `{name}`
@@ -372,6 +372,7 @@ select = [
372372
[lint.per-file-ignores]
373373
"doc/*" = [
374374
"ANN", # documentation doesn't need annotations
375+
"TCH001", # documentation doesn't need type-checking blocks
375376
]
376377
"doc/conf.py" = ["INP001", "W605"]
377378
"doc/development/tutorials/examples/*" = ["INP001"]
@@ -447,7 +448,32 @@ exclude = [
447448
"sphinx/directives/*",
448449
"sphinx/domains/*",
449450
"sphinx/environment/*",
450-
"sphinx/ext/*",
451+
"sphinx/ext/autodoc/__init__.py",
452+
"sphinx/ext/autodoc/directive.py",
453+
"sphinx/ext/autodoc/importer.py",
454+
"sphinx/ext/autodoc/mock.py",
455+
"sphinx/ext/autodoc/preserve_defaults.py",
456+
"sphinx/ext/autodoc/type_comment.py",
457+
"sphinx/ext/autodoc/typehints.py",
458+
"sphinx/ext/autosectionlabel.py",
459+
"sphinx/ext/autosummary/__init__.py",
460+
"sphinx/ext/coverage.py",
461+
"sphinx/ext/doctest.py",
462+
"sphinx/ext/duration.py",
463+
"sphinx/ext/extlinks.py",
464+
"sphinx/ext/githubpages.py",
465+
"sphinx/ext/graphviz.py",
466+
"sphinx/ext/ifconfig.py",
467+
"sphinx/ext/imgconverter.py",
468+
"sphinx/ext/imgmath.py",
469+
"sphinx/ext/inheritance_diagram.py",
470+
"sphinx/ext/intersphinx/*",
471+
"sphinx/ext/linkcode.py",
472+
"sphinx/ext/mathjax.py",
473+
"sphinx/ext/napoleon/__init__.py",
474+
"sphinx/ext/napoleon/docstring.py",
475+
"sphinx/ext/todo.py",
476+
"sphinx/ext/viewcode.py",
451477
"sphinx/pycode/*",
452478
"sphinx/pygments_styles.py",
453479
"sphinx/registry.py",

CHANGES.rst

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ Deprecated
1313
Features added
1414
--------------
1515

16+
* #12456: Add :option:`sphinx-autogen --remove-old` option.
17+
Patch by Chris Sewell.
18+
* #12448: Add :option:`sphinx-apidoc --remove-old` option.
19+
Patch by Chris Sewell.
20+
* #12358: Add :attr:`.Sphinx.fresh_env_used`.
21+
Patch by Chris Sewell.
22+
* #12361: Add :attr:`.BuildEnvironment.parser`.
23+
Patch by Chris Sewell.
1624
* #11165: Support the `officially recommended`_ ``.jinja`` suffix for template
1725
files.
1826
Patch by James Addison and Adam Turner
@@ -21,6 +29,23 @@ Features added
2129
* Flatten ``Union[Literal[T], Literal[U], ...]`` to ``Literal[T, U, ...]``
2230
when turning annotations into strings.
2331
Patch by Adam Turner.
32+
* #12329: Add detection of ambiguous ``std:label`` and ``std:term`` references during
33+
loading and resolution of Intersphinx targets.
34+
Patch by James Addison.
35+
* #12319: ``sphinx.ext.extlinks``: Add ``extlink-{name}`` CSS class to links.
36+
Patch by Hugo van Kemenade.
37+
* #12492: Add helper methods for parsing reStructuredText content into nodes from
38+
within a directive.
39+
40+
- :py:meth:`~sphinx.util.docutils.SphinxDirective.parse_content_to_nodes()`
41+
parses the directive's content and returns a list of Docutils nodes.
42+
- :py:meth:`~sphinx.util.docutils.SphinxDirective.parse_text_to_nodes()`
43+
parses the provided text and returns a list of Docutils nodes.
44+
- :py:meth:`~sphinx.util.docutils.SphinxDirective.parse_inline()`
45+
parses the provided text into inline elements and text nodes.
46+
47+
Patch by Adam Turner.
48+
2449

2550
Bugs fixed
2651
----------
@@ -36,10 +61,38 @@ Bugs fixed
3661
Patch by Matthias Geier.
3762
* #12224: Properly detect WebP files.
3863
Patch by Benjamin Cabé.
64+
* #12380: LaTeX: Footnote mark sometimes indicates ``Page N`` where ``N`` is
65+
the current page number and the footnote does appear on that same page.
66+
Patch by Jean-François B.
67+
* #12416: :confval:`root_doc` is synchronized with :confval:`master_doc`
68+
so that if either of the two values is modified, the other reflects that
69+
modification. It is still recommended to use :confval:`root_doc`.
70+
Patch by Bénédikt Tran.
71+
* #12220: Fix loading custom template translations for ``en`` locale.
72+
Patch by Nicolas Peugnet.
73+
* #12459: Add valid-type arguments to the ``linkcheck_rate_limit_timeout``
74+
configuration setting.
75+
Patch by James Addison.
76+
* #12331: Resolve data-URI-image-extraction regression from v7.3.0 affecting
77+
builders without native support for data-URIs in their output format.
78+
Patch by James Addison.
79+
80+
Improvements
81+
------------
82+
83+
* #12387: Improve CLI progress message, when copying assets.
84+
Patch by Bénédikt Tran.
85+
* #12422: Do not duplicate "navigation" in aria-label of built-in themes.
86+
Patch by Thomas Weißschuh
87+
* #12421: Include project name in ``logo_alt`` of built-in themes.
88+
Patch by Thomas Weißschuh
3989

4090
Testing
4191
-------
4292

93+
* karma: refactor HTML search tests to use fixtures generated by Sphinx.
94+
Patch by James Addison.
95+
4396
Release 7.3.7 (released Apr 19, 2024)
4497
=====================================
4598

EXAMPLES.rst

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Documentation using the classic theme
6464
* `DEAP <https://deap.readthedocs.io/>`__ (customized)
6565
* `Director <https://pythonhosted.org/director/>`__
6666
* `EZ-Draw <https://pageperso.lis-lab.fr/~edouard.thiel/ez-draw/doc/en/html/ez-manual.html>`__ (customized)
67-
* `Generic Mapping Tools (GMT) <https://gmt.soest.hawaii.edu/doc/latest/>`__ (customized)
67+
* `Generic Mapping Tools (GMT) <https://docs.generic-mapping-tools.org/latest/>`__ (customized)
6868
* `Genomedata <https://noble.gs.washington.edu/proj/genomedata/doc/1.3.3/>`__
6969
* `GetFEM <https://getfem.org/>`__ (customized)
7070
* `Glasgow Haskell Compiler <https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/>`__ (customized)
@@ -73,7 +73,7 @@ Documentation using the classic theme
7373
* `GSL Shell <https://www.nongnu.org/gsl-shell/>`__
7474
* `Hands-on Python Tutorial <http://anh.cs.luc.edu:80/python/hands-on/3.1/handsonHtml/>`__
7575
* `Kaa <https://freevo.github.io/kaa-base/>`__ (customized)
76-
* `Leo <https://leoeditor.com/>`__ (customized)
76+
* `Leo <https://leo-editor.github.io/leo-editor/>`__ (customized)
7777
* `Mayavi <https://docs.enthought.com/mayavi/mayavi/>`__ (customized)
7878
* `MediaGoblin <https://mediagoblin.readthedocs.io/>`__ (customized)
7979
* `mpmath <https://mpmath.org/doc/current/>`__
@@ -91,10 +91,10 @@ Documentation using the classic theme
9191
* `Python 2 <https://docs.python.org/2/>`__
9292
* `Python 3 <https://docs.python.org/3/>`__ (customized)
9393
* `Python Packaging Authority <https://www.pypa.io/>`__ (customized)
94-
* `Ring programming language <https://ring-lang.sourceforge.net/doc/>`__ (customized)
94+
* `Ring programming language <https://ring-lang.github.io/doc1.20/>`__ (customized)
9595
* `SageMath <https://doc.sagemath.org/>`__ (customized)
9696
* `Segway <https://noble.gs.washington.edu/proj/segway/doc/1.1.0/segway.html>`__
97-
* `simuPOP <https://simupop.sourceforge.net/manual_release/build/userGuide.html>`__ (customized)
97+
* `simuPOP <https://bopeng.github.io/simuPOP/>`__ (customized)
9898
* `SymPy <https://docs.sympy.org/>`__
9999
* `TurboGears <https://turbogears.readthedocs.io/>`__ (customized)
100100
* `tvtk <https://docs.enthought.com/mayavi/tvtk/>`__
@@ -120,7 +120,6 @@ Documentation using the sphinxdoc theme
120120
* `Python Wild Magic <https://vmlaker.github.io/pythonwildmagic/>`__ (customized)
121121
* `RDKit <https://www.rdkit.org/docs/>`__
122122
* `Reteisi <https://www.reteisi.org/contents.html>`__ (customized)
123-
* `Sqlkit <https://sqlkit.argolinux.org/>`__ (customized)
124123
* `Turbulenz <http://docs.turbulenz.com/>`__
125124

126125
Documentation using the nature theme
@@ -183,7 +182,7 @@ Documentation using sphinx_rtd_theme
183182
* `DNF <https://dnf.readthedocs.io/>`__
184183
* `Distro Tracker <https://qa.pages.debian.net/distro-tracker/>`__
185184
* `Django-cas-ng <https://djangocas.dev/docs/>`__
186-
* `dj-stripe <https://dj-stripe.readthedocs.io/>`__
185+
* `dj-stripe <https://dj-stripe.github.io/dj-stripe/>`__
187186
* `edX <https://docs.edx.org/>`__
188187
* `Electrum <https://docs.electrum.org/>`__
189188
* `ESWP3 <https://eswp3.readthedocs.io/>`__
@@ -262,7 +261,7 @@ Documentation using sphinx_rtd_theme
262261
* `Releases Sphinx extension <https://releases.readthedocs.io/>`__
263262
* `Qtile <https://docs.qtile.org/>`__
264263
* `Quex <https://quex.sourceforge.net/doc/html/main.html>`__
265-
* `QuTiP <https://qutip.org/docs/latest/>`__
264+
* `QuTiP <https://qutip.readthedocs.io/en/latest/>`__
266265
* `Sawtooth <https://sawtooth.splinter.dev/docs>`__
267266
* `Scapy <https://scapy.readthedocs.io/>`__
268267
* `SimGrid <https://simgrid.org/doc/latest/>`__
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// UML for the standard Sphinx build workflow
2+
3+
digraph build {
4+
graph [
5+
rankdir=LR
6+
];
7+
node [
8+
shape=rect
9+
style=rounded
10+
];
11+
12+
"Sphinx" [
13+
shape=record
14+
label = "Sphinx | <init> __init__ | <build> build"
15+
];
16+
"Sphinx":init -> "Builder.init";
17+
"Sphinx":build -> "Builder.build_all";
18+
"Sphinx":build -> "Builder.build_specific";
19+
"Builder.build_update" [
20+
shape=record
21+
label = "<p1> Builder.build_update | Builder.get_outdated_docs"
22+
];
23+
"Sphinx":build -> "Builder.build_update":p1 ;
24+
25+
"Builder.build_all" -> "Builder.build";
26+
"Builder.build_specific" -> "Builder.build";
27+
"Builder.build_update":p1 -> "Builder.build";
28+
29+
"Builder.build" -> "Builder.read";
30+
"Builder.write" [
31+
shape=record
32+
label = "<p1> Builder.write | Builder._write_serial | Builder._write_parallel"
33+
];
34+
"Builder.build" -> "Builder.write";
35+
"Builder.build" -> "Builder.finish";
36+
37+
"Builder.read" -> "Builder.read_doc";
38+
"Builder.read_doc" -> "Builder.write_doctree";
39+
40+
"Builder.write":p1 -> "Builder.prepare_writing";
41+
"Builder.write":p1 -> "Builder.copy_assets";
42+
"Builder.write":p1 -> "Builder.write_doc";
43+
44+
"Builder.write_doc" -> "Builder.get_relative_uri";
45+
46+
"Builder.get_relative_uri" -> "Builder.get_target_uri";
47+
}
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
// A flow graph of the Sphinx build process, highlighting event callbacks
2+
3+
digraph events {
4+
graph [
5+
rankdir=TB
6+
];
7+
node [
8+
shape=rect
9+
style=rounded
10+
];
11+
"Sphinx" [
12+
shape=record
13+
label = "<init> Sphinx.__init__() | <build> Sphinx.build()"
14+
];
15+
16+
// During initialization
17+
"config-inited"[style=filled fillcolor="#D5FFFF" color=blue penwidth=2];
18+
"Sphinx":init -> "config-inited";
19+
"builder-inited"[style=filled fillcolor="#D5FFFF" color=blue penwidth=2];
20+
"Sphinx":init -> "builder-inited";
21+
22+
// During build
23+
"Builder" [label = "Builder.build()"]
24+
"Sphinx":build -> "Builder";
25+
"Builder.build" [
26+
shape=record
27+
label = "
28+
<before_read> before read |
29+
<read> read |
30+
<after_read> after read |
31+
<write> write |
32+
<finalize> finalize"
33+
];
34+
"Builder" -> "Builder.build";
35+
36+
"env-get-outdated"[style=filled fillcolor="#D5FFFF" color=blue penwidth=2];
37+
"Builder.build":before_read -> "env-get-outdated";
38+
remove_each_doc [shape="ellipse", label="for removed"];
39+
"Builder.build":before_read -> "remove_each_doc";
40+
"env-purge-doc"[style=filled fillcolor="#D5FFFF" color=blue penwidth=2];
41+
"remove_each_doc" -> "env-purge-doc";
42+
"env-before-read-docs"[style=filled fillcolor="#D5FFFF" color=blue penwidth=2];
43+
"Builder.build":before_read -> "env-before-read-docs";
44+
45+
// during read phase
46+
"Builder.read" [label = "Builder.read()"]
47+
"Builder.build":read -> "Builder.read";
48+
read_each_doc [shape="ellipse", label="for added | changed"];
49+
"Builder.read" -> "read_each_doc";
50+
merge_each_process [
51+
shape="ellipse", label="for each process\n(parallel only)"
52+
];
53+
"Builder.read" -> merge_each_process;
54+
"env-updated"[style=filled fillcolor="#D5FFFF" color=blue penwidth=2];
55+
"Builder.read" -> "env-updated"
56+
57+
// during read phase, for each document/process
58+
"env-purge-doc"[style=filled fillcolor="#D5FFFF" color=blue penwidth=2];
59+
"read_each_doc" -> "env-purge-doc";
60+
"source-read"[style=filled fillcolor="#D5FFFF" color=blue penwidth=2];
61+
"read_each_doc" -> "source-read";
62+
"Include" [label="Include\ndirective"]
63+
"read_each_doc" -> "Include";
64+
"include-read"[style=filled fillcolor="#D5FFFF" color=blue penwidth=2];
65+
"Include" -> "include-read";
66+
"ObjectDescription" [label="ObjectDescription\ndirective"]
67+
"read_each_doc" -> "ObjectDescription";
68+
"object-description-transform"[style=filled fillcolor="#D5FFFF" color=blue penwidth=2];
69+
"ObjectDescription" -> "object-description-transform";
70+
"doctree-read"[style=filled fillcolor="#D5FFFF" color=blue penwidth=2];
71+
"read_each_doc" -> "doctree-read";
72+
"env-merge-info"[style=filled fillcolor="#D5FFFF" color=blue penwidth=2];
73+
"merge_each_process" -> "env-merge-info";
74+
75+
// after read phase
76+
"env-get-updated"[style=filled fillcolor="#D5FFFF" color=blue penwidth=2];
77+
"Builder.build":after_read -> "env-get-updated";
78+
if_read_changes [shape="diamond", label="if changed\ndocuments"];
79+
"Builder.build":after_read -> if_read_changes;
80+
if_read_changes -> "cache the\nBuild.Environment";
81+
"env-check-consistency"[style=filled fillcolor="#D5FFFF" color=blue penwidth=2];
82+
if_read_changes -> "env-check-consistency";
83+
84+
// during write phase
85+
"Builder.write" [label = "Builder.write()"]
86+
"Builder.build":write -> "Builder.write";
87+
write_each_doc [shape="ellipse", label="for updated"];
88+
"Builder.write" -> write_each_doc;
89+
"ReferenceResolver" [
90+
label="ReferenceResolver\nPost-transform"
91+
]
92+
write_each_doc -> "ReferenceResolver";
93+
"missing-reference"[style=filled fillcolor="#D5FFFF" color=blue penwidth=2];
94+
ReferenceResolver -> "missing-reference";
95+
"warn-missing-reference"[style=filled fillcolor="#D5FFFF" color=blue penwidth=2];
96+
ReferenceResolver -> "warn-missing-reference";
97+
"HyperlinkCollector" [
98+
label="HyperlinkCollector\nPost-transform"
99+
]
100+
write_each_doc -> "HyperlinkCollector";
101+
"linkcheck-process-uri"[style=filled fillcolor="#D5FFFF" color=blue penwidth=2];
102+
HyperlinkCollector -> "linkcheck-process-uri";
103+
"doctree-resolved"[style=filled fillcolor="#D5FFFF" color=blue penwidth=2];
104+
write_each_doc -> "doctree-resolved";
105+
"html-page-context"[style=filled fillcolor="#D5FFFF" color=blue penwidth=2];
106+
write_each_doc -> "html-page-context";
107+
108+
// html only
109+
"html-collect-pages"[style=filled fillcolor="#D5FFFF" color=blue penwidth=2];
110+
"Builder.build":finalize -> "html-collect-pages";
111+
112+
// finalize build
113+
"build-finished"[style=filled fillcolor="#D5FFFF" color=blue penwidth=2];
114+
"Builder.build":finalize -> "build-finished";
115+
116+
// constrain layout ordering
117+
{rank=same "config-inited" "builder-inited"};
118+
{rank=same; "env-get-outdated" "env-before-read-docs" "env-get-updated"};
119+
{rank=same; "env-purge-doc" "source-read" "doctree-read", "merge_each_process"};
120+
{rank=same; "env-updated" "env-check-consistency"};
121+
{rank=same; "env-merge-info" "Builder.write"};
122+
{rank=max; "build-finished"};
123+
}

doc/_static/jupyter-logo.png

126 KB
Loading

doc/_static/linux-logo.png

602 KB
Loading

doc/_static/more.png

-1.32 KB
Binary file not shown.

doc/_static/python-logo.png

183 KB
Loading

0 commit comments

Comments
 (0)