npm.io
0.1.1 • Published 1 week ago

@lesto/content-markdown

Licence
MIT
Version
0.1.1
Deps
13
Size
84 kB
Vulns
0
Weekly
0

@lesto/content-markdown

Markdown rendering for Docks content collections.

Installation

npm install @lesto/content-markdown

Quick Start

import { render } from "@lesto/content-markdown";

const result = await render("# Hello World");
console.log(result.html);
// <h1 id="hello-world">Hello World</h1>

Features

  • Syntax highlighting with Shiki
  • GitHub Flavored Markdown support
  • Auto-generated heading IDs
  • Copy buttons for code blocks
  • Reading time calculation
  • Heading extraction for table of contents

Render Options

const result = await render(content, {
  syntaxHighlighting: true,
  copyButtons: true,
  sanitize: true,
});

result.html; // Rendered HTML
result.headings; // Extracted headings
result.readingTime; // { minutes, words }

Documentation

Full documentation at usedocks.dev

License

MIT