✨ Publier v1 is live — a polished docs platform built for the open web.
Skip to content

Plugins

Extend the MDX pipeline with remark and rehype plugins.

Publier builds on Astro’s MDX pipeline, so any remark or rehype plugin from the ecosystem works. Publier registers the standard plugins automatically; you can add more in astro.config.ts.

Built-in plugins (auto-wired)

You do not need to register these manually:

PluginWhat it does
Container directivesParses :::note, :::tip, etc.
AsidesConverts directive nodes to <Aside> callout HTML
GitHub Flavored MarkdownTables, strikethrough, task lists, autolinks
Heading anchorsWraps headings with anchor links

Opt-in plugins (enabled via integration options)

astro.config.ts
docsShell({
math: true, // KaTeX math rendering (install peer deps first)
mermaid: true, // Mermaid diagrams (auto-detected; explicitly force-enable here)
snippets: { directory: 'src/content/snippets' }, // reusable MDX fragments
})

Adding extra remark plugins

Add custom remark plugins alongside the Publier integration — they append after the built-ins:

astro.config.ts
import remarkSmartypants from 'remark-smartypants';
import tailwind from '@tailwindcss/vite';
import { defineConfig } from 'astro/config';
import { docsShell } from '@publier/shell/integration';
export default defineConfig({
integrations: [docsShell()],
markdown: {
remarkPlugins: [
[remarkSmartypants, { dashes: 'oldschool' }],
],
},
vite: { plugins: [tailwind()] },
});

Plugins in markdown.remarkPlugins run after Publier’s built-ins.

Adding rehype plugins

Same pattern — append to markdown.rehypePlugins:

import rehypeExternalLinks from 'rehype-external-links';
export default defineConfig({
// ...
markdown: {
rehypePlugins: [
[rehypeExternalLinks, { target: '_blank', rel: ['noopener', 'noreferrer'] }],
],
},
});

Plugin execution order

  1. Publier’s built-in plugins (directive → callouts → GFM)
  2. User markdown.remarkPlugins (appended by Astro after integrations)
  3. Rehype plugins in the same order

If you need a plugin to run before Publier’s built-ins, email [email protected] — configurable plugin ordering is planned.