Commit Graph

335 Commits

Author SHA1 Message Date
Adam Turner
d102e62bc7 Format code blocks in docstrings 2025-01-14 12:17:46 +00:00
Adam Turner
44aced1ab7
Add types and defaults to confval directives (#13218) 2025-01-07 03:55:27 +00:00
Firefly
717dcc531a
Napoleon: Define confval types and defaults (#13094)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-01-05 11:05:12 +00:00
Tim Hoffmann
432bc5e50b
Add a class option to the autosummary directive (#13144)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-01-04 00:28:59 +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
ff2693242d Run Ruff on `doc/usage/extensions/` 2025-01-02 23:59:48 +00:00
Tim Hoffmann
a2db696777
Format options for doctest directives (#13107)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-11-13 22:20:56 +00:00
Tim Hoffmann
8117bcaae8
Format autosummary options in docs (#13106)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-11-07 16:25:40 +00:00
Adam Turner
1266c421be Use pathlib in `sys.path` manipulation examples 2024-11-03 22:58:19 +00:00
Tim Hoffmann
283d863af1
Minor cleanup to autosectionlabel docs (#12992)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-10-10 16:23:54 +01:00
Jared Dillard
aa39a6095d
docs: fix syntax typo in intersphinx external role example (#12941) 2024-10-05 20:13:03 +02:00
Tim Hoffmann
b16e196a60
Improve `autodoc` docs (#12935)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-10-02 23:02:48 +00:00
Adam Turner
702ba34aff
Restructure `autodoc` documentation (#12932) 2024-10-01 14:15:24 +01:00
Adam Turner
fadb6b10cb
Stop exiting early with `--fail-on-warnings; add --exception-on-warning` (#12743)
Co-authored-by: Jeremy Maitin-Shepard <jbms@google.com>
2024-08-13 17:12:42 +01:00
Adam Turner
b88905b6f7 Use long options to sphinx-build in our documentation 2024-07-24 15:21:25 +01:00
Adam Turner
9e3f4521db
Drop support for Python 3.9 (#12633) 2024-07-22 15:05:15 +01:00
Bénédikt Tran
aacca3064e
Remove support for the Sphinx 0.5 `intersphinx_mapping` format (#12083)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-07-22 12:59:59 +01:00
Adam Turner
7b570c06a1 Standardise on a common directive for describing code snippets 2024-07-15 02:15:52 +01:00
Adam Turner
1252c7b549 Use "rst" consistently for code and highlighting directives 2024-07-15 02:15:52 +01:00
Adam Turner
f2640a4286 Standardise on "reStructuredText" over "reST" in documentation 2024-07-15 02:15:52 +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
Rafael Fontenelle
2ccae70089
[docs] Fix typos in autodoc.rst (#12469) 2024-06-24 14:48:54 +02:00
Chris Sewell
8f97fd276a
[docs] Improve landing page (#12453)
This commit is intended to improve new user's first-interaction with the Sphinx site:

- Make page header icon/text smaller and not capitalized
- Give min-width to left sidebar (it was getting too small at certain window sizes)
- Replace features list on landing page with admonition boxes, with adaptive layout
- Add landing page "used by" section
- Slightly restructure the Extension section, into Tutorials and How-tos
- Add code to `conf.py` to write HTML write redirect pages for moved documents
- Improve support page, by adding link to Stackoverflow, GH discussion and ReadtheDocs,
  and remove defunct link to libera chat and matplotlib tutorial
2024-06-21 20:12:57 +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
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
Françoise Conil
5fc2d515fd
Fix debug option in autosectionlabel documentation (#12324)
Co-authored-by: Françoise Conil <francoise.conil@insa-lyon.fr>
2024-04-24 18:59:30 +01:00
Bénédikt Tran
f44ff30673
[doc] cleanup references and update external URLs (#12182) 2024-03-25 11:39:05 +01:00
Chris Sewell
3bedde26a9
🔧 Ruff format python files within docs folder (#12139)
Remove `docs` files from the `exclude` list, and also add the `preview = false` format config, which is shown to reduce diffs to the current code base
2024-03-19 15:23:57 +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
b2069fb64f
[lint] update Makefile and lint doc (#12117) 2024-03-17 14:45:56 +01: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
b935915c57
Improve make-mode documentation (#11692) 2023-09-21 09:39:39 +01:00
Adam Turner
1cfb68d8be
Consistently name the object description options (#11533)
*  The directive option ``:noindex:`` was renamed to ``:no-index:``.
*  The directive option ``:noindexentry:`` was renamed to ``:no-index-entry:``.
*  The directive option ``:nocontentsentry:`` was renamed to ``:no-contents-entry:``.

The previous names are retained as aliases, but will be deprecated
and removed in a future version of Sphinx (9.0 or later).
2023-07-28 22:30:26 +01:00
Adam Turner
ff20efcd7e
Tweaks to `doctest_show_successes` (#11535) 2023-07-28 22:29:04 +01:00
benkrikler
762ed8540a
Add line numbers in `sphinx.ext.viewdoc` (#6319)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-07-28 05:52:48 +01:00
Jorge Leitao
99f9209924
Add summary statistics to the coverage report (#5474)
The current implementation of ``sphinx.ext.coverage`` outputs which
methods,classes, and functions are documented.
This commit adds a short summary of this report in terms of
``documented objects / total number of objects``,
both per module and total.

The purpose of this is to support
a currently not mainstream but relevant use-case:
a coverage report on the number of objects that are documented.

By having the statistics on the report or on the stdout,
a regex expression can capture the coverage percentage
(e.g. ``re.search(r'TOTAL.*?([0-9.]{4,6}\%)', d).group(1)``)
and use it e.g. in another report, a status badge, etc.

Two options were added to the configuration to allow a table
to be printed in the report and/or to stdout.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-07-28 02:33:42 +01:00
Adam Turner
ad61e41157
Drop support for Python 3.8 (#11511) 2023-07-25 02:07:23 +01:00
Adam Turner
7ecf037280 Enable 'nit-picky mode' for Sphinx's documentation
Fix several reference errors throughout the documentation and set
``nitpick_ignore`` in ``doc/conf.py``.
2023-04-06 23:11:39 +01:00
Jean-François B
e1b15a5c11 Update doc and CHANGES for PR #11281 2023-04-03 11:12:41 +02:00
Benjamin Balder Bach
eda388a506
Docs: Add a link to sphinx-extensions (#11260) 2023-03-23 08:33:16 +01:00
Adam Turner
2902c6c55b
Deprecate legacy `intersphinx_mapping` format (#11247)
This format was made obsolete in Sphinx 1.0, but never formally deprecated.
2023-03-17 16:41:22 +00:00
Adam Turner
670bcb743b
Documentation reshuffle (#11112) 2023-01-08 13:52:36 +00:00
Tim Hoffmann
ec26c2f874
Document autosummary template variable "objtype" (#11044) 2023-01-02 18:38:17 +00:00
Adam Turner
920828fe35 Run the `pyupgrade` tool 2022-10-17 22:39:09 +01:00
Martin Patz
3e29abf8de
Add debug logging to autosectionlabel (#10881)
Co-authored-by: Martin Patz <martin@recogni.com>
2022-10-04 15:25:06 +01:00
Julien Schueller
ef01c5b6bd
imgmath: Allow embedding images in HTML as base64 (#10816)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2022-09-23 17:11:21 +01:00
Adam Turner
ee005caf22 Do not apply epigraph style to all block quotes
Correct indentation where appropriate for stanzas that should not be
rendered as `<blockquote>` HTML elements.

Closes GH-10686
2022-09-12 19:54:36 +01:00
Abdur-Rahmaan Janhangeer
59056aa781
Remove extra line (#10749)
Co-authored-by: Jean-François B. <2589111+jfbu@users.noreply.github.com>
2022-08-04 18:42:55 +02:00