@primeui-devkit/lit-markdown
v0.1.0-rc.6
Published
Lit renderer for the PrimeUI DevKit markdown AST with built-in prose behaviors: heading anchors, code copy button and table scroll wrapper. Renders into light DOM so shared prose styles apply.
Readme
@primeui-devkit/lit-markdown
Lit renderer for the markdown AST. Renders into light DOM so shared prose styles apply; heading anchors, code copy button and table scroll wrapper are built in.
import { defineLitMarkdown } from '@primeui-devkit/lit-markdown';
defineLitMarkdown(); // registers <lit-markdown>
const el = document.createElement('lit-markdown');
el.tree = tree; // pre-parsed MarkdownTree (or set el.markdown for runtime parse)
el.components = { 'demo-viewer': (props, children) => myDemoNode(props) };
document.body.append(el);