docs: automated documentation pipeline (per-symbol source → pages)
Some checks failed
docs / build-and-deploy (push) Failing after 38s

Replace the hardcoded landing page and minimal reference with a generated
documentation site driven by a single source of truth.

- docs/language/**: one file per symbol (93 keywords/types/builtins/namespace
  methods/operators/annotations), each with front-matter (id, kind, tokens,
  sig, tip) + description + a ```ludic example. Seeded by exploding the former
  inline SECTIONS list; these files are now the source of truth.
- docs/site/: site.json (editable hero/features/showcase/messaging, not
  hardcoded) + snippets/*.ludic (real programs shown on the landing page).
- tools/docgen/gen.py: generates index.html, api.html, ludic-highlight.js and
  symbols.json. The highlighter's symbol tables, hover tips and jump anchors
  are GENERATED from the per-symbol files — add a symbol and it is recognized,
  tipped and linked in every snippet automatically. Python stdlib only.
- tools/docgen/check.py: verifies the pages contract + that no snippet token
  links to a missing reference anchor.
- .forgejo/workflows/docs.yml: rebuilds and publishes to the pages branch on
  every push to main touching the docs sources.

Consumes the new Screen.*/Color.*/named-arg API and the 221-color palette.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-08-29 16:25:54 +03:00
parent a3a1e4d160
commit 51ddfa3ce9
121 changed files with 3827 additions and 0 deletions

View file

@ -0,0 +1,7 @@
---
id: control
title: Control flow
order: 2
---
Branches, loops, and state machines.

View file

@ -0,0 +1,12 @@
---
id: kw-become
name: become
category: control
kind: keyword
tokens: become
sig: become Name
tip: Transition: to another state of the enclosing machine, or to another scene.
order: 8
---
Transition: to another <code>state</code> of the enclosing machine, or to another <code>scene</code>.

View file

@ -0,0 +1,16 @@
---
id: kw-for
name: for … in
category: control
kind: keyword
tokens: for
sig: for name in a .. b { … }
tip: Range loop.
order: 2
---
Range loop. <b>Each pass binds a fresh, immutable <code>name</code></b> — it is not a variable you reuse or reassign; the range <code>a .. b</code> runs from <code>a</code> up to but not including <code>b</code>.
```ludic
for gy in 0 .. GRID_H { … }
```

View file

@ -0,0 +1,12 @@
---
id: kw-if
name: if / else
category: control
kind: keyword
tokens: if else
sig: if cond { … } else { … }
tip: A branch.
order: 0
---
A branch. Conditions are plain expressions; no parentheses required.

View file

@ -0,0 +1,12 @@
---
id: kw-in
name: in
category: control
kind: keyword
tokens: in
sig: for x in range | query
tip: Binds the loop name to each value of a range or query.
order: 3
---
Binds the loop name to each value of a range or query.

View file

@ -0,0 +1,16 @@
---
id: kw-machine
name: machine
category: control
kind: keyword
tokens: machine
sig: machine store { state Name { … } }
tip: A state machine over an int var (or register).
order: 6
---
A state machine over an int <code>var</code> (or register). It dispatches on the store's value.
```ludic
machine turn_phase { state KnightMenu { … } }
```

View file

@ -0,0 +1,12 @@
---
id: kw-match
name: match / when
category: control
kind: keyword
tokens: match
sig: match x { when a, b => … }
tip: Multi-way branch on a value, matching one or more literals per arm.
order: 4
---
Multi-way branch on a value, matching one or more literals per arm.

View file

@ -0,0 +1,12 @@
---
id: kw-state
name: state
category: control
kind: keyword
tokens: state
sig: state Name { … }
tip: One state of a machine.
order: 7
---
One state of a <code>machine</code>.

View file

@ -0,0 +1,12 @@
---
id: kw-when
name: when
category: control
kind: keyword
tokens: when
sig: when value => result
tip: One arm of a match.
order: 5
---
One arm of a <code>match</code>.

View file

@ -0,0 +1,12 @@
---
id: kw-while
name: while
category: control
kind: keyword
tokens: while
sig: while cond { … }
tip: Loop while the condition holds.
order: 1
---
Loop while the condition holds.