Nov 20, 2026

Turn Anything into Markdown, Then Polished HTML or Publisher-Grade DOCX

A 1k-star skill from the huashu family runs a four-way md/html/docx pipeline — anything to markdown, markdown to themed HTML, HTML back to markdown, and markdown to publisher-ready DOCX.

#tutorial#markdown#workflow#productivity

Writing happens in markdown and sharing happens in HTML, but the conversion between them is usually the ugly part. huashu-md-html, another member of the huashu skill family, treats markdown as the source and everything else as a product: PDFs and URLs come in as clean markdown, markdown goes out as themed HTML or a publisher-grade DOCX.

Why This Skill Matters

The README frames the observation directly: in the AI era, the production format and the consumption format have decoupled for the first time. One skill covers four directions — anything to markdown (markitdown), markdown to polished HTML (pandoc plus four hand-tuned themes), HTML back to markdown (html-to-markdown plus trafilatura), and markdown to publisher-grade DOCX (python-docx with typesetting presets). Every theme passes the repo's anti-AI-slop checklist — no purple gradients, no emoji as icons, no #0D1117 dark-blue backgrounds.

Installation

npx skills add alchaincyf/huashu-md-html

The README lists Claude Code, Cursor, Codex, OpenClaw and Hermes as runtimes that can install it. Python dependencies matter here: markitdown[all], pandoc (on macOS, brew install pandoc), html-to-markdown, trafilatura, and python-docx plus Pillow. The scripts self-check at startup and print the install command for anything missing instead of failing silently — and on macOS, install with python3 -m pip install ..., because pip and python3 can point at different Python versions.

Real Workflow: A Whitepaper into Themed HTML, Then a Book into DOCX

The natural-language interface needs no panel:

「这个 PDF 转成 md」
「把这篇 md 做成精美 html,用 article 主题」

Underneath, each capability is one script. The whitepaper path runs python3 scripts/any_to_md.py whitepaper.pdf -o whitepaper.md, then python3 scripts/md_to_html.py whitepaper.md --theme report -o whitepaper.html — the README's own documented scenario.

URLs have a documented fork. Structured pages (product details, technical docs, API references, certificate pages, e-commerce product pages) go through capability 1 with markitdown to keep metadata, field values, links and heading hierarchy; prose pages (blogs, news, essays, long reads) go through capability 3 with trafilatura to strip navigation, sidebars, related recommendations and ads. The README's shortcut: if the content is for reading, take capability 3; if it is for looking things up, take capability 1 — and when unsure, run both and compare.

The DOCX end is the publishing destination. The README's position is that pandoc md -o docx output — default Calibri, no table styles, no cover — can be read by machines but not edited by a publishing house. The alternative script ships book mode:

python3 scripts/md_to_docx.py ch*.md postscript.md appendix.md --book \
    --title "图解 Agent Skills" \
    --subtitle "让 AI 记住你的工作方式" \
    --author "花叔" \
    --images-dir ./images \
    -o book.docx

Page size is large 32-mo (176×240mm) or A4, and the presets cover chapter titles, code blocks with a left accent border, centered figures with captions, and running headers with automatic page numbers. As its own validation, the repo says this script produced a 158-page publisher-review manuscript of 《图解 Agent Skills》 — 9 chapters plus postscript and appendix with 57 figures — in one command.

Tips

  • The four themes map to intents: article (Tufte-inspired, for essays and blogs), report (whitepaper style, dense tables), reading (Medium-minimalist, single column), and interactive (fold-and-navigate for long tutorials and books). A fifth, WeChat-specific template sits in the repo for WeChat Official Account transfers.
  • Typography floors are shared across themes: Chinese line height 1.75–1.85, desktop font size 17–18px, article max width 680–720px.
  • The banned list is explicit: purple gradients, cyber neon, #0D1117 backgrounds, Comic Sans, emoji as formal icons.
  • For archived content, capability 3 pulls a published blog back into project-source markdown instead of losing the HTML.

When Not to Use This

The DOCX presets target the publishing pipeline the README describes — when your destination is a plain internal document with no editorial requirements, pandoc's direct md -o docx conversion is fewer moving parts. And the theme aesthetics are deliberately restrained; if a project needs a branded marketing page, a themed conversion will not substitute for design work.


See the leaderboard for more skills.