1197 Commits

Author SHA1 Message Date
Adam Turner
783884c0c8 Link to `docs.python.org instead of docs.python.jp` 2025-02-15 21:50:00 +00:00
Adam Turner
139d6b0936 Use full URLs for links to issues and pull requests 2025-02-15 21:47:31 +00:00
Will Lachance
bb68e72333 Add ability to "skip" adding marked documentation to the search index (#11280)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-02-12 16:47:14 +00:00
Adam Turner
c069960e8a Use blank testroot for `restructuredtext.parse()` 2025-02-11 01:11:19 +00:00
Adam Turner
22e0f8944b Use pathlib in more places 2025-02-07 13:51:42 +00:00
pholica
766900e416 autodoc: Handle multiple inheritance correctly (#13136)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-02-03 01:46:35 +00:00
Bénédikt Tran
1b83e55809 autodoc: add support for `python_display_short_literal` (#12003)
Co-authored-by: James Addison <55152140+jayaddison@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-02-02 22:50:41 +00:00
Chris Sewell
134bd7f1fb Add `collapsible` option to admonition directives (#12507)
This PR adds the `collapsible` and option to the core admonition type directives, which are propagated to the nodes, e.g.

```restructuredtext
.. admonition:: title
   :collapsible:

   content

.. note:: content
   :collapsible: closed
```

For the HTML5 writer, this replaces the outer `div` with a `details` tag, and the title `p`  with a `summary` tag (with an `open` attribute if set), e.g.

```html
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>hallo</p>
</div>
```

changes to

```html
<details class="admonition note" open="open">
<summary class="admonition-title">Note</summary>
<p>hallo</p>
</details>
```

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-01-29 18:06:57 +01:00
Tim Hoffmann
5871ce266a Add support for short signatures in autosummary (#13172)
This introduces a new ``:signatures:`` option to ``sphinx.ext.autosummary``.
Possible values are:

"long" (*default*):
  same as the current default

"short":
  format functions and classes as ``func()`` if they do not
  have arguments and ``func(…)`` if they do have arguments.

"none":
  replaces the pre-existing ``:nosignatures:`` (which becomes deprecated)

The new functionality here is the "short" option.
This allows to distinguish properties and attributes
from functions and classes without costing a lot of space
for a long signature.
2025-01-29 00:44:09 +00:00
Adam Turner
42f300ee83 Rename the `:nowrap and :nosignatures:` directive options (#13264)
Rename the ``:nowrap`` and ``:nosignatures:`` directive options to
``:no-wrap`` and ``:no-signatures:``, for readability.
This mirrors changes already made to `:no-index`, `:no-index-entry`,
`:no-contents-entry`, and `:no-search` in Sphinx 7.2 and 7.3.
2025-01-23 04:30:46 +00:00
Adam Turner
fe06909e32 autodoc: Use type stub files when documenting native modules (#13253) 2025-01-21 19:36:55 +00:00
Bénédikt Tran
5b9fb9e060 autodoc: fix ordering of class and static methods for groupwise order (#13201)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-01-20 15:19:05 +00:00
Valentin Pratz
cfb47865d6 autosummary: Respect empty module `__all__` (#13187)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-01-16 23:36:31 +00:00
Adam Turner
c4daa95c09 Enable the entire D category in Ruff 2025-01-14 15:55:02 +00:00
Adam Turner
c66d3e85d1 Enable 11 more categories in Ruff
* flake8-builtins ('A')
* flake8-blind-except ('BLE')
* flake8-copyright ('CPY')
* eradicate ('ERA')
* flake8-boolean-trap ('FBT')
* flake8-fixme ('FIX')
* flake8-implicit-str-concat ('ISC')
* pep8-naming ('N')
* flake8-use-pathlib ('PTH')
* flake8-self ('SLF')
* tryceratops ('TRY')
2025-01-14 14:43:02 +00:00
Adam Turner
66905d24e1 Use strict flake8-type-checking settings in Ruff 2025-01-13 21:56:36 +00:00
Adam Turner
dec45eaf28 Bump Ruff to 0.9.0 2025-01-10 13:50:26 +00:00
Adam Turner
74ec220479 apidoc: Rename test roots 2025-01-07 11:06:29 +00:00
Adam Turner
91bae649c1 Remove shebang from test-apidoc-toc test root 2025-01-06 21:55:29 +00:00
Adam Turner
a69d79bf67 Add .gitattributes 2025-01-06 21:55:29 +00:00
Adam Turner
d59084a1fa Bump Ruff to 0.8.6 2025-01-06 06:05:55 +00:00
ProGamerGov
fec4d7c2f1 Viewcode: Fix issue with import paths that differ from the directory structure (#13195)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-01-05 10:43:57 +00:00
Nicolas Peugnet
0fbf88a59f Allow extensions to define the keys returned by linkcode (#11824)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-01-03 21:28:34 +00:00
Adam Turner
00ad109a39 Run Ruff on `tests/roots/` 2025-01-03 01:33:14 +00:00
Adam Turner
34f5a8d503 Avoid using camelCase names in autodoc tests 2024-12-09 14:59:25 +00:00
Adam Turner
2d2b73c706 Avoid using camelCase names in autosummary tests 2024-12-09 14:57:08 +00:00
Adam Turner
801c60a873 Consistently calculate the current file's directory 2024-11-03 17:28:02 +00:00
Adam Turner
71c0fcfbc5 Use pathlib in the tests (#13051) 2024-10-25 22:41:08 +01:00
khanxmetu
8351936994 Ensure deterministic resolution of toctree (#12888)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-10-09 21:20:25 +01:00
Adam Turner
886bb945af Log differences in configuration from the pickled environment (#12949) 2024-10-08 06:25:49 +01:00
Adam Turner
3677dd1bca Shorten `copyright` in the ChangesBuilder tests 2024-10-04 12:33:03 +01:00
Adam Turner
5f3846f8c6 Improve testing for copyright year substitution (#12950) 2024-10-03 21:56:50 +01:00
James Addison
80c4b65a2a apidoc: Restore support for legacy '_t'-suffix template files (#12929)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-10-03 00:21:03 +01:00
Jean-François B.
1c131dfffe LaTeX: make contents, topic, and sidebar separately customizable (#12704)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-08-19 20:43:47 +02:00
Jean-François B.
4c7fe10a4b LaTeX: fix mark-up when \DUrole is used with multiple classes (#12745) 2024-08-17 20:33:15 +02:00
Adam Dangoor
ae8b37793d Improve typing for `mocksvgconverter.py` (#12788)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-08-16 22:35:32 +01:00
Jeremy Bowman
0cbdd98ffb Correctly support custom gettext output templates (#12645)
Co-authored-by: Jeremy Bowman <jmbowman@alum.mit.edu>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-08-11 20:34:04 +01:00
Adam Turner
d03156e078 Format `tests/` (#12760) 2024-08-11 14:58:56 +01:00
Adam Turner
a4102a7507 Specify encoding to avoid EncodingWarning 2024-07-29 18:21:01 +01:00
Adam Turner
7c4db269af Normalise `sys.path` manipulation in tests (#12665) 2024-07-23 16:55:21 +01:00
Adam Turner
217f267822 Do not overwrite user-supplied data by default when copying (#12647) 2024-07-22 16:00:16 +01:00
Bénédikt Tran
6c486a575c Fix detecting file changes for the overwritten file warning (#12627)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-07-20 14:31:53 +01:00
Adam Turner
2bd973e719 autodoc: Fix warnings with dataclasses in `Annotated` metadata (#12622) 2024-07-20 11:28:03 +01:00
Adam Turner
587da413ca Warn when files are overwritten in the build directory (#12612) 2024-07-19 08:20:48 +01:00
Adam Turner
e61f56950d Do not add the module prefix when generating autosummary documents (#12609) 2024-07-17 21:42:21 +01:00
Jean-François B.
152b78318d LaTeX: fix figures in seealso and seealso inside table cell (#12598)
This also fixes unreported issues unrelated to the 7.4.0 release:

- (now old style "lightbox") admonitions render badly in tabulary,
- "heavybox" admonitions (they are all now but warning et al. were already) cause PDF crash if in tabulary and rendered badly if in tabular or longtable.
- figure in a table cell is not properly separated from immediately preceding text.

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-07-16 21:03:42 +01:00
Adam Turner
4bdef1b576 Remove old-styled `source_suffix` values in tests 2024-07-15 12:50:56 +01:00
Adam Turner
18ac58bd53 Fix possibly-invalid HTML when a rubric node is manually created 2024-07-15 10:04:48 +01:00
Bénédikt Tran
2a30bb661f Fix PEP 695 output for classes in the LaTeX builder (#12561) 2024-07-15 05:17:36 +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