# Data flow — krahets/hello-algo

> Canonical page: https://codevetter.com/unpack/hello-algo/data-flow

# Data flow — krahets/hello-algo

Scanned commit 28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9 (2026-08-18). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

Data flow is a static publishing pipeline rather than a runtime system. Author inputs are markdown pages, PNG frame assets, and code files; these flow through a staged build/ directory into per-locale mkdocs builds, producing one static site/ tree served over HTTP. Code samples move by manual transcription: authors write codes/<lang>/chapter_* files, then copy excerpts into the docs' tabbed blocks and into URL-encoded PythonTutor links. At view time the browser pulls third-party resources (MathJax CDN, giscus.app, pythontutor.com, contrib.rocks) — the repo itself serves only static files.
- Build pipeline: Dockerfile copies overrides→build/overrides and docs→build/docs, runs 'mkdocs build -f mkdocs.yml' producing site/, then repeats the copy+build for each locale where locale mkdocs.yml sets docs_dir=../build/<locale>/docs and site_dir=../site/<locale> — all locales land in one /hello-algo/site tree. — [Dockerfile#L14-34](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/Dockerfile#L14-L34) [en/mkdocs.yml](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/en/mkdocs.yml)
- Locale configs are derived, not duplicated: en/mkdocs.yml (and zh-hant/ja/ru equivalents) start with 'INHERIT: ../mkdocs.yml' and only override identity fields (site_name, site_url, docs_dir, site_dir, theme.language, nav), so structural changes to the root config propagate to all locales. — [en/mkdocs.yml](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/en/mkdocs.yml) [zh-hant/mkdocs.yml](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/zh-hant/mkdocs.yml)
- Code-to-docs flow is manual transcription: docs pages contain fenced copies of the sample code inside === 'Lang' tabs (e.g. array.md's Python block mirrors array.py's logic), so the docs and codes/ trees are independent artifacts that must be kept in sync by contributors. — [docs/chapter_array_and_linkedlist/array.md#L13-60](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/docs/chapter_array_and_linkedlist/array.md#L13-L60) [codes/python/chapter_array_and_linkedlist/array.py#L10-30](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/codes/python/chapter_array_and_linkedlist/array.py#L10-L30)
- PythonTutor flow: each function's source is URL-encoded into a pythontutor.com/render.html#code=... URL with parameters like curInstr, mode=display, py=311; the URLs are stored both inline in '??? pythontutor' admonitions and as standalone records in codes/pythontutor/chapter_*/*.md. — [codes/pythontutor/chapter_array_and_linkedlist/array.md](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/codes/pythontutor/chapter_array_and_linkedlist/array.md) [docs/chapter_heap/heap.md#L411](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/docs/chapter_heap/heap.md#L411)
- Animation flow: authors produce ordered PNG frames in <page>.assets/ and reference them as === '<N>' tabs; at view time animation_player.js detects all-numeric-label tabbed sets via isAnimationSet(), wraps them in controllers with prev/next/play buttons, and auto-advances the checked radio input on a 1500ms interval. — [docs/chapter_sorting/quick_sort.md#L11-36](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/docs/chapter_sorting/quick_sort.md#L11-L36) [overrides/zensical/javascripts/animation_player.js#L1-45](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/overrides/zensical/javascripts/animation_player.js#L1-L45)
- Comment data flow: page.meta.comments flag → comments.html emits a localized prompt + giscus.app script tag with repo/category IDs → giscus maps the page pathname to a GitHub Discussion → theme changes are pushed back via postMessage to the giscus iframe. — [overrides/partials/comments.html](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/overrides/partials/comments.html) [giscus.json](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/giscus.json)
- CI data flow: push/PR events filtered on paths 'codes/<lang>/**' and 'en/codes/<lang>/**' trigger the matching workflow; the job checks out the repo, sets up the toolchain, then builds or executes every sample in that directory, failing the run on any compile/runtime error. — [.github/workflows/python.yml#L6-46](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/.github/workflows/python.yml#L6-L46) [.github/workflows/go.yml](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/.github/workflows/go.yml)
- Python execution harness: test_all.py globs 'chapter_*/*.py', subprocess.Popens 'python <file>' for each with PYTHONIOENCODING=utf-8, collects stderr per file, and raises RuntimeError aggregating all stderr if any exit code is non-zero — 'Tested N files / Found exception in M files' is the only output. — [codes/python/test_all.py](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/codes/python/test_all.py)
- JavaScript execution harness: codes/javascript/test_all.js uses Deno APIs (expandGlob 'chapter_*/*.js', Deno.Command 'node') to spawn every sample under node, awaiting all statuses — the CI workflow invokes it via 'deno run -A test_all.js'. — [codes/javascript/test_all.js](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/codes/javascript/test_all.js) [.github/workflows/javascript.yml#L30-33](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/.github/workflows/javascript.yml#L30-L33)
- Helper-module data flow: chapter samples import shared structures (e.g. 'use hello_algo_rust::include::print_util' in array.rs, 'from modules import *' style in Python) so TreeNode/ListNode/Vertex construction and printing flow through one module per language, keeping sample files focused on the algorithm. — [codes/rust/chapter_array_and_linkedlist/array.rs#L7](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/codes/rust/chapter_array_and_linkedlist/array.rs#L7) [codes/python/modules/__init__.py](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/codes/python/modules/__init__.py) [codes/typescript/chapter_array_and_linkedlist/array.ts](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/codes/typescript/chapter_array_and_linkedlist/array.ts)
- Rendered pages pull external assets at view time: MathJax from cdnjs.cloudflare.com, giscus client from giscus.app, contributor image from contrib.rocks, PythonTutor frames from pythontutor.com — declared in mkdocs.yml extra_javascript, comments.html, docs/index.html, and ??? pythontutor blocks respectively. — [mkdocs.yml#L136-139](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/mkdocs.yml#L136-L139) [overrides/partials/comments.html#L26](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/overrides/partials/comments.html#L26) [docs/index.html](https://github.com/krahets/hello-algo/blob/28c1e74c1d3594fca7cc41b78a6bd18b700c5ce9/docs/index.html)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
