Skip to content

Restructure the repository around one naming rule - #22

Merged
Powfu-zwx merged 1 commit into
mainfrom
restructure/one-naming-rule
Sep 22, 2026
Merged

Powfu-zwx merged 1 commit into
mainfrom
restructure/one-naming-rule

Conversation

@Powfu-zwx

Copy link
Copy Markdown
Owner

Root cause

The repository carried three language-suffix conventions at once (.zh, -zh, _en), and bare meant English in two places and Chinese in fifty-eight. Chapter files also had three spellings per edition (_experiments, a bare English name, pg / ac abbreviations). Every new page had to pick a convention, and five catalog tables were maintained by hand, so they drifted.

Change

One naming rule: Chinese is the source edition and English its translation. An unsuffixed file is Chinese, -en is English — for text, PDF and notebook alike (dqn.tex / dqn-en.tex). tools/chapters.py is the only place that turns a chapter into a path.

  • Delete the unused issue templates, CODEOWNERS, and the old .zh entry points.
  • Move scripts/ to tools/, check_consistency.py to check_repo.py, and book/requirements-site.txt to the repository root.
  • Add book/chapters.yml as the single chapter list. tools/sync_pages.py generates the four catalog tables and book/_toc.yml from it.
  • Split the demo into demo.md and demo-en.md; drop the page's private data-zh / data-en layer and its own language buttons.
  • Reduce the language switch to one rule, add or strip -en, and derive each sidebar part's language from its links instead of a caption dictionary.
  • Drop the figure-placement assertion and the per-URL catalog assertions. Both guarded prose the generator now owns; the catalog is now checked by regenerating and comparing.
  • Move the chapter writing template to docs/rl-note-template.tex, so book/notes/ holds chapters only.
  • Describe the project as lecture notes rather than a textbook.

Net: 112 files, +1246 / −1324.

Verification

All five gates pass locally on the built site:

python tools/check_repo.py        # 14 chapters, 28 notebooks, 28 TeX, 42 figures
python tools/check_site.py book/_build/html   # 38 HTML pages and local links
node tools/test_lang_toggle.js    # 18 pairs derived from the repository
python tools/test_colab_setup.py  # Colab bootstrap unit tests
jupyter-book build book           # build succeeded

check_catalog now regenerates each catalog block from book/chapters.yml and compares byte for byte, so a stale table fails CI instead of drifting.

Cleanup

No backups, temporary files, or dead paths left. The only remaining scripts/ mention is the pinned Colab raw URL in tools/colab_setup.py, which points at the v1.2.2 tag's tree layout; a comment there says so, and bumping RELEASE_TAG means repointing the path.

Residual risk

  • Chinese is now the default README, home page and site language. Reversible in one step: flip the EDITIONS suffix map in tools/chapters.py, run python tools/sync_pages.py, rebuild.
  • Known content defect, deliberately not fixed here: gymnasium 1.3.0 raises DeprecatedEnv for CliffWalking-v0, which temporal-difference-learning and model-based-rl still use in code cells (both languages). Those four notebooks cannot be re-run as committed. Fixing it means re-running two chapters of experiments, re-exporting figures, and reconciling numbers in the text and the Failure Atlas — content work, not structure. python tools/test_colab_setup.py --smoke reports it; CI does not run --smoke.

🤖 Generated with Claude Code

Chinese is the source edition and English its translation: an unsuffixed
file is Chinese and `-en` is English, for text, PDF and notebook alike.
That retires three older spellings at once (`_experiments`, a bare English
name, and the `pg` / `ac` abbreviations).

- Delete the unused issue templates, CODEOWNERS and the old `.zh` entry points.
- Move `scripts/` to `tools/`, `check_consistency.py` to `check_repo.py`, and
  `book/requirements-site.txt` to the repository root.
- Add `book/chapters.yml` as the single chapter list and generate the four
  catalog tables and `book/_toc.yml` from it with `tools/sync_pages.py`.
- Split the demo into `demo.md` and `demo-en.md` and drop the page's private
  `data-zh` / `data-en` layer and its own language buttons.
- Reduce the language switch to one rule, add or strip `-en`, and derive each
  sidebar part's language from its links instead of a caption dictionary.
- Drop the figure-placement assertion and the per-URL catalog assertions, both
  of which guarded prose the generator now owns.
- Move the chapter writing template to `docs/rl-note-template.tex`, so
  `book/notes/` holds chapters only.
- Make Chinese the default README, home page and site language.
- Describe the project as lecture notes rather than a textbook.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Powfu-zwx
Powfu-zwx merged commit 3620e0f into main Sep 22, 2026
4 checks passed
@Powfu-zwx
Powfu-zwx deleted the restructure/one-naming-rule branch September 22, 2026 02:38
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