baoyu-markdown-to-html
Markdown形式の文章を、WeChat(微信)でも見やすいようにデザインされたHTML形式に変換し、コードのハイライト表示や数式、図表の埋め込みなど、多様な表現をサポートするSkill。
📜 元の英語説明(参考)
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.
🇯🇵 日本人クリエイター向け解説
Markdown形式の文章を、WeChat(微信)でも見やすいようにデザインされたHTML形式に変換し、コードのハイライト表示や数式、図表の埋め込みなど、多様な表現をサポートするSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o baoyu-markdown-to-html.zip https://jpskill.com/download/19390.zip && unzip -o baoyu-markdown-to-html.zip && rm baoyu-markdown-to-html.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/19390.zip -OutFile "$d\baoyu-markdown-to-html.zip"; Expand-Archive "$d\baoyu-markdown-to-html.zip" -DestinationPath $d -Force; ri "$d\baoyu-markdown-to-html.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
baoyu-markdown-to-html.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
baoyu-markdown-to-htmlフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 20
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
MarkdownからHTMLへの変換ツール
Markdownファイルを、WeChat公式アカウントやその他のプラットフォーム向けに最適化された、インラインCSSで美しくスタイル設定されたHTMLに変換します。
スクリプトディレクトリ
エージェントの実行: このSKILL.mdディレクトリをSKILL_DIRとして決定し、${SKILL_DIR}/scripts/<name>.tsを使用します。
| スクリプト | 目的 |
|---|---|
scripts/main.ts |
メインエントリーポイント |
設定 (EXTEND.md)
Bashを使用してEXTEND.mdの存在を確認します(優先順位):
# まずプロジェクトレベルを確認
test -f .baoyu-skills/baoyu-markdown-to-html/EXTEND.md && echo "project"
# 次にユーザーレベル(クロスプラットフォーム: $HOMEはmacOS/Linux/WSLで動作)
test -f "$HOME/.baoyu-skills/baoyu-markdown-to-html/EXTEND.md" && echo "user"
┌──────────────────────────────────────────────────────────────┬───────────────────┐ │ パス │ 場所 │ ├──────────────────────────────────────────────────────────────┼───────────────────┤ │ .baoyu-skills/baoyu-markdown-to-html/EXTEND.md │ プロジェクトディレクトリ │ ├──────────────────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.baoyu-skills/baoyu-markdown-to-html/EXTEND.md │ ユーザーホーム │ └──────────────────────────────────────────────────────────────┴───────────────────┘
┌───────────┬───────────────────────────────────────────────────────────────────────────┐ │ 結果 │ アクション │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ 見つかった │ 設定を読み込み、解析し、適用する │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ 見つからない │ デフォルトを使用する │ └───────────┴───────────────────────────────────────────────────────────────────────────┘
EXTEND.mdがサポートするもの: デフォルトテーマ | カスタムCSS変数 | コードブロックスタイル
ワークフロー
ステップ0: 事前チェック (中国語コンテンツ)
条件: 入力ファイルに中国語テキストが含まれている場合にのみ実行します。
検出:
- 入力Markdownファイルを読み込みます
- コンテンツにCJK文字(中国語/日本語/韓国語)が含まれているか確認します
- CJKコンテンツがない場合 → ステップ1にスキップします
フォーマットの提案:
CJKコンテンツが検出され、かつbaoyu-format-markdownスキルが利用可能な場合:
まずフォーマットするかどうかをAskUserQuestionで尋ねます。フォーマットにより以下が修正されます:
- 句読点を含む太字マーカーによる
**解析の失敗 - CJK/英語のスペースの問題
ユーザーが同意した場合: baoyu-format-markdownスキルを呼び出してファイルをフォーマットし、フォーマットされたファイルを入力として使用します。
ユーザーが拒否した場合: 元のファイルで続行します。
ステップ1: テーマの確認
変換前に、AskUserQuestionを使用してテーマを確認します(ユーザーが既に指定している場合を除く):
| テーマ | 説明 |
|---|---|
default (推奨) |
经典主题 - 伝統的なレイアウト、中央揃えのタイトルと下線、白文字とカラー背景の二次タイトル |
grace |
优雅主题 - テキストシャドウ、角丸カード、洗練された引用ブロック |
simple |
简洁主题 - 現代的なミニマリストスタイル、非対称の角丸、すっきりとした余白 |
ステップ2: 変換
npx -y bun ${SKILL_DIR}/scripts/main.ts <markdown_file> --theme <theme>
ステップ3: 結果の報告
JSON結果から出力パスを表示します。バックアップが作成された場合は、その旨を伝えます。
使用方法
npx -y bun ${SKILL_DIR}/scripts/main.ts <markdown_file> [options]
オプション:
| オプション | 説明 | デフォルト |
|---|---|---|
--theme <name> |
テーマ名 (default, grace, simple) | default |
--title <title> |
フロントマターからのタイトルを上書き | |
--keep-title |
コンテンツの最初の見出しを保持 | false (削除されます) |
--help |
ヘルプを表示 |
例:
# 基本的な変換 (デフォルトテーマを使用し、最初の見出しを削除)
npx -y bun ${SKILL_DIR}/scripts/main.ts article.md
# 特定のテーマを使用
npx -y bun ${SKILL_DIR}/scripts/main.ts article.md --theme grace
# コンテンツの最初の見出しを保持
npx -y bun ${SKILL_DIR}/scripts/main.ts article.md --keep-title
# タイトルを上書き
npx -y bun ${SKILL_DIR}/scripts/main.ts article.md --title "My Article"
出力
ファイルの場所: 入力Markdownファイルと同じディレクトリです。
- 入力:
/path/to/article.md - 出力:
/path/to/article.html
競合処理: HTMLファイルが既に存在する場合、まずバックアップされます。
- バックアップ:
/path/to/article.html.bak-YYYYMMDDHHMMSS
標準出力への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"
}
]
}
テーマ
| テーマ | 説明 |
|---|---|
default |
经典主题 - 伝統的なレイアウト、中央揃えのタイトルと下線、白文字とカラー背景の二次タイトル |
grace |
优雅主题 - テキストシャドウ、角丸カード、洗練された引用ブロック (by @brzhang) |
simple |
简洁主题 - 現代的なミニマリストスタイル、非対称の角丸、すっきりとした余白 (by @okooo5km) |
サポートされるMarkdown機能
| 機能 | 構文 |
|---|---|
| 見出し | # H1 から ###### H6 |
| 太字/斜体 | **bold**, *italic* |
| コードブロック | ```lang (シンタックスハイライト付き) |
| インラインコード | `code` |
| テーブル | GitHub-flavored markdownテーブル |
| 画像 |  |
| リンク | [text](url) (脚注参照付き) |
| 引用ブロック | > quote |
| リスト | - (順序なし), 1. (順序あり) |
| アラート | > [!NOTE], > [!WARNING], など |
| 脚注 | [^1] 参照 |
| ルビテキスト | {base|annotation} |
| Mermaid | ```mermaid 図 |
| PlantUML | ```plantuml 図 |
フロントマター
メタデータ用のYAMLフロントマターをサポートしています:
---
title: Article Title
author: Author Name
description: Article summary
---
タイトルが見つからない場合、最初のH1/H2見出しから抽出するか、ファイル名を使用します。
拡張機能のサポート
EXTEND.mdを介したカスタム設定。パスとサポートされるオプションについては、「設定」セクションを参照してください。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Markdown to HTML Converter
Converts Markdown files to beautifully styled HTML with inline CSS, optimized for WeChat Official Account and other platforms.
Script Directory
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 |
Preferences (EXTEND.md)
Use Bash to check EXTEND.md existence (priority order):
# Check project-level first
test -f .baoyu-skills/baoyu-markdown-to-html/EXTEND.md && echo "project"
# Then user-level (cross-platform: $HOME works on macOS/Linux/WSL)
test -f "$HOME/.baoyu-skills/baoyu-markdown-to-html/EXTEND.md" && echo "user"
┌──────────────────────────────────────────────────────────────┬───────────────────┐ │ Path │ Location │ ├──────────────────────────────────────────────────────────────┼───────────────────┤ │ .baoyu-skills/baoyu-markdown-to-html/EXTEND.md │ Project directory │ ├──────────────────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.baoyu-skills/baoyu-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
Workflow
Step 0: Pre-check (Chinese Content)
Condition: Only execute if input file contains Chinese text.
Detection:
- Read input markdown file
- Check if content contains CJK characters (Chinese/Japanese/Korean)
- If no CJK content → skip to Step 1
Format Suggestion:
If CJK content detected AND baoyu-format-markdown skill is available:
Use AskUserQuestion to ask whether to format first. Formatting can fix:
- Bold markers with punctuation inside causing
**parse failures - CJK/English spacing issues
If user agrees: Invoke baoyu-format-markdown skill to format the file, then use formatted file as input.
If user declines: Continue with original file.
Step 1: Confirm Theme
Before converting, use AskUserQuestion to confirm the theme (unless user already specified):
| Theme | Description |
|---|---|
default (Recommended) |
经典主题 - 传统排版,标题居中带底边,二级标题白字彩底 |
grace |
优雅主题 - 文字阴影,圆角卡片,精致引用块 |
simple |
简洁主题 - 现代极简风,不对称圆角,清爽留白 |
Step 2: Convert
npx -y bun ${SKILL_DIR}/scripts/main.ts <markdown_file> --theme <theme>
Step 3: Report Result
Display the output path from JSON result. If backup was created, mention it.
Usage
npx -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:
# 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"
Output
File location: Same directory as input markdown file.
- Input:
/path/to/article.md - Output:
/path/to/article.html
Conflict handling: If HTML file already exists, it will be backed up first:
- Backup:
/path/to/article.html.bak-YYYYMMDDHHMMSS
JSON output to stdout:
{
"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"
}
]
}
Themes
| Theme | Description |
|---|---|
default |
经典主题 - 传统排版,标题居中带底边,二级标题白字彩底 |
grace |
优雅主题 - 文字阴影,圆角卡片,精致引用块 (by @brzhang) |
simple |
简洁主题 - 现代极简风,不对称圆角,清爽留白 (by @okooo5km) |
Supported Markdown Features
| 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 |  |
| Links | [text](url) 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 |
Frontmatter
Supports YAML frontmatter for metadata:
---
title: Article Title
author: Author Name
description: Article summary
---
If no title is found, extracts from first H1/H2 heading or uses filename.
Extension Support
Custom configurations via EXTEND.md. See Preferences section for paths and supported options.
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (7,904 bytes)
- 📎 scripts/main.ts (10,489 bytes)
- 📎 scripts/md/extensions/alert.ts (19,759 bytes)
- 📎 scripts/md/extensions/footnotes.ts (2,427 bytes)
- 📎 scripts/md/extensions/index.ts (280 bytes)
- 📎 scripts/md/extensions/infographic.ts (3,698 bytes)
- 📎 scripts/md/extensions/katex.ts (4,742 bytes)
- 📎 scripts/md/extensions/markup.ts (2,372 bytes)
- 📎 scripts/md/extensions/plantuml.ts (8,306 bytes)
- 📎 scripts/md/extensions/ruby.ts (4,044 bytes)
- 📎 scripts/md/extensions/slider.ts (3,019 bytes)
- 📎 scripts/md/extensions/toc.ts (2,115 bytes)
- 📎 scripts/md/LICENSE (650 bytes)
- 📎 scripts/md/package.json (321 bytes)
- 📎 scripts/md/render.ts (25,333 bytes)
- 📎 scripts/md/themes/base.css (718 bytes)
- 📎 scripts/md/themes/default.css (7,857 bytes)
- 📎 scripts/md/themes/grace.css (2,538 bytes)
- 📎 scripts/md/themes/simple.css (2,715 bytes)
- 📎 scripts/md/utils/languages.ts (8,295 bytes)