feat(baoyu-markdown-to-html): rename themes and add color presets with theme defaults

Rename red→heritage and orange→warm themes. Add 13 named color presets,
serif-cjk font family, and per-theme style defaults with CLI override support.
This commit is contained in:
Jim Liu 宝玉
2026-02-28 11:18:16 -06:00
parent e754eae5ae
commit 6edc1b7822
4 changed files with 150 additions and 75 deletions
+29 -5
View File
@@ -92,8 +92,8 @@ test -f "$HOME/.baoyu-skills/baoyu-post-to-wechat/EXTEND.md" && grep -o 'default
| `default` (Recommended) | 经典主题 - 传统排版,标题居中带底边,二级标题白字彩底 |
| `grace` | 优雅主题 - 文字阴影,圆角卡片,精致引用块 |
| `simple` | 简洁主题 - 现代极简风,不对称圆角,清爽留白 |
| `red` | 红色主题 - 红金配色,宋体排版,传统书法风格 |
| `orange` | 橙色主题 - 暖色调现代风,宽松行距,圆角装饰 |
| `heritage` | 传统主题 - 宋体排版,传统书法风格,默认红金配色 |
| `warm` | 温暖主题 - 暖色调现代风,宽松行距,圆角装饰 |
### Step 2: Convert
@@ -115,11 +115,32 @@ npx -y bun ${SKILL_DIR}/scripts/main.ts <markdown_file> [options]
| Option | Description | Default |
|--------|-------------|---------|
| `--theme <name>` | Theme name (default, grace, simple, red, orange) | default |
| `--theme <name>` | Theme name (default, grace, simple, heritage, warm) | default |
| `--color <name\|hex>` | Primary color: preset name or hex value | theme default |
| `--font-family <name>` | Font: sans, serif, serif-cjk, mono, or CSS value | theme default |
| `--font-size <N>` | Font size: 14px, 15px, 16px, 17px, 18px | 16px |
| `--title <title>` | Override title from frontmatter | |
| `--keep-title` | Keep the first heading in content | false (removed) |
| `--help` | Show help | |
**Color Presets:**
| Name | Hex | Label |
|------|-----|-------|
| blue | #0F4C81 | 经典蓝 |
| green | #009874 | 翡翠绿 |
| vermilion | #FA5151 | 活力橘 |
| yellow | #FECE00 | 柠檬黄 |
| purple | #92617E | 薰衣紫 |
| sky | #55C9EA | 天空蓝 |
| rose | #B76E79 | 玫瑰金 |
| olive | #556B2F | 橄榄绿 |
| black | #333333 | 石墨黑 |
| gray | #A9A9A9 | 雾烟灰 |
| pink | #FFB7C5 | 樱花粉 |
| red | #A93226 | 中国红 (heritage default) |
| orange | #D97757 | 暖橘 (warm default) |
**Examples:**
```bash
@@ -129,6 +150,9 @@ npx -y bun ${SKILL_DIR}/scripts/main.ts article.md
# With specific theme
npx -y bun ${SKILL_DIR}/scripts/main.ts article.md --theme grace
# Theme with custom color
npx -y bun ${SKILL_DIR}/scripts/main.ts article.md --theme heritage --color green
# Keep the first heading in content
npx -y bun ${SKILL_DIR}/scripts/main.ts article.md --keep-title
@@ -171,8 +195,8 @@ npx -y bun ${SKILL_DIR}/scripts/main.ts article.md --title "My Article"
| `default` | 经典主题 - 传统排版,标题居中带底边,二级标题白字彩底 |
| `grace` | 优雅主题 - 文字阴影,圆角卡片,精致引用块 (by @brzhang) |
| `simple` | 简洁主题 - 现代极简风,不对称圆角,清爽留白 (by @okooo5km) |
| `red` | 红色主题 - 红金配色,宋体排版,传统书法风格 |
| `orange` | 橙色主题 - 暖色调现代风,宽松行距,圆角装饰 |
| `heritage` | 传统主题 - 宋体排版,传统书法风格,默认红金配色 |
| `warm` | 温暖主题 - 暖色调现代风,宽松行距,圆角装饰 |
## Supported Markdown Features