CodeVetter · Repo Unpack · Extension points
krahets/hello-algo
The repo is built to be extended in five dimensions: new programming languages (add a codes/<lang> mirror + workflow + docs tabs), new chapters/sections (docs/chapter_x + nav entry + per-language code dirs), new locales (copy tree + INHERIT config + Dockerfile stage + alternate entry), new page features (custom admonition types, animation frame sets, pythontutor embeds), and theme behavior (override partials + CSS/JS). Some extension is registry-driven (Cargo.toml [[bin]], CMakeLists add_executable, mkdocs.yml nav) while the run-all harnesses auto-discover files via chapter_* globs.
- Add a new programming language: create codes/<lang>/chapter_* mirrors of the sample set, a modules/pkg/utils helper dir, a manifest (go.mod/package.json/Cargo.toml/.csproj/CMakeLists/build.zig pattern), a .github/workflows/<lang>.yml path-filtered to codes/<lang> and en/codes/<lang>, plus a === '<Lang>' tab in every docs code block and a README badge.
- Add a new chapter or page: create docs/chapter_x/*.md (+ <page>.assets/ for images), register it in the nav tree in mkdocs.yml, and mirror it across locale docs trees and codes/<lang>/chapter_x directories.
- New Rust samples plug in via the Cargo.toml [[bin]] registry — each entry maps a bin name to a chapter_*/*.rs path with a '# Run Command: cargo run --bin <name>' comment; shared helpers go in codes/rust/src/include/ exposed through src/lib.rs.
- New C/C++ samples plug in via per-chapter CMakeLists add_executable lines; a whole new chapter requires an add_subdirectory line in the root codes/c/CMakeLists.txt.
- New locale: copy a locale tree, write a mkdocs.yml starting with 'INHERIT: ../mkdocs.yml' overriding site_name/site_url/docs_dir/site_dir/theme.language, add the language to extra.alternate, and add a COPY+mkdocs-build stage in the Dockerfile.
- Run-all harnesses auto-discover new files: test_all.py (glob 'chapter_*/*.py') and test_all.js (expandGlob 'chapter_*/*.js') pick up added samples with no registry edit — unlike Rust/C/C++ which need manifest entries.
- New callout types are added via CSS: extra.css defines --md-admonition-icon--pythontutor and .admonition.pythontutor/details.pythontutor styles; the same pattern extends to new '??? <type>' admonitions.
- New animations need no code: any tabbed set whose labels are all '<N>' is auto-detected by animation_player.js's isAnimationSet() and upgraded to a slideshow — authors just add sequential frame PNGs as === '<k>' tabs.
- Theme surface is extensible through Material's override blocks: main.html extends base.html (announce block), partials/{actions,comments,content}.html slot into content rendering — new per-page chrome plugs in here rather than by forking the theme.
- Page-level feature flags via front matter: comments.html keys off page.meta.comments and content.html checks page.meta.hide for action buttons — new pages opt into features declaratively.
- pymdownx.snippets is enabled in mkdocs.yml but no docs page uses the --8<-- include syntax — an available-but-unused extension point that could replace manual code transcription. (inferred)
- overrides/zensical/ is the forward extension path: zensical.toml + its own javascripts/stylesheets dirs define an alternate site build (Zensical SSG) where animation_player.js and animation_player.css already live — new interactive features land there first.