build: add lint toolchain and generate the index page - #54
Merged
Conversation
Add prettier and markdownlint-cli2 behind `make check`, plus the reformat and the two long-line and heading-level fixes they require in the Legacy Code decks. Build `_site/index.html` from the README curriculum through a pandoc template and Lua filter instead of maintaining a second copy by hand, and stop tracking the generated output. Replace the `**/*.md` deck glob, which relies on globstar that GNU make does not implement, with a find that keeps decks at any depth.
This was referenced Aug 16, 2026
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.
First of three stacked PRs, replacing #53. Merge in order: this one, then #55, then #56.
Lint toolchain
Adds prettier and markdownlint-cli2 behind
make check, withformat,format-check, andlinttargets. Dependencies are pinned exactly and a lockfile is committed, sonpm ci --ignore-scriptsreproduces the toolchain.Most of the diff is the reformat this produces across the Legacy Code decks: trailing whitespace inside code fences, blank lines before lists, and table alignment. Three edits in
05-safe-changes.mdare lint-driven rather than cosmetic, and are here rather than in #56 because without them this commit fails its own gate: two Exercise bullets are split to satisfy MD013, and one heading is demoted from###to##to satisfy MD001.MD025is disabled, since each#in a deck is a beamer slide rather than a document title.Generated index page
_site/index.htmlwas a hand-maintained duplicate of the README curriculum, and it had already drifted: the Legacy Code table had to be added by hand after the decks landed, and a C++ kata link pointed at the Python repository for some time.It is now built from the README Curriculum section through
index.template.htmlandindex.lua. The template holds the head, the Bootstrap link, and the Overview prose; the filter keeps the Curriculum section, rewrites*.md#anchordeck links to.pdf, and reapplies the Bootstrap table classes. If the Curriculum heading is ever renamed, the filter callserror()so the build fails instead of publishing an empty page.The site's Overview copy stays in the template rather than coming from the README's Overview, since the two address different readers. Only the curriculum is shared.
The generated page has an identical link set and row count to the file it replaces. Two cosmetic differences: pandoc's
smartextension produces typographic quotes, matching what the beamer decks already do, and headings pick up anchor ids. Add-smarttoHTMLFLAGSif the straight quotes are preferred._site/is now ignored and_site/index.htmluntracked, with a.prettierignoreso a localmake -jfollowed bymake checkdoes not fail on pandoc's output formatting.Deck glob
$(wildcard **/*.md)relied on globstar, which GNU make does not implement, so it silently meant*/*.mdand would have dropped any deck nested deeper. Replaced with afindusing-mindepth 2, which preserves the existing behaviour of keepingREADME.mdout while picking up decks at any depth. Same 21 decks as before, plussolid/01-foundations-worksheet, which was already being rendered.