Skip to content
ironmark

Which function should I use?

GoalFunction
Several outputs from one inputironmark.parse(input): see Documents
Render Markdown to HTMLmarkdownToHtml(input, options?): see HTML
Plain text (search, excerpts)markdownToText(input, options?): see Plain text
Parse Markdown to an AST objectmarkdownToAst(input, options?): see AST
Normalize or round-tripmarkdownToAst() + astToMarkdown()
Terminal or CLI outputmarkdownToAnsi(input, options?): see Terminal
Convert HTML back to MarkdownhtmlToMarkdown(html, options?) / htmlToAst(html, options?)
Compile MDX to JSXmdxToJsx(input, options?): see MDX
Import .md or .mdx filesironmark/vite, /esbuild, …: see Build tool plugins
Render from the shellnpx ironmark README.md: see CLI
Use it from Rustrender_html(input, &options): see Rust

Documents or functions?

Use a document when you need more than one output from the same input, such as HTML plus a table of contents plus an excerpt. The document keeps the source and options together, so every output agrees on them.

Use a function when you need one output. ironmark.html(md) is the same as ironmark.parse(md).html(), and markdownToHtml(md) is the same again as a named export.