GlyphWeaveForge

GlyphWeaveForge

Convert Markdown into PDF through an explicit Rust pipeline. Minimal and Typst backends, configurable themes, math & mermaid support.

Get Started GitHub
Crates.io docs.rs MIT License Rust

Why GlyphWeaveForge?

A Rust library that gives you full control over Markdown-to-PDF conversion — from parsing to rendering.

Dual Backends

Choose between a lightweight Minimal renderer (zero system dependencies) or the powerful Typst backend for professional typesetting with fonts, layouts, and math.

Configurable Themes

Built-in themes (Professional, Engineering, Scientific Article, Invoice, Informational) plus full JSON overrides for fonts, colors, and sizes.

Math & Mermaid

GFM math ($...$, $$...$$) with TeX-subset conversion for real Typst rendering. Rust-native Mermaid diagram subset — no Node, no npm.

🔧 Fluent Builder API

Chain .from_text().to_file().with_theme().convert(). Everything is type-safe and composable.

🔒 Safe by Default

No panicking .expect() in production. Paths sanitized. Secrets scanned before every release. Built with a layered architecture (api → pipeline → core → adapters).

🄯 Open Source — MIT

Free for personal and commercial use. Contributions welcome! Fork, improve, and submit a PR on GitHub.

Quick Example

Convert Markdown to PDF in 4 lines of Rust.

// Cargo.toml
// glyphweaveforge = "0.1"

use glyphweaveforge::Forge;

fn main() {
    let pdf = Forge::new()
        .from_text("# Hello World\n\nThis is **Markdown**.")
        .to_memory()
        .convert()
        .expect("conversion should succeed");

    assert!(pdf.bytes.expect("bytes present").starts_with(b"%PDF"));
}
Full Getting Started Guide →

Features

FeatureMinimalTypst
Headings, paragraphs, lists
Bold, italic, code, links
Tables
Code blocks with language
Images (inline & HTML)
Page themes (5 built-in)
Resource resolver (custom)
Math ($...$, $$...$$)text fallback✓ real
Mermaid diagramsfallback notice✓ SVG
Custom fonts