` | Mermaid background: `white`, `transparent`, or `#hex` | white |
| `--no-mermaid` | Skip Mermaid PNG rendering; emit `` fallback | false |
| `--help` | Show help | |
**Color Presets:**
| Name | Hex | Label |
|------|-----|-------|
| blue | #0F4C81 | Classic Blue |
| green | #009874 | Emerald Green |
| vermilion | #FA5151 | Vibrant Vermilion |
| yellow | #FECE00 | Lemon Yellow |
| purple | #92617E | Lavender Purple |
| sky | #55C9EA | Sky Blue |
| rose | #B76E79 | Rose Gold |
| olive | #556B2F | Olive Green |
| black | #333333 | Graphite Black |
| gray | #A9A9A9 | Smoke Gray |
| pink | #FFB7C5 | Sakura Pink |
| red | #A93226 | China Red |
| orange | #D97757 | Warm Orange (modern default) |
**Examples:**
```bash
${BUN_X} {baseDir}/scripts/main.ts article.md # default theme, first heading removed
${BUN_X} {baseDir}/scripts/main.ts article.md --theme modern --color red
${BUN_X} {baseDir}/scripts/main.ts article.md --cite --keep-title --title "My Article"
```
## Output
`/path/to/article.md` → `/path/to/article.html` (same directory). An existing HTML file is first backed up to `/path/to/article.html.bak-YYYYMMDDHHMMSS`.
**JSON to stdout:**
```json
{
"title": "Article Title",
"author": "Author Name",
"summary": "Article summary...",
"htmlPath": "/path/to/article.html",
"backupPath": "/path/to/article.html.bak-20260128180000",
"contentImages": [
{
"placeholder": "MDTOHTMLIMGPH_1",
"localPath": "/path/to/img.png",
"originalPath": "imgs/image.png"
}
],
"mermaidImages": [
{
"hash": "a1b2c3d4e5f6",
"localPath": "/path/to/imgs/.mermaid-cache/mermaid-a1b2c3d4e5f6.png",
"cached": false
}
]
}
```
**Mermaid**: ` ```mermaid ` blocks are rendered to PNG via headless Chrome (CDP), cached at `imgs/.mermaid-cache/mermaid-.png` (key: code, theme, scale, target width, background, mermaid version; suggest adding the dir to `.gitignore`). Needs Chrome/Chromium/Edge; if unavailable or rendering fails, falls back to `…
` and conversion still succeeds.
## Themes
| Theme | Description |
|-------|-------------|
| `default` | Classic - traditional layout, centered title with bottom border, H2 with white text on colored background |
| `grace` | Elegant - text shadow, rounded cards, refined blockquotes (by @brzhang) |
| `simple` | Minimal - modern minimalist, asymmetric rounded corners, clean whitespace (by @okooo5km) |
| `modern` | Modern - large radius, pill-shaped titles, relaxed line height (pair with `--color red` for traditional red-gold style) |
## Supported Markdown Features
Standard GFM (headings, emphasis, lists, tables, images, links, blockquotes, inline code) plus:
| Feature | Syntax |
|---------|--------|
| Code blocks | ` ```lang ` with syntax highlighting |
| Links | `[text](url)`; add `--cite` to move ordinary external links into bottom references |
| Alerts | `> [!NOTE]`, `> [!WARNING]`, etc. |
| Footnotes | `[^1]` references |
| Ruby text | `{base|annotation}` |
| Mermaid | ` ```mermaid ` (see Output) |
| PlantUML | ` ```plantuml ` diagrams |
## Frontmatter
`title`, `author`, `description` (summary). No title → first H1/H2, else filename.
## Extension Support
Custom configuration via EXTEND.md — see Preferences.