Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Converts Markdown to styled HTML with WeChat-compatible themes. Supports code highlighting, math, PlantUML, footnotes, alerts, and infographics. Use when user asks for "markdown to html", "convert md to html", "md转html", or needs styled HTML output from markdown.
.claude/skills/freestylefly-canghe-markdown-to-html/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-18 | ✗→✓ | ▲ Improved | 140% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 21% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 28% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 15% | 0% |
| case-19 | ✗→✓ | ▲ Improved | -47% | 0% |
Converts Markdown files to beautifully styled HTML with inline CSS, optimized for WeChat Official Account and other platforms.
Agent Execution: Determine this SKILL.md directory as SKILL_DIR, then use ${SKILL_DIR}/scripts/<name>.ts.
| Script | Purpose | |--------|---------| | scripts/main.ts | Main entry point |
Use Bash to check EXTEND.md existence (priority order):
bash# Check project-level first test -f .canghe-skills/canghe-markdown-to-html/EXTEND.md && echo "project" # Then user-level (cross-platform: $HOME works on macOS/Linux/WSL) test -f "$HOME/.canghe-skills/canghe-markdown-to-html/EXTEND.md" && echo "user"
┌──────────────────────────────────────────────────────────────┬───────────────────┐ │ Path │ Location │ ├──────────────────────────────────────────────────────────────┼───────────────────┤ │ .canghe-skills/canghe-markdown-to-html/EXTEND.md │ Project directory │ ├──────────────────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.canghe-skills/canghe-markdown-to-html/EXTEND.md │ User home │ └──────────────────────────────────────────────────────────────┴───────────────────┘
┌───────────┬───────────────────────────────────────────────────────────────────────────┐ │ Result │ Action │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Found │ Read, parse, apply settings │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Not found │ Use defaults │ └───────────┴───────────────────────────────────────────────────────────────────────────┘
EXTEND.md Supports: Default theme | Custom CSS variables | Code block style
Condition: Only execute if input file contains Chinese text.
Detection:
Format Suggestion:
If CJK content detected AND canghe-format-markdown skill is available:
Use AskUserQuestion to ask whether to format first. Formatting can fix:
** parse failuresIf user agrees: Invoke canghe-format-markdown skill to format the file, then use formatted file as input.
If user declines: Continue with original file.
Before converting, use AskUserQuestion to confirm the theme (unless user already specified):
| Theme | Description | |-------|-------------| | default (Recommended) | 经典主题 - 传统排版,标题居中带底边,二级标题白字彩底 | | grace | 优雅主题 - 文字阴影,圆角卡片,精致引用块 | | simple | 简洁主题 - 现代极简风,不对称圆角,清爽留白 |
bashnpx -y bun ${SKILL_DIR}/scripts/main.ts <markdown_file> --theme <theme>
Display the output path from JSON result. If backup was created, mention it.
bashnpx -y bun ${SKILL_DIR}/scripts/main.ts <markdown_file> [options]
Options:
| Option | Description | Default | |--------|-------------|---------| | --theme <name> | Theme name (default, grace, simple) | default | | --title <title> | Override title from frontmatter | | | --keep-title | Keep the first heading in content | false (removed) | | --help | Show help | |
Examples:
bash# Basic conversion (uses default theme, removes first heading) 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 # Keep the first heading in content npx -y bun ${SKILL_DIR}/scripts/main.ts article.md --keep-title # Override title npx -y bun ${SKILL_DIR}/scripts/main.ts article.md --title "My Article"
File location: Same directory as input markdown file.
/path/to/article.md/path/to/article.htmlConflict handling: If HTML file already exists, it will be backed up first:
/path/to/article.html.bak-YYYYMMDDHHMMSSJSON output 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" } ] }
| Theme | Description | |-------|-------------| | default | 经典主题 - 传统排版,标题居中带底边,二级标题白字彩底 | | grace | 优雅主题 - 文字阴影,圆角卡片,精致引用块 (by @brzhang) | | simple | 简洁主题 - 现代极简风,不对称圆角,清爽留白 (by @okooo5km) |
| Feature | Syntax | |---------|--------| | Headings | # H1 to ###### H6 | | Bold/Italic | **bold**, *italic* | | Code blocks | lang with syntax highlighting | | Inline code | code | | Tables | GitHub-flavored markdown tables | | Images | !alt | | Links | text with footnote references | | Blockquotes | > quote | | Lists | - unordered, 1. ordered | | Alerts | > !NOTE], > !WARNING], etc. | | Footnotes | ^1] references | | Ruby text | {base|annotation} | | Mermaid | mermaid diagrams | | PlantUML | plantuml diagrams |
Supports YAML frontmatter for metadata:
yaml--- title: Article Title author: Author Name description: Article summary ---
If no title is found, extracts from first H1/H2 heading or uses filename.
Custom configurations via EXTEND.md. See Preferences section for paths and supported options.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-18 | fail→pass | 5,502 | 2,241 | -59% | 1 | 1 | 0% | 810 | 1,940 | +140% | 0 | 0 | — |
case-12 | pass→pass | 12,295 | 1,673 | -86% | 1 | 1 | 0% | 1,752 | 1,876 | +7% | 0 | 0 | — |
case-01 | fail→fail | 5,609 | 6,552 | +17% | 1 | 1 | 0% | 339 | 2,100 | +519% | 0 | 0 | — |
case-02 | fail→fail | 15,285 | 7,920 | -48% | 1 | 1 | 0% | 3,054 | 2,059 | -33% | 0 | 0 | — |
case-03 | fail→fail | 22,188 | 6,783 | -69% | 1 | 1 | 0% | 3,776 | 1,944 | -49% | 0 | 0 | — |
case-04 | fail→fail | 17,455 | 6,523 | -63% | 1 | 1 | 0% | 3,050 | 1,927 | -37% | 0 | 0 | — |
case-05 | pass→pass | 10,818 | 5,716 | -47% | 1 | 1 | 0% | 2,145 | 2,479 | +16% | 0 | 0 | — |
case-06 | fail→fail | 1,951 | 7,139 | +266% | 1 | 1 | 0% | 276 | 2,045 | +641% | 0 | 0 | — |
case-13 | fail→pass | 11,602 | 3,396 | -71% | 1 | 1 | 0% | 1,796 | 2,174 | +21% | 0 | 0 | — |
case-07 | fail→pass | 10,320 | 4,328 | -58% | 1 | 1 | 0% | 1,824 | 2,335 | +28% | 0 | 0 | — |
case-08 | fail→pass | 13,066 | 3,508 | -73% | 1 | 1 | 0% | 2,000 | 2,306 | +15% | 0 | 0 | — |
case-09 | pass→pass | 8,513 | 2,683 | -68% | 1 | 1 | 0% | 1,110 | 2,067 | +86% | 0 | 0 | — |
case-10 | fail→fail | 21,495 | 8,388 | -61% | 1 | 1 | 0% | 3,990 | 2,163 | -46% | 0 | 0 | — |
case-11 | fail→fail | 21,717 | 8,609 | -60% | 1 | 1 | 0% | 4,728 | 2,149 | -55% | 0 | 0 | — |
case-14 | pass→pass | 10,828 | 5,062 | -53% | 1 | 1 | 0% | 1,771 | 2,468 | +39% | 0 | 0 | — |
case-15 | pass→pass | 12,298 | 3,121 | -75% | 1 | 1 | 0% | 2,085 | 2,058 | -1% | 0 | 0 | — |
case-16 | pass→pass | 12,011 | 4,869 | -59% | 1 | 1 | 0% | 1,810 | 2,400 | +33% | 0 | 0 | — |
case-17 | pass→pass | 8,720 | 2,547 | -71% | 1 | 1 | 0% | 1,249 | 2,064 | +65% | 0 | 0 | — |
case-19 | fail→pass | 22,887 | 2,036 | -91% | 1 | 1 | 0% | 3,639 | 1,944 | -47% | 0 | 0 | — |
case-20 | pass→pass | 6,193 | 3,913 | -37% | 1 | 1 | 0% | 972 | 2,260 | +133% | 0 | 0 | — |
case-21 | fail→pass | 10,281 | 3,982 | -61% | 1 | 1 | 0% | 1,552 | 2,328 | +50% | 0 | 0 | — |
case-22 | fail→pass | 6,921 | 1,903 | -73% | 1 | 1 | 0% | 1,228 | 1,928 | +57% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 15 counted toward the lift figure. The other 7 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +32 percentage points is the difference between those two pass rates over the 15 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.