Skip to content

Commit e0b4789

Browse files
authored
Merge branch 'master' into latex_xelatex_math
2 parents 4890a11 + 0cbdd98 commit e0b4789

File tree

192 files changed

+21230
-12623
lines changed

Some content is hidden

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

192 files changed

+21230
-12623
lines changed

.github/workflows/main.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ env:
2323
FORCE_COLOR: "1"
2424
PYTHONDEVMODE: "1" # -X dev
2525
PYTHONWARNDEFAULTENCODING: "1" # -X warn_default_encoding
26+
UV_SYSTEM_PYTHON: "1" # make uv do global installs
2627

2728
jobs:
2829
ubuntu:
@@ -124,6 +125,38 @@ jobs:
124125
DO_EPUBCHECK: "1"
125126
EPUBCHECK_PATH: "/tmp/epubcheck/epubcheck-5.1.0/epubcheck.jar"
126127

128+
oldest-supported:
129+
runs-on: ubuntu-latest
130+
name: Oldest supported
131+
132+
steps:
133+
- uses: actions/checkout@v4
134+
- name: Set up Python
135+
uses: actions/setup-python@v5
136+
with:
137+
python-version: "3"
138+
- name: Check Python version
139+
run: python --version --version
140+
- name: Install graphviz
141+
run: sudo apt-get install graphviz
142+
- name: Install uv
143+
run: >
144+
curl
145+
--location
146+
--fail
147+
--proto '=https' --tlsv1.2
148+
--silent --show-error
149+
https://astral.sh/uv/install.sh
150+
| sh
151+
- name: Install dependencies
152+
run: |
153+
uv pip install .[test] --resolution lowest-direct
154+
uv pip install alabaster==1.0.0
155+
- name: Test with pytest
156+
run: python -m pytest -vv --durations 25
157+
env:
158+
PYTHONWARNINGS: "error" # treat all warnings as errors
159+
127160
latex:
128161
runs-on: ubuntu-latest
129162
name: LaTeX

.github/workflows/nodejs.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@ on:
66
- ".github/workflows/nodejs.yml"
77
- "sphinx/themes/**.js"
88
- "tests/js/**"
9-
- "karma.conf.js"
109
- "package.json"
1110
- "package-lock.json"
1211
pull_request:
1312
paths:
1413
- ".github/workflows/nodejs.yml"
1514
- "sphinx/themes/**.js"
1615
- "tests/js/**"
17-
- "karma.conf.js"
1816
- "package.json"
1917
- "package-lock.json"
2018

.ruff.toml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
target-version = "py310" # Pin Ruff to Python 3.10
2-
line-length = 95
2+
line-length = 88
33
output-format = "full"
44

55
extend-exclude = [
@@ -427,6 +427,9 @@ select = [
427427
"ANN", # utilities don't need annotations
428428
]
429429

430+
[lint.pycodestyle]
431+
max-line-length = 95
432+
430433
[lint.flake8-quotes]
431434
inline-quotes = "single"
432435

@@ -482,18 +485,4 @@ exclude = [
482485
"sphinx/transforms/*",
483486
"sphinx/util/*",
484487
"sphinx/writers/*",
485-
"tests/*",
486-
"tests/roots/*",
487-
"tests/test_builders/*",
488-
"tests/test_config/*",
489-
"tests/test_directives/*",
490-
"tests/test_domains/*",
491-
"tests/test_environment/*",
492-
"tests/test_extensions/*",
493-
"tests/test_intl/*",
494-
"tests/test_markup/*",
495-
"tests/test_pycode/*",
496-
"tests/test_transforms/*",
497-
"tests/test_util/*",
498-
"tests/test_writers/*",
499488
]

CHANGES.rst

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ Release 8.1.0 (in development)
44
Dependencies
55
------------
66

7+
* #12756: Add lower-bounds to the ``sphinxcontrib-*`` dependencies.
8+
Patch by Adam Turner.
9+
710
Incompatible changes
811
--------------------
912

@@ -20,29 +23,52 @@ Incompatible changes
2023
- For ``'pdflatex'`` as :confval:`latex_engine`, it is planned to replace at
2124
Sphinx 9 usage of ``amssymb`` by ``stix2`` in order for the math glyphs to
2225
much better match the default Times-like text font.
26+
* #12763: Remove unused internal class ``sphinx.util.Tee``.
27+
Patch by Adam Turner.
2328

2429
Deprecated
2530
----------
2631

32+
* #12762: Deprecate ``sphinx.util.import_object``.
33+
Use :py:func:`importlib.import_module` instead.
34+
Patch by Adam Turner.
35+
* #12766: Deprecate ``sphinx.util.FilenameUniqDict``
36+
and ``sphinx.util.DownloadFiles``.
37+
Patch by Adam Turner.
38+
2739
Features added
2840
--------------
2941

42+
* #11328: Mention evaluation of templated content during production of static
43+
output files.
44+
* #12474: Support type-dependent search result highlighting via CSS.
45+
Patch by Tim Hoffmann.
46+
3047
Bugs fixed
3148
----------
3249

3350
* #12514: intersphinx: fix the meaning of a negative value for
3451
:confval:`intersphinx_cache_limit`.
3552
Patch by Shengyu Zhang.
36-
3753
* #12730: The ``UnreferencedFootnotesDetector`` transform has been improved
3854
to more consistently detect unreferenced footnotes.
3955
Note, the priority of the transform has been changed from 200 to 622,
4056
so that it now runs after the docutils ``Footnotes`` resolution transform.
4157
Patch by Chris Sewell.
42-
58+
* #12587: Do not warn when potential ambiguity detected during Intersphinx
59+
resolution occurs due to duplicate targets that differ case-insensitively.
60+
Patch by James Addison.
61+
* #12639: Fix singular and plural search results text.
62+
Patch by Hugo van Kemenade.
63+
* #12645: Correctly support custom gettext output templates.
64+
Patch by Jeremy Bowman.
4365
* #12714: LaTeX: Let ``\mathbf{\Lambda}`` work as expected if
4466
:confval:`latex_engine` is ``'xelatex'`` or ``'lualatex'``, via usage
4567
of ``unicode-math`` with XITS Math font.
4668

4769
Testing
4870
-------
71+
72+
* #12141: Migrate from the deprecated ``karma`` JavaScript test framework to
73+
the actively-maintained ``jasmine`` framework. Test coverage is unaffected.
74+
Patch by James Addison.

doc/_themes/sphinx13/static/sphinx13.css

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,28 @@ div.sphinx-feature > p.admonition-title::before {
691691
justify-content: center;
692692
gap: 10px;
693693
}
694-
695694
.sphinx-users-logos .headerlink {
696695
display: none;
697696
}
697+
698+
/* -- search results -------------------------------------------------------- */
699+
700+
ul.search {
701+
padding-left: 30px;
702+
}
703+
ul.search li {
704+
padding: 5px 0 5px 10px;
705+
list-style-type: "\25A1"; /* Unicode: White Square */
706+
}
707+
ul.search li.context-index {
708+
list-style-type: "\1F4D1"; /* Unicode: Bookmark Tabs */
709+
}
710+
ul.search li.context-object {
711+
list-style-type: "\1F4E6"; /* Unicode: Package */
712+
}
713+
ul.search li.context-title {
714+
list-style-type: "\1F4C4"; /* Unicode: Page Facing Up */
715+
}
716+
ul.search li.context-text {
717+
list-style-type: "\1F4C4"; /* Unicode: Page Facing Up */
718+
}

doc/conf.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,14 @@
7777
epub_description = 'Sphinx documentation generator system manual'
7878

7979
latex_documents = [
80-
('index', 'sphinx.tex', 'Sphinx Documentation', 'the Sphinx developers', 'manual', 1)
80+
(
81+
'index',
82+
'sphinx.tex',
83+
'Sphinx Documentation',
84+
'the Sphinx developers',
85+
'manual',
86+
1,
87+
)
8188
]
8289
latex_logo = '_static/sphinx.png'
8390
latex_elements = {
@@ -324,7 +331,9 @@ def setup(app: Sphinx) -> None:
324331
app.connect('autodoc-process-docstring', cut_lines(4, what=['module']))
325332
app.connect('include-read', linkify_issues_in_changelog)
326333
app.connect('build-finished', build_redirects)
327-
fdesc = GroupedField('parameter', label='Parameters', names=['param'], can_collapse=True)
334+
fdesc = GroupedField(
335+
'parameter', label='Parameters', names=['param'], can_collapse=True
336+
)
328337
app.add_object_type(
329338
'event',
330339
'event',

doc/development/html_themes/index.rst

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,64 @@ If your theme package contains two or more themes, please call
221221
``sphinx.html_themes`` entry_points feature.
222222

223223

224+
Styling with CSS
225+
----------------
226+
227+
The :confval:`!stylesheets` setting can be used to add custom CSS files to a theme.
228+
229+
.. caution::
230+
231+
The structure of the HTML elements and their classes are currently not a
232+
well-defined public API. Please infer them from inspecting the built HTML
233+
pages. While we cannot guarantee full stability, they tend to be fairly
234+
stable.
235+
236+
Styling search result entries by category
237+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
238+
239+
.. versionadded:: 8.0
240+
241+
The search result items have classes indicating the context in which the
242+
search term was found. You can use the CSS selectors:
243+
244+
- ``ul.search li.context-index``:
245+
For results in an index, such as the glossary
246+
- ``ul.search li.context-object``:
247+
For results in source code, like Python function definitions
248+
- ``ul.search li.context-title``:
249+
For results found in section headings
250+
- ``ul.search li.context-text``:
251+
For results found anywhere else in the documentation text
252+
253+
As a base for inheritance by other themes, the ``basic`` theme is
254+
intentionally minimal and does not define CSS rules using these.
255+
Derived themes are encouraged to use these selectors as they see fit.
256+
For example, the following stylesheet adds contextual icons to the
257+
search result list:
258+
259+
.. code-block:: css
260+
261+
ul.search {
262+
padding-left: 30px;
263+
}
264+
ul.search li {
265+
padding: 5px 0 5px 10px;
266+
list-style-type: "\25A1"; /* Unicode: White Square */
267+
}
268+
ul.search li.context-index {
269+
list-style-type: "\1F4D1"; /* Unicode: Bookmark Tabs */
270+
}
271+
ul.search li.context-object {
272+
list-style-type: "\1F4E6"; /* Unicode: Package */
273+
}
274+
ul.search li.context-title {
275+
list-style-type: "\1F4C4"; /* Unicode: Page Facing Up */
276+
}
277+
ul.search li.context-text {
278+
list-style-type: "\1F4C4"; /* Unicode: Page Facing Up */
279+
}
280+
281+
224282
Templating
225283
----------
226284

doc/development/tutorials/examples/recipe.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,15 @@ def generate(self, docnames=None):
6262
for ingredient, recipe_names in ingredient_recipes.items():
6363
for recipe_name in recipe_names:
6464
dispname, typ, docname, anchor = recipes[recipe_name]
65-
content[ingredient].append((dispname, 0, docname, anchor, docname, '', typ))
65+
content[ingredient].append((
66+
dispname,
67+
0,
68+
docname,
69+
anchor,
70+
docname,
71+
'',
72+
typ,
73+
))
6674

6775
# convert the dict to the sorted list of tuples expected
6876
content = sorted(content.items())
@@ -153,7 +161,14 @@ def add_recipe(self, signature, ingredients):
153161

154162
self.data['recipe_ingredients'][name] = ingredients
155163
# name, dispname, type, docname, anchor, priority
156-
self.data['recipes'].append((name, signature, 'Recipe', self.env.docname, anchor, 0))
164+
self.data['recipes'].append((
165+
name,
166+
signature,
167+
'Recipe',
168+
self.env.docname,
169+
anchor,
170+
0,
171+
))
157172

158173

159174
def setup(app: Sphinx) -> ExtensionMetadata:

doc/development/tutorials/examples/todo.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ def purge_todos(app, env, docname):
5757
if not hasattr(env, 'todo_all_todos'):
5858
return
5959

60-
env.todo_all_todos = [todo for todo in env.todo_all_todos if todo['docname'] != docname]
60+
env.todo_all_todos = [
61+
todo for todo in env.todo_all_todos if todo['docname'] != docname
62+
]
6163

6264

6365
def merge_todos(app, env, docnames, other):
@@ -98,7 +100,9 @@ def process_todo_nodes(app, doctree, fromdocname):
98100
newnode = nodes.reference('', '')
99101
innernode = nodes.emphasis(_('here'), _('here'))
100102
newnode['refdocname'] = todo_info['docname']
101-
newnode['refuri'] = app.builder.get_relative_uri(fromdocname, todo_info['docname'])
103+
newnode['refuri'] = app.builder.get_relative_uri(
104+
fromdocname, todo_info['docname']
105+
)
102106
newnode['refuri'] += '#' + todo_info['target']['refid']
103107
newnode.append(innernode)
104108
para += newnode

doc/extdev/deprecated.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,21 @@ The following is a list of deprecated interfaces.
2222
- Removed
2323
- Alternatives
2424

25+
* - ``sphinx.util.FilenameUniqDict``
26+
- 8.1
27+
- 10.0
28+
- N/A
29+
30+
* - ``sphinx.util.DownloadFiles``
31+
- 8.1
32+
- 10.0
33+
- N/A
34+
35+
* - ``sphinx.util.import_object``
36+
- 8.1
37+
- 10.0
38+
- ``importlib.import_module``
39+
2540
* - ``sphinx.ext.intersphinx.normalize_intersphinx_mapping``
2641
- 8.0
2742
- 10.0

0 commit comments

Comments
 (0)