Skip to content

MarkForge — Overview

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.


Supported Markdown Elements

ElementDOCXPDFHTML
Headings H1–H6YesYesYes
Paragraphs & inline formattingYesYesYes
GFM TablesYesYesYes
Ordered & unordered listsYesYesYes
Checklists (- [x])YesYesYes
BlockquotesYesYesYes
Callout / Alert BoxesYesYesYes
Code blocks (syntax highlighted)YesYesYes
Inline codeYesYesYes
Mermaid DiagramsYesYesYes
Math & LaTeX ($inline$ / $$block$$)YesYesYes
Multi-Column Layouts (:::columns)YesYesYes
Footnotes & Endnotes ([^1])YesYesYes
Images (local / URL / Base64)YesYesYes
Horizontal rulesYesYesYes
Auto Table of ContentsYesYesYes
Hierarchical Heading NumberingYesYesYes
Cover Page Builder (4 Presets)YesYesYes
Back Cover / Closing Page (4 Presets)YesYesYes
Header & Footer (per-zone slots)YesYes
Signatures & Approval BlocksYesYesYes
PDF Security & PasswordsYes
Live-Reload Preview ServerYes
Embedded <style> / HTMLYesYes
Watermark (100% unselectable)YesYes

Document Theming

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:

markforge.config.ts
import { defineConfig, Theme } from "@masumdev/markforge";
export default defineConfig({
theme: Theme.CORPORATE, // Flagship preset
});
// Custom ThemeProps
export 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.


Quick Example

Terminal window
markforge spec.md --to docx,pdf,html -o ./dist
---
title: "Enterprise System Specification"
author: "Masum Dev"
version: "1.0.0"
theme: "corporate"
toc: true
header:
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
```mermaid
flowchart LR
MD[Markdown Source] --> P[MarkForge Parser]
P --> DOCX[Word DOCX]
P --> PDF[Vector PDF]
P --> HTML[Bundled HTML]