Skip to main content

Crate md_tmpl_core

Crate md_tmpl_core 

Source

Modules§

consts
Template grammar constants, syntax characters, and utility functions.

Macros§

ctx
Construct a Context with JSON-like syntax.

Structs§

CompileOptions
Configuration for template compilation.
Context
Template rendering context — holds all variables available during rendering.
DeError
Error type for Value-to-Deserialize conversion.
Frontmatter
Parsed YAML frontmatter from a .tmpl.md file.
Import
A template import declaration: [stem](path.tmpl.md).
ImportedNamespace
Resolved namespace from an imported template.
SerError
Error type for serde-to-Value conversion.
SyntaxError
A structured syntax error with optional line number and source context.
Template
A parsed template ready for rendering.
TemplateCache
A template compilation cache parameterised over a BuildHasher for content-addressed invalidation.
TypeCheckError
Structured error from VarType::check with the path to the mismatch.
ValueTypeError
Error returned when a Value is the wrong variant for a conversion.
VarDecl
A variable declaration: name + type + optional default.
VariantDecl
A variant declaration inside an enum type.

Enums§

TemplateError
Errors produced by the template engine.
Value
A value that can be inserted into a template.
VarType
Expected type of a template variable.

Constants§

BUILTIN_TYPE_NAMES
Names of all built-in types. Used for shadowing checks in validation.

Functions§

extract_template_stem
Extract the template stem (filename without extensions) from a path.
from_value
Convert a Value back into any Deserialize type.
load_template
Load a named template from a directory.
parse_frontmatter
Parse YAML frontmatter delimited by --- lines.
parse_frontmatter_with_env
Parse YAML frontmatter with compile-time environment values.
parse_type_annotation
Parses a type annotation string into a VarType.
resolve_imports
Resolve imports by reading referenced template files and extracting their type information.
resolve_imports_with_consts
Resolve imports with available constants for path interpolation.
strip_frontmatter
Strip YAML frontmatter delimited by --- and return only the body text.
to_pascal_case
Convert a snake_case, kebab-case, or other string to PascalCase.
to_value
Convert any Serialize type into a Value.