Changelog
[0.10.0] - 2026-11-14
React Headless Primitives, Document Hooks & Reactive Preview Engine
- Dedicated Subpath Export (
@masumdev/markforge/react):- Exported native React components, hooks, and TypeScript definitions via
@masumdev/markforge/reactwith dedicateddist/react.d.tstype definitions and tree-shakeable CJS/ESM bundles. - Also re-exported from root
@masumdev/markforgefor maximum developer convenience.
- Exported native React components, hooks, and TypeScript definitions via
<MarkforgeDocument />Declarative Document Canvas:- Renders Markdown/MDX into a reactive React component tree.
- Supports
mode="continuous"(responsive web reading layout) andmode="paginated"(A4 sheet cards with drop shadows, page breaks, and print simulation). - Built-in theme styling (
corporate,academic,github,minimal, or customThemeProps), KaTeX equations, Mermaid diagram containers, and unselectable watermark overlays.
- 100% Flexible Headless Component Slots (
componentsProp):- Supports slot overrides for
heading,paragraph,codeBlock,blockquote,callout,table,mermaid,math,columns,coverPage, andbackCover. - Enables developers to plug in their own UI components (e.g. custom syntax highlighters, interactive alert boxes, zoomable diagrams).
- Supports slot overrides for
- Headless React Hooks:
useMarkforge(): Memoized AST parser, TOC extractor, statistics calculator (words, characters, reading minutes, estimated pages), and programmatic export helpers (exportPdf(),exportDocx(),exportHtml()).useMarkforgeToc(): Automatic Scroll Spy withIntersectionObserverto track the active heading in viewport and smooth scrolling navigation.
- Upgraded CLI Live Preview Server (
previewServer.ts):- Migrated
/document-contentpreview frame from static HTML string builder to React server-side component markup (renderToStaticMarkup). - Eliminates flickering and scroll jumps during live editing with Server-Sent Events (SSE).
- Migrated
[0.9.0] - 2026-11-13
Native ESM Mermaid Engine, Universal Diagram Theming & Proportional Layout
- Modern ESM Module Mermaid Loader (
mermaid@11):- Migrated from legacy scripts to modern ESM module
https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjswith<script type="module">. - Replaced diagram containers with semantic
<pre class="mermaid">elements as recommended by official Mermaid documentation to prevent whitespace normalization issues.
- Migrated from legacy scripts to modern ESM module
- Theme-Adaptive Mermaid Engine (
theme&themeVariables):- Dynamically synchronizes Mermaid theme (
default,neutral,dark,forest,base) and color variables (primaryColor,primaryBorderColor,lineColor,fontFamily) with the active document theme. - Zero external icon dependencies: Cleaned out raw Font Awesome text and font dependencies, allowing Mermaid’s native geometry, shape coloring, and arrow connections to render cleanly.
- Dynamically synchronizes Mermaid theme (
- Print & PDF Page Break Protection:
- Added
.markforge-mermaid-containertoavoidInsideBlocks(break-inside: avoid !important; page-break-inside: avoid !important;) inpdfBuilder.ts. - Added print media constraints (
max-height: 700px !important;) ensuring large diagrams scale down gracefully without splitting or leaving empty container boxes across pages.
- Added
- Support for Comprehensive Diagram Types:
- Full native rendering fidelity for Flowcharts, Sequence Diagrams, State Diagrams, ER Diagrams, Class Diagrams, and Gantt Charts.
- Proportional 2x Retina PNG rendering for Microsoft Word (DOCX) via
getImageDimensions.
- Badges Standardization:
- Standardized badge suites across all open-source libraries in the monorepo with flat-square styling and XERJ Corpus Hub contributor verification.
[0.8.0] - 2026-11-12
Native Word Equations (OMML), Synchronized TOC with Dot Leaders & Proportional Logos
- Native Microsoft Word Equation (OMML
<m:oMath>) Engine:- Implemented stack-based MathML-to-OMML parser (
parseMathML) indocxBuilder.tsto convert KaTeX mathematical formulas into native Microsoft Word Equations (<m:oMath>). - Supports fractions (
<m:f>), superscripts (<m:sSup>), subscripts (<m:sSub>), sub-superscripts, radicals/roots (<m:rad>), and mathematical operator glyphs ($\le$, $\ge$, $\lambda$, $\mu$, $\rho$, $\Delta t$, etc.). - Both inline math (
$...$) and display block math ($$...$$) are now fully editable native Word equation components instead of raw LaTeX text.
- Implemented stack-based MathML-to-OMML parser (
- Table of Contents (TOC) with Dot Leaders & Synchronized Page Numbering:
- Implemented dot leader formatting (
. . . . .) leading to right-aligned page numbers across both PDF and DOCX. - Symmetrical outline normalization (
normalizeForMatch) eliminates mismatches between Chromium PDF outline headings and Word document headings caused by symbols (&), line breaks, or whitespace differences. - Enforced strict monotonic non-decreasing page constraint (
Math.max(lastPage, ...)) so subsequent sections and chapters never jump backward in page numbering. - Automatic manual numbering prefix cleanup in
applyHeadingNumberingto prevent duplicate numbering artifacts like7.1. 1. Title.
- Implemented dot leader formatting (
- Proportional Cover Page & Back Cover Logo Dimensions:
- Zero-dependency buffer inspection (
getImageDimensions) reads intrinsic dimensions of PNG, JPEG, GIF, SVG, WebP, and BMP files. - Added
calculateProportionalLogoDimensionsindocxBuilder.tsto strictly preserve natural logo aspect ratios and prevent vertical or horizontal stretching in Microsoft Word.
- Zero-dependency buffer inspection (
[0.7.0] - 2026-11-12
Microsoft Edge Priority, Manual Browser Path & Logo Aspect Ratio
- Microsoft Edge Priority & Windows Auto-Discovery:
- Headless PDF and screenshot generation on Windows now prioritizes Microsoft Edge (
msedge.exe) as the system-native Chromium browser acrossProgram Files,Program Files (x86),SystemDrive, andLocalAppData. - Guarantees seamless out-of-the-box PDF compilation on Windows 10 & Windows 11 without requiring a separate Google Chrome installation.
- Headless PDF and screenshot generation on Windows now prioritizes Microsoft Edge (
- Manual Browser Path Configuration (
browserPath/chromiumPath):- Added
browserPath(and aliaschromiumPath) tomarkforge.config.ts, Markdown frontmatter, and API options. - Added CLI flags
--browser-path <path>and--chromium-path <path>. - Added support for
MARKFORGE_BROWSER_PATHandEDGE_PATHenvironment variables alongside existingCHROME_PATHandPUPPETEER_EXECUTABLE_PATH.
- Added
- Proportional Cover Page & Back Cover Logo Aspect Ratio Preservation:
- Implemented zero-dependency
getImageDimensionsinimageResolver.tssupporting PNG, JPEG, GIF, SVG, WebP, and BMP buffer header parsing. - Added
calculateProportionalLogoDimensionsindocxBuilder.tsto strictly maintain natural image aspect ratios and prevent vertical logo stretching in Microsoft Word (DOCX). - Added
logoHeightconfiguration and frontmatter property for optional explicit height overrides.
- Implemented zero-dependency
- Windows Defender & Enterprise EDR Compliance:
- Eliminated subprocess registry execution (
reg.exe) in favor of direct, zero-process filesystem checks (fs.existsSync). - Removed risky infostealer-associated flags (
--password-store=basic,--use-mock-keychain) from headless browser launches. - Removed
--disable-web-securityfrom Mermaid diagram rendering. - Enforced strict browser sandboxing on Windows, ensuring
--no-sandboxis never passed on Windows environments.
- Eliminated subprocess registry execution (
[0.6.0] - 2026-11-08
Page Breaks, Typography Control & Unified Configuration
- Page Breaks & Typography Pagination Controller (
pageBreaks):- Implemented configurable print and PDF layout pagination rules via
pageBreaksinmarkforge.config.tsand Markdown frontmatter. - Orphan Headings Prevention (
avoidOrphanHeadings: true): Guarantees headings (h1throughh6) are never isolated at the bottom of a page without subsequent content (break-after: avoid !important; page-break-after: avoid !important;). - Chapter & Section Breaks (
beforeH1&beforeH2): Configurable option to force major chapters to automatically begin on a fresh page (break-before: page;). - Repeating Table Headers (
repeatTableHeaders: true): Repeats<thead>on subsequent pages when tables span across multiple pages (display: table-header-group !important;). - Block Integrity Protection (
avoidInsideBlocks: true): Prevents code blocks (pre), callout boxes, blockquotes, multi-columns (:::columns), and signatures from splitting awkwardly across pages. - Table Rows Protection (
avoidInsideTableRows: true): Prevents individual<tr>rows from being sliced in the middle of text lines. - Typographic Orphans & Widows Control: Configurable
orphansandwidowsthresholds (default: 3) for clean paragraph flow.
- Implemented configurable print and PDF layout pagination rules via
- Manual Page Break Directives:
- Added native AST support for explicit page breaks in Markdown:
<!-- pagebreak -->,<!-- page-break -->,\pagebreak,:::pagebreak,:::break, or<div class="pagebreak"></div>. - Compiles cleanly into CSS Paged Media in PDF/HTML and native section breaks (
new PageBreak()) in Microsoft Word DOCX.
- Added native AST support for explicit page breaks in Markdown:
- Unified Symmetrical Configuration & Frontmatter Routing:
- Added support for root-level document metadata (
title,author,company,subtitle,date,version,lang) in both config files and frontmatter without requiring a nestedmetadata: { ... }wrapper. - Frontmatter
to:andoutputDir:properties now dynamically route compilation outputs directly without requiring CLI overrides. - Injected missing PDF header and footer divider rules (
header.dividerandfooter.divider) into CSS Paged Media. - Added full support for
watermark.position("diagonal" | "center" | "top-right" | "bottom-right"), DOCX watermark stamping, and DOCX language proofing.
- Added support for root-level document metadata (
- CLI Watch Mode & Native Open Flags:
- Implemented the reactive file watcher loop for
-w, --watchusing Nodefs.watch. - Implemented the cross-platform file opener for
-O, --opento automatically launch generated documents in the OS default viewer. - Added
--no-tocflag to allow disabling Table of Contents directly from the CLI.
- Implemented the reactive file watcher loop for
[0.5.2] - 2026-09-11
OS-Specific PDF Page Normalization
- Platform-Aware Blank Page Pruning:
- Implemented platform-aware handling for Chromium headless print. On Windows (
win32), DirectWrite renders page bounds with subpixel precision without trailing pages, while on Linux/Unix, trailing overflow blank pages after 100vh sections are cleanly pruned, ensuring exact and consistent page counts across all operating systems.
- Implemented platform-aware handling for Chromium headless print. On Windows (
[0.5.1] - 2026-09-11
Cross-Platform PDF Back Cover Preservation
- CSS Height Standardizing:
- Adjusted
.markforge-back-coverprint media CSS height tocalc(100vh - 2px)withoverflow: hidden;andpage-break-after: avoid; break-after: avoid;, eliminating subpixel page overflow across Windows (DirectWrite / Edge / Chrome) and Linux (FreeType).
- Adjusted
- Eliminated Blind Page Truncation:
- Removed trailing page deletion (
pdfDoc.removePage) in the PDF builder pipeline that previously led to the back cover closing card being inadvertently deleted on Windows multi-page documents.
- Removed trailing page deletion (
[0.5.0] - 2026-09-03
Plain Text (.txt) Document Publishing Engine
- Plain Text (.txt) Output Format:
- Added native support for compiling Markdown documents into structured plain text files (
OutputFormat.TXTor"txt"into:array /--to txt). - Structured document rendering with centered title banner, Table of Contents, double (
=) and single (-) divider rules, callout tags (| [NOTE]), blockquotes (> text), code blocks with language annotations, and task item checkboxes ([x]/[ ]). - ASCII grid-aligned tables with dynamic column width calculation and text padding.
- Complete support for footnotes (
[1] text), approval signatures, and back cover closing card with dynamic metadata token replacement. - Terminal CLI and Ink UI integration with green badge color highlighting for
[TXT]documents in the compilation summary table.
- Added native support for compiling Markdown documents into structured plain text files (
[0.4.1] - 2026-08-30
Enhancements, Security, CLI, and Configuration Refinements
- Watermark Suppression on Front & Back Covers:
- Excluded the vector/PNG watermark overlay from both the Front Cover Page (page 0) and the Back Cover Closing Page (final page) in PDF generation.
- Suppressed the HTML fixed canvas watermark in print media (
@media print { .document-watermark { display: none !important; } }) to ensure only explicitpdf-libpage indexing controls watermark rendering.
- Symmetric & Unified Cover & Back Cover Styling Configuration:
- Unified configuration property names across
CoverPageConfigandBackCoverConfigfor complete API consistency. - Added support for
backgroundColor,bgGradient,textColor,titleColor,subtitleColor,accentColor,badge,badgeColor,badgeTextColor,logo,logoWidth,footerText,copyright,address,email,phone,website, andsocialacross front and back covers in HTML, PDF, and DOCX.
- Unified configuration property names across
- Heading Color Harmonization (
h1throughh6):- Unified all heading levels (
h1,h2,h3,h4,h5,h6) to use brand primary dark styling (var(--mf-primary-dark)) across HTML, PDF, and DOCX for visual consistency. h1: 2.5px solid primary border underline;h2: 1px subtle teal border underline.
- Unified all heading levels (
- Strict Package.json Version Resolution:
- Removed fallback version constant in
version.ts. The engine now resolves version strictly from the nearest@masumdev/markforgepackage.jsonat runtime and throws an explicit error if missing or unreadable.
- Removed fallback version constant in
- Comprehensive Terminal CLI Parameter & Configuration Banner:
- Ink CLI header box and Live Preview banner (
--serve) now display all resolved configuration details: source path, config path, visual theme, syntax highlighter, layout, output directory, and active module list (TOC, Numbering, Cover, BackCover, Watermark, Security, Math, Syntax).
- Ink CLI header box and Live Preview banner (
- Arbitrary Dynamic Metadata & Nested Record Token Interpolation:
- Enhanced
replaceDocumentTokensto dynamically unpack and replace tokens defined in top-levelmetadataor nestedmetadatadictionaries (e.g.{metakuda}or{custom_key}). - Fixed AST parser inline text chunking to merge adjacent plain text spans, ensuring token names containing underscores (
_) or hyphens are not split across separate tokens.
- Enhanced
- Table of Contents (TOC) Page Break Isolation:
- Table of Contents is now fully isolated from subsequent document body content via
page-break-after: always; break-after: page;in PDF/HTML and a dedicated section break in Microsoft Word DOCX.
- Table of Contents is now fully isolated from subsequent document body content via
- Academic & Enterprise Page Numbering Schema:
- Front Cover: Unnumbered, running headers/footers suppressed.
- Table of Contents: Formal lowercase Roman numerals (
i,ii, …). - Main Document Body: Counter reset (
counter-reset: page 1;) with standard decimal numbers (1, 2, ...). - Back Cover: Unnumbered, isolated final closing section.
- Config-Driven Section Numbering (
numberHeadings):- Propagated top-level configuration options (
numberHeadings: { enabled, depth, skipH1, prefix }) directly into AST parsing and compilation across HTML, PDF, and DOCX.
- Propagated top-level configuration options (
[0.4.0] - 2026-08-29
Major Enterprise Features & Security Release
- ISO 32000-2 AES-256 PDF Security & Password Encryption (
security):- Native standard PDF encryption with independent
userPassword(password required to open the document) andownerPassword(master password required to modify document permissions). - Granular permissions enforcement:
printing,modifying,copying,annotating,fillingForms,contentAccessibility, anddocumentAssembly. - Supports permission-only protection mode when
userPasswordis left empty.
- Native standard PDF encryption with independent
- 100% Unselectable Image XObject Watermark:
- Replaced live text glyphs with transparent Chromium-rendered PNG buffers embedded via
pdfDoc.drawImage()as PDF Image XObjects. - Eliminates 100% of selectable text stream tokens (
Tj/TJ), preventing any cursor interference or unwanted text highlights during document review. - Automatically centered diagonally (
rotate: -45) across content pages and excluded from Front Cover and Back Cover.
- Replaced live text glyphs with transparent Chromium-rendered PNG buffers embedded via
- Cover Page Builder with Company Logo Embedding (
coverPage):- Four enterprise design presets:
modern,corporate-split,minimal, andcard. - Native image embedding for brand logos across DOCX, PDF, and HTML with configurable
logoWidth. - Generates dedicated unnumbered first sections in Microsoft Word DOCX and suppresses running headers/footers via CSS
@page :firstin PDF.
- Four enterprise design presets:
- Back Cover / Closing Page Builder (
backCover):- Four closing design presets:
modern,corporate,minimal, andcontact-card. - Full-bleed edge-to-edge dark closing card in PDF and isolated final section in DOCX.
- Company profile grid including address, email, phone, website, and social links.
- Four closing design presets:
- Math & LaTeX Equation Rendering (
math):- Native KaTeX in-memory math parsing for inline formulas (
$E=mc^2$) and display block equations ($$\int e^x dx$$). - Self-contained inlined KaTeX CSS for zero-network HTML and PDF generation.
- Cambria Math typography and shaded equation containers in Microsoft Word DOCX.
- Native KaTeX in-memory math parsing for inline formulas (
- Multi-Column Container Directives (
:::columns,:::col):- Multi-column container syntax with configurable columns count and gap (
:::columns 2or:::columns [cols=3 gap=2rem]). - Emitted as CSS Grid layouts in HTML/PDF and native borderless multi-cell table structures in DOCX.
- Multi-column container syntax with configurable columns count and gap (
- Hierarchical Section Numbering (
numberHeadings):- Automated decimal heading prefixes (
1.,1.1.,1.1.1.) with configurable depth and optional H1 skip. - Synchronized Table of Contents entries and anchor slugs.
- Automated decimal heading prefixes (
- Footnotes & Endnotes (
[^1],[^1]: text):- Markdown footnote references (
[^id]) and bottom definition parsing. - Formatted as superscripts with return links in HTML/PDF and dedicated numbered sections in Word DOCX.
- Markdown footnote references (
- Windows Enterprise & Strict Corporate Policy Compliance:
- Prioritizes Microsoft Edge (
msedge.exe) with AppLocker and GPO whitelist compatibility. - Isolated process arguments without suspicious flags (
--disable-sync, isolated temp profile). - Added
windowsHide: trueon child processes to eliminate console prompt flashes on Windows.
- Prioritizes Microsoft Edge (
- Interactive Live-Reload Preview Server (
markforge --serve):- Real-time Server-Sent Events (SSE)
/eventsbroadcast on file or config changes. - Automatic scroll position and reading preservation across live reloads.
- Real-time Server-Sent Events (SSE)
[0.3.0] - 2026-08-29
Features & Enhancements
- Comprehensive Programmatic API Suite:
- Added full programmatic compilation examples in
apps/cli/markforge/examples/:1-minimal.ts: Zero-configuration Markdown-to-MultiFormat execution.2-intermediate.ts: Themes, syntax palettes, TOC, and live progress callbacks.3-full-custom.ts: 100% feature utilization including dynamic tokens, per-zone header/footer slots, watermarks, signatures, andThemeProps.4-low-level-ast.ts: Direct in-memory binaryBuffergeneration (DOCX,PDF, andHTML) without writing to disk.
- Added full programmatic compilation examples in
- Terminal CLI ASCII Redesign & Author Branding:
- Modernized Ink CLI layout with clean ASCII borders and tree-style file summaries.
- Added author attribution (
Author: Ma'sum (@masumrpg)) and direct repository links. - Removed all emojis across CLI terminal outputs for maximum shell compatibility.
- Author Identity & Workspace Normalization:
- Normalized author identity to
Ma'sumand updated GitHub profiles tohttps://github.com/masumrpg.
- Normalized author identity to
[0.2.5] - 2026-08-29
Features & Enhancements
- Document Signatures & Approval Blocks (
signatures):- Add formal approval and sign-off blocks with 1 to 4 signatory slots.
- Multi-alignment support (
left,center,right,space-between). - Multiple visual styles:
line(classic underline divider),box(bordered card), andclean(borderless). - Dynamic token interpolation (
{author},{company},{date}) and optional digital signature image/seal embedding.
- Native Word Paragraph TabStops for Running Headers & Footers:
- Replaced 3-column table headers and footers with native Microsoft Word OpenXML
TabStopType.CENTERandTabStopType.RIGHTparagraph architecture. - Eliminates 100% of table gridline boundaries in LibreOffice Writer, Google Docs, and Microsoft Word when dividers are disabled.
- Replaced 3-column table headers and footers with native Microsoft Word OpenXML
- Synchronized Header & Footer Divider Lines:
- Solid horizontal separator lines render cleanly via
border.bottom/border.topon Word paragraphs and fixed print dividers (@media print) on Chromium PDF.
- Solid horizontal separator lines render cleanly via
- DOCX Visual & Typography Overhaul:
- Enhanced title area with 22pt bold title, 12pt subtitle, and bottom border.
- Auto-generated Table of Contents card with shaded container (
#F8FAFC, border#E2E8F0). - Shaded zebra table rows with alternating fills.
[0.2.4] - 2026-08-29
Features & Enhancements
- Granular Header & Footer Slot Customization (
HeaderFooterSlot):- Each running header and footer zone (
left,center,right) can now be individually styled with customcolor,fontSize(in points),fontFamily,bold, anditalic. - Fully implemented across DOCX TextRuns and PDF CSS Paged Media (
@top-*and@bottom-*).
- Each running header and footer zone (
- Flagship
Theme.CORPORATEPreset &ThemePropsInterface:- Simplified built-in themes to
Theme.CORPORATEwhile providing the typedThemePropsinterface for total custom document theming (backgroundColor,textColor,primaryColor,fontFamily,fontMono,customCss).
- Simplified built-in themes to
- TypeScript Enums:
- Full autocompletion and type-safety with
OutputFormat,Theme,Orientation,PaperSizeEnum,SyntaxTheme, andWatermarkPosition.
- Full autocompletion and type-safety with
- Background-Layered Watermark:
- Watermarks are positioned strictly at the background layer (
z-index: 0) under content to avoid obscuring tables, text, or images.
- Watermarks are positioned strictly at the background layer (
[0.1.0] - 2026-08-28
Initial Release
- Core markdown parser supporting standard CommonMark and GitHub Flavored Markdown (GFM).
- Binary DOCX document builder using
docxlibrary. - Pixel-perfect PDF generation via headless Chromium.
- Standalone HTML document generator with embedded CSS tokens.
- Syntax highlighting engine with customizable palettes.
- Mermaid diagram parser and image renderer.