- Home
- Skills
- Jimliu
- Baoyu Skills
- Baoyu Markdown To Html
baoyu-markdown-to-html_skill
- TypeScript
5.8k
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill jimliu/baoyu-skills --skill baoyu-markdown-to-html- SKILL.md8.4 KB
Overview
This skill converts Markdown into styled, self-contained HTML optimized for WeChat Official Account and similar publishing targets. It produces inline CSS themes, handles code highlighting, math, PlantUML, footnotes, alerts, and infographics, and returns a JSON summary including output path and any backup created. Use it when you need ready-to-publish HTML from Markdown with consistent styling and extended features.
How this skill works
The converter reads the input Markdown, optionally runs a CJK-aware formatting step if Chinese (or other CJK) text is detected, and asks to confirm a theme when not specified. It renders extended Markdown features (syntax-highlighted code blocks, math, PlantUML, Mermaid, footnotes, alerts, ruby text, tables, and images) and writes a single HTML file next to the source. When an output file would overwrite an existing HTML, the tool creates a timestamped backup and prints a JSON result with metadata, paths, and extracted image placeholders.
When to use it
- You need to convert Markdown to WeChat-compatible HTML with inline styling.
- You want syntax-highlighted code, math rendering, or PlantUML/Mermaid diagrams in the output.
- You need footnotes, alerts, ruby text, or advanced Markdown features preserved in HTML.
- You want a single self-contained HTML file with theme options and predictable output path.
- You need automatic backup of existing HTML files and a machine-readable JSON report.
Best practices
- Choose a theme (default, grace, simple) before converting to match your target platform style.
- If content contains Chinese or other CJK characters, allow the optional CJK-aware formatter to avoid spacing and emphasis issues.
- Include YAML frontmatter (title, author, description) to control metadata and page title extraction.
- Keep images referenced with relative paths; the tool reports placeholders and local paths in its JSON output.
- Use the --keep-title option if you want the first heading retained in the content rather than used as the page title.
Example use cases
- Convert a blog draft to WeChat-ready HTML with the default theme and inline CSS for direct upload.
- Generate a standalone HTML export of technical notes with highlighted code blocks and math equations.
- Produce documentation pages that include PlantUML or Mermaid diagrams rendered into the final HTML.
- Batch-convert Markdown files while preserving existing HTML by creating timestamped backups automatically.
- Create small infographic-style posts using the grace or simple themes for a cleaner presentation.
FAQ
The HTML is written to the same directory as the Markdown file, with the same base name and .html extension.
What happens if an HTML file already exists?
An existing HTML file is backed up with a .bak-YYYYMMDDHHMMSS suffix before writing the new output; the JSON report includes the backup path.
How do I control the page title?
Supply a title in YAML frontmatter or use the --title option. If none is provided, the tool extracts from the first H1/H2 or falls back to the filename.