Commit Graph

192 Commits

Author SHA1 Message Date
Thomas Louf
1418339eb9
Allow configuration of trailing commas in multi-line signatures (#12975)
Stop outputting trailing commas for C and C++, as it is invalid syntax.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
Co-authored-by: Jakob Lykke Andersen <jakobandersen@users.noreply.github.com>
2025-01-21 20:08:18 +00:00
Adam Turner
c4daa95c09 Enable the entire D category in Ruff 2025-01-14 15:55:02 +00:00
Adam Turner
9b7205b65e
Improve mathematics domain performance (#13044)
When profiling, ``MathDomain.process_doc()`` takes around 1% of runtime.
This change reduces this to ~0.
2025-01-07 01:34:18 +00:00
Adam Turner
83bf866059
Avoid attribute indirection with `env` (#13212) 2025-01-05 09:10:55 +00:00
Adam Turner
531436b794 Remove redundant 'fmt: skip' comments 2025-01-05 05:42:39 +00:00
Adam Turner
b458850b32 Bump Ruff to 0.8.1 2024-11-29 23:09:10 +00:00
Adam Turner
e834327925 Use `_StrPath in sphinx.util.images` 2024-11-04 18:10:11 +00:00
Adam Turner
2ccbc3209a Use type hints for directories 2024-11-04 18:02:31 +00:00
Adam Turner
1094556afb Bump Ruff to 0.7.2 2024-11-03 02:55:19 +00:00
Adam Turner
4b72423ed3 Enable the S105 lint in Ruff 2024-10-19 19:05:43 +01:00
Adam Turner
77e2cbb2d3
Enable automatic formatting for `sphinx/writers/` (#12974) 2024-10-05 03:16:57 +01:00
Adam Turner
76110c3ea0
Add `_DomainsContainer` for better static typing (#12783)
Co-authored-by: Daniel Eades <danieleades@hotmail.com>
2024-09-18 03:50:27 +01:00
danieleades
e8f8247e0c
Disallow subclassing `Any` (#12638) 2024-07-23 01:52:20 +01:00
Adam Turner
18ac58bd53 Fix possibly-invalid HTML when a rubric node is manually created 2024-07-15 10:04:48 +01:00
Chris Sewell
41b363dbff
[rst] Add level option to rubric directive (#12506)
This commit adds a `level` option to the `rubric` directive, which propagates a `level` attribute to the `rubric` node,
and allows renderers to select a specific heading level.

Logic for this attribute has been added to the HTML5 and LaTeX builder.
2024-07-14 05:52:58 +02:00
Adam Turner
e7beb8bc5c
Remove dead class attributes (#12545) 2024-07-11 08:34:57 +01:00
tuncbkose
bdd9140842
Remove custom SVG processing in the HTML builder (#12425)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-07-10 18:31:01 +00:00
Chris Sewell
8387f4a491
[html] propagate rel attribute from reference nodes (#12489)
See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel,
this allows third-party extensions to set this attribute on the node and have it propagate to the output HTML
2024-07-03 12:53:16 +02:00
Adam Turner
6419d31bef
Partially revert Docutils' [r9562] to fix epubcheck (#12271) 2024-04-12 19:39:27 +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
danieleades
d4c739cdd1
[lint] add PERF401 lint (#12070)
Co-authored-by: daniel.eades <daniel.eades@seebyte.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-03-14 11:16:36 +01:00
James Addison
2fe103acda
Maintenance: apply pyupgrade suggestions for py3.9 (#11910) 2024-02-14 11:05:47 +01:00
Nicolas Peugnet
59cf4d4c35
Allow custom targets in the manpage role (#11825)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-01-17 01:09:18 +00:00
Adam Turner
23cef9b59a Use `https://` where possible 2024-01-14 04:18:57 +00:00
Adam Turner
17c1aa76c6 Add type hints to untyped definitions 2024-01-13 21:23:48 +00:00
Adam Turner
9bcf1d8bb3 Fix TCH001 (move application import into a type-checking block) 2023-08-14 00:18:13 +01:00
Adam Turner
36012b7d96 Fix TCH002 (move third-party import into a type-checking block) 2023-08-13 22:50:03 +01:00
Adam Turner
92e60b3f15 Fix PGH003 (type: ignore comment must have parameters) 2023-08-13 22:11:15 +01:00
Adam Turner
7e9a2066c2 Be more ephemeral (in anchor link title text) 2023-08-12 05:30:38 +01:00
Adam Turner
cb6d568715
Enable `strict-optional` for several more modules (#11523)
This enables mypy's ``strict-optional`` mode for:

* ``sphinx.builders.html``
* ``sphinx.builders.latex``
* ``sphinx.domains.python``
* ``sphinx.domains.std``
* ``sphinx.environment``
* ``sphinx.ext.apidoc``
* ``sphinx.ext.autodoc``
* ``sphinx.ext.autodoc.importer``
* ``sphinx.ext.autosummary``
* ``sphinx.ext.autosummary.generate``
* ``sphinx.ext.inheritance_diagram``
* ``sphinx.ext.intersphinx``
* ``sphinx.ext.imgmath``
* ``sphinx.ext.mathjax``
* ``sphinx.ext.napoleon.docstring``
* ``sphinx.registry``
* ``sphinx.writers.latex``
2023-07-27 20:17:35 +01:00
Adam Turner
ad61e41157
Drop support for Python 3.8 (#11511) 2023-07-25 02:07:23 +01:00
picnixz
480630c649
Support PEP 695 and PEP 696 syntax in the Python domain (#11444)
* Generic classes can be documented with ``.. py:class::`` using PEP 695 syntax:

  .. code:: rst

     .. py:class:: Sequence[T]

* Generic functions can be documented with ``.. py:function::`` using PEP 695 syntax:

  .. code:: rst

     .. py:function:: foo[T](x: T)

* Default values for type bounds are supported.

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-07-23 23:22:40 +01:00
Adam Turner
571becb6af Re-instate the footnote-reference class 2023-07-14 07:50:12 +01:00
TLouf
86b07d4a97
Allow multi-line object description signatures (#11011)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
Co-authored-by: Jean-François B <2589111+jfbu@users.noreply.github.com>
Co-authored-by: TLouf <loufthomas@gmail.com>
2023-05-11 14:28:57 +01:00
Adam Turner
13442f6901 Fix pytest style issues 2023-02-18 02:16:50 +00:00
Adam Turner
c8f4a03dac Fix COM812 2023-02-18 01:58:05 +00:00
Adam Turner
bb9821b968 Resolve Ruff SIM114 violations 2023-02-15 02:09:47 +00:00
Adam Turner
2a7c40d07f Undo parallel image changes 2023-01-10 14:53:17 +00:00
Adam Turner
dc3f22a370 Make MyPy happy 2023-01-02 17:41:28 +00:00
Adam Turner
4032070e81
Run pyupgrade (#11070) 2023-01-02 00:01:14 +00:00
Adam Turner
14a9289d78 Use PEP 604 types 2023-01-01 20:48:39 +00:00
Adam Turner
26f79b0d2d Use PEP 595 types 2023-01-01 20:48:38 +00:00
Adam Turner
f4c8a0a68e Insert `from __future__ import annotations` 2023-01-01 20:48:37 +00:00
Daniel Eades
1abb24e309 remove blanket 'noqas' 2022-12-16 16:50:24 +01:00
Adam Turner
cd3f2e4350 Update typing ignores for mypy 0.990 2022-11-13 20:36:24 +00:00
Adam Turner
592b46c431
Revert `html_codeblock_linenos_style` removal (#10922) 2022-10-16 16:50:53 +01:00
Adam Turner
e70a0fac6d Merge branch '5.x'
# Conflicts:
#	.github/workflows/main.yml
#	CHANGES
#	sphinx/__init__.py
#	sphinx/domains/c.py
2022-10-16 11:24:18 +01:00
Eric Wieser
fa6d42597f
URI-escape image filenames (#10268)
Without this change, local images with `#` in their name result in incorrect URLs

There is already a similar call to `urllib.parse.quote` for file downloads, suggesting this is a sensible approach.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Takeshi KOMIYA <i.tkomiya@gmail.com>
2022-10-13 17:37:07 +01:00
Adam Turner
56aa3412ef Merge branch '5.x'
# Conflicts:
#	setup.py
#	sphinx/__init__.py
2022-09-23 17:27:00 +01:00
danieleades
9b65adc50c
Shrink strict optional whitelist (HTML writers) (#10838) 2022-09-20 22:26:39 +01:00