baoyu-markdown-to-html
Skill này làm gì
Skill này biến markdown thành các trang web đẹp với kiểu dáng nội tuyến. Skill dành cho người viết và lập trình viên muốn văn bản sẵn sàng cho việc xuất bản trên web hoặc WeChat.
Khi nào nên dùng
- ✓Khi bạn có một bài viết markdown và cần nó dưới dạng HTML có định dạng.
- ✓Khi bạn muốn xuất bản lên WeChat và cần định dạng tương thích.
- ✓Khi markdown của bạn có mã, công thức toán hoặc sơ đồ cần hiển thị trong HTML.
Liên kết skill
https://github.com/JimLiu/baoyu-skills/blob/main/skills/baoyu-markdown-to-html/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Chuyển bài viết markdown của tôi sang HTML với một theme gọn gàng hoạt động được trên WeChat.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent của bạn đọc markdown, áp dụng một theme với CSS nội tuyến, hiển thị mã, công thức toán và sơ đồ, rồi xuất một file HTML.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Markdown to HTML Converter
Output is HTML with inline CSS, optimized for WeChat Official Account.
User Input Tools
When this skill prompts the user, follow this tool-selection rule (priority order):
- Prefer built-in user-input tools exposed by the current agent runtime — e.g.,
AskUserQuestion,request_user_input,clarify,ask_user, or any equivalent. - Fallback: if no such tool exists, emit a numbered plain-text message and ask the user to reply with the chosen number/answer for each question.
- Batching: if the tool supports multiple questions per call, combine all applicable questions into a single call; if only single-question, ask them one at a time in priority order.
Concrete AskUserQuestion references below are examples — substitute the local equivalent in other runtimes.
Script Directory
{baseDir} = this SKILL.md's directory. Resolve ${BUN_X}: bun if installed → else npx -y bun → else suggest installing bun.
| Script | Purpose |
|---|---|
scripts/main.ts |
Main entry point |
Preferences (EXTEND.md)
First found wins:
| Priority | Path | Scope |
|---|---|---|
| 1 | .baoyu-skills/baoyu-markdown-to-html/EXTEND.md |
Project |
| 2 | ${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-markdown-to-html/EXTEND.md |
XDG |
| 3 | $HOME/.baoyu-skills/baoyu-markdown-to-html/EXTEND.md |
User home |
None found → use defaults.
Supported: default theme, custom CSS variables, code block style, mermaid defaults (mermaid_theme, mermaid_scale, mermaid_background).
Workflow
Step 0: Pre-check (CJK Content)
Only if the input contains CJK characters AND the baoyu-format-markdown skill is available: ask (AskUserQuestion) whether to format first — it fixes ** bold markers broken by inner punctuation and CJK/English spacing. Agree → run baoyu-format-markdown, use the formatted file. Decline → use the original. No CJK → skip to Step 1.
Step 1: Determine Theme
First match wins:
- User-specified (CLI
--themeor conversation) - This skill's EXTEND.md
default_theme - Cross-skill fallback (only if step 2 has none):
default_theme:line in$HOME/.baoyu-skills/baoyu-post-to-wechat/EXTEND.md, if it exists - None → ask (
AskUserQuestion) with the Themes table
Theme from EXTEND.md → use it directly, do NOT ask.
Step 1.5: Determine Citation Mode
Default off; don't ask. Enable (--cite) only if the user explicitly asks for "微信外链转底部引用", "底部引用", "文末引用", or passes --cite. When enabled:
- Ordinary external links are rendered with numbered superscripts and collected under a final
引用链接section. https://mp.weixin.qq.com/...links stay as direct links and are not moved to the bottom.- Bare links where link text equals URL stay inline.
Step 2: Convert
${BUN_X} {baseDir}/scripts/main.ts <markdown_file> --theme <theme> [--cite]
Step 3: Report Result
Show htmlPath from the JSON result; mention backupPath if a backup was created.
Options
| Option | Description | Default |
|---|---|---|
--theme <name> |
Theme name (default, grace, simple, modern) | 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 | |
--cite |
Convert external links to bottom citations, append 引用链接 section |
false (off) |
--keep-title |
Keep the first heading in content | false (removed) |
--mermaid-theme <name> |
Mermaid theme: default, forest, dark, neutral, base |
default |
--mermaid-scale <N> |
Mermaid render scale (positive number ≤ 4) | 2 |
--mermaid-width <N> |
Mermaid target display width in CSS px; PNG is rendered at width × scale pixels when the diagram is narrower than this |
860 |
--mermaid-bg <value> |
Mermaid background: white, transparent, or #hex |
white |
--no-mermaid |
Skip Mermaid PNG rendering; emit <pre class="mermaid"> fallback |
false |
--help |
Show help |
Color Presets:
| Name | Hex | Label |
|---|---|---|
| blue | #0F4C81 | Classic Blue |
| green | #009874 | Emerald Green |
| vermilion | #FA5151 | Vibrant Vermilion |
| yellow | #FECE00 | Lemon Yellow |
| purple | #92617E | Lavender Purple |
| sky | #55C9EA | Sky Blue |
| ro |
Câu hỏi thường gặp
Nó có hoạt động với WeChat không?
Có. Kết quả được thiết kế cho các bài viết trên tài khoản công khai WeChat, với kiểu dáng nội tuyến.
Các liên kết bên ngoài có thể được chuyển xuống cuối không?
Có. Skill có thể chuyển các liên kết bên ngoài thành trích dẫn ở cuối bài, phù hợp với định dạng WeChat.
Nó có hiển thị sơ đồ không?
Có. Skill hỗ trợ Mermaid, được hiển thị thành PNG bằng Chrome không giao diện, và cả PlantUML.
Chi tiết
Mô tả gốc của tác giả
Converts Markdown to styled HTML with WeChat-compatible themes. Supports code highlighting, math, Mermaid (rendered to PNG via headless Chrome), PlantUML, footnotes, alerts, infographics, and optional bottom citations for external links. Use when user asks for "markdown to html", "convert md to html", "md 转 html", "微信外链转底部引用", or needs styled HTML output from markdown.
repo: JimLiu/baoyu-skills
Độ phổ biến
- Sao GitHub
- 27k
- Vị trí xếp hạng
- #9959
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
release-skills
27kHướng dẫn agent của bạn qua quy trình phát hành cho mọi dự án: tăng số phiên bản, cập nhật changelog và xuất bản bản phát hành hoặc thẻ trên GitHub.
baoyu-article-illustrator
27kGiúp agent của bạn minh họa bài viết bằng cách tìm những chỗ cần hình ảnh và tạo ảnh theo một phong cách nhất quán.
baoyu-comic
27kCho agent của bạn cách tạo truyện tranh giáo dục có khung, phong cách vẽ và giọng điệu khác nhau, chẳng hạn như tiểu sử hoặc hướng dẫn.
baoyu-compress-image
27kCho phép agent của bạn thu nhỏ file ảnh bằng cách chuyển sang WebP hoặc PNG với tự động chọn công cụ, để ảnh tải nhanh hơn.
Skill tương tự
angular-developer
280kGiúp agent của bạn viết code Angular và tư vấn cấu trúc dự án, hữu ích khi bắt đầu dự án mới hoặc cải thiện hiệu suất.
frontend-a11y
280kGiúp agent của bạn làm cho giao diện web dễ tiếp cận với mọi người. Đảm bảo website và ứng dụng hoạt động tốt với trình đọc màn hình và điều hướng bằng bàn phím.
frontend-patterns
280kGiúp agent của bạn áp dụng các mẫu hiện đại trong phát triển frontend. Tối ưu hiệu năng, quản lý trạng thái và tuân theo thực hành tốt nhất với React và Next.js.