MD2TXT: Markdown-to-Document Engine
A live conversion workspace that turns Markdown and TeX-heavy AI study notes into consistent previews, clipboard output, TXT, PDF, and DOCX documents.
Engineering evidence
- My contribution
- Product design · Conversion architecture · Frontend and export service
- Outcome
- Live multi-format document workflow with diagnostic and source-fallback paths
- Decision record 01
- Used a shared parsed document model instead of DOM scraping so preview, clipboard, TXT, PDF, and DOCX preserve the same source semantics.
Live preview
Technical highlights
- 01
Built a shared semantic document model for GFM structure, TeX math, AMS equations, mhchem chemistry, Bangla, Greek, and scientific symbols across every output format.
- 02
Moved parsing into a browser worker while the export service reparses source and renders PDF and DOCX through isolated Chromium contexts with structured diagnostics.
- 03
Blocked raw HTML and remote resource execution, avoided document persistence, and made source fallbacks an explicit user decision when faithful conversion is not possible.
Abstract
MD2TXT treats Markdown structure and mathematical notation as separate parsing concerns, then normalizes both into one document model. That model drives the formatted preview, Unicode text, clipboard output, PDF, and editable DOCX paths, keeping equations, chemistry, tables, nesting, and emphasis consistent instead of scraping the rendered DOM. The export service validates source again, reports unsupported or overflowing material, and processes each document without retaining its body.
Stack
- TypeScript
- React
- Vite
- Unified / Remark
- MathJax
- Playwright