Multi-Format Output
Generate .docx, .pdf, and .html simultaneously from a single Markdown source.
MarkForge is an enterprise-grade Markdown & MDX document publishing engine and CLI. It compiles a single Markdown source into pixel-perfect Microsoft Word (DOCX), PDF, and standalone HTML — with native Mermaid diagrams, GitHub-style callout alert boxes, dual-theme syntax highlighting, customizable ThemeProps, per-zone header/footer slots, and an interactive Ink terminal UI.
Multi-Format Output
Generate .docx, .pdf, and .html simultaneously from a single Markdown source.
Theme.CORPORATE & ThemeProps
Flagship cyan corporate design system + full custom colors and fonts via ThemeProps.
Per-Zone Header & Footer
Granular color, font size, font family, bold, and italic controls per left, center, and right slot.
Mermaid Diagrams
Flowcharts, sequence diagrams, gantt charts, and class diagrams — rendered and embedded natively.
Callout / Alert Boxes
GitHub-style > [!NOTE], > [!TIP], > [!IMPORTANT], > [!WARNING], > [!CAUTION] with rich colored styling.
Dual Syntax Highlighting
Dark theme for PDF/HTML, Light theme for DOCX — optimized per document format.
| Element | DOCX | HTML | |
|---|---|---|---|
| Headings H1–H6 | Yes | Yes | Yes |
| Paragraphs & inline formatting | Yes | Yes | Yes |
| GFM Tables | Yes | Yes | Yes |
| Ordered & unordered lists | Yes | Yes | Yes |
Checklists (- [x]) | Yes | Yes | Yes |
| Blockquotes | Yes | Yes | Yes |
| Callout / Alert Boxes | Yes | Yes | Yes |
| Code blocks (syntax highlighted) | Yes | Yes | Yes |
| Inline code | Yes | Yes | Yes |
| Mermaid Diagrams | Yes | Yes | Yes |
| Math & LaTeX ($inline$ / $$block$$) | Yes | Yes | Yes |
| Multi-Column Layouts (:::columns) | Yes | Yes | Yes |
| Footnotes & Endnotes ([^1]) | Yes | Yes | Yes |
| Images (local / URL / Base64) | Yes | Yes | Yes |
| Horizontal rules | Yes | Yes | Yes |
| Auto Table of Contents | Yes | Yes | Yes |
| Hierarchical Heading Numbering | Yes | Yes | Yes |
| Cover Page Builder (4 Presets) | Yes | Yes | Yes |
| Back Cover / Closing Page (4 Presets) | Yes | Yes | Yes |
| Header & Footer (per-zone slots) | Yes | Yes | — |
| Signatures & Approval Blocks | Yes | Yes | Yes |
| PDF Security & Passwords | — | Yes | — |
| Live-Reload Preview Server | — | — | Yes |
Embedded <style> / HTML | — | Yes | Yes |
| Watermark (100% unselectable) | Yes | Yes | — |
MarkForge uses Theme.CORPORATE as its flagship built-in theme (featuring the clean Blu-by-BCA-Digital cyan palette). You can also pass a typed ThemeProps object to configure custom background colors, text tones, brand accents, and typography:
import { defineConfig, Theme } from "@masumdev/markforge";
export default defineConfig({ theme: Theme.CORPORATE, // Flagship preset});// Custom ThemePropsexport default defineConfig({ theme: { primaryColor: "#0D998D", primaryDark: "#008073", primaryLight: "#D9F1F0", backgroundColor: "#FFFFFF", textColor: "#0F172A", textMuted: "#64748B", borderColor: "#E2E8F0", cardBackground: "#F8FAFC", fontFamily: "'Inter', sans-serif", fontMono: "'Fira Code', monospace", },});All themes inherit a shared THEME_COMPONENTS foundation layer providing consistent callout alert boxes, code blocks, tables, and TOC styles.
markforge spec.md --to docx,pdf,html -o ./dist---title: "Enterprise System Specification"author: "Masum Dev"version: "1.0.0"theme: "corporate"toc: trueheader: left: text: "Masum Dev Technologies" color: "#0D998D" bold: true right: "v{version}"footer: right: "Page {page} of {pages}"---
# System Architecture
> [!NOTE]> All builders run concurrently. Assets are resolved once and cached.
## Flowchart
```mermaidflowchart LR MD[Markdown Source] --> P[MarkForge Parser] P --> DOCX[Word DOCX] P --> PDF[Vector PDF] P --> HTML[Bundled HTML]