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: builtins
title: Builtin functions
order: 12
---
Global functions available anywhere, beyond the namespaced APIs above.

View file

@ -0,0 +1,12 @@
---
id: fn-abs
name: abs
category: builtins
kind: builtin
tokens: abs
sig: abs(a) -> int
tip: Absolute value.
order: 8
---
Absolute value.

View file

@ -0,0 +1,12 @@
---
id: fn-bytes
name: bytes / words
category: builtins
kind: builtin
tokens: bytes words
sig: bytes(n) -> ptr / words(n) -> words
tip: Allocate a raw buffer of n bytes / n 32-bit words.
order: 11
---
Allocate a raw buffer of n bytes / n 32-bit words.

View file

@ -0,0 +1,12 @@
---
id: fn-clamp
name: clamp
category: builtins
kind: builtin
tokens: clamp
sig: clamp(v, lo, hi) -> int
tip: Constrain v to [lo, hi].
order: 9
---
Constrain v to [lo, hi].

View file

@ -0,0 +1,12 @@
---
id: fn-font_load
name: font_load
category: builtins
kind: builtin
tokens: font_load
sig: font_load(path) -> int
tip: Load a TrueType font and return a handle for the UI.
order: 12
---
Load a TrueType font and return a handle for the UI.

View file

@ -0,0 +1,12 @@
---
id: fn-fx
name: fx / flr
category: builtins
kind: builtin
tokens: fx flr
sig: fx(n) -> fixed / flr(x) -> int
tip: Convert between int and fixed-point.
order: 10
---
Convert between int and fixed-point.

View file

@ -0,0 +1,12 @@
---
id: fn-len
name: len
category: builtins
kind: builtin
tokens: len
sig: len(x) -> int
tip: Length of a slice or string.
order: 5
---
Length of a slice or string.

View file

@ -0,0 +1,12 @@
---
id: fn-load
name: load
category: builtins
kind: builtin
tokens: load
sig: load() -> bool
tip: Restore a snapshot written by save().
order: 4
---
Restore a snapshot written by <code>save()</code>.

View file

@ -0,0 +1,12 @@
---
id: fn-min
name: min / max
category: builtins
kind: builtin
tokens: min max
sig: min(a, b) / max(a, b) -> int
tip: The smaller / larger of two ints.
order: 7
---
The smaller / larger of two ints.

View file

@ -0,0 +1,12 @@
---
id: fn-print
name: print
category: builtins
kind: builtin
tokens: print
sig: print(x)
tip: Print an int or string, followed by a newline — for headless tests and debugging.
order: 0
---
Print an int or string, followed by a newline — for headless tests and debugging.

View file

@ -0,0 +1,12 @@
---
id: fn-push
name: push
category: builtins
kind: builtin
tokens: push
sig: push(slice, x)
tip: Append to a slice.
order: 6
---
Append to a slice.

View file

@ -0,0 +1,12 @@
---
id: fn-quit
name: quit
category: builtins
kind: builtin
tokens: quit
sig: quit()
tip: Stop the game loop after this frame.
order: 2
---
Stop the game loop after this frame.

View file

@ -0,0 +1,12 @@
---
id: fn-save
name: save
category: builtins
kind: builtin
tokens: save
sig: save()
tip: Serialize the entire world — every entity, property and program var — to a snapshot in one call.
order: 3
---
Serialize the entire world — every entity, property and program <code>var</code> — to a snapshot in one call.

View file

@ -0,0 +1,12 @@
---
id: fn-str
name: str
category: builtins
kind: builtin
tokens: str
sig: str(x) -> str
tip: Convert an int/bool/fixed to text; a string passes through.
order: 1
---
Convert an int/bool/fixed to text; a string passes through. Also used by <code>`{…}`</code> interpolation.