When converting technical Markdown documents into presentation-ready DOCX, PDF, or print deliverables, developers routinely hit three frustrating edge cases:
- Mixed-Script Bidi Layout Breakage: When a document mixes RTL scripts (such as Persian or Arabic) with LTR English words, inline code runs (
<code>const x = 1;</code>), or Latin heading identifiers, standard Markdown renderers often flip question marks (?Why), misalign tables, or break list indentation. - Legacy Binary & Spatial Spreadsheet Formats: Opening older binary
.xlsexports (OLE2 Compound File / BIFF8 records) or FastReport.fp3coordinate-based XML reports normally pulls in bloated third-party dependencies or requires sending sensitive financial data to an external cloud server. - Telemetry & Destructive Cloud Silos: Sensitive engineering and administrative documents need an offline-first, zero-telemetry studio that operates reliably from
file://or127.0.0.1and guarantees that user revisions are never silently destroyed.
To solve this, I open-sourced DocLoom under the MIT license.
What is DocLoom?
DocLoom is a self-contained document compiler and live studio bundled into a single standalone HTML file under 900 KB (including inlined subset WOFF2 fonts), an installable Progressive Web App (PWA), and an optional zero-dependency Node.js companion server.
Key Architectural Highlights
- Pure-JS Zero-Dependency OLE2 & BIFF8 Engine: Parses binary
.xlsfiles directly in memory using custom OLE2 sector allocation tables (FAT/DIFAT/mini-FAT) and BIFF8 record streams without external libraries. - FastReport (.fp3) Spatial Table Reconstruction: Delivers a pure geometric layout algorithm that turns arbitrary 2D memo coordinates into structured, semantic HTML tables.
- Per-Block Bidi Direction Engine: Automatically inspects typography script vectors per paragraph, heading, list item, and table while strictly isolating inline code spans.
- Client-Side OOXML (.docx) Package Generator: Builds native Word documents directly in the browser via clean XML stream generation.
- 410 Unit & Fuzzing Tests: Features a deterministic mutation fuzzing harness exercising corrupted sector chains, boundary splits, and extreme coordinate values.
Try It Live in Browser
No installation or registration required:
- Live Studio (PWA): https://mojtabahasani.github.io/DocLoom/
- Download Single-File HTML (~744 KB): https://mojtabahasani.github.io/DocLoom/DocLoom.html
- Source Code on GitHub: https://github.com/mojtabahasani/DocLoom
Feedback, bug reports, and pull requests are warmly welcomed!