Guides
Presets
Nizel exposes built-in option bundles for common use cases.
Available Presets
blog
Optimized for blog content:
const nizel = useNizel({ preset: 'blog' });
// frontmatter: true
// toc: true
// anchors: true
// elements: { time: { class: 'nizel-date' } }
docs
Optimized for documentation:
const nizel = useNizel({ preset: 'docs' });
// toc: true
// anchors: true
// elements: { h2: { class: 'nizel-docs-heading' }, code: { class: 'nizel-code' } }
email
Optimized for email HTML:
const nizel = useNizel({ preset: 'email' });
// safe: true
// anchors: false
// autolinks: { enabled: true }
// elements: {
// a: { attr: { target: undefined, rel: undefined } },
// table: { attr: { role: 'presentation', cellpadding: '0', cellspacing: '0', border: '0' } },
// }
minimal
Minimal processing, no extras:
const nizel = useNizel({ preset: 'minimal' });
// frontmatter: false
// template: false
// toc: false
// anchors: false
// autolinks: false
Override Preset Options
Presets set defaults. You can override individual options:
const nizel = useNizel({
preset: 'blog',
toc: false, // disable TOC from the blog preset
});
Guides
More Pages
-
Getting Started
The main call returns a structured object:
-
API Reference
Creates a Nizel processor instance.
-
Result Object
Nizel returns a structured result object from every parse call.
-
Pipeline
Nizel processes content in a predictable order.
-
Template Variables
Nizel supports variable injection before Markdown parsing. Use
{{ expression }}syntax in both frontmatter and body content. -
Filters
Filters transform template values before Markdown parsing. Nizel includes built-in filters from
@sil/formatand@sil/case. -
Frontmatter
Nizel extracts a leading frontmatter block before template rendering and Markdown parsing.
-
Table of Contents
Nizel collects headings into
result.tocwhentoc: trueis set. -
Elements
Elements control how HTML is generated from the AST. You can customize tag names, attributes, and classes for any element type.
-
Plugins
Plugins bundle functionality into reusable extensions that hook into the Nizel pipeline.
-
NizelKit for Native Apps
nizel-kitis the browser/WebView bundle for native apps that want Nizel rendering with user-selectable plugins. -
Styling
nizel-styleships scoped CSS for rendered Markdown content and official Nizel plugin output. -
Nizel Format
nizel-formatformats Markdown source text. Use it when an app needs consistent Markdown before saving, syncing, or rendering. -
Safety
Safe output is enabled by default in Nizel.
-
Testing
Nizel's test suite protects the Markdown behavior documented for the package.
-
Transforms
Transforms receive the normalized AST after parsing and before rendering. They let you modify the content tree programmatically.
-
Benchmarks
Per-plugin overhead can be measured with:
-
HTML to Markdown
Nizel exposes
htmlToMarkdown(html, options)for importing semantic HTML into Markdown.