Simon Willison: TILs on sphinx

Atom feed for sphinx

sphinx literalinclude with markers for showing code in documentation - 2024-01-10

I wanted to include some example Python tests in the Datasette documentation - but since they were tests, I also wanted to execute them as part of my test suite to make sure they worked correctly. …

sphinx Format code examples in documentation with blacken-docs - 2022-04-24

I decided to enforce that all code examples in the Datasette documentation be formatted using Black. Here's issue 1718 where I researched the options for doing this. …

sphinx Adding Sphinx autodoc to a project, and configuring Read The Docs to build it - 2021-08-10

I built a new API reference page today for sqlite-utils, using the Sphinx autodoc extension to extract docstrings from the code and use them to build a full class reference. …

sphinx Using sphinx.ext.extlinks for issue links - 2021-02-17

Datasette's release notes are formatted using Sphinx. Almost every bullet point links to the corresponding GitHub issue, so they were full of lines that look like this: …