md-to-docslisted
Install: claude install-skill UMIN1703/system-analyst-skill
# md-to-docs
Turn a directory of Markdown into engineering-grade deliverables: **one `.pdf` and
one `.docx` per source file**, with Mermaid fenced blocks rendered to real images
(not code text), GFM tables, blockquotes, and Thai text that renders correctly in
both formats.
The pipeline renders each file in a real Chrome instance (so Mermaid runs natively),
prints to PDF, then screenshots each diagram to PNG and embeds it into the DOCX.
## When to use
- User has `.md` specs/docs and wants `.docx`, `.pdf`, or both to share, print, or hand off.
- Content contains ```mermaid diagrams, tables, or Thai text that must survive export.
Not for: writing the content (→ `system-analyst`), or a quick one-off HTML page.
## Prerequisites
- **Node ≥ 18** (`node -v`).
- **A Chromium-based browser installed** — Google Chrome, Chromium, or Edge. The
script auto-detects it; override with `CHROME_PATH=/path/to/chrome`.
- **Thai fonts** (recommended for Thai docs): IBM Plex Sans Thai, Sarabun, or Noto
Sans Thai. Without one, Thai may render as boxes. The CSS falls back through all three.
## How to run
1. **Install deps once** (only if `node_modules/` is missing in the skill dir):
```bash
cd <skill-dir> && npm install
```
2. **Build** — pass the folder that holds the `.md` files:
```bash
node build.js <sourceDir> [outDir]
```
- `sourceDir` — folder containing the `.md` files (required).
- `outDir` — where to write `.pdf`/`.docx` (optional; defaults to `sourceDir`)