
Huashu Md Html
Run a single md-first pipeline that imports arbitrary files to markdown, exports designer-grade HTML or publisher-ready DOCX, and round-trips web content without hand-editing every format.
Overview
Huashu-md-html is an agent skill most often used in Build (also Launch content, Grow content) that turns markdown into a multi-format publishing pipeline with markitdown, Pandoc, and python-docx.
Install
npx skills add https://github.com/alchaincyf/huashu-md-html --skill huashu-md-htmlWhat is this skill?
- Four capabilities: anything→md, md→html, html→md, and md→docx with a clear user-intent decision tree
- md→html offers fallback pandoc mode plus visual designer mode with three differentiated layout directions
- Imports PDF, DOCX, PPTX, XLSX, HTML, images, audio, YouTube, EPUB, and ZIP via markitdown wrappers
- Publisher-oriented DOCX path with covers, TOC, headers, footers, and embedded images for print review
- Inherits anti-AI-slop design taste from huashu-design for HTML that reads like editorial craft
- Four pipeline capabilities plus two md→html modes (fallback and designer)
- Four Pandoc HTML templates bundled for md→html
Adoption & trust: 668 installs on skills.sh; 748 GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You keep rewriting the same document for PDF import, a styled web page, archivable markdown, and a Word manuscript because each format lives in a different tool.
Who is it for?
Indie authors, newsletter operators, and solo PMs who want md as source and need HTML or DOCX exports without opening InDesign or manual Pandoc every week.
Skip if: Teams that only need a one-off PDF scrape with no HTML or book pipeline, or repos where Python markitdown, Pandoc, and docx dependencies cannot be installed.
When should I use this skill?
User asks to convert files or URLs to md, build styled HTML from md, save web pages as md, export publisher DOCX, or compare design directions—even via casual phrases like 这个PDF变md or 做个好看的网页.
What do I get? / Deliverables
One triggered workflow produces the right artifact—clean md, template or designer HTML, loss-minimized md from URLs, or submission-ready DOCX—from a single md source tree.
- Clean markdown from arbitrary inputs or URLs
- HTML pages from templates or designer-customized layouts
- Publisher-ready DOCX with professional typography
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Build/docs is the canonical shelf because the skill treats markdown as source code and automates multi-format publishing artifacts indie authors and product teams need while shipping. Docs subphase fits the four scripted capabilities—any→md, md→html, html→md, md→docx—rather than application runtime code.
Where it fits
Pull a competitor article URL into markdown so you can annotate pain points before scoping your product.
Convert imported PDF specs to md then emit styled HTML for your internal handbook.
Round-trip an old HTML newsletter back to md, edit, and republish as a fresh docx for guest columns.
How it compares
Use instead of ad-hoc single-purpose converters when you want one decision tree across import, styled export, and round-trip web capture.
Common Questions / FAQ
Who is huashu-md-html for?
Solo builders and small content teams who publish in Chinese or bilingual workflows and want agent-driven document conversion with editorial-quality HTML and print-minded Word output.
When should I use huashu-md-html?
Use it while drafting docs in Build, when turning a validated article into a launch landing page in Launch, when archiving competitor URLs to markdown in Idea research, or when packaging Grow newsletter drafts into DOCX for an editor.
Is huashu-md-html safe to install?
Check the Security Audits panel on this Prism page before running bundled scripts; URL import and file conversion touch the filesystem and network and should run on content you trust.
SKILL.md
READMESKILL.md - Huashu Md Html
# huashu-md-html > 你不再需要亲手编辑产物。md 是源代码,html / docx 是产物。这个 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 + 专业排版) | | 「这个产品页/技术文档URL转md」「带metadata一起拿」 | **能力1:万物→md**(也吃URL) | `scripts/any_to_md.py` | **决策原则**: - 能力1产出的md可以直接喂给能力2组成一条龙(如「PDF→精美阅读html」) - 能力3用于反向归档(如「把已发布的html博客文章存回项目源」) - **能力4是出版终点**——给人类编辑/出版社审校时用 docx,不要直接给 html 或 md,专业出版生态默认 docx ### 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`。 ## Junior Designer 工作流 收到「转换/美化/导入」类任务时,**不要直接执行**。先问: 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消费设计**,给