Bindings
Roots
What `{{ path }}`, `:prop="path"` and `::prop="path"` can point to.
Comark renderers resolve bindings against { frontmatter, meta, data, props }. The editor completes the same roots, segment by segment:
| Root | Keys come from | Offered |
|---|---|---|
frontmatter | this document's frontmatter, parsed live | always |
props | the nearest enclosing component that has its own attributes: its attribute block, its YAML props block, manifest defaults | inside such a component (not on its own opener) |
data | the host's data / dataSchema | when configured |
meta | the host's meta / metaSchema, plus plugins (title, description, toc, summary) | when configured or a plugin adds keys |
| loop variables | scope of an enclosing component, e.g. ::for | inside it |
---
site:
name: My Blog
---
Welcome to {{ frontmatter.site.name || our site }}.
::card{title="Hello" variant="ghost"}
:badge{:label="props.title"}
::
- Objects show
›and drill in with → or .; leaves show their current value. - After a complete path and a space,
||adds a fallback; the next menu offers the current value. :prop="…"on a boolean prop also offerstrueandfalse.::prop="…"(two-way) only offers writable roots —databy default.- Paths that do not start with a root (
$doc.snippet.link) are passed through by comark and left alone.
Lint and hover
A path that leaves a known shape is reported with a suggestion — frontmatter.titel → "did you mean title?" — and a quick fix. The frontmatter is always known completely; data is known completely when you give a schema. Hover shows a path's current value.