Guide

Bindings

How comark-flint-chart resolves literal specs, frontmatter paths, and runtime binding expressions.
SyntaxBehaviour
spec='{"…"}'Literal JSON — compiled at parse time
:spec="path.to.spec"Dotted frontmatter path — resolved at parse time
:spec="live.data" (missing)Left unchanged — resolved by renderer at request time
backend="vegalite"Literal string — always
theme="economist"Literal string — always

Compile a literal spec at parse time

literal.md
::flint{spec='{"data":{"values":[]},"chart_spec":{"chartType":"Bar Chart",...}}'}
::

The JSON string is parsed and assembled immediately.

Resolve a frontmatter path

frontmatter-path.md
::flint{:spec="dashboard.kpiChart" backend="vegalite"}
::

With frontmatter:

frontmatter.md
---
dashboard:
  kpiChart:
    data:
      values: [{ month: Jan, revenue: 120000 }]
    chart_spec:
      chartType: Bar Chart
      ...
---

Leave runtime bindings for the renderer

runtime.md
::flint{:spec="live.metrics" backend="vegalite"}
::

When live.metrics is not available at parse time, the node stays in the AST. Your Vue app resolves it when data arrives.

Keep backend and theme literal

Non-prefixed attrs are always literal strings, even inside a directive that uses :spec:

literal-attrs.md
::flint{:spec="charts.revenue" backend="vegalite" theme="economist"}
::
Copyright © 2026