baoyu-markdown-to-html

Converts Markdown files to styled HTML with inline CSS for WeChat publishing.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/chhpt/skills --skill baoyu-markdown-to-html-chhpt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: baoyu-markdown-to-html
Source: https://github.com/chhpt/skills/tree/main/skills/baoyu-markdown-to-html
Command: npx skills add https://github.com/chhpt/skills --skill baoyu-markdown-to-html-chhpt

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires marked, juice, highlight.js, front-matter, reading-time, unified, remark-parse, remark-stringify, remark-cjk-friendly, fflate, and includes scripts (resource) components.

What problem does it solve? Manually styling Markdown content for platforms like WeChat Official Accounts is tedious, since these platforms strip external stylesheets and require inline CSS. This Skill converts Markdown files into fully styled, self-contained HTML documents ready for direct publishing. ## Core Features & Use Cases - Themed HTML Conversion: Renders Markdown with three built-in themes (default, grace, simple) and inlines all CSS using juice for platform compatibility. - Rich Markdown Support: Handles code syntax highlighting, math, PlantUML and Mermaid diagrams, footnotes, GFM alerts, ruby text, tables, and YAML frontmatter metadata. - Image Handling: Downloads remote images, resolves local paths, and reports content images as structured JSON for downstream upload workflows. - Use Case: You wrote a technical article in Markdown with code blocks and diagrams. Run the converter to get a styled HTML file you can paste directly into the WeChat editor without losing formatting. ## Quick Start Convert my article.md file to HTML using the grace theme so I can publish it on WeChat.

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 script with bun, passing your Markdown file and an optional theme flag. It produces an HTML file in the same directory with all CSS inlined, which WeChat's editor requires since it strips external stylesheets.

What themes are available for Markdown to HTML conversion?

Three built-in themes are supported: default (classic layout with centered headings), grace (elegant style with rounded cards and shadows), and simple (minimalist modern design). Select one with the --theme option.

Does this Markdown converter support code highlighting and diagrams?

Yes, code blocks are highlighted using highlight.js with mac-style window decorations. It also supports Mermaid and PlantUML diagram blocks, math rendering, footnotes, GFM alerts, and ruby text annotations.

What happens if the output HTML file already exists?

The existing HTML file is automatically backed up with a timestamp suffix like .bak-YYYYMMDDHHMMSS before the new file is written, so previous versions are never lost.

How are images handled when converting Markdown to HTML?

Remote image URLs are downloaded to a temp directory, and relative paths are resolved against the Markdown file's location. The JSON output lists each image's placeholder, local path, and original path for further processing.

Why does bold text with Chinese punctuation fail to render in Markdown?

Standard Markdown parsers struggle with bold markers adjacent to CJK punctuation. The skill detects CJK content and can invoke a formatting step first, plus it uses remark-cjk-friendly preprocessing to handle emphasis correctly.