Create a Template Schema
Author a Cuddler Template Schema that defines a markdown-compliant template document without weakening data validation.
How a Template Schema should be authored
The Template Schema starts from validated data and then describes the final markdown-template structure that should be rendered.
Do not invent the markdown-template contract from vague layout ideas alone.
Constrain headings, tables, lists, and other structure directly in schema logic.
Describe rendering behavior without trying to redefine the data contract.
Check the markdown-template contract after the data contract is already sound.
Presentation is a separate contract, not an override for bad data.
A Template Schema defines the template document contract, not the source-of-truth facts. It should describe the final markdown-compliant template structure that will be rendered later, while leaving the data contract intact.
Recommended sequence
- Start from the final reader-visible template structure you need to publish.
- Constrain headings, paragraphs, tables, lists, images, and other markdown blocks directly in schema logic.
- Keep template-specific instructions focused on the authored template document and renderer behavior.
- Validate the template document on its own after the data contract is already sound.
Keep the boundary clean
- Data validation comes first.
- Template validation comes second.
- Template rules should not override a bad or missing data contract.
- Rendered output should stay predictable once the template document validates.
Good template habits
- Make the markdown structure explicit instead of leaving headings or sections implied.
- Keep table headers, list types, and renderer options deterministic.
- Write safe rendering behavior as the default, not the exception.
