Commit Graph

21033 Commits

Author SHA1 Message Date
Chris Sewell
ee92847a0a
[format] Add ruff formating for apidoc/autosummary (#12447) 2024-06-20 09:37:49 +02:00
Chris Sewell
13b16c9b04
DOCS: hide todo admonitions on RTD (#12442)
`todo` admonitions should not be present in the user-facing documentation (built on ReadTheDocs)
2024-06-19 15:15:31 +02:00
Chris Sewell
37ff33dff7
[builder] type Builder core methods with @final and improve docs (#12436)
This commit:

- annotates the `Builder`'s "core" methods, with [`final`](https://docs.python.org/3/library/typing.html#typing.final)
- adds a UML graph to the Builder API docs
- Adds more methods to the Builder API docs

to make it clearer for extension developers, what is expected from a new builder subclass.
2024-06-19 14:51:20 +02:00
Tim Hoffmann
e30430d2ba
DOC: Improve internal sphinx13 style (#12439)
This commit adds a few changes to the theme to make it more readable and visually more appealing. In particular:

- Slightly increase the font weight of headings (300 --> 400).
- Adapt the color of the search box border to sphinx-blue.
- Add horizontal bars between the components of the side bar. 
- Re-style admonitions to use colored title backgrounds.
2024-06-19 00:44:44 +02:00
Thomas Weißschuh
6471027d19
[themes]: Include project name in logo_alt by default (#12421)
The "alt" attribute of an `<img>` is required to convey all information.
Make it clear which logo is shown.
Also make it possible for users to override the logo_alt with a custom value.
2024-06-18 01:47:14 +02:00
Bénédikt Tran
581bcdd140
[config] correctly synchronize `root_doc and master_doc` (#12417) 2024-06-17 18:04:33 +02:00
Thomas Weißschuh
d5bdabdd80
themes: Don't duplicate "navigation" in aria-label (#12422)
The word "navigation" is not supposed to be included as part of the aria-label attribute:
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/navigation_role
2024-06-17 12:50:34 +02:00
Chris Sewell
1e297bb8c5
🔧 Narrow typing for Builder.build method (#12357) 2024-06-17 12:44:04 +02:00
James Addison
799ae16a01
Intersphinx: log warnings for ambiguous target resolutions. (#12329)
This commit adds detection of ambiguous ``std:label`` and ``std:term`` references (due to case-insensitivity)
during loading and resolution of Intersphinx targets,
and emits a warning if found.

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
Co-authored-by: Chris Sewell <chrisj_sewell@hotmail.com>
2024-06-17 12:42:22 +02:00
Chris Sewell
9c834ff8c5
Remove doctree cache from pickled BuildEnvironment (#12431)
This commit removes `_write_doc_doctree_cache` from the pickled `BuildEnvironment`,
greatly reducing the on-disk and parallel forking memory consumption,
and ensuring outdated doctrees are not used for re-builds.
2024-06-17 12:36:20 +02:00
Tim Hoffmann
1e77e6bc9a
DOC: Move autodoc setup/usage to extension docs (#12435)
Leaving just the link in the quickstart guide
2024-06-17 11:58:55 +02:00
Chris Sewell
b97d14a8b0
Improve tox docs config (#12434)
For example, allow for `CLEAN=true BUILDER=man tox -e docs -- -j4`, 
to use the `man` builder on a clean build, with 4 processes
2024-06-17 11:52:52 +02:00
James Addison
568e26c797
[tests] JavaScript: refactor test fixtures (#12102)
This PR allows to serve JavaScript test fixtures using a fixture-based logic as for Python tests.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-06-13 13:07:46 +02:00
Tim Hoffmann
4fbd3682d5
DOC: Add autodoc section "Ensuring the code can be imported" (#12426)
This explains the requirements for importablilty (can be found and dependencies can be resolved). It also explains two common approaches how this can be achieved.
2024-06-12 11:43:33 +02:00
Rafael Fontenelle
da076d1854
DOCS: Improve Internationalization guide (#12377)
Documentation needs to mention the new Transifex CLI tool instead of the deprecated transifex-client

Co-authored-by: Chris Sewell <chrisj_sewell@hotmail.com>
2024-06-07 12:30:01 +02:00
Rafael Fontenelle
20ec3bd69d
[docs] fix a typo in `markupapi.rst` (#12413) 2024-06-06 12:52:31 +02:00
Jean-François B
b90482fc81
LaTeX: fix docs for `'babel' key of latex_elements` (#12411)
This fixes the documentation which was faulty since v1.7.6, but #12410 is left open until a decision is taken.
2024-06-05 12:52:35 +02:00
Chris Sewell
f0dc8239cd
[app] Allow extensions to detect freshenv builds (#12358)
Some extensions cache data outside of the `BuildEnvironment` (usually for memory/performance reasons).
For these extensions, it would be helpful to detect when `sphinx-build -E` has been called, which in essence suggests the user wishes to remove cached data before building.

This commit adds the `Sphinx.fresh_env_used` public property, exposing `Sphinx._fresh_env_used` in an immutable manner.
2024-06-03 12:01:10 +02:00
Dimitri Papadopoulos Orfanos
53c31f77b6
🔧 Apply ruff rule ISC001 (#12401) 2024-06-03 08:35:48 +02:00
dependabot[bot]
7550588b42
Bump ruff from 0.4.4 to 0.4.7 (#12404)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-03 08:33:20 +02:00
Nicolas Peugnet
90574bc966
[patch] fix undefined label after readthedocs update (#12395) 2024-05-29 12:32:26 +02:00
Inada Naoki
48cbb43e28
[console] improve `progress_message` context (#12387)
This allows statements executed within a ``progress_message`` context
to emit log messages without polluting the console output.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-05-22 14:09:19 +02:00
quotuva
9cc0ea1408
[build] texinfo: fix crash in `reference` nodes without children (#12389)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-05-22 09:51:27 +02:00
Chris Sewell
548f0f928a
👌 Allow access to the parser during the read phase (#12361)
This commit allows access to the `Parser` instance during the read phase, using the read-only property `BuildEnvironment.parser`.

This aims to allow for parser agnostic logic within roles and directives,
as opposed to hard-coding for implementation details of the default docutils `RSTParser`.
2024-05-21 14:46:43 +02:00
Nicolas Peugnet
ac3f74a3e0
[tests] Add intl regression test for term not found warning (#12388)
Add test for term not found warning in test_intl to prevent future regressions
2024-05-19 12:14:13 +02:00
Jelle Zijlstra
6ce4f96c85
More precise types in preserve_defaults.py (#12385) 2024-05-18 19:48:24 +02:00
Jean-François B
a51331c4b7
LaTeX: fix #12380 (#12382) 2024-05-17 12:28:50 +02:00
Chris Sewell
43276dcbac
🔧 add tox environment for mypy (#12376) 2024-05-15 07:18:31 +02:00
Nicolas Peugnet
18d30343f2
i18n: Fix loading custom template translations for en (#12220)
Co-authored-by: Chris Sewell <chrisj_sewell@hotmail.com>
2024-05-15 07:11:21 +02:00
Chris Sewell
71d50a8658
🔧 Update ruff v0.4.4 (#12375) 2024-05-15 07:00:55 +02:00
Chris Sewell
92b30c26e0
DOCS: Add changelog for #12319 (#12374) 2024-05-15 06:38:14 +02:00
Chris Sewell
3496de62b7
🧪 Fix python 3.13 tests (#12373) 2024-05-15 06:28:40 +02:00
Hugo van Kemenade
c06f246124
sphinx.ext.extlinks: Add extlink-{name} CSS class to links (#12319) 2024-05-15 04:21:11 +02:00
James Addison
9467bf7849
[typehints] tests: enable mypy for linkcheck builder tests. (#12160) 2024-05-15 04:13:57 +02:00
Rafael Fontenelle
c64002f1bd
DOCS: Add sphinx-build --jobs default value (#12368) 2024-05-15 03:40:33 +02:00
Michał Górny
ce86026f3b
DEPS: Lazy import defusedxml only when necessary (#12362)
The `defusedxml` dependency was added to `sphinx.testing` in sphinx 7.3,
but it is not part of the core sphinx dependencies, and not strictly necessary for the running of the pytest plugin.
This commit moves the import into the only function which uses it,
so that the pytest plugins can be used again without this dependency.
2024-05-11 18:31:02 +02:00
Ed Cormany
98f953e158
DOCS: improve :tocdepth: note (#12356) 2024-05-07 04:49:08 +02:00
Viktor Garske
88a54d8a13
Update EXAMPLES.rst: Linux kernel switched theme (#12348) 2024-05-05 19:07:32 +02:00
Matthias Geier
13b0fcc532
DOC: Add env_version to "todo" tutorial (#12349) 2024-05-05 19:04:10 +02:00
Matthias Geier
afcafe0409
DOC: add data_version to "recipe" tutorial (#12350) 2024-05-05 19:02:54 +02:00
Adam Turner
c41aab829d
Add `sphinx._cli` (#10877)
This is the first step towards a new ``sphinx`` command.
2024-04-29 03:03:15 +01:00
Adam Turner
0d74c85e8c
Extract inner check functions in `test_domain_cpp` (#12336) 2024-04-29 02:07:56 +01:00
Adam Turner
172a2aa88e
Minimise Ruff's `[format.exclude]` list (#12338) 2024-04-29 02:07:47 +01:00
Johannes Altmanninger
95a8553487
Do not emit manpage OSC 8 hyperlinks for anchor references (#12260)
A reference like ":ref:`Some other page <some-other-page>`" results
in a refuri "#some-other-page".  This does not seem useful to readers
of the man page. It is especially unhelpful when using a terminal
that implements a hint mode for selecting links -- the extra links
add noise, making it harder to select the interesting ones.
Don't emit OSC 8 for those.
2024-04-29 01:24:04 +01:00
Adam Turner
7c7f0d7f57 Add a CHANGES entry for #12314 2024-04-29 01:10:15 +01:00
Matthias Geier
76497988cb
Return `parallel_read_safe` in the autodoc_intenum tutorial (#12288)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-04-26 01:49:04 +01:00
Adam Turner
2dcc8f9fa9 Update pattern in `utils/bump_docker.py` 2024-04-25 21:13:33 +01:00
Adam Turner
938d3732f8
Collapse unions of `Literal types in stringify_annotation` (#12325) 2024-04-25 16:07:10 +01:00
Adam Turner
7953798074 Update to mypy 1.10 2024-04-25 16:04:06 +01:00
Adam Turner
3edf2a2c6b Style `sphinx.ext.intersphinx` 2024-04-25 15:45:28 +01:00