docs-pipeline 0.1.0

Markdown rendering and tree-sitter syntax highlighting pipeline for documentation sites
Documentation

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 docs_pipeline::{render_markdown, extract_toc};

let md = "# Getting Started\n\nSome **bold** text.";
let html = render_markdown(md);
assert!(html.contains("<strong>bold</strong>"));

let toc = extract_toc(md);
assert_eq!(toc.len(), 1);
assert_eq!(toc[0].text, "Getting Started");

Syntax highlighting example

use docs_pipeline::syntax::SyntaxHighlighter;

let hl = SyntaxHighlighter::new();
assert!(hl.is_language_supported("rust"));
let html = hl.highlight_or_fallback("fn main() {}", "rust");
assert!(html.contains("syntax-highlight"));