← notes

A Sphinx theme is not a stylesheet

May 16, 2019

Change the Sphinx theme on the Bitcoin developer documentation.

Switching conf.py to sphinxbootstrap4theme and updating project metadata. Small diff, and a good illustration of how much a docs build depends on something that presents itself as styling.

A Sphinx theme is not a stylesheet. It supplies page templates, decides how the sidebar and table of contents render and to what depth, defines which html_theme_options keys exist at all, and ships its own static assets. Swapping one silently drops every option the previous theme defined, because unknown options in conf.py are not the error you would want.

The consequence that bites later is structural. Generated page structure changes, so heading anchors can change, so external links into specific sections break. Documentation is exactly what people deep-link to, and the breakage is invisible from inside the project because internal links are regenerated.

So the audit is bigger than the diff: check options that no longer exist, check TOC depth, spot-check anchors on the most-linked pages. None of it is hard and none of it is prompted by the change.

Pinning the theme version is the other half, unpinned, the docs can change appearance and structure with no commit.