Commit Graph

1157 Commits

Author SHA1 Message Date
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
Jakob Lykke Andersen
e08f12f848 toctree: Use document nesting instead of domain nesting when adding domain objects (#12367)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-07-14 01:16:26 +01:00
Trevor Bekolay
2c0943784c Disallow module cycles in autosummary (#6792)
Consider the following piece of reST::

  .. automodule:: sphinx.ext.autosummary
     :members:

     .. autosummary::

        sphinx.ext.autosummary.Autosummary

This inserts an autosummary after the module docstring, but before
the members of the module. Without the change in this commit, this
would fail because `import_by_name` would attempt to import::

    sphinx.ext.autosummary.sphinx.ext.autosummary.Autosumary

because the prefix (from the parent) is `sphinx.ext.autosummary`,
and the name is `sphinx.ext.autosummary.Autosummary`, which is able
to be imported from `sphinx.ext.autosummary`, but is not the way
that anyone would want to refer to it.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-07-13 06:37:50 +01:00
James Addison
a6c2bdd371 Rename template files in Sphinx to use the `.jinja` extension (#12364) 2024-07-11 12:31:35 +01:00
Ashley Whetter
e38a60d3f2 Add `py:type` directive and role for documenting type aliases (#11989)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-07-11 12:15:54 +01:00
Stephen Finucane
6b37a6b2a2 Allow explicitly specifying modules in the coverage builder (#11592)
Currently there is no mechanism to identify totally undocumented modules
in the coverage builder, unlike with partially documented modules.
Resolve this by introducing a new ``coverage_modules`` config option.
This is a list of modules that should be documented somewhere
within the documentation tree. 
Any modules that are specified in the configuration value but 
are not documented anywhere will result in a warning. 
Likewise, any modules that are not in the config option but 
are documented somewhere will result in a warning.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2024-07-11 07:36:36 +01:00
Adam Turner
82edc3d385 Rewrite `usage/configuration.rst` (#12537)
- Remove now-removed configuration values
- Use obvious 'unset' defaults for ``project`` and ``author``
- Prefer 'e.g.' to 'ex.'
- Allow non-list sequence types in various configuration values
- Add types and defaults to every confval directive
2024-07-10 21:43:14 +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
James Addison
778013f91a Regression: restore extraction of data-URI images from source for builders whose output formats do not support them natively (#12344) 2024-07-03 02:16:43 +01: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
James Addison
2008aa8c78 linkcheck: Store the original (unquoted) anchor (#12206) 2024-04-24 18:07:31 +00:00
James Addison
0806a00f05 Support `.jinja` for theme static templates (#11916)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-04-23 10:40:24 +01:00
Nicolas Peugnet
55ca37f684 Add more internationalisation tests (#12277)
- Add test for basic literal block & literalinclude translation
- Add gettext builder test for litteral blocks additional targets
- Add i18n test for xref roles in titles
- Add i18n tests for strange markup
2024-04-23 05:22:43 +01:00
James Addison
67303920fe Make the test suite connectivity-agnostic (#12095)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-04-12 23:32:12 +01: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
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
James Addison
4eede5c534 [tests] Increase timeouts for linkcheck build tests. (#12166)
This is an attempt to resolve intermittent failures of the linkcheck tests currently occuring on the GitHub CI
2024-03-21 21:46:27 +01:00
Bénédikt Tran
da0733b338 [autodoc] fix rendering of enumerations inheriting from mixin and data types (#11596) 2024-03-21 12:36:36 +01:00
Chris Sewell
565d4104d5 👌 Handle external references pointing to object types (#12133)
This commit fixes the issue of `objects.inv` denoting object names, whilst the `external` role only allows for role names. 

As an example, take the `objects.inv` for the sphinx documentation, which contains:

```
py:function
    compile                  : usage/domains/python.html#compile
```

A user might understandably expect that they could reference this using `` :external:py:function:`compile` ``, but actually this would previously error with:

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

this is because, `function` is the object type, yet `external` expects the related role name `func`.

It should not be necessary for the user to know about this distinction,
so in this commit, we add logic, to first look if the name relates to a role name (as previous, to not be back-breaking) but, if not, then also look if the name relates to an object that has a known role and, if so, use that.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-03-19 13:42:50 +01:00
Bénédikt Tran
c86e90842f [autodoc] add support for singledispatchmethod class methods (#11284) 2024-03-14 12:26:35 +01:00
MatrixEditor
182053198d Added support for `slice` objects in subscriptions (#11981)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-02-14 14:45:30 +01:00
Bénédikt Tran
08386826fb Add tests for `:manpage:` inside a title (#11705) 2024-02-14 10:33:09 +01:00
Bénédikt Tran
b587eb243a Fix `:paramtype:` reference targets (#11964) 2024-02-14 00:04:49 +01:00
j-carson
cd2bf0a7e5 #11917 - Fix rendering of inherited members for Python 3.9 (#11919)
Co-authored-by: j-carson <j-carson@fastmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-02-03 10:46:13 +01:00
danieleades
f9c8943889 Use `# NoQA` consistently (#11903)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-01-21 20:20:58 +00:00
Hugo van Kemenade
95b2cce9a0 Add a `versionremoved` directive (#11905)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-01-21 20:12:52 +00:00
James Addison
2418e007ce Support unary subtraction in annotation parsing (#11904) 2024-01-21 14:31:04 +00:00
Adam Turner
f195c4ae87 Various C++ domain performance improvements (#11895)
Authored-by: Jakob Lykke Andersen <Jakob@caput.dk>
Co-authored-by: Jakob Lykke Andersen <Jakob@caput.dk>
2024-01-19 02:20:43 +00:00
Adam Turner
462404cb25 Organise tests into directories 2024-01-17 03:56:35 +00: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
569fde84d4 Happy New Year! 2024-01-16 22:13:47 +00:00
Adam Turner
23cef9b59a Use `https://` where possible 2024-01-14 04:18:57 +00:00
Dimitri Papadopoulos Orfanos
460a63010f Fix various spelling errors (#11735) 2024-01-04 02:37:44 +00:00
Adam Turner
8878bee000 Replace the header image with a new SVG logo 2023-10-04 16:56:46 +01:00
Bénédikt Tran
46f8f76e56 Fix the lazy loading conditions for MathJax (#11597)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-09-21 18:18:09 +01:00
Adam Turner
2a631f97ef Restore support for YYYY copyright lines 2023-08-30 22:51:23 +01:00
Adam Turner
ff18318613 Add an `'include-read'` event (#11657) 2023-08-30 22:21:16 +01:00
Albert Y. Shih
4692208fde Fix two relative link bugs in inheritance diagrams (#11634)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-08-30 18:44:37 +01:00
Matt Wozniski
8248be31db autodoc: Reset `sys.modules` on partial import failure (#11645)
If importing with ``TYPE_CHECKING is True`` fails, reset the state of ``sys.modules``
so that the attempt with ``TYPE_CHECKING is False`` may succeed.

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-08-29 20:05:41 +01:00
Bénédikt Tran
76658c49a9 Fix `sphinx.ext.autodoc.preserve_defaults` (#11550)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-08-17 01:19:25 +00:00
Stephen Finucane
53a930f8c7 Fix C coverage support in `sphinx.ext.coverage` (#11591) 2023-08-15 14:50:15 +01:00