Skip to content

build: add lint toolchain and generate the index page - #54

Merged
megabyde merged 1 commit into
mainfrom
build/lint-toolchain
Aug 16, 2026
Merged

build: add lint toolchain and generate the index page#54
megabyde merged 1 commit into
mainfrom
build/lint-toolchain

Conversation

@megabyde

@megabyde megabyde commented Aug 16, 2026

Copy link
Copy Markdown
Member

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, with format, format-check, and lint targets. Dependencies are pinned exactly and a lockfile is committed, so npm ci --ignore-scripts reproduces 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.md are 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.

MD025 is disabled, since each # in a deck is a beamer slide rather than a document title.

Generated index page

_site/index.html was 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.html and index.lua. The template holds the head, the Bootstrap link, and the Overview prose; the filter keeps the Curriculum section, rewrites *.md#anchor deck links to .pdf, and reapplies the Bootstrap table classes. If the Curriculum heading is ever renamed, the filter calls error() 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 smart extension produces typographic quotes, matching what the beamer decks already do, and headings pick up anchor ids. Add -smart to HTMLFLAGS if the straight quotes are preferred.

_site/ is now ignored and _site/index.html untracked, with a .prettierignore so a local make -j followed by make check does not fail on pandoc's output formatting.

Deck glob

$(wildcard **/*.md) relied on globstar, which GNU make does not implement, so it silently meant */*.md and would have dropped any deck nested deeper. Replaced with a find using -mindepth 2, which preserves the existing behaviour of keeping README.md out while picking up decks at any depth. Same 21 decks as before, plus solid/01-foundations-worksheet, which was already being rendered.

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.
@megabyde
megabyde merged commit 081ffdc into main Aug 16, 2026
2 checks passed
@megabyde
megabyde deleted the build/lint-toolchain branch August 16, 2026 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant