Dev.to WebDev 🛠 Dev 👁 0 📖 2 min read

Building an Offline Single-File (

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 RT

When converting technical Markdown documents into presentation-ready DOCX, PDF, or print deliverables, developers routinely hit three frustrating edge cases:

  1. 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.
  2. Legacy Binary & Spatial Spreadsheet Formats: Opening older binary .xls exports (OLE2 Compound File / BIFF8 records) or FastReport .fp3 coordinate-based XML reports normally pulls in bloated third-party dependencies or requires sending sensitive financial data to an external cloud server.
  3. Telemetry & Destructive Cloud Silos: Sensitive engineering and administrative documents need an offline-first, zero-telemetry studio that operates reliably from file:// or 127.0.0.1 and 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 .xls files 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:

Feedback, bug reports, and pull requests are warmly welcomed!

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.