Record the theme version on generated PDFs - #40
Merged
Merged
Conversation
A PDF is handed to a reader and leaves the repository that produced it. Both places the installed version is recorded are deliberately kept out of the build -- .meta is dot-prefixed and MkDocs drops it, theme.toml is in exclude_docs -- so nothing in the artifact said which theme rendered it. A site is a git log away from that answer; a PDF is not, and once four projects bump the theme on their own schedules it stops being inferable at all. The cover now carries the line. It reads .meta rather than theme.toml because .meta records what is installed and theme.toml only what was requested, so a drifted tree cannot misreport itself. A --source install takes its version from theme.toml without ever resolving a release, so printing that number would assert something untrue. It renders an explicit local-build marker instead. A missing .meta is an error. A cover that quietly omits the line is the same class of silent asset loss the rest of this pipeline exists to prevent. Closes #33
sehkone
force-pushed
the
sehkone/issue-33
branch
from
August 8, 2026 07:11
5f98e1a to
eee192b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #33. Stacked on #39 — based on
sehkone/issue-38, because both changebuild-docs-pdf.shandtests/pdf-test.sh. Merge #39 first and this rebases to a clean diff.Why
Both places the installed version is recorded are deliberately kept out of the build:
docs/theme/.metais dot-prefixed so MkDocs drops it, anddocs/theme.tomlis inexclude_docs. That exclusion is right — theme machinery should not be published — but it left nothing in a generated PDF saying which theme rendered it.A site is a
git logaway from that answer. A PDF is handed to a reader and leaves the repository that produced it, and once four projects bump the theme on their own schedules the answer stops being inferable at all.What the cover carries
Two decisions worth flagging:
.meta, nottheme.toml..metarecords what is installed;theme.tomlrecords only what was requested. Reading the latter would let a drifted or hand-edited tree misreport itself as a release.--sourceinstall does not print its version. That number came fromtheme.tomland never resolved a release, so printing it would assert something untrue. It names the build instead.A missing
.metais an error. A cover that quietly omits the line is the same class of silent asset loss as the 404 stylesheets this whole effort started from.It reaches the template through
extra, the waycover_taglinedoes, and is overwritten rather than honoured if a consumer sets it — this is derived, not configured.Verification
tests/pdf-test.shgains three checks, all passing:--sourcebuild renders the local marker and not a version number.metatosource = "release"makes the cover printdocs-theme 1.2.3, and the local marker disappears — this is what proves the value is read from.meta.metafails the build with the file namedAlso: both samples build
--strict,shellcheckandmarkdownlint-cli2clean.Note
scripts/ci-build-pdf.pybuilds the sample PDFs directly fromtemplates/andshared/rather than through an installeddocs/theme/, so sample covers render without the line — the{% if %}guard in the template handles it. It is repo-internal and not part of the consumer surface, so it is left alone.