Sätteri · Astro 7

Remark and rehype plugins, ported to Sätteri

Remark and rehype plugins ported to Sätteri, the Rust Markdown engine behind Astro 7. Ten plugins, each checked against the output of the original.

npm install <plugin>

Install the plugins you need one at a time. Each plugin's page shows its own install command and usage.

All plugins

Use with Astro

Pass the plugins to Astro's Sätteri processor. Each plugin is a function you call with its options.

// astro.config.mjs
import { satteri } from "@astrojs/markdown-satteri";
import { satteriSlug } from "satteri-slug";
import { satteriCitation } from "satteri-citation";

export default defineConfig({
  markdown: {
    processor: satteri({
      mdastPlugins: [
        satteriCitation({ bibliography: "./src/refs.bib" }),
      ],
      hastPlugins: [satteriSlug()],
    }),
  },
});

Some plugins run on the Markdown tree (MDAST) and others on the HTML tree (HAST). Each plugin page says which, because the order of plugins in each list matters.

Why these exist

Astro 7 compiles Markdown with Sätteri, which does not run remark or rehype plugins. These packages restore the behaviour of the originals, with the same output checked against them, so existing sites keep working.

Read the demo to see every plugin running in a real Astro build, or the MDX page for the MDX side. The source, tests and changelogs are on GitHub.