Skip to content

Built-in Plugins

Generative DOM ships with a set of official plugins that cover standard markdown syntax and several stress-test extensions. All plugins are available from the @generative-dom/plugins package.

Standard Markdown Plugins

PluginFactoryPriorityHandles
markdown-basemarkdownBase()300Paragraphs, line breaks, escaping, horizontal rules
markdown-inlinemarkdownInline()200Bold, italic, strikethrough, inline code
markdown-headingmarkdownHeading()100ATX headings (h1--h6)
markdown-codemarkdownCode()100Fenced code blocks
markdown-quotemarkdownQuote()100Blockquotes (including nested)
markdown-listmarkdownList()100Ordered and unordered lists
markdown-linkmarkdownLink()200Links, images, autolinks

Stress Test Plugins

PluginFactoryPriorityHandles
highlighthighlight()95Syntax highlighting for code blocks
custom-elementscustomElements()50Custom Web Components (<md-clock>, <md-plot>, <md-counter>)
eventsevents()40Invisible event elements (<progress>, <status>, <milestone>)
interactiveinteractive()45Interactive elements (<md-button>, <md-toggle>, <md-input>)

Import

ts
// Import all plugins from the umbrella package
import {
  markdownBase,
  markdownInline,
  markdownHeading,
  markdownCode,
  markdownQuote,
  markdownList,
  markdownLink,
  highlight,
  customElements,
  events,
  interactive,
} from '@generative-dom/plugins';

Minimal

For plain text with headings:

ts
const plugins = [markdownBase(), markdownHeading()];

Standard

Full markdown support without extensions:

ts
const plugins = [
  markdownBase(),
  markdownInline(),
  markdownHeading(),
  markdownCode(),
  markdownQuote(),
  markdownList(),
  markdownLink(),
];

Full

All plugins including extensions:

ts
const plugins = [
  markdownBase(),
  markdownInline(),
  markdownHeading(),
  markdownCode(),
  markdownQuote(),
  markdownList(),
  markdownLink(),
  highlight(),
  customElements(),
  events(),
  interactive(),
];

Plugin Options

Some plugins accept configuration through their factory functions:

ts
highlight({
  languages: ['javascript', 'typescript', 'html', 'css', 'json'],
  theme: 'dark',
})

customElements({
  allowedTags: ['md-clock', 'md-plot', 'md-counter'],
})

See each plugin's documentation page for available options.