Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 125 additions & 0 deletions examples/comprehensive-document/content/document.json
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,131 @@
"type": "horizontalRule",
"id": "hr-9"
},
{
"type": "heading",
"id": "admonition-heading",
"level": 2,
"children": [
{ "type": "text", "value": "Admonitions" }
]
},
{
"type": "paragraph",
"id": "admonition-intro",
"children": [
{ "type": "text", "value": "Admonition blocks highlight important information with visual callouts:" }
]
},
{
"type": "admonition",
"id": "admonition-note",
"variant": "note",
"children": [
{
"type": "paragraph",
"children": [
{ "type": "text", "value": "This is a note admonition. Use it for supplementary information that readers may find helpful." }
]
}
]
},
{
"type": "admonition",
"id": "admonition-warning",
"variant": "warning",
"title": "Caution Required",
"children": [
{
"type": "paragraph",
"children": [
{ "type": "text", "value": "Warning admonitions highlight potential issues or important considerations." }
]
}
]
},
{
"type": "admonition",
"id": "admonition-tip",
"variant": "tip",
"children": [
{
"type": "paragraph",
"children": [
{ "type": "text", "value": "Tip admonitions provide helpful suggestions and best practices." }
]
}
]
},
{
"type": "admonition",
"id": "admonition-danger",
"variant": "danger",
"children": [
{
"type": "paragraph",
"children": [
{ "type": "text", "value": "Danger admonitions warn about critical issues that could cause serious problems." }
]
}
]
},
{
"type": "horizontalRule",
"id": "hr-admonition"
},
{
"type": "heading",
"id": "subfigure-heading",
"level": 2,
"children": [
{ "type": "text", "value": "Subfigures" }
]
},
{
"type": "paragraph",
"id": "subfigure-intro",
"children": [
{ "type": "text", "value": "Multi-panel figures with individual sub-captions:" }
]
},
{
"type": "figure",
"id": "fig-comparison",
"subfigures": [
{
"id": "fig-comparison-a",
"label": "a",
"children": [
{
"type": "image",
"src": "assets/images/before.png",
"alt": "Sample before processing"
}
],
"caption": "Before processing"
},
{
"id": "fig-comparison-b",
"label": "b",
"children": [
{
"type": "image",
"src": "assets/images/after.png",
"alt": "Sample after processing"
}
],
"caption": "After processing"
}
],
"caption": [
{ "type": "text", "value": "Comparison of sample images showing the effects of processing. (a) Original sample. (b) Processed sample with enhanced contrast." }
],
"numbering": "auto"
},
{
"type": "horizontalRule",
"id": "hr-subfigure"
},
{
"type": "heading",
"id": "i18n-heading",
Expand Down
29 changes: 29 additions & 0 deletions schemas/academic.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,35 @@
"title": "Codex Academic Extension",
"description": "Schema for academic extension blocks and marks in a Codex document",
"$defs": {
"abstractBlock": {
"type": "object",
"description": "Abstract block for papers and reports",
"required": ["type"],
"properties": {
"type": { "const": "academic:abstract" },
"children": {
"type": "array",
"description": "Abstract content (paragraph blocks)"
},
"keywords": {
"type": "array",
"description": "List of keywords/key phrases",
"items": { "type": "string" }
},
"sections": {
"type": "object",
"description": "Structured abstract sections",
"additionalProperties": {
"type": "array",
"description": "Section content (paragraph blocks)"
}
}
},
"oneOf": [
{ "required": ["children"] },
{ "required": ["sections"] }
]
},
"theoremVariant": {
"type": "string",
"description": "Built-in theorem-like environment variants",
Expand Down
81 changes: 80 additions & 1 deletion schemas/content.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@
{
"if": { "properties": { "type": { "const": "break" } } },
"then": { "$ref": "#/$defs/break" }
},
{
"if": { "properties": { "type": { "const": "admonition" } } },
"then": { "$ref": "#/$defs/admonition" }
}
]
},
Expand Down Expand Up @@ -647,7 +651,7 @@
},
"figure": {
"type": "object",
"required": ["type", "children"],
"required": ["type"],
"properties": {
"type": { "const": "figure" },
"numbering": {
Expand All @@ -662,6 +666,59 @@
"description": "Figure content and optional caption",
"minItems": 1,
"maxItems": 2
},
"subfigures": {
"type": "array",
"description": "Array of subfigure objects for multi-panel figures",
"items": { "$ref": "#/$defs/subfigure" },
"minItems": 1
},
"caption": {
"oneOf": [
{ "type": "string", "description": "Simple caption text" },
{
"type": "array",
"description": "Rich caption with text nodes",
"items": { "$ref": "#/$defs/textNode" }
}
],
"description": "Overall figure caption (used with subfigures)"
}
},
"oneOf": [
{ "required": ["children"] },
{ "required": ["subfigures"] }
]
},
"subfigure": {
"type": "object",
"description": "A subfigure within a multi-panel figure",
"required": ["children"],
"properties": {
"id": {
"type": "string",
"description": "Unique subfigure identifier for cross-referencing"
},
"label": {
"type": "string",
"description": "Subfigure label (e.g., 'a', 'b', 'i', 'ii')"
},
"children": {
"type": "array",
"description": "Content block(s) for this subfigure",
"items": { "$ref": "#/$defs/block" },
"minItems": 1
},
"caption": {
"oneOf": [
{ "type": "string", "description": "Simple caption text" },
{
"type": "array",
"description": "Rich caption with text nodes",
"items": { "$ref": "#/$defs/textNode" }
}
],
"description": "Subfigure-specific caption"
}
}
},
Expand All @@ -675,6 +732,28 @@
"items": { "$ref": "#/$defs/textNode" }
}
}
},
"admonition": {
"type": "object",
"description": "Callout box for notes, warnings, tips, and other highlighted content",
"required": ["type", "variant", "children"],
"properties": {
"type": { "const": "admonition" },
"variant": {
"type": "string",
"description": "Admonition type",
"enum": ["note", "tip", "info", "warning", "caution", "danger", "important", "example"]
},
"title": {
"type": "string",
"description": "Custom title (defaults to variant label)"
},
"children": {
"type": "array",
"description": "Block-level content (typically paragraph blocks)",
"items": { "$ref": "#/$defs/block" }
}
}
}
}
}
89 changes: 89 additions & 0 deletions schemas/presentation.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,44 @@
"additionalProperties": {
"$ref": "#/$defs/style"
}
},
"typography": {
"type": "object",
"description": "Document-level typography settings",
"properties": {
"hyphenation": {
"type": "object",
"description": "Hyphenation settings",
"properties": {
"enabled": { "type": "boolean" },
"language": { "type": "string" },
"minWordLength": { "type": "integer", "minimum": 1 },
"minBefore": { "type": "integer", "minimum": 1 },
"minAfter": { "type": "integer", "minimum": 1 },
"maxConsecutive": { "type": "integer", "minimum": 1 }
}
},
"widows": {
"type": "integer",
"description": "Minimum lines at top of page",
"minimum": 1
},
"orphans": {
"type": "integer",
"description": "Minimum lines at bottom of page",
"minimum": 1
},
"baselineGrid": {
"type": "object",
"description": "Baseline grid settings",
"properties": {
"enabled": { "type": "boolean" },
"lineHeight": { "type": "string" },
"offset": { "type": "string" }
}
},
"lineNumbering": { "$ref": "#/$defs/lineNumbering" }
}
}
},
"$defs": {
Expand Down Expand Up @@ -271,6 +309,57 @@
}
]
},
"lineNumbering": {
"type": "object",
"description": "Line numbering configuration for margins",
"required": ["enabled"],
"properties": {
"enabled": {
"type": "boolean",
"description": "Whether line numbering is active"
},
"start": {
"type": "integer",
"description": "Starting line number",
"minimum": 1,
"default": 1
},
"interval": {
"type": "integer",
"description": "Number every N lines (1 = every line, 5 = every 5th line)",
"minimum": 1,
"default": 1
},
"side": {
"type": "string",
"description": "Which margin to display numbers",
"enum": ["left", "right"],
"default": "left"
},
"restart": {
"type": "string",
"description": "When to restart numbering",
"enum": ["page", "section", "none"],
"default": "page"
},
"scope": {
"type": "array",
"description": "Block types to number (if omitted, all content is numbered)",
"items": { "type": "string" }
},
"style": {
"type": "object",
"description": "Styling for line numbers",
"properties": {
"fontSize": { "type": "string" },
"color": { "type": "string" },
"fontFamily": { "type": "string" },
"marginRight": { "type": "string" },
"marginLeft": { "type": "string" }
}
}
}
},
"style": {
"type": "object",
"properties": {
Expand Down
Loading