createMarkdownRenderer #
Creates a standalone Markdown renderer for build-time tools such as demo source loaders. It has the same asynchronous rendering shape as the site compiler, without creating a page or running site plugins.
Usage #
TypeScript
import { createMarkdownRenderer } from 'kawapress'
const markdown = await createMarkdownRenderer()
const html = await markdown.renderAsync('# Hello')Parameters
optionsoptionalMarkdownRendererOptions
Whether to allow raw HTML, and how to highlight code.
default {}
htmloptionalboolean
Whether raw HTML in Markdown is rendered. Defaults to true.
highlightoptional((str: string, lang: string, attrs: string, env: MarkdownExitEnv) => string | Promise<string>) | null
Optional code-fence highlighter, for example from @kawapress/plugin-shiki.
Returns The Markdown renderer.
Full type signature
TypeScript
function createMarkdownRenderer(options?: MarkdownRendererOptions): Promise<MarkdownExit>

Comments