docs-pipeline
Markdown rendering and syntax highlighting pipeline for documentation sites, extracted from the Tachyon knowledge base renderer.
Modules
- [
markdown] — markdown → HTML/plain-text/AST rendering with GFM, wikilinks, admonitions, embeds, block references, TOC extraction, and ammonia-based sanitization. - [
syntax] — tree-sitter based syntax highlighting with per-language cargo features (lang-rust,lang-python, …), themeable CSS output, and rendered-HTML code block highlighting. - [
latex] — KaTeX equation rendering with$/$$placeholder handling that skips<pre>/<code>content. - [
embeds] — whitelisted rich-media embed rendering (YouTube, Figma, Gist, CodePen, tweets) as sandboxed iframes. - [
sanitize] — standalone HTML sanitization. - [
types] — render options, output formats, results, metadata, themes, and supported languages. - [
error] — the pipeline error type.
Example
use ;
let md = "# Getting Started\n\nSome **bold** text.";
let html = render_markdown;
assert!;
let toc = extract_toc;
assert_eq!;
assert_eq!;
Syntax highlighting example
use SyntaxHighlighter;
let hl = new;
assert!;
let html = hl.highlight_or_fallback;
assert!;