
GlyphWeaveForge
GlyphWeaveForge converts Markdown into PDF through a small Rust pipeline with explicit boundaries:
api -> pipeline -> core -> adapters
The crate ships a lightweight built-in renderer by default and can optionally use Typst without changing the public builder API.
Installation
[]
= "0.1"
Enable optional features when you need them:
[]
= { = "0.1", = ["renderer-typst"] }
Main builder flow
use Forge;
let pdf = new
.from_text
.to_memory
.convert
.expect;
let bytes = pdf.bytes.expect;
assert!;
Supported inputs and outputs
Always available:
from_textfrom_bytesto_memory- injected resource resolvers through
with_resource_resolver - explicit backend selection through
with_backend
Available with the default fs feature:
from_pathto_fileto_directory- filesystem-based resource lookup for local assets
Backend selection
The default build uses the minimal built-in renderer. To opt into the Typst backend, enable renderer-typst and select it explicitly:
#
#
Feature matrix
fs(default): enables path-based source/output helpers and filesystem resource loading.renderer-minimal(default): keeps the built-in lightweight renderer enabled and addressable in tests/documentation.renderer-typst: enables the Typst-backed renderer.typst: compatibility alias forrenderer-typst.mermaid: currently does not add real Mermaid rendering; fencedmermaidblocks remain visible as explicit unsupported fallbacks.math: currently does not add real math layout; fencedmathblocks remain visible as explicit unsupported fallbacks.
Current Markdown behavior
Supported today:
- headings
- paragraphs
- emphasis/strong text
- inline code
- links
- unordered and ordered lists
- block quotes
- thematic breaks
- fenced code blocks
- images, including injected resolvers and memory-backed assets
Unsupported advanced Markdown stays visible instead of silently disappearing. Examples include:
- tables
- footnotes
- Mermaid diagrams
- math fences
These paths render deterministic fallback labels with the original content preserved in the output.
Limitations
- This crate does not claim real Mermaid diagram rendering.
- This crate does not claim real TeX/LaTeX or advanced math typesetting.
- Advanced Markdown such as tables and footnotes is exposed through visible fallback text, not full layout support.
- The minimal renderer writes a compact PDF text stream; it is designed for deterministic output and testability rather than rich page design.
Architecture note
Release work should preserve the internal boundary:
api -> pipeline -> core -> adapters