Replace knit with generate_toc.py (#6279)

This commit is contained in:
Jorge Martin Espinosa 2026-03-10 09:05:20 +01:00 committed by GitHub
parent 28c9bed632
commit d848ccc148
11 changed files with 244 additions and 59 deletions

View file

@ -16,7 +16,7 @@
* [Code quality](#code-quality)
* [detekt](#detekt)
* [ktlint](#ktlint)
* [knit](#knit)
* [checkDocs](#checkdocs)
* [lint](#lint)
* [Unit tests](#unit-tests)
* [konsist](#konsist)
@ -123,13 +123,13 @@ Note that you can run
For ktlint to fix some detected errors for you (you still have to check and commit the fix of course)
#### knit
#### checkDocs
[knit](https://github.com/Kotlin/kotlinx-knit) is a tool which checks markdown files on the project. Also it generates/updates the table of content (toc) of the markdown files.
`checkDocs` is a Gradle task which checks markdown files on the project to ensure their table of contents is up to date. It uses `tools/docs/generate_toc.py --verify` under the hood, and has a counterpart `generateDocsToc` task which runs `tools/docs/generate_toc.py` to update the table of contents of markdown files.
So everytime the toc should be updated, just run
<pre>
./gradlew knit
./gradlew generateDocsToc
</pre>
and commit the changes.
@ -137,7 +137,7 @@ and commit the changes.
The CI will check that markdown files are up to date by running
<pre>
./gradlew knitCheck
./gradlew checkDocs
</pre>
#### lint