Commit 980bd8e
authored
* Fix #171: Document ENV config TOML file
* Generate the RST from TOML file through a Python script (`toml_parser.py`).
It can be executed as a standalone script or integrated into Sphinx.
* Enhance `conf.py` to read the TOML config(s) and create the generated
file. The generate file is included in `reference/env-toml/index.rst`.
* The generated file has a different extension than .rst (actually `.rst.inc`).
This was necessary otherwise you get a warning from Sphinx about duplicate labels.
* Enrich the TOML file with comments similar to "docstrings": it contains
the syntax "KEYNAME(TYPE): DESCRIPTION"
This is a kind of "self-documenting" approach.
* Currently, the standard tomllib library doesn't preserve comments.
To not rely on a different library, we need to read it line by line. :(
* There is a small optimization in the conf.py file: the .rst.inc file is
only generated when the TOML file has a newer date.
* Use "github-action" group for CI test
* Use "uv lock --no-upgrade" to upgrade uv.lock file
* Rework regex
* Add UTF-8 encoding when writing RST
* Use UTF-8 encoding when reading TOML
* Fix comment
* Fix regexes for doc comments
---------
Co-authored-by: Sushant Gaurav <[email protected]>
1 parent 13cc03c commit 980bd8e
9 files changed
Lines changed: 919 additions & 22 deletions
File tree
- .github/workflows
- docs/source
- reference
- env-toml
- etc/docbuild
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
| 32 | + | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
10 | 16 | | |
11 | 17 | | |
12 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
13 | 23 | | |
14 | 24 | | |
15 | 25 | | |
| |||
219 | 229 | | |
220 | 230 | | |
221 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
0 commit comments