litedown
v0.0.1
Published
A lightweight, streaming-first Markdown renderer with native MathML and Prism highlighting
Maintainers
Readme
LiteDown
A lightweight, streaming-first Markdown renderer.
Installation
npm install litedownQuick Start
import { litedown } from 'litedown';
import 'litedown/styles.css';
function MyChat({ markdown, isStreaming }) {
return (
<litedown.Streaming
content={markdown}
isStreaming={isStreaming}
theme="glass"
/>
);
}
// Or use it directly as a function
const html = litedown("# Hello World");Advanced Usage
import { render, useStreamdown } from 'litedown';
// Streaming hook for custom implementations
const { html, push, finish } = useStreamdown();
// Direct rendering for static content
const staticHtml = render(markdownText);6.2 Build and Test Locally
# Build the library
npm run build:lib
# Check dist folder contains:
# - index.js (ESM)
# - index.umd.cjs (CommonJS)
# - index.d.ts (TypeScript declarations)
# - index.css (Styles)
# Test locally
npm pack # Creates a tarball
npm install ./litedown-1.0.0.tgz # Test installFeatures
- Streaming-first architecture
- Native MathML support
- Prism syntax highlighting
- Callout support
- Mermaid diagrams
- TypeScript support
License
MIT © AbhinavTheDev
