Guide

Frontmatter

Set global Flint defaults in Comark document frontmatter. Per-directive attrs override frontmatter values.

Set global defaults in the document frontmatter under the flint key. Per-directive attrs always take precedence.

Set global defaults

defaults.md
---
flint:
  backend: vegalite
  theme: economist
  output: component
  width: 560
  height: 320
---

::flint{spec='{"chart_spec":{"chartType":"Bar Chart",...}}'}
::

Apply theme via frontmatter

The theme attr and frontmatter flint.theme are injected into theme_spec before assembly. A value already present in theme_spec inside the JSON spec takes precedence.

Layer plugin factory defaults

Pass defaults via the plugin factory — frontmatter values override these:

plugin.ts
import flint from 'comark-flint-chart'

const plugins = [
  flint({
    flint: {
      backend: 'vegalite',
      theme: 'economist',
      output: 'component',
      width: 560,
      height: 320,
    },
  }),
]

Precedence (lowest to highest):

  1. Plugin factory flint({ flint: { … } })
  2. Document frontmatter flint:
  3. Fence meta and directive attrs
Copyright © 2026