feat(tooling): port the docgen site generator to Ludic (no Python) (#41)
Follow-up to #31: the doc/lint/grammar checks moved to Ludic there; this ports the remaining docgen piece (gen.py / check.py / palette.py) so nothing in the documentation pipeline is Python any more. Three new `x` subcommands, all in Ludic and compiled by Ludic: - x docs-gen [--out DIR] the static-site generator: parses docs/language/** front-matter + bodies (fences, Parameters:), builds the section/symbol model, reads the asset templates, and emits every page + ns/color/api pages + the landing page + ludic-highlight.js + symbols.json + .nojekyll. - x docs-check [DIR] the coverage / integrity guard (required files, a page per inventory.json symbol, duplicate-token and one-dir-per-namespace guards, highlighter link targets). - x docs-palette the named-colour source of truth: the palette table moved into tools/x/docgen.ludic, emitting emit_color.ludic (pointer, not ptr) + palette.json. Verified against the Python oracle: `x docs-gen` reproduces all 466 output files BYTE-FOR-BYTE (a Ludic json.dumps/html.escape/front-matter port — ordered dicts, indent=2 vs compact, ensure_ascii \uXXXX, codepoint-aware truncation), and `x docs-check` matches check.py's pass/fail output. Wired into `x test` as a gate (docs-gen -> docs-check on a fresh site; docs-palette stays byte-identical). CI swap: ci.yml and docs.yml call the Ludic generator; docs.yml drops the python:3.12 container and bootstraps the toolchain from the IR seed instead. tools/docgen/{gen,check,palette}.py deleted; only assets/ + inventory.json remain. Completes #31's criterion 3. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
109d8c5b4f
commit
9ed0070039
13 changed files with 2027 additions and 946 deletions
|
|
@ -19,6 +19,9 @@ program X {
|
|||
import "test.ludic"
|
||||
import "json.ludic"
|
||||
import "checks.ludic"
|
||||
import "docgen.ludic"
|
||||
import "docgen_gen.ludic"
|
||||
import "docgen_check.ludic"
|
||||
import "release.ludic"
|
||||
|
||||
function usage() -> void {
|
||||
|
|
@ -43,6 +46,9 @@ program X {
|
|||
print(" x check-impl every implemented feature has a docs/language page")
|
||||
print(" x check-vocabulary the vocabulary is in sync across grammar / lexer / header / parser")
|
||||
print(" x lint-asset <file> validate one editor .json / .xml asset")
|
||||
print(" x docs-gen [--out DIR] generate the documentation site (default build/pages)")
|
||||
print(" x docs-check [DIR] coverage/integrity guard over a generated docs site")
|
||||
print(" x docs-palette regenerate emit_color.ludic + palette.json from the palette table")
|
||||
print("")
|
||||
print("release:")
|
||||
print(" x version print the toolchain version (ludicc --version)")
|
||||
|
|
@ -80,6 +86,9 @@ program X {
|
|||
if (cmd == "check-impl") { exit(cmd_check_impl()) }
|
||||
if (cmd == "check-vocabulary") { exit(cmd_check_vocab()) }
|
||||
if (cmd == "lint-asset") { exit(cmd_lint_asset()) }
|
||||
if (cmd == "docs-palette") { exit(cmd_docs_palette()) }
|
||||
if (cmd == "docs-gen") { exit(cmd_docs_gen()) }
|
||||
if (cmd == "docs-check") { exit(cmd_docs_check()) }
|
||||
if (cmd == "golden") { exit(cmd_golden()) }
|
||||
if (cmd == "bootstrap") { exit(cmd_bootstrap()) }
|
||||
if (cmd == "bootstrap-cfree") { exit(cmd_bootstrap_cfree()) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue