docs: publish plugin-env.md on the options-doc Pages site (#614) - #629
Merged
Conversation
Step 4 of #573, deferred by PR #574 until #570's flake.nix/workflow changes landed (they did, 2026-07-28). docs/plugin-env.md was readable only in the repo while the options reference next to it was published. Teaches the options-doc derivation (flake.nix) to render plugin-env.md too, rather than doing it in the workflow: it reuses the exact same cmark rendering path as options.html, factored into a small render_page shell function, so both pages share one source of styling truth. The cmark tool swaps to cmark-gfm (still tiny, no pandoc/Haskell closure) because plugin-env.md's env-var tables are GFM pipe tables, which plain CommonMark has no syntax for and would otherwise print literally. Since there are now two documents, index.html stops being a byte-copy of options.html and becomes a small generated landing page linking both. options-doc.yml stays a dumb copier: it now copies plugin-env's .md/.html and the derivation's own index.html instead of re-deriving one from options.html. Closes #614 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Adversarial review of PR #629 found four gaps, all one-liners on paper but one required a real structural fix: 1. options-doc was never wired into `checks`, so `nix flake check` (the only gate CI runs on PRs) never built the derivation this PR just made meaningfully bigger — the exact #449-class gap flake.nix already warns about for `trollshell`/`trollshell-control-center`. Wiring it in isn't a plain `inherit`, though: `options-doc` was defined inline inside `packages`'s own `let` block, which is a different scope from `checks`'s `let` block (each `forAllSystems` callback is independently scoped), so the name simply wasn't in reach. Extracted the whole derivation into nix/options-doc.nix — its own file, `pkgs.callPackage`'d from both `packages` and `checks` — matching how `trollshell`, `bundledPlugins`, and `hytte-infobroker` are already built in both outputs from a shared file rather than duplicated inline. `options-doc` is pure eval plus one tiny C binary, so this is effectively free on every `nix flake check`. 2. nix/module-common.nix's `plugins.<name>.env` option description — the only in-repo pointer to the env-knob reference — linked to raw Markdown on GitHub instead of the now-published plugin-env.html. Repointed to the absolute Pages URL (https://vibec0re.github.io/trollshell/plugin-env.html). Deliberately absolute, not relative: this same description is rendered by `nixos-option` and `man home-configuration.nix`, where a relative `plugin-env.html` resolves to nothing. 3. The landing page's inline <style> was a second, independently-drifting copy of render_page's — already visibly different (h1 line-height 1.5 vs 1.2). Folded into the nix/options-doc.nix extraction: page_style/ page_head/page_foot are now shared shell functions/variables used by all three generated pages, verified byte-identical across index.html, options.html, and plugin-env.html. 4. options-doc.yml's "this workflow only copies files" comment didn't match five hand-enumerated `cp`s, so a future new output file wouldn't publish and no gate would notice. Changed to `cp -R result/share/doc/trollshell/. _site/`, making the comment actually true. Rebuilt `nix build .#options-doc` after each fix; output file list unchanged (index.html, options.html, options.md, plugin-env.html, plugin-env.md). `nix fmt` clean (0 changed) both before and after. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
vibechoom
added a commit
that referenced
this pull request
Jul 30, 2026
…630/#634 (#636) PR #634 (closes #613) makes two existing entries actively wrong rather than merely stale, which is worse than a gap: a verifier following the old text would read a successful self-heal as a regression. Corrects both, per #635: - The #610 "restart NetworkManager" caveat no longer says the backend probe runs once at startup; it retries while inconclusive. The deferred re-probe gap now points at #633 (the genuinely-unsolved half — switching backends after one is already committed) instead of the closed #613. - The #609 entry no longer expects an `error!` pointing at `systemctl --user restart trollshell` on a transient probe failure. The shipped retry policy is unbounded and self-heals into a `RECOVERED` line instead of giving up. Also folds in the three PRs that merged alongside #634 since the doc's last refresh (#628): - #629 (closes #614): docs/plugin-env.md publishing to the Pages options-doc site, new "Documentation site (GitHub Pages)" section (deploy itself is outside `nix flake check` by design — flagged as a manual check). - #630 (closes #627): modal::close_all's borrow-timing fix, added to Shell chrome as a regression-only check — explicitly states that no observable change is the pass condition. - #634 itself: new Wi-Fi entry covering the INCONCLUSIVE/RECOVERED journal pair and the incidental startup-freeze fix. - #628: docs-only refresh of this file, noted in the closing section. Coverage line bumped to #458 through #634. Documentation-only change. Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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 #614
Design points settled (per the issue)
Who renders the Markdown? Took the preferred option: the
options-docderivation now rendersdocs/plugin-env.mdtoo, reusing the exact same rendering mechanismoptions.htmluses (factored into a sharedrender_pageshell function so both pages share one source of styling truth). The workflow (.github/workflows/options-doc.yml) stays a dumb copier — it just copies files out ofresult/.One tool swap was required to do this properly:
cmark→cmark-gfm.plugin-env.md's env-var reference tables are GFM pipe tables (| Variable | Default | Effect |), which plain CommonMark has no syntax for — verified with plaincmark --unsafefirst, which printed the|characters literally instead of a table.cmark-gfm --extension tableis still the same tiny C library (no pandoc/Haskell closure), just the GFM-flavored build, applied uniformly to both docs (harmless onoptions.md, which has no tables).The root page.
index.htmlis no longer a byte-copy ofoptions.html. The derivation now generates a small landing page linking both documents, styled consistently with the rest of the site (same inline CSS approach, no new dependency, no JS framework). Bothoptions.htmlandplugin-env.htmlalso gained a small "← trollshell docs" nav link back to the new root.Review follow-up (this PR was adversarially reviewed before merge)
Four gaps were found and fixed in a second commit, three cosmetic-shaped but one structural:
options-docis now inchecks, not justpackages.nix flake check— the only gate CI runs on PRs — never built theoptions-docderivation this PR just made meaningfully bigger. That's the exact chore(ci): flake checks never build packages.trollshell — CI can be green while nix build is red #449-class gapflake.nixalready documents fortrollshell/trollshell-control-center: a broken derivation could stay green here and only surface as a red Pages deploy after merge.Wiring it in wasn't a plain
inherit, though —options-docwas originally defined inline insidepackages's ownletblock, andcheckshas its own, separately-scopedletblock (eachforAllSystemscallback is an independent scope), so the binding simply wasn't reachable from there. Fixed by extracting the whole derivation intonix/options-doc.nix,pkgs.callPackage'd from bothpackagesandchecks— the same shape already used fortrollshell,bundledPlugins, andhytte-infobroker, which are likewise built via a shared file from both outputs rather than defined inline in one and inherited by the other.options-docis pure module evaluation plus one tiny C binary (cmark-gfm), so this is effectively free on everynix flake checkrun.nix/module-common.nix'splugins.<name>.envoption description — the only in-repo cross-reference to the env-knob doc — pointed at raw Markdown on GitHub instead of the newly-publishedplugin-env.html. Repointed to the absolute Pages URL:https://vibec0re.github.io/trollshell/plugin-env.html. Deliberately absolute, not relative — this same description is rendered bynixos-optionandman home-configuration.nix, where a relativeplugin-env.htmllink resolves to nothing.Shared page styling. The landing page's inline
<style>was a second, independently-drifting copy ofrender_page's (already visibly different: the landing page's<h1>inheritedline-height:1.5frombodywhile both doc pages used1.2). Folded into thenix/options-doc.nixextraction:page_style/page_head/page_footare now one shared shell function/variable set used by all three generated pages — verified byte-identical<style>blocks acrossindex.html,options.html, andplugin-env.htmlafter the fix.Workflow copy step now matches its own comment.
options-doc.ymlclaimed "this workflow only copies files out ofresult/into_site/" while actually hand-enumerating fivecps — a sixth derivation output would have silently not published, with no gate catching it. Changed tocp -R result/share/doc/trollshell/. _site/, so the comment is now literally true and a future output file ships automatically.Gate evidence
nix build .#options-doc, inspectingresult/share/doc/trollshell/(current, post-review-fixes):plugin-env.htmlhas its own<h1>Plugin environment-variable reference</h1>(from the file's own top heading — no duplicate H1 injected, unlikeoptions.md, which has none of its own and gets one injected viarender_page's optional third argument).nix fmt— first run:0 changed. Second run:0 changed.nix flake check -Lwas kicked off locally to double-check the newchecksentry doesn't turn CI red, but the workspace-wide clippy/test/VM suite runs well past any reasonable local wait (~37 min is this repo's own CI number for the equivalent job) — pushing was correctly prioritized over waiting on a local run that duplicates what CI'sflake-checkjob will verify authoritatively. Ifoptions-doc-in-checksturns this PR's CI red, that is exactly the signal adding it was for, and it'll get fixed then.What CI does and doesn't cover
options-doc.yml(the actual Pages-publishing workflow) is deliberately not part ofnix flake checkand still isn't after this PR — so CI never exercises thecp -R/deploy steps themselves, only theoptions-docderivation's build (now viachecks, see review point 1 above).Manual check for a human after merge: watch the "options doc → GitHub Pages" Action run once this lands on
main, then check the deployed site:https://vibec0re.github.io/trollshell/) shows the small landing page (not the options doc directly) — confirm both links work..../plugin-env.htmlrenders with real tables, code spans, and the "← trollshell docs" nav back to root..../options.htmlstill renders correctly, including itsplugins.<name>.envdescription now linking out toplugin-env.htmlwith a real, working absolute URL.🤖 Generated with Claude Code