プロトタイプ · プレビュー版:公式レジストリのすべてのサーバーを掲載し、30分ごとに同期しています。Google でログインするとレビューを書けます。プロトタイプ · 30分ごとに更新
PopNx MCPAIを使う人のためのMCPサーバー · やさしい言葉で解説

huashu-md-html Skill

リポジトリ ↗

作者:alchaincyf★ 9481 個の skill

インストール

What it does

md/html 双向流水线 · 三个能力一站式:万物→md / md→精美html / html→md。封装 markitdown + Pandoc + html-to-markdown + trafilatura。4 套反 AI slop 主题。Claude Code skill.

  • Connects Instruction files the AI reads, with steps that call an outside service
  • Account or key Some steps need a key for OpenAI (per the README)
  • Category デザインと Web
作者向け:README にバッジを付ける

作者の方は、このコードを README に貼れます。バッジはこのページにリンクします。

[![Featured on PopNx MCP](https://mcp.popnx.com/badge/skill/alchaincyf-huashu-md-html.svg)](https://mcp.popnx.com/en/skills/alchaincyf-huashu-md-html)

一緒に使える

同じ作業で AI をサービスにつなぐ MCP

Pascal 3D Editor

Create, inspect, validate, and save editable 3D building scenes with Pascal's MCP server.

作者:pascalorg広く使われている↓ 1037/週★ 2.6万 リポジトリ全体のスター昨日更新

MCP · サービスにつなぐパソコンでもクラウドでも✓ 提供元 · pascal.app

Semiotic

Verified React chart generation: select, validate, repair, render, and inspect charts through MCP.

作者:nteract広く使われている↓ 8456/週★ 271720 日前更新

MCP · サービスにつなぐパソコンでもクラウドでも

似た Skill

同じ種類の作業。Skill 一覧と同じ並び

似たものと比べる
これ
huashu-md-html
impeccablediagram-designfrontend-slidesguizang-ppt-skill
作者alchaincyfpbakauscathrynlaveryzarazhangruiop7418
Skill 数11111
GitHub スター948112,54468,06932,51430,030
最終コード更新2026年11月15日2026年11月18日2026年11月13日2026年6月24日2026年10月30日
ライセンスMITApache-2.0MITMITAGPL-3.0

alchaincyf による 1 個の Skill(指示セット)。AI が読んでそのとおりに作業します · MCP server ではありません

Skill と MCP の違い

MCP = 手

AI を外部のサービスやデータにつなぎます(例:Notion を読む、請求書を作る)。プログラムやサーバーが動いている必要があります。

Skill = 手順書

作業のやり方を AI に教えるテキストファイル。どのサービスにもつながりません。

重なる部分もあります。ツールを呼ぶスクリプト付きの Skill や、知識だけを渡す MCP もあります。やりたい作業から選んでください。

使えるアプリ

Claude CodeCodexCursor

提供元の README と repo のフォルダから判断

インストール

Is it safe?

  • Who made it

    GitHub account alchaincyf (person), 3 years old

  • Use and upkeep

    ★ 948 stars · code last changed 2026年11月15日

  • Any scripts?

    4 scripts that can run on a computer: scripts/any_to_md.py, scripts/html_to_md.py, scripts/md_to_html.py, scripts/md_to_docx.py

  • Uses the internet?

    Scripts that go online: scripts/html_to_md.py

  • Changes machine-wide settings?

    No hooks or writes to machine settings found

Checked automatically from the repo files at commit 0943f0b (read only, nothing was run). Not a safety guarantee: read it and decide for yourself

まず:どの AI を使っていますか

使っているアプリを選ぶと、そのアプリでのインストール方法だけが表示されます

Option 1Upload to claude.ai (web and app)

This skill is over 5 MB or 300 files, so we do not build a ZIP. Use "Let the AI install it" instead

Option 1Claude Code にインストールしてもらう

この文をコピーして Claude Code のチャットに貼り付けます

Where to install
Please install the skill huashu-md-html from https://github.com/alchaincyf/huashu-md-html (commit 0943f0b) for all my projects, at ~/.claude/skills/huashu-md-html. First show me every file and tell me whether it has scripts or changes machine settings, then tell me the full path you will install to and wait for me to agree.
Please install the skill huashu-md-html from https://github.com/alchaincyf/huashu-md-html (commit 0943f0b) into the project this chat is open in (at .claude/skills/huashu-md-html). First show me every file and tell me whether it has scripts or changes machine settings, then tell me the project name and the full path you will install to and wait for me to agree.

For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing

The AI tells you what it will do first and asks your permission at every step

Claude Code を開き直し、/huashu-md-html と入力するか関連する作業を頼むと Claude が自動で使います

Checked against official docs 2026年11月12日 · Source: code.claude.com

For Terminal users

Skill は AI が従う指示です。入れる前にファイルを読み、信頼できる提供元のものだけを入れてください。

提供元のおすすめの方法

Node.js を入れる(まだなければ)

もう入っていますか?先に確認 · ターミナルを開き、このコマンドを入力して Enter

node -v
  • バージョン番号(例 v26.13.1)が出る = 入っています。この手順は飛ばせます
  • "command not found"(Windows では "is not recognized")が出る = まだ入っていないか、入れた直後でターミナルを開き直す必要があります
ターミナルの開き方

Mac:⌘ + Space を押し、Terminal と入力して Enter

Windows:スタートメニューを開き、Windows PowerShell と入力して「開く」

まだ入っていない場合: 公式ダウンロードページで LTS 版と、クリックで進むインストーラーを選びます:Mac は .pkg、Windows は .msi。ダブルクリックして最後まで進めるだけで、curl コマンドは不要です

Node.js のダウンロードページを開く ↗

入れ終わったらターミナルを閉じて開き直し、同じコマンドをもう一度実行します。バージョン番号が出れば完了です: node -v

一度入れれば、Node.js を使うすべてのツールで使えます

npx skills add alchaincyf/huashu-md-html

提供元の README から引用。提供元のコードをダウンロードして実行します

  1. ターミナルを開く

    Mac:Command+スペースで Terminal と入力 · Windows:下のコマンドは PowerShell では動きません。上の「AI にインストールしてもらう」を使ってください

  2. skill フォルダを ~/.claude/skills にコピー

    repo を一時フォルダにダウンロードし、SKILL.md のあるフォルダだけをコピーします

    git clone --depth 1 https://github.com/alchaincyf/huashu-md-html.git /tmp/popnx-skill-alchaincyf-huashu-md-html-0943f0b && mkdir -p ~/.claude/skills && cp -R '/tmp/popnx-skill-alchaincyf-huashu-md-html-0943f0b/.' ~/.claude/skills/huashu-md-html
  3. Claude Code を開き直し、/huashu-md-html と入力するか関連する作業を頼むと Claude が自動で使います

自分でインストールした Skill は ChatGPT デスクトップアプリ、Codex CLI、IDE の Codex 拡張機能で使えます · Web 版とモバイル版の ChatGPT では自分でインストールした Skill は使えず、ディレクトリのプラグインに含まれる Skill だけが使えます

ChatGPT デスクトップアプリ

ChatGPT デスクトップアプリには Codex が組み込まれていて、Codex は ~/.agents/skills フォルダから Skill を読み込みます

Option 1ChatGPT にインストールしてもらう

ChatGPT デスクトップアプリで Codex を開き、この文をチャットに貼り付けます

Where to install
Please install the skill huashu-md-html from https://github.com/alchaincyf/huashu-md-html (commit 0943f0b) for all my projects, at ~/.agents/skills/huashu-md-html. First show me every file and tell me whether it has scripts or changes machine settings, then tell me the full path you will install to and wait for me to agree.
Please install the skill huashu-md-html from https://github.com/alchaincyf/huashu-md-html (commit 0943f0b) into the project this chat is open in (at .agents/skills/huashu-md-html). First show me every file and tell me whether it has scripts or changes machine settings, then tell me the project name and the full path you will install to and wait for me to agree.

The AI always shows you the path before installing

The AI tells you what it will do first and asks your permission at every step

Option 2自分でフォルダを置く

huashu-md-html フォルダを ~/.agents/skills/huashu-md-html に置きます

~ はホームフォルダ($HOME)です

For Terminal users

Skill は AI が従う指示です。入れる前にファイルを読み、信頼できる提供元のものだけを入れてください。

  1. ターミナルを開く

    Mac:Command+スペースで Terminal と入力 · Windows:下のコマンドは PowerShell では動きません。上の「AI にインストールしてもらう」を使ってください

  2. skill フォルダを ~/.agents/skills にコピー

    repo を一時フォルダにダウンロードし、SKILL.md のあるフォルダだけをコピーします

    git clone --depth 1 https://github.com/alchaincyf/huashu-md-html.git /tmp/popnx-skill-alchaincyf-huashu-md-html-0943f0b && mkdir -p ~/.agents/skills && cp -R '/tmp/popnx-skill-alchaincyf-huashu-md-html-0943f0b/.' ~/.agents/skills/huashu-md-html

インストールしたあと

  • ChatGPT デスクトップアプリ:サイドバーの Skills を開いて Skill があるか確認します
  • 使い方:ChatGPT では @ を入力して Skill を選びます · Codex CLI や IDE 拡張機能では /skills を実行するか、$ に続けて Skill 名を入力します
  • Codex は新しくインストールした Skill を自動で見つけます。表示されない場合は Codex を再起動してください

Checked against official docs 2026年11月15日 · Source: learn.chatgpt.com

Web 版とモバイル版の ChatGPT

自分でインストールした Skill は使えません。ディレクトリのプラグインに含まれる Skill だけが使えます

この Skill を ChatGPT で使うには、上の方法で ChatGPT デスクトップアプリを使ってください

Checked against official docs 2026年11月15日 · Source: learn.chatgpt.com

Option 1Codex にインストールしてもらう

この文をコピーして Codex のチャットに貼り付けます · ChatGPT デスクトップアプリ内の Codex、Codex CLI、IDE 拡張機能で使えます

Where to install
Please install the skill huashu-md-html from https://github.com/alchaincyf/huashu-md-html (commit 0943f0b) for all my projects, at ~/.agents/skills/huashu-md-html. First show me every file and tell me whether it has scripts or changes machine settings, then tell me the full path you will install to and wait for me to agree.
Please install the skill huashu-md-html from https://github.com/alchaincyf/huashu-md-html (commit 0943f0b) into the project this chat is open in (at .agents/skills/huashu-md-html). First show me every file and tell me whether it has scripts or changes machine settings, then tell me the project name and the full path you will install to and wait for me to agree.

For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing

The AI tells you what it will do first and asks your permission at every step

Codex は新しくインストールした Skill を自動で見つけます。表示されない場合は Codex を再起動してください · 使い方:ChatGPT では @ を入力して Skill を選びます · Codex CLI や IDE 拡張機能では /skills を実行するか、$ に続けて Skill 名を入力します

Checked against official docs 2026年11月15日 · Source: learn.chatgpt.com

For Terminal users

Skill は AI が従う指示です。入れる前にファイルを読み、信頼できる提供元のものだけを入れてください。

  1. ターミナルを開く

    Mac:Command+スペースで Terminal と入力 · Windows:下のコマンドは PowerShell では動きません。上の「AI にインストールしてもらう」を使ってください

  2. skill フォルダを ~/.agents/skills にコピー

    repo を一時フォルダにダウンロードし、SKILL.md のあるフォルダだけをコピーします

    git clone --depth 1 https://github.com/alchaincyf/huashu-md-html.git /tmp/popnx-skill-alchaincyf-huashu-md-html-0943f0b && mkdir -p ~/.agents/skills && cp -R '/tmp/popnx-skill-alchaincyf-huashu-md-html-0943f0b/.' ~/.agents/skills/huashu-md-html
  3. Codex を開き直して関連する作業を頼むと、Codex が skill を一覧に出します

Option 1Cursor にインストールしてもらう

この文をコピーして Cursor のチャットに貼り付けます

Where to install
Please install the skill huashu-md-html from https://github.com/alchaincyf/huashu-md-html (commit 0943f0b) for all my projects, at ~/.cursor/skills/huashu-md-html. First show me every file and tell me whether it has scripts or changes machine settings, then tell me the full path you will install to and wait for me to agree.
Please install the skill huashu-md-html from https://github.com/alchaincyf/huashu-md-html (commit 0943f0b) into the project this chat is open in (at .cursor/skills/huashu-md-html). First show me every file and tell me whether it has scripts or changes machine settings, then tell me the project name and the full path you will install to and wait for me to agree.

For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing

The AI tells you what it will do first and asks your permission at every step

Cursor の Agent チャットで / を入力し huashu-md-html を選ぶ

Checked against official docs 2026年11月12日 · Source: cursor.com

For Terminal users

Skill は AI が従う指示です。入れる前にファイルを読み、信頼できる提供元のものだけを入れてください。

  1. ターミナルを開く

    Mac:Command+スペースで Terminal と入力 · Windows:下のコマンドは PowerShell では動きません。上の「AI にインストールしてもらう」を使ってください

  2. skill フォルダを ~/.cursor/skills にコピー

    repo を一時フォルダにダウンロードし、SKILL.md のあるフォルダだけをコピーします

    git clone --depth 1 https://github.com/alchaincyf/huashu-md-html.git /tmp/popnx-skill-alchaincyf-huashu-md-html-0943f0b && mkdir -p ~/.cursor/skills && cp -R '/tmp/popnx-skill-alchaincyf-huashu-md-html-0943f0b/.' ~/.cursor/skills/huashu-md-html
  3. Cursor の Agent チャットで / を入力し huashu-md-html を選ぶ

Option 1Let the AI install it

Skill を読めるほかのアプリ向けです。この文には Claude Code、Codex、Cursor のパスが入っていて、AI が使っているアプリに合わせて選びます · Copy this sentence into the app’s chat

Where to install
Please install the skill huashu-md-html from https://github.com/alchaincyf/huashu-md-html (commit 0943f0b) for all my projects, at ~/.claude/skills/huashu-md-html (in Codex use ~/.agents/skills/huashu-md-html, in Cursor ~/.cursor/skills/huashu-md-html). First show me every file and tell me whether it has scripts or changes machine settings, then tell me the full path you will install to and wait for me to agree.
Please install the skill huashu-md-html from https://github.com/alchaincyf/huashu-md-html (commit 0943f0b) into the project this chat is open in (at .claude/skills/huashu-md-html; in Codex use .agents/skills/huashu-md-html, in Cursor .cursor/skills/huashu-md-html). First show me every file and tell me whether it has scripts or changes machine settings, then tell me the project name and the full path you will install to and wait for me to agree.

For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing

The AI tells you what it will do first and asks your permission at every step

Checked against official docs 2026年11月12日 · Source: code.claude.com, learn.chatgpt.com, cursor.com

For Terminal users

Gemini CLI や GitHub Copilot など Agent Skills 対応の他のアプリはフォルダが違います。そのアプリのガイドを見て、SKILL.md のあるフォルダをコピーしてください。

GitHub で見る ↗

2026年11月11日 に Claude Code、Codex、Cursor の公式ガイドで skill フォルダを確認

✓ コマンド確認済み 2026年11月18日

元の SKILL.md を見る

以下は提供元の repo の文章で、PopNx MCP の指示ではありません

最初の 8,000 文字を表示 · GitHub で全文を開く

---
name: huashu-md-html
description: "md/html/docx/pdf/epub 多向流水线,落地「md 生产,多端消费」。能力:任意文件(PDF/DOCX/PPTX/XLSX/图片/音频/URL)转干净 md;md 加工成出版级 html、docx、PDF(A4/A5/大32开)、EPUB3,四套精挑模板,html 与 PDF 另有设计师模式(AI 读懂内容后推荐三个差异化视觉方向)。SKIP:需要新生成图片、或只做压缩截图的任务。"
metadata:
  author: "花叔"
  homepage: "https://github.com/alchaincyf"
  repository: "https://github.com/alchaincyf/huashu-md-html"
  version: "1.0.1"
---

# huashu-md-html

## 你是谁

**你不是格式转换器。你是把稿子做成出版物的人。**

同样一份 md,转出来可以是一个「能看」的网页,也可以是一件别人会想收藏的东西。
差别不在工具——pandoc 谁都会调——**在于你把自己当成转换脚本,
还是当成一家出版社。**

那个标准是:产出拿在手里不像「导出来的」,像**做出来的**。
你有能力达到,现在的模型可以调用任何一家出版社、任何一位装帧设计师积累的
排版传统和品位。**限制通常不在能力,在于有没有先认定自己要做到那个水准。**

### 你不是一个人,是一个出版团队

| 角色 | 他负责什么 | 缺了会怎样 |
|---|---|---|
| **编辑** | 内容结构、层级、标题该怎么分 | 一级二级标题乱套,读者找不到路 |
| **装帧设计师** | 版式、字体、留白、那处 120% 的细节 | 「能看」但没人想收藏 |
| **排版师** | 分页、断行、孤行寡行、图文咬合 | 一页只剩一行、标题掉在页底 |
| **印制** | 尺寸、页边距、装订留边、出血 | PDF 打出来发现内侧被装订吃掉 |

媒介不同,主导的人就不同——做网页是装帧设计师说了算,
做纸质书 PDF 是排版师和印制说了算。开工前先想清楚这次谁主导。

### 你可以想多久

**想多久都行。** 版式这件事,多试两个方向再定,比先做完再改省十倍力气。

---

> 你不再需要亲手编辑产物。md 是源代码,html / docx / pdf / epub 是产物。这个 skill 把多端的最优解打通成一条流水线。

## 六个能力(决策树)

| 用户说什么 | 走哪个能力 | 用什么工具 |
|------|------|------|
| 「把这个PDF/DOCX/PPTX/XLSX/EPUB/图片/音频转成md」「import文档」 | **能力1:万物→md** | `scripts/any_to_md.py`(封装 markitdown) |
| 「把这篇md做成网页/出色html/可发布的html」「md转html」 | **能力2:md→精美html** | `scripts/md_to_html.py`(封装 pandoc + 4模板) |
| 「这个本地html转回md」「博客文章URL转md」「提取网页正文」 | **能力3:html→md** | `scripts/html_to_md.py`(封装 html-to-markdown + trafilatura) |
| 「把这些md做成出版社可审校的word」「给出版社/编辑的稿件」「投稿用的docx」「纸质书定稿」 | **能力4:md→精美docx** | `scripts/md_to_docx.py`(封装 python-docx + 专业排版) |
| 「md打印成pdf」「文章转pdf」「A4 pdf」「单章节预览PDF」「打印纸质书外形」 | **能力5:md→精美PDF** | `scripts/md_to_pdf.py`(pandoc + 4模板 + Playwright) |
| 「md做个epub」「电子书」「Apple Books」「Kindle」「单章节预览电子书」 | **能力6:md→精美EPUB** | `scripts/md_to_epub.py`(pandoc + ebooklib) |
| 「这个产品页/技术文档URL转md」「带metadata一起拿」 | **能力1:万物→md**(也吃URL) | `scripts/any_to_md.py` |

**决策原则**:
- 能力1产出的md可以直接喂给能力2/5/6 组成一条龙(如「PDF→md→精美阅读html」或「PDF→md→重新打版 PDF」)
- 能力3用于反向归档(如「把已发布的html博客文章存回项目源」)
- **能力4是出版终点**——给人类编辑/出版社审校时用 docx,不要直接给 html 或 md,专业出版生态默认 docx
- **能力5/6 是 stateless 单 md 转换**——项目级橙皮书(多 fragments + 版本号 + R2 上传 + 微信读书上架)走 huashu-book-pdf skill,不要试图在这里复刻整条发布流水线

### URL 场景的进一步分流(2026-05 实测发现)

URL 输入时**两条路径都能跑**,但产出质量差异巨大。Microsoft Learn 证书页实测:能力1(markitdown)192行,含完整 YAML frontmatter、证书全名、所有结构化字段值、标题层级、链接保留;能力3(trafilatura+html-to-markdown)87行,丢失证书名/字段值/标题层级/链接,只剩扁平正文。

| 页面类型 | 走哪个 | 原因 |
|---------|--------|------|
| **结构化页面**:产品详情、技术文档、API doc、证书/课程页、电商商品页 | **能力1**(markitdown) | 保留 metadata、字段值、链接、标题层级——「信息完整版」 |
| **正文类页面**:博客、新闻、Essay、公众号文章、专栏长文 | **能力3**(trafilatura) | 自动去导航/侧栏/相关推荐/广告——「纯阅读版」 |
| **不确定** | **两个都跑一遍对比** | 看哪个产出对你的下游用途更合适 |

判断捷径:

> **URL 包含的内容是「读」的,还是「查」的?**
> 读 → 能力3(去噪)
> 查 → 能力1(保信息)

## 核心审美底线(继承自 huashu-design)

这个skill产出的每一份html都必须符合花叔的审美底线。**违反任一条都重做,不要交付**。

| 类别 | 必须 | 禁止 |
|------|------|------|
| 配色 | 出版社品位的克制色(赤陶橙 / Tufte象牙白 / 墨水蓝 / 安静灰) | 紫渐变、赛博霓虹、深蓝底(#0D1117)、彩虹色 |
| 字体 | 中文衬线(思源宋/PingFang SC)+ 英文serif/Inter;代码字 JetBrains Mono | Comic Sans、Roboto/Arial 大字号 display、过细字重导致瘦弱感 |
| 图标 | 真图(Wikimedia/Met/Unsplash/AI生成的有内容图)| Emoji作正式图标、SVG手画人物 |
| 容器 | 诚实分隔(细线、留白、字体级差) | 圆角卡片+左border accent 烂大街组合、阴影堆叠 |
| 装饰 | 一处120%细节签名(边距笔记/serif斜体引语/手作排印细节) | 处处平均用力的 emoji + tag + status dot |
| 节奏 | 段落间气口、行高1.75-1.85(中文)、最大宽度680-820px | 顶到边的密集排版、行高1.4以下、>900px宽体(眼动疲劳) |

详细规则见 `references/anti-ai-slop.md`。

## 开工前先问清楚,别边做边猜

收到「转换/美化/导入」类任务时,**不要直接执行**。
不是因为你级别不够要请示——是因为返工成本远大于多问一句。先问:

1. **能力是哪个**?三选一(用决策树自检)
2. **来源/去向**?文件路径 / URL / 字符串?输出到哪?
3. **能力2专属问**:模板选哪个?(article默认 / report / reading / interactive)
4. **特殊需求**?(图片处理:保留相对路径 还是 base64嵌入?语言:中文版/英文版?)

回答清楚再动手。不要默认猜,错了用户返工成本远大于多问一句。

## 能力1:万物 → md(`scripts/any_to_md.py`)

封装 [microsoft/markitdown](https://github.com/microsoft/markitdown) v0.1.5+,一份Python脚本兼容20+种格式。

### 调用

```bash
# 基本:自动按扩展名识别
python scripts/any_to_md.py input.pdf
python scripts/any_to_md.py input.docx -o output.md
python scripts/any_to_md.py "https://www.youtube.com/watch?v=xxx"

# 结构化网页/产品页/技术文档(保留 metadata + 标题层级 + 链接)
python scripts/any_to_md.py "https://learn.microsoft.com/en-us/credentials/certifications/modern-desktop/" -o cert.md

# 启用LLM图片描述(需要OPENAI_API_KEY环境变量)
python scripts/any_to_md.py photo.jpg --llm-describe
```

### 支持的格式

PDF、DOCX、PPTX、XLSX、XLS、HTML、CSV、JSON、XML、图片(EXIF/可选LLM描述)、音频(可选语音转写)、YouTube URL(自动抓字幕)、**普通网页URL**(带 YAML frontmatter)、EPub、ZIP(递归解包)、Outlook邮件(.msg)。

### 已知坑(写在脚本输出里提醒用户)

- 扫描PDF不做OCR,需要挂LLM client或Azure Doc Intelligence
- 复杂表格(合并单元格/嵌套)会丢失语义
- PPTX只保留文本+备注,动画排版完全丢
- 输出**为LLM消费设计**,给人读还要再过一道排版

依赖:`pip install 'markitdown[all]'`(自动检测,缺失时提示安装)。

完整cookbook见 `references/markitdown-cookbook.md`。

## 能力2:md → 精美html(`scripts/md_to_html.py`)

封装 [Pandoc](https://pandoc.org/) + 4套精挑模板,覆盖花叔写作场景全部需求。

### 调用

```bash
# 默认:article模板(Tufte风,适合essay/博客)
python scripts/md_to_html.py article.md

# 选模板
python scripts/md_to_html.py report.md --theme report      # 宽体多表格,适合技术报告/白皮书
python scripts/md_to_html.py article.md --theme reading    # Medium极简,适合公众号转接
python scripts/md_to_html.py book.md --theme interactive   # 折叠目录+SVG图,适合长文/橙皮书

# 输出位置
python scripts/md_to_html.py input.md -o out.html

# 图片处理
python scripts/md_to_html.py input.md --inline-images      # base64嵌入(自包含单文件)
python scripts/md_to_html.py input.md --copy-images        # 拷贝到output目录(默认保持相对路径)
```

### 4套模板速览

| 模板 | 哲学锚点 | 适合场景 |
|------|---------|---------|
| **article** | Tufte CSS启发,Pentagram式信息建筑 | essay、博客、深度阅读、独立文章 |
| **report** | 出版社白皮书风,多表格密度型 | 技术报告、调研、白皮书、产品文档 |
| **reading** | Medium风极简,单栏窄体大字 | 公众号转接、纯阅读、轻量分发 |
| **interactive** | 长文档导航型,折叠+目录+边栏 | 橙皮书章节、技术书籍、长教程 |

每个模板都是**自包含单CSS**,HTML打开即可用,不依赖外部CDN。

### 依赖

- `brew install pandoc`(必装,二进制)
- 脚本启动时自动检查`which pandoc`,缺失则提示安装命令

完整cookbook见 `references/md-to-html-themes.md`。

### 两种模式 · 兜底 vs 视觉设计师

能力 2 有两条路径——

| 模式 | 是否耗 token | 何时用 |
|------|------|------|
| **兜底**(4 主题套版) | ❌ 不耗 | 已知主题、要快、不挑细节——`md_to_html.py --theme xxx` 一条命令出活 |
| **设计师模式**(AI 介入定制) | ✅ 耗 | 让 AI 读懂内容、推荐 3 个设计方向、定制视觉表达 |

兜底模式跑 pandoc 二进制,5 秒出结果,全程不联网不耗 token——这是**默认行为**。
设计师模式是**可选升级**:当用户说「给这个 md 做个出色的 html」「让我看看几种风格」「按 Anthropic 风格做」时,应该启动 4 步工作流(阅读→推荐→拍板→实现)。

完整方法论 + 流派池 + 评审清单见 `references/visual-designer-mode.md`。
**参考实现**:`examples/readme.html`——用设计师模式 · 方向 C(Anthropic 暖色科技)做的活样本。

## 能力3:html → md(`scripts/html_to_md.py`)

封装 [html-to-markdown](https://github.com/Goldziher/html-to-markdown)(Rust底层,150-280MB/s)+ [trafilatura](https://github.com/adbar/trafilatura)(URL场景的正文提取)。

**最适合的场景**:博客文章、新闻报道、Essay、公众号长文——任何「正文是产品、其他都是噪声」的页面。能力3 会扔掉导航/侧栏/相关推荐/广告,只留正文。

**不适合的场景**:产品页、技术文档、API doc、电商商品页这类**结构化页面**——能力3 会丢字段值/链接/层级。这种走能力1(markitdown)。

### 调用

```bash
# 本地HTML文件(直接走 html-to-markdown)
python scripts/html_to_md.py input.html

# 博客/新闻URL(自动跑trafilatura提取正文,去除导航/广告/侧栏)
python scripts/html_to_md.py "https://example.com/article"

# URL但你想要原始HTML不要正文提取
python scripts/html_to_md.py "https://example.com/data" --no-extract

# 精细控制
python scripts/html_to_md.py input.html --bullets="-" --heading-style=atx --strip="script,style,nav,footer"

# 输出
python scripts/html_to_md.py input.html -o output.md
```

### 引擎选择

| 输入类型 | 默认引擎 | 何时切换 |
|---------|---------|---------|
| 本地HTML / 已清洁的HTML | `html-to-markdown` | 速度快、自动净化 |
| 博客/新闻 URL | `trafilatura` 提取正文 → `html-to-markdown` 转换 | 自动启动,去除噪声 |
| 结构化URL(产品页/文档/证书页) | **改用能力1(markitdown)** | trafilatura 会丢字段值,markitdown 保留 metadata 和层级 |
| 需精细控制(heading/bullets风格) | `markdownify`(opt-in,`--engine=markdownify`) | 用户明确要求时 |

依赖:`pip install html-to-markdown trafilatura markdownify`。

完整cookbook见 `references/html-to-md-cookbook.md`。

## 能力4:md → 精美docx(`scripts/md_to_docx.py`)

封装 [python-docx](https://github.com/python-openxml/python-docx) + 出版社级排版预设,专为「给人类编辑/出版社审校/投稿/纸质书定稿」场景设计。

**为什么独立做能力4,不复用能力2 → docx**:pandoc 自带 `md → docx` 但是出来的版式很「生硬」(默认 Calibri、表格无样式、引用块单调、章节首页无设计)。专业出版社/纸面书的版式有自己的语言——章号小标 + 大字号章名 + 英文副标题 + 橙色分隔线、引用块按类型配色、表格表头底色、代码块左侧色条 + 浅灰底、页眉书名 + 页脚自动页码。能力4 把这些预设都内置了,**单文件或一整本书都能一条命令生成**。

### 

話し合い

質問、コツの共有、使えないことの報告ができます。「役に立った」の多い順です。

まだ投稿はありません。最初の質問や共有をどうぞ。

ここの投稿は利用者によるもので、PopNx チームのものではありません。

ログインして投稿

GitHub の情報

GitHub スター
948
提供元
alchaincyf
ライセンス
MIT
最終コード更新
2026年11月15日
repo 内の SKILL.md(翻訳版とテンプレートを含む)
1
トピック
agent-skills, claude-code, claude-code-skills, claude-skills, codex, cursor, document-conversion, epub, html-to-markdown, huashu-skills, markdown, openclaw