docs: automated documentation pipeline (per-symbol source → pages)
Some checks failed
docs / build-and-deploy (push) Failing after 38s
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:
parent
a3a1e4d160
commit
51ddfa3ce9
121 changed files with 3827 additions and 0 deletions
7
docs/language/operators/_section.md
Normal file
7
docs/language/operators/_section.md
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
id: operators
|
||||
title: Operators & tokens
|
||||
order: 11
|
||||
---
|
||||
|
||||
The symbols the grammar recognizes.
|
||||
11
docs/language/operators/op-access.md
Normal file
11
docs/language/operators/op-access.md
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
id: op-access
|
||||
name: Member & index
|
||||
category: operators
|
||||
kind: operator
|
||||
sig: x.field buf[i] s[a..b]
|
||||
tip: Field/method access, element index, and string slice (a fresh substring).
|
||||
order: 6
|
||||
---
|
||||
|
||||
Field/method access, element index, and string slice (a fresh substring).
|
||||
11
docs/language/operators/op-arith.md
Normal file
11
docs/language/operators/op-arith.md
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
id: op-arith
|
||||
name: Arithmetic
|
||||
category: operators
|
||||
kind: operator
|
||||
sig: + - * / %
|
||||
tip: Add, subtract, multiply, integer-divide, remainder.
|
||||
order: 0
|
||||
---
|
||||
|
||||
Add, subtract, multiply, integer-divide, remainder. On <code>fixed</code> values the same symbols do fixed-point math.
|
||||
11
docs/language/operators/op-assign.md
Normal file
11
docs/language/operators/op-assign.md
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
id: op-assign
|
||||
name: Assignment
|
||||
category: operators
|
||||
kind: operator
|
||||
sig: name = value
|
||||
tip: Assign to a var, a field, or an element.
|
||||
order: 5
|
||||
---
|
||||
|
||||
Assign to a <code>var</code>, a field, or an element. Not an expression.
|
||||
11
docs/language/operators/op-bitwise.md
Normal file
11
docs/language/operators/op-bitwise.md
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
id: op-bitwise
|
||||
name: Bitwise
|
||||
category: operators
|
||||
kind: operator
|
||||
sig: & | ^ ~ << >>
|
||||
tip: And, or, xor, not, shift left/right.
|
||||
order: 3
|
||||
---
|
||||
|
||||
And, or, xor, not, shift left/right. Shifts and <code>&</code> bind like <code>*</code>; <code>|</code>/<code>^</code> bind like <code>+</code> — tighter than comparison, so <code>flags & MASK == 0</code> needs no parentheses.
|
||||
11
docs/language/operators/op-comment.md
Normal file
11
docs/language/operators/op-comment.md
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
id: op-comment
|
||||
name: Comment
|
||||
category: operators
|
||||
kind: operator
|
||||
sig: # to end of line
|
||||
tip: Everything after # on a line is a comment.
|
||||
order: 9
|
||||
---
|
||||
|
||||
Everything after <code>#</code> on a line is a comment.
|
||||
11
docs/language/operators/op-compare.md
Normal file
11
docs/language/operators/op-compare.md
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
id: op-compare
|
||||
name: Comparison
|
||||
category: operators
|
||||
kind: operator
|
||||
sig: == != < <= > >=
|
||||
tip: Yield a bool.
|
||||
order: 1
|
||||
---
|
||||
|
||||
Yield a <code>bool</code>. On strings, <code>==</code> compares contents.
|
||||
15
docs/language/operators/op-interp.md
Normal file
15
docs/language/operators/op-interp.md
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
id: op-interp
|
||||
name: String interpolation
|
||||
category: operators
|
||||
kind: operator
|
||||
sig: `text {expr} more`
|
||||
tip: A backtick string with {expr} holes, each stringified and concatenated.
|
||||
order: 7
|
||||
---
|
||||
|
||||
A backtick string with <code>{expr}</code> holes, each stringified and concatenated. <code>{{</code> and <code>}}</code> are literal braces.
|
||||
|
||||
```ludic
|
||||
print(`score: {score}`)
|
||||
```
|
||||
11
docs/language/operators/op-literals.md
Normal file
11
docs/language/operators/op-literals.md
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
id: op-literals
|
||||
name: Literals
|
||||
category: operators
|
||||
kind: operator
|
||||
sig: 42 0x1E90FF 'w' "text" true null
|
||||
tip: Decimal and hex ints (hex is how colors are written), a character code in single quotes, a string in double quotes, booleans, and the null pointer.
|
||||
order: 8
|
||||
---
|
||||
|
||||
Decimal and hex ints (hex is how colors are written), a character code in single quotes, a string in double quotes, booleans, and the null pointer.
|
||||
15
docs/language/operators/op-logical.md
Normal file
15
docs/language/operators/op-logical.md
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
id: op-logical
|
||||
name: Logical
|
||||
category: operators
|
||||
kind: operator
|
||||
sig: and or not
|
||||
tip: Boolean combinators — words, not symbols.
|
||||
order: 2
|
||||
---
|
||||
|
||||
Boolean combinators — words, not symbols.
|
||||
|
||||
```ludic
|
||||
if k != 0 and mode == 0 { … }
|
||||
```
|
||||
11
docs/language/operators/op-range.md
Normal file
11
docs/language/operators/op-range.md
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
id: op-range
|
||||
name: Range
|
||||
category: operators
|
||||
kind: operator
|
||||
sig: a .. b
|
||||
tip: A half-open range for for loops: a up to but not including b.
|
||||
order: 4
|
||||
---
|
||||
|
||||
A half-open range for <code>for</code> loops: <code>a</code> up to but not including <code>b</code>.
|
||||
Loading…
Add table
Add a link
Reference in a new issue