Add shared card schemas layouts and renderer

This commit is contained in:
mpabi
2026-07-15 08:41:20 +02:00
commit 65299458ed
19 changed files with 7786 additions and 0 deletions
+134
View File
@@ -0,0 +1,134 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Layout karty pracy",
"description": "Schemat pliku templates/karta-*.json używanego przez render_card.py.",
"type": "object",
"required": [
"schema",
"id",
"name",
"version",
"description",
"tokens",
"emitters"
],
"properties": {
"$schema": {
"type": "string"
},
"schema": {
"const": "esc-card-template.v1"
},
"id": {
"type": "string",
"pattern": "^[a-z0-9][a-z0-9-]*$"
},
"name": {
"type": "string",
"minLength": 1
},
"version": {
"type": "string",
"minLength": 1
},
"approved": {
"type": "string"
},
"description": {
"type": "string",
"minLength": 1
},
"tokens": {
"type": "object",
"properties": {
"page": {
"type": "object",
"properties": {
"format": {
"type": "string"
},
"orientation": {
"enum": ["portrait", "landscape"]
},
"width_px": {
"type": "number",
"exclusiveMinimum": 0
},
"height_px": {
"type": "number",
"exclusiveMinimum": 0
}
},
"additionalProperties": true
},
"grid": {
"type": "object",
"properties": {
"columns": {
"type": "array",
"minItems": 3,
"items": {
"type": "string"
}
},
"left_role": {
"type": "string"
},
"right_role": {
"type": "string"
},
"geometry_cm": {
"type": "object",
"additionalProperties": {
"type": "number"
}
}
},
"additionalProperties": true
},
"typography": {
"type": "object",
"additionalProperties": true
},
"colors": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"additionalProperties": true
},
"components": {
"type": "object",
"additionalProperties": true
},
"block_map": {
"type": "object",
"additionalProperties": true
},
"emitters": {
"type": "object",
"required": ["html", "latex"],
"properties": {
"html": {
"enum": ["classic", "5a", "5b"]
},
"latex": {
"enum": ["classic", "5a", "5b"]
}
},
"additionalProperties": false
},
"limitations": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"additionalProperties": true
}