Commit Graph

38 Commits

Author SHA1 Message Date
Adam Turner
72ce43619c
Remove unneeded runtime typing imports (#13233) 2025-01-12 01:04:14 +00:00
Adam Turner
83bf866059
Avoid attribute indirection with `env` (#13212) 2025-01-05 09:10:55 +00:00
danieleades
05679efe7b
Type-check the 'autodoc_intenum' example (#12827) 2024-10-12 01:14:56 +01:00
Adam Turner
18fbced7e0
Reduce the formatter's target line length to 88 (#12757) 2024-08-11 00:19:50 +01:00
Adam Turner
1887df0b5c
Add reStructuredText parsing functions to `SphinxDirective` (#12492) 2024-07-02 22:14:19 +01:00
Chris Sewell
d130c2e710
[docs] Improve tutorials (#12473)
This commit make it clearer, from the filenames and titles,
what the extension tutorials are intended to teach.
2024-06-27 22:30:03 +02:00
Matthias Geier
13b0fcc532
DOC: Add env_version to "todo" tutorial (#12349) 2024-05-05 19:04:10 +02:00
Matthias Geier
afcafe0409
DOC: add data_version to "recipe" tutorial (#12350) 2024-05-05 19:02:54 +02:00
Matthias Geier
76497988cb
Return `parallel_read_safe` in the autodoc_intenum tutorial (#12288)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-04-26 01:49:04 +01:00
Chris Sewell
d59b158371
👌 Make ExtensionMetadata type public and use it in internal extensions (#12153)
This type alias has now been fully documented for public consumption.

This will be beneficial to the sphinx ecosystem,
to aide/encourage extension developers to provide the correct metadata.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-03-21 16:19:26 +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
Dimitri Papadopoulos Orfanos
4f08cdff13
Enable the FURB113 rule in Ruff (#11856)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: danieleades <33452915+danieleades@users.noreply.github.com>
2024-01-21 20:25:05 +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
c8f4a03dac Fix COM812 2023-02-18 01:58:05 +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
f4c8a0a68e Insert `from __future__ import annotations` 2023-01-01 20:48:37 +00:00
Adam Turner
920828fe35 Run the `pyupgrade` tool 2022-10-17 22:39:09 +01:00
danieleades
276f430b57
Begin addding flake8-simplify checks (#10820)
Start with SIM104 and ignore all other flake8-simplify warnings
2022-09-20 21:30:31 +01:00
daniel.eades
964fcb2e07 Fix flake8 5.0.0 reported formatting errors 2022-08-01 20:55:47 +02:00
Adam Turner
35ed39c946 Use Node.findall 2022-04-22 04:21:39 +01:00
Adam Turner
cbe0c99181 rawsource is deprecated in docutils.nodes.Text 2022-04-22 04:21:38 +01:00
danieleades
9c68cd12d7
Update recipe.py 2022-01-14 08:58:54 +00:00
Daniel Eades
6697ed62ed address some unused loop control variables (B007) 2022-01-12 20:19:18 +00:00
Jouke Witteveen
e200e7b7c1
doc: Improve autodoc extension example
Enumerations can have aliases, which should be documented as well.
2021-12-06 12:31:09 +01:00
Jouke Witteveen
bc849e2170
doc: Fix autodoc extension example
`directivetype` is set to mimic `ClassDocumenter`. Reflect that.

`isinstance` would work on the enum members, but that is not what we want here.
`issubclass` raises a TypeError when called on objects that are not classes.
2021-12-02 16:50:09 +01:00
Takeshi KOMIYA
c1692faba7 Fix #9525: tutorial: Wrong condition in recipe.py 2021-08-05 01:38:58 +09:00
igo95862
1ac05a2a83
doc: Create autodoc extension tutorial 2021-03-09 17:56:46 +03:00
Takeshi KOMIYA
f17ab57b64 Fix #8860: doc: recipe directive crashes with AttributeError
The pre check in the `ReceipeDirective.add_target_and_index() was wrong.
It checkes non-existing option "noindex", but it should check "contains"
option instead.
2021-02-11 22:13:07 +09:00
François Freitag
0949735210
Sort imports with isort
Keep imports alphabetically sorted and their order homogeneous across
Python source files.

The isort project has more feature and is more active than the
flake8-import-order plugin.

Most issues caught were simply import ordering from the same module.
Where imports were purposefully placed out of order, tag with
isort:skip.
2020-11-11 13:19:05 +01:00
Julien Palard
418576ddd1 Doc: Add missing 'env-merge-info' to the todo tutorial. 2020-07-06 17:55:55 +02:00
Takeshi KOMIYA
8090e9040f Fix #7299: doc: Fix TODO tutorial 2020-03-15 18:33:41 +09:00
Stephen Finucane
17596b5f3c docs: Remove unused imports
These were causing flake8 failures.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2019-02-25 11:03:59 +00:00
Stephen Finucane
a35040c454 docs: Address further review comments
todo:
- Subclass SphinxDirective instead of Directive

recipe:
- Remove unnecessary '__init__' methods

Signed-off-by: Stephen Finucane <stephen@that.guru>
2019-02-18 13:46:30 +00:00
Stephen Finucane
5c061ff266 docs: Address review comments
helloworld:
- Return version metadata from extension
- Use 'reST' instead of 'rST'
- Don't use single backticks

todo:
- Return version metadata from extension
- Link to events section of API guide, rather than entire document
- Include name of phases in when describing build phases
- Use more method cross-references where possible
- Fix typo in usage example

recipe:
- Return version metadata from extension
- Rework code to simplify things
- Remove docstrings from 'generate' functions, which are simply
  duplicates of the original docstring
- Rename 'rcp' directive to 'recipe', the 'reref' role to 'ref', and a
  whole lot of variables to something more grokable
- Fix typos in both documentation and code

I've also fixed up the docstrings for some of the 'domain' functions to
make them render a little nicer (they took me a while to figure out).

Signed-off-by: Stephen Finucane <stephen@that.guru>
2019-02-14 10:31:45 +00:00
Stephen Finucane
b1ebdcd3c6 doc: Add "recipe" tutorial
This is based on a post from opensource.com [1] and demonstrates how one
can use indexes for cross-referencing and domains to group these indexes
along with domains and roles. The source code was taken from [2] after
getting the license changed [3].

[1] https://opensource.com/article/18/11/building-custom-workflows-sphinx
[2] https://github.com/ofosos/sphinxrecipes
[3] https://github.com/ofosos/sphinxrecipes/issues/1

Signed-off-by: Stephen Finucane <stephen@that.guru>
2019-02-09 17:58:30 +00:00
Stephen Finucane
93081e2fce doc: Use 'literalinclude' directive for examples
This avoid duplication and could conceivably let us test this stuff in
code later on.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2019-02-09 17:58:30 +00:00