A seed goes in, a sequence comes out - rand-th is the Thai bridge to that exact transformation. This is the complete Thai translation of the official Rust Rand Book: 33 source files (31 linked chapters, an unlisted overview page, and the summary), built with mdbook, terminology locked by a single glossary, and every code block byte-identical to the original. The links are checked against the built book (431 anchors), the structure mirrors the upstream repo file-for-file, and the license travels with the text. Built for the Thai-speaking Rustacean: suradet-ps.github.io/rand-th.
| 31 chapters translated ▣ | Glossary ▣ | Links 431/431 ▣ | Build passing ▣ |
|---|---|---|---|
| 45 code blocks byte-exact ▣ | 441 links ▣ | 6 updating guides ▣ | MIT OR Apache-2.0 ▣ |
v1.0.0 - translation, glossary, verification, and the static build are all sealed.
Built with mdbook 0.5 + Markdown, translated from rust-random/book, verified by script and rendered as static HTML - a book with the entropy on the page.
suradet-ps, artifact keeper
One runtime, three commands.
⟫ git clone https://github.com/suradet-ps/rand-th.git
⟫ cd rand-th
⟫ cargo install mdbook
⟫ mdbook serve book --open
Open http://localhost:3000.
⟫ mdbook build book # static HTML into book/book
⟫ powershell scripts/check-links.ps1 # all anchors in the built book (pwsh on Linux/macOS)
⟫ powershell scripts/verify-translation.ps1 # byte-exact check vs upstream
On Linux or macOS, run the verification scripts using
pwsh scripts/<script>.ps1.verify-translation.ps1checks againstrust-random/bookin adjacent directories or via-Orig <path>. The upstreambookrepository sits beside this one (clonehttps://github.com/rust-random/bookalongsiderand-th), and its source lives inbook/src, so the verifier is pointed at../book/src.
Translating a chapter
A chapter is a file: book/src/<chapter>.md, listed in
book/src/SUMMARY.md. The glossary lives in GLOSSARY.md - a term
is chosen once and reused everywhere. Code blocks, commands, links,
and filenames stay verbatim; only prose and headings are translated.
Heading anchors follow mdbook's slug rules (Thai tone marks and
than-thakhat are stripped while vowel signs such as ุ and ื survive),
so anchors are copied from the built HTML, never guessed.
One stack, zero custom JS, several quiet helpers.
- Translates - the complete book: introduction, quick start, the crate family with features, platforms and reproducibility, the 12-chapter guide from random data to testing functions that use RNGs, all six updating guides (0.5 through 0.10), and the contributor's guide - Thai prose over untouched code.
- Glossaries -
GLOSSARY.mdlocks the vocabulary (one Thai term per concept, chosen once and reused), so chapter nine agrees with chapter two. - Verifies -
scripts/verify-translation.ps1diffs every code block (45 of them), heading level, and link target against upstreamrust-random/book- byte-exact or it does not pass. - Checks -
scripts/check-links.ps1walks the built book and resolves every anchor link against real heading ids - 431 of them, all reachable. - Builds - mdbook renders static HTML into
book/book/, zero server runtime, readable offline and searchable by built-in static index. - Licenses - MIT OR Apache-2.0, inherited from upstream, with the LICENSE files shipped beside the text.
The core ceremony - the translation pass:
- Open a chapter in
book/src/. The upstreamrust-random/bookrepo sits beside it (clonehttps://github.com/rust-random/bookalongsiderand-th)- structure is a contract.
- Translate the prose; keep every code block and command as the original wrote it.
- Consult
GLOSSARY.mdfor every term that already has a canon. New terms get proposed in the glossary first. - Build, verify, check. The book builds clean, the diff is byte-exact, and the anchors resolve.
The ceremony of the anchor - mdbook slugs strip Thai tone marks and than-thakhat but keep vowel signs, so a heading's anchor is never its plain spelling. Anchors are read from the built HTML, written into the source, and re-verified - a guessed anchor is a broken link waiting to happen.
The ceremony of the code block - a translated command that is not byte-identical to the original is a regression, not a translation. The verifier is the conscience of the repo.
Where this artifact is heading
P1 ▸ SUMMARY + introduction, indexes ──────────────────────────────── ▸ sealed
P2 ▸ crates, features, platforms, reproducibility ─────────────────── ▸ sealed
P3 ▸ the guide, from random data to testing functions with RNGs ───── ▸ sealed
P4 ▸ updating guides 0.5 to 0.10 ──────────────────────────────────── ▸ sealed
P5 ▸ contributor's guide, glossary, license, verification, build ──── ▸ sealed
Raising the artifact - the honest path lives in GLOSSARY.md
(term canon), scripts/ (the verification gate), and
book/book.toml (book config). New chapters follow the
frontmatter-free contract of the SUMMARY. Open an issue first to
discuss a change.
Status - on every change: mdbook build book must pass, the
translation verifier must report byte-exact code blocks across all 33
files (31 chapters + overview + SUMMARY.md), and the link checker
must report ALL ANCHOR LINKS OK.
Watch the gates.
─────────────────────────────────────────
Every seed has its sequence
Every book has its first page
─────────────────────────────────────────
Translated from The Rust Rand Book, which is licensed under MIT OR Apache-2.0.