7 Commits

Author SHA1 Message Date
Yeqi Huang
d12d14a1eb refactor: symmetric config layout and root CONTRIBUTING docs (#502)
* refactor: reorganize mdbook config and contributing docs

* fix: correct preprocessor relative paths in book.toml configs

The preprocessor command paths had one extra ../ level, resolving
outside the repo root. Fix from ../../../../tools/ to ../../../tools/.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 18:07:53 +00:00
anyin233
92e3f3e059 refactor: restructure project and update documentation for second edition (#500)
* feat: remove bilingual button on the front page

* misc: clean repo

* test: fix test suite for v1/v2 restructure and removed language switch

* refactor: restructure chapters for the second edition

* refactor: restructure project

* refactor: remove unused scripts

* refactor: move conftest.py to tests directory

* refactor: update README with new chapter structure and logo path

* fix: update image paths in README and README_EN for consistency

* refactor: update directory structure and script references in documentation
2026-03-12 20:39:45 +00:00
anyin233
bdb823c575 refactor: clean the structure of current project (#499)
* feat: remove bilingual button on the front page

* misc: clean repo

* test: fix test suite for v1/v2 restructure and removed language switch
2026-03-12 18:24:03 +00:00
Yeqi Huang
6f677ff507 fix: fix undefined docsRoot variable in version-selector.js (#498)
The variable was renamed from docsRoot to root in #496 but one
reference was missed, causing a ReferenceError that broke the
entire script and prevented V1/V2/EN/ZH buttons from rendering.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 17:32:57 +00:00
Yeqi Huang
95a086903b fix: fix 404 on version switch from index.html and strip pandoc heading IDs (#496)
Two fixes:

1. version-selector.js: Simplify basePath() to determine site root from
   the URL prefix (/ or /docs/) instead of trying to strip path segments.
   Previously, visiting /index.html caused basePath to compute
   /index.html/v1/ (404) because it didn't strip the filename first.

2. prepare_mdbook.py: Strip pandoc-style heading IDs ({#label}) from
   both extracted titles (used in SUMMARY.md sidebar) and rendered
   markdown content. Fixes "Model Deployment {#ch:deploy}" showing
   raw in the sidebar and page headings.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 14:42:46 +00:00
Yeqi Huang
ea4d0d178e fix: fix preprocessor paths for v1/v2 mdbook builds (#495)
mdbook runs preprocessor commands from the book root directory (where
book.toml lives). The v1/v2 book.toml files had incorrect relative
paths to the preprocessor scripts, causing them to silently fail and
leaving raw rst directives (.. raw:: html, toc blocks) unprocessed.

Fix by using correct relative paths in book.toml (../tools/ for
top-level books, ../../../tools/ for books/zh/) and changing build
scripts to cd into book directories before running mdbook build.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 14:01:24 +00:00
Yeqi Huang
d953030747 feat: add v1/v2 versioning with language selector (#494)
* feat: add v1/v2 versioning and language selector for mdbook

- Copy current content to v1/ directory (1st Edition)
- Create v2/ directory with new TOC structure (2nd Edition) and placeholder chapters
- Add version selector (V1/V2) and language toggle (EN/ZH) in top-right nav bar
- Add build scripts: build_mdbook_v1.sh, build_mdbook_v2.sh
- Update assemble_docs_publish_tree.py to support v1/v2 deployment layout
- Fix mdbook preprocessor to use 'sections' key (v0.4.43 compatibility)
- Update .gitignore for new build artifact directories
- Deployment layout: / = v2 EN, /cn/ = v2 ZH, /v1/ = v1 EN, /v1/cn/ = v1 ZH

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* build: update CI to build and verify all four books (v1/v2 x EN/ZH)

- Clarify step names: "Build v2 (EN + ZH)" and "Build v1 (EN + ZH)"
- Add verification step to check all four index.html outputs exist
- Deploy workflow assembles: / = v2 EN, /cn/ = v2 ZH, /v1/ = v1 EN, /v1/cn/ = v1 ZH

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: gracefully skip missing TOC entries instead of crashing

resolve_toc_target() now returns None for missing files instead of
raising FileNotFoundError. This fixes v1 EN build where chapter index
files reference TOC entry names that don't match actual filenames.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 13:37:42 +00:00