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: structure
title: Program structure
order: 0
---
The shape of a Ludic program: one <code>program</code> block holding declarations.

View file

@ -0,0 +1,12 @@
---
id: kw-const
name: const
category: structure
kind: keyword
tokens: const
sig: const NAME: T = value
tip: A compile-time constant.
order: 5
---
A compile-time constant. Folds directly into the code — no storage, no cost.

View file

@ -0,0 +1,12 @@
---
id: kw-extern
name: extern
category: structure
kind: keyword
tokens: extern
sig: extern fn name(a: T) -> R = "symbol"
tip: Bind a name to an external C-ABI symbol — the seam for platform and library calls.
order: 12
---
Bind a name to an external C-ABI symbol — the seam for platform and library calls.

View file

@ -0,0 +1,12 @@
---
id: kw-fn
name: fn
category: structure
kind: keyword
tokens: fn
sig: fn name(a: T, b: T) -> R { … }
tip: A function.
order: 8
---
A function. Call it positionally or with named arguments: <code>name(a: 1, b: 2)</code>.

View file

@ -0,0 +1,16 @@
---
id: kw-handler
name: handler
category: structure
kind: keyword
tokens: handler
sig: handler Name phase P { … }
tip: A block of code the engine runs every frame during phase P.
order: 3
---
A block of code the engine runs every frame during phase <code>P</code>. With a query, the body runs once per matching entity.
```ludic
handler Move phase Update { … }
```

View file

@ -0,0 +1,12 @@
---
id: kw-import
name: import
category: structure
kind: keyword
tokens: import
sig: import "file.ludic"
tip: Splice another Ludic file into this program.
order: 10
---
Splice another Ludic file into this program. Paths resolve relative to the importer; re-imports are free.

View file

@ -0,0 +1,12 @@
---
id: kw-let
name: let
category: structure
kind: keyword
tokens: let
sig: let name = value
tip: An immutable binding, scoped to the block it appears in.
order: 7
---
An immutable binding, scoped to the block it appears in.

View file

@ -0,0 +1,16 @@
---
id: kw-model
name: model
category: structure
kind: keyword
tokens: model
sig: model Name { PropA, PropB, … }
tip: A named bundle of properties, so an entity that always travels together is spawned by one name.
order: 2
---
A named bundle of properties, so an entity that always travels together is spawned by one name.
```ludic
model Player { Health, Shield }
```

View file

@ -0,0 +1,12 @@
---
id: kw-module
name: module
category: structure
kind: keyword
tokens: module
sig: module Name { @export fn … }
tip: Build a shared library of plain C-ABI symbols instead of an executable.
order: 11
---
Build a shared library of plain C-ABI symbols instead of an executable.

View file

@ -0,0 +1,12 @@
---
id: kw-phase
name: phase
category: structure
kind: phase
tokens: Start Input Update FixedUpdate Render
sig: phase Start | Input | Update | FixedUpdate | Render
tip: When a handler runs.
order: 4
---
When a handler runs. <b>Start</b> once at boot; <b>Input</b> reads the keyboard; <b>Update</b> is the per-frame step; <b>FixedUpdate</b> is the deterministic fixed-step; <b>Render</b> draws the frame.

View file

@ -0,0 +1,12 @@
---
id: kw-program
name: program
category: structure
kind: keyword
tokens: program
sig: program Name { … }
tip: The top-level unit.
order: 0
---
The top-level unit. A program compiles to one native game; everything else lives inside it.

View file

@ -0,0 +1,16 @@
---
id: kw-property
name: property
category: structure
kind: keyword
tokens: property
sig: property Name { field: T = default, … }
tip: A component: a named record of fields an entity can carry.
order: 1
---
A component: a named record of fields an entity can carry. Fields have a type and a default.
```ludic
property Pos { x: int = 0, y: int = 0 }
```

View file

@ -0,0 +1,12 @@
---
id: kw-return
name: return
category: structure
kind: keyword
tokens: return
sig: return value
tip: Return from a function.
order: 9
---
Return from a function.

View file

@ -0,0 +1,16 @@
---
id: kw-var
name: var
category: structure
kind: keyword
tokens: var
sig: var name: T = value
tip: A mutable binding.
order: 6
---
A mutable binding. At program scope it is your game's persistent, named state — the modern replacement for numeric registers.
```ludic
var score: int = 0
```