baoyu-markdown-to-html

Converts Markdown files to styled HTML with themes, Mermaid rendering, and WeChat-compatible formatting.

2|Updated May 30, 2026
One-click install
npx skills add https://github.com/virahitvin8/crafty-gis --skill baoyu-markdown-to-html-virahitvin8
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: baoyu-markdown-to-html
Source: https://github.com/virahitvin8/crafty-gis/tree/main/GIT_STAR/assignment-generator/antigravity-skills-main/antigravity-skills-main/skills/baoyu-markdown-to-html
Command: npx skills add https://github.com/virahitvin8/crafty-gis --skill baoyu-markdown-to-html-virahitvin8

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires baoyu-md, baoyu-chrome-cdp, and includes scripts (resource) components.

What problem does it solve? Converting Markdown articles into polished, platform-ready HTML usually requires manual styling, and WeChat Official Accounts reject most external CSS, forcing authors to inline styles by hand. This Skill automates the entire conversion, producing styled HTML with inline CSS ready for WeChat and other platforms. ## Core Features & Use Cases - Themed HTML Conversion: Transforms Markdown into styled HTML using built-in themes (default, grace, simple, modern) with customizable colors, fonts, and font sizes. - Diagram Rendering: Renders Mermaid code blocks to PNG images via headless Chrome with caching, and supports PlantUML diagrams. - WeChat Citation Mode: Optionally converts ordinary external links into numbered bottom citations (引用链接) while keeping mp.weixin.qq.com links inline. - Use Case: A blogger writes an article in Markdown with Mermaid diagrams and wants to publish it to a WeChat Official Account. The Skill converts the file to HTML with a chosen theme, renders diagrams as images, and moves external links to a bottom reference section. ## Quick Start Convert my article.md file to HTML using the grace theme with bottom citations enabled.

Frequently Asked Questions about baoyu-markdown-to-html

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert Markdown to HTML for WeChat Official Accounts?

Run the main.ts script with your Markdown file and a theme name, for example with bun or npx. The script generates an HTML file with inline CSS in the same directory, compatible with WeChat's styling restrictions.

How to render Mermaid diagrams to PNG in Markdown conversion?

Mermaid code blocks are rendered to PNG images via headless Chrome using the Chrome DevTools Protocol. Images are cached under imgs/.mermaid-cache/ and the cache key includes code, theme, scale, width, and background.

Does the Markdown to HTML conversion work without Chrome installed?

Yes, conversion still succeeds without Chrome. Mermaid blocks fall back to a <pre class="mermaid"> element instead of a rendered PNG, and all other Markdown features convert normally.

Can I convert external links to bottom citations for WeChat articles?

Yes, pass the --cite flag to move ordinary external links into a numbered 引用链接 section at the bottom. Links to mp.weixin.qq.com remain inline, and bare URLs where the text equals the link also stay inline.

What themes and customization options are available for the HTML output?

Four themes are available: default, grace, simple, and modern. You can customize the primary color from presets or hex values, font family, font size, code highlight theme, and Mermaid rendering options via CLI flags or an EXTEND.md preferences file.

What happens if the output HTML file already exists?

The existing HTML file is backed up before overwriting. The backup is saved with a timestamp suffix in the format article.html.bak-YYYYMMDDHHMMSS in the same directory.