Commit Graph

20850 Commits

Author SHA1 Message Date
Adam Turner
db7ba522d7
Install epubcheck for Docutils HEAD tests (#12272) 2024-04-12 21:32:19 +01:00
Adam Turner
b30088d68f Bump Ruff to 0.3.7 2024-04-12 21:04:51 +01:00
Adam Turner
b4cccb70f7
Support Docutils 0.21 (#12267) 2024-04-12 19:42:15 +01:00
Adam Turner
6419d31bef
Partially revert Docutils' [r9562] to fix epubcheck (#12271) 2024-04-12 19:39:27 +01:00
Adam Turner
5d98553b63 Add Python 3.12 to the version support policy 2024-04-11 19:57:11 +01:00
Adam Turner
f51b9d9988 Test with Docutils 0.21 2024-04-11 19:51:47 +01:00
Adam Turner
8ee9c536b7
Fix mypy errors on Windows (#12266) 2024-04-11 19:40:53 +01:00
Dimitri Papadopoulos Orfanos
5bec029bfd
Import `Sequence from collections.abc` (#12252) 2024-04-11 19:03:04 +01:00
Adam Turner
72760ad5f3 Ensure that `[theme] and [options] are tables in theme.toml` 2024-04-11 19:01:17 +01:00
Adam Turner
44a42d53af Add basic tests for `_ConfigFile` 2024-04-11 19:01:17 +01:00
Adam Turner
fba5d2af6c Convert `theme.conf to theme.toml` (part 2) 2024-04-11 19:01:17 +01:00
Adam Turner
e29e5fed36 Convert `theme.conf to theme.toml` (part 1) 2024-04-11 19:01:17 +01:00
Adam Turner
254bfe4f4e Add `theme.toml` migration tool 2024-04-11 19:01:17 +01:00
Adam Turner
8976fa4498 Support `theme.toml` 2024-04-11 19:01:17 +01:00
Adam Turner
a5d7cce7f5 Fix `_ConfigFile` handling of sequence types 2024-04-11 19:01:17 +01:00
Dimitri Papadopoulos Orfanos
6caf4ee17e
Reduce size of PNG files in the tutorial (#12245) 2024-04-11 16:26:06 +01:00
Adam Turner
6fd8b30043
Parse `theme.conf to a new _ConfigFile` type (#12254) 2024-04-10 00:10:26 +01:00
Dimitri Papadopoulos Orfanos
dbedb52782
Apply the FURB142 Ruff rule (#12240) 2024-04-09 18:48:24 +01:00
Dimitri Papadopoulos Orfanos
be9b9349cc
Use the proper type for Pytest's "minversion" option (#12244)
Numbers (integer or decimal) are permitted, but strings are preferred
2024-04-09 18:46:32 +01:00
Adam Turner
9ebfadbcad Create subsection for theme configuration 2024-04-09 18:34:55 +01:00
Adam Turner
e3f0aa9307 Ensure raw strings are used for regular expression patterns 2024-04-09 18:33:42 +01:00
Dimitri Papadopoulos Orfanos
63e7ee6de1
[docs] Fix a typo newly found by codespell (#12243) 2024-04-09 09:42:01 +02:00
Adam Turner
3421e5382a
Narrow `Generator[T, None, None] types to Iterator[T]` (#12241) 2024-04-09 03:26:44 +01:00
Eric Norige
413e740dca
🐛 Fix singlehtml target uris to be same-document references (#11970)
Before this change, target_uris would be generated as `index.html#foo`. 
This makes it difficult to rename the generated document and can require reloading the document when following a link.

After this change, they are just `#foo`, which avoids the above problems.
2024-04-08 00:08:30 +02:00
Bénédikt Tran
c7c02002e5
[search] fix an undefined local variable (#12235) 2024-04-06 20:12:53 +02:00
Bénédikt Tran
db4939f007
[misc] update wording of `versionadded to Added in [...]` (#12184)
Motivated by the community feedback, the wording of ``versionadded`` is changed 
from ``New in [...]`` to ``Added in [...]``.
2024-04-05 13:32:55 +02:00
Nok Lam Chan
17a84a6443
[doc] clarify units for `linkcheck_rate_limit_timeout` (#12225)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

This normalizes the description of the configuration value so that its default value's unit is the same as the internal one (i.e., seconds).
2024-04-05 11:51:02 +02:00
James Addison
4b7a2c3f05
[search] refactor `Search.query` into separate functions (#12229)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-04-05 11:20:04 +02:00
James Addison
de1c4d7faa
[typo] fix `language_data.js_t` (#12228)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-04-04 19:24:58 +02:00
Nicolas Peugnet
600d3d3ada
[i18n] fix non-translated formatted string in the search page (#12215) 2024-04-04 17:57:39 +02:00
Bénédikt Tran
f7a1397d6c
[console] enhance detection and elimination of known ANSI escape sequences (#12216)
This PR improves the logic for detecting and eliminating ANSI color codes and other escape sequences introduced by Sphinx. ANSI escape sequences that are not natively known to Sphinx are not eliminated (e.g., VT100-specific functions).
2024-04-04 12:35:38 +02:00
James Addison
df3cde65fa
[tests] linkcheck: bind each test HTTP server to a unique port per-testcase (#12126)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-04-04 11:25:53 +02:00
Bénédikt Tran
cb8a28dd7e
[mypy] add stubs for color functions (#12217) 2024-04-01 13:45:47 +02:00
Bénédikt Tran
f5fc408e2a
[ruff] expand exclusion list (#12218) 2024-04-01 13:35:53 +02:00
Bénédikt Tran
d5baa46d85
[mypy] use explicit exclusion fpr test files (#12199)
This explicitly excludes test files instead of ignoring errors by test modules.
2024-03-28 09:11:56 +01:00
Chris Sewell
430866e029
👌 Add warning log for config values that cannot be cached (#12203)
As a user and/or extension developer, it can be a source of confusion when,
on performing a `sphinx-build` for a cached project, 
an unchanged configuration variable is always marked as changed (triggering a full rebuild).

This is often due to the variable being an unpicklable value,
which is silently omitted from the cache (i.e. the `environment.pickle`).

This commit introduces a specific warning for when a configuration variable is omitted from the cache,
allowing users to understand the root of the problem.
2024-03-27 12:59:24 +01:00
Chris Sewell
448cb9931d
🔧 CI: fix Python 3.13 tests (#12210) 2024-03-27 12:45:24 +01:00
James Addison
bfce4f54b0
[HTML search] include partially-matched document titles in search results (#12041)
Co-authored-by: William Lachance <wlach@protonmail.com>
2024-03-26 12:18:26 +01:00
Chris Sewell
04bd0df100
👌 Improve external role warnings (and revert object fallback) (#12193)
The key issue this commit seeks to address, is that existing tools / documentation often lead users to mistakenly use object types and not role names, a classic example being `function` not `func`

Previously, the warning message for using e.g. `` external:function`target` `` (with `py` as the default domain), would be:

```
WARNING: role for external cross-reference not found: function
```

This gives no information to the user on how to fix the issue, even though there is actually quite an easy fix

This commit adds logic to create more specific / helpful warning messages, e.g.

```
WARNING: role for external cross-reference not found in domains 'py', 'std': 'function' (perhaps you meant one of: 'py:func', 'py:obj')
```

This goes through the same original logic but, if the role is not found, it will look if the role name is actually an available object type on the domain(s), and then suggest its related roles.

This commit also reverts #12133, which provided a (silent) fallback to auto convert an object type to a role name.
2024-03-25 14:39:51 +01:00
Bénédikt Tran
2e05fd2ffe
[cleanup] remove deprecated objects and improve deprecation private interface (#12185)
This removes the deprecated objects that should have been removed in 7.x.
2024-03-25 12:45:45 +01:00
James Addison
0ef96a7d52
[tests] fix flakiness of `test_linkcheck_exclude_documents` (#12189) 2024-03-25 11:48:03 +01:00
Bénédikt Tran
f44ff30673
[doc] cleanup references and update external URLs (#12182) 2024-03-25 11:39:05 +01:00
Bénédikt Tran
f26d492d6d
[config] protect `is_serializable` against circular references (#12196) 2024-03-25 11:19:02 +01:00
Bénédikt Tran
885818bb7f
[tests] move utilities and static data into dedicated modules and remove `html5lib` (#12173)
Since #12168, HTML files are now XML compliant, hence ``html5lib`` is no more needed as a testing dependencies.
2024-03-25 11:03:44 +01:00
Jakob Lykke Andersen
9e239729d4
C, fix debug functionality (#12194) 2024-03-24 14:44:19 +01:00
Bénédikt Tran
f24eef7b6b
[cleanup] deprecate `sphinx.testing.util.strip_escseq in favor of sphinx.util.console.strip_colors` (#12186) 2024-03-24 00:43:54 +01:00
danieleades
22cee42094
[lint] use `types-docutils instead of docutils-stubs for docutils` type annotations (#12012)
Co-authored-by: daniel.eades <daniel.eades@seebyte.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-03-23 21:09:18 +01:00
James Addison
42a0d73160
[lint] follow PEP 8 for module-level dunder names (#12180)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-03-23 19:21:22 +01:00
James Addison
4b3c4abe0d
[cleanup] add `confval role to entry for linkcheck_allow_unauthorized` (#12177) 2024-03-23 17:40:50 +01:00
Bénédikt Tran
d91ba115bd
Verify that an asset file to be copied exists (#12183) 2024-03-23 14:57:32 +01:00