Guide
Dual syntax
Author Flint charts in Comark with fenced flint code blocks or ::flint component directives. Both compile to the same Flint AST node.
Both entry points compile to the same <Flint> AST node.
Write a static spec in a fenced block
The fenced block content is a ChartAssemblyInput JSON string. Backend and theme are Comark fence meta key=value tokens (backend="…" theme="…"). Curly braces in the info string are line highlights, not chart attrs.
fenced-block.md
```flint backend="vegalite" theme="economist"
{
"data": { "values": [{ "month": "Jan", "revenue": 120000 }] },
"semantic_types": { "month": "Time", "revenue": "Money" },
"chart_spec": {
"chartType": "Bar Chart",
"encodings": {
"x": { "field": "month" },
"y": { "field": "revenue" }
},
"baseSize": { "width": 560, "height": 320 }
}
}
```
Bind a dynamic spec with a directive
directive.md
::flint{:spec="dashboard.kpiChart" backend="vegalite" theme="swiss"}
::
:spec="path.to.spec" is a Comark binding expression. The plugin resolves the dotted path against the document frontmatter at parse time.
Handle unresolvable bindings
Unresolvable paths (runtime data bindings) are left unchanged in the AST so the renderer can evaluate them at request time.
Non-prefixed attrs (backend="…") are always treated as literal strings, consistent with Comark's binding plugin behaviour.
See Bindings for the full matrix.