CodeVetter · Repo Unpack · Feature catalog
krahets/hello-algo
User-facing features are reading/learning features rather than app features: a 16-chapter illustrated book, per-language tabbed code samples, step-through frame animations, collapsible PythonTutor visual-execution links, runnable driver-code files, a giscus comment section per page, light/dark themes, full-text search, MathJax math rendering, a custom hero landing page, and five site locales. Contribution-facing features include per-page edit buttons wired to GitHub, a PR template with separate checklists for translation vs. code contributions, and Docker-based one-command local deployment.
- The book is organized as 16 numbered chapters plus preface/appendix/reference/paperbook sections; the full nav tree (Preface → Introduction → Complexity → Data Structures → Arrays/Linked Lists → ... → Greedy → Appendix) is hard-coded in mkdocs.yml.
- Every algorithm sample is presented as a pymdownx.tabbed block with one tab per language (=== 'Python', 'C++', 'Java', 'C#', 'Go', 'Swift', 'JS', 'TS', 'Dart', 'Rust', 'C', 'Kotlin', 'Ruby') containing a fenced code block titled with the source filename, e.g. ```python title='array.py'.
- Step-through animations are encoded as tabbed blocks whose labels are frame numbers (=== '<1>' ... === '<9>'), each wrapping one PNG from <page>.assets/ — e.g. quick_sort.md's pivot_division_step1..9.png sequence for the partition walk-through.
- overrides/zensical/javascripts/animation_player.js upgrades any tabbed set whose labels all match /^<\d+>$/ into a slideshow player with SVG play/pause/prev/next controls, auto-advancing every 1500ms after a 1000ms delay (labels '播放幻灯片'/'暂停幻灯片').
- PythonTutor visual execution is offered via collapsible '??? pythontutor "可视化运行"' admonitions embedding URL-encoded pythontutor.com/render.html#code=... links; codes/pythontutor/ holds the same links in per-function .md files annotated '[file]{array}-[class]{}-[func]{random_access}'.
- Every code sample file is a self-contained runnable program: Python files define functions then a '"""Driver Code""" if __name__ == "__main__":' block that exercises them with printed output (e.g. array.py initializes [1,3,2,5,4] and demos random_access/extend/insert/remove/traverse/find).
- Shared pretty-printing utilities let samples print linked lists, binary trees, heaps, matrices and dicts: codes/python/modules/print_util.py provides print_tree (borrowed from techiedelight), print_linked_list, print_heap, print_dict, print_matrix, re-exported through modules/__init__.py.
- Page comments render only when front matter sets 'comments: true' — comments.html checks page.meta.comments, picks a per-locale prompt string, includes an optional 'partials/checkin.html' (ignore missing), and injects the giscus script with data-mapping='pathname'.
- Giscus theme is synchronized with the Material palette: comments.html reads __md_get('__palette'), maps 'slate' to 'noborder_dark', and posts setConfig messages to the .giscus-frame iframe on palette change.
- Each page gets edit/view action buttons from overrides/partials/actions.html honoring theme features content.action.edit/view, and mkdocs.yml sets edit_uri=tree/main/docs so 'edit' links jump to GitHub's editor (per-locale mkdocs.yml overrides to tree/main/<locale>/docs).
- The landing page docs/index.html is a hand-crafted HTML hero with a .starfield canvas container, absolutely-positioned chapter link cards (astronaut/links/ground artwork), a reviewer grid, and a contrib.rocks contributor image — shipped as a static file inside docs_dir alongside index.md.
- Math rendering uses MathJax 3: mkdocs.yml loads overrides/javascripts/mathjax.js plus the cdnjs tex-mml-chtml bundle and enables pymdownx.arithmatex; mathjax.js configures inline/display delimiters and re-typesets on each navigation via document$.subscribe.
- Five-locale navigation is declared via extra.alternate in mkdocs.yml (简体中文 /, 繁體中文 /zh-hant/, English /en/, 日本語 /ja/, Русский /ru/) and theme language is switched per-locale (zh, zh-Hant, en, ja, ru).
- Contribution workflow is a documented feature: docs/chapter_appendix/contribution.md describes edit-button micro-fixes, the fork/PR pipeline for code transpilation, and 'docker-compose up -d' local deployment; en/CONTRIBUTING.md documents the AI-translate → human-optimize → two-reviewer translation pipeline.