npm.io
0.4.0 • Published 5d ago

@generative-dom/preset-markdown

Licence
MIT
Version
0.4.0
Deps
9
Size
7 kB
Vulns
0
Weekly
0

@generative-dom/preset-markdown

The eight CommonMark plugins of Generative DOM bundled as a single zero-config preset. Drop it in when you want full Markdown without the kitchen-sink of @generative-dom/preset-all.

Installation

pnpm add @generative-dom/core @generative-dom/preset-markdown

Usage

import { GenerativeDom } from '@generative-dom/core';
import { markdownPreset } from '@generative-dom/preset-markdown';

const md = new GenerativeDom(container, { plugins: markdownPreset() });
md.push('# Hello\n\nWorld\n');

What's inside

Plugin Covers
@generative-dom/plugin-markdown-base Paragraphs, line breaks, escaping, horizontal rules
@generative-dom/plugin-markdown-inline Emphasis, strong, code spans, autolinks
@generative-dom/plugin-markdown-heading ATX and Setext headings
@generative-dom/plugin-markdown-code Indented and fenced code blocks
@generative-dom/plugin-markdown-quote Block quotes (incl. nested)
@generative-dom/plugin-markdown-list Ordered and unordered lists, task lists
@generative-dom/plugin-markdown-link Links and images, including reference style
@generative-dom/plugin-markdown-table GFM-style pipe tables

When to use

  • @generative-dom/preset-markdown — pure CommonMark, smallest install
  • @generative-dom/preset-llm — adds syntax highlighting, custom elements, interactive components, event delegation
  • @generative-dom/preset-all — everything zero-config

License

MIT

Keywords