Document Pipeline / Markdown, HTML & Word Skill

Huashu MD-HTML:
Treat Markdown as source code; compile to clean HTML and Word.

A four-way document pipeline wrapping markitdown, Pandoc, html-to-markdown, trafilatura, and python-docx. Convert almost any file into clean Markdown, compile self-contained editorial HTML, archive web articles back to Markdown, or output publisher-grade DOCX manuscripts.

Author: · MIT License · Verified against repository on

What Huashu MD-HTML helps you ship.

Convert Any File to Clean Markdown

Run scripts/any_to_md.py (markitdown) on PDF, DOCX, PPTX, XLSX, EPUB, images, audio, or structured web pages.

Compile 4 Anti-AI-Slop HTML Themes

Render self-contained, zero-CDN HTML in article (Tufte-inspired), report (whitepaper), reading (minimal), or interactive (sidebar TOC) themes.

Archive Published Web Pages Back to Markdown

Use scripts/html_to_md.py with trafilatura and Rust html-to-markdown to strip navbars, sidebars, and ads from live blogs.

Export Publisher-Ready Word (DOCX)

Compile single essays or multi-chapter books via scripts/md_to_docx.py with covers, TOC, styled tables, headers/footers, and centered figures.

Quick Start

Turn one messy PDF or Markdown draft into editorial HTML.

npx skills add alchaincyf/huashu-md-html

Scripts self-check missing dependencies and print exact install commands. On macOS, use python3 -m pip install (plus brew install pandoc) to avoid pip/python3 version mismatches.

  1. 1. Install the skill and local converters

    Run npx skills add alchaincyf/huashu-md-html, install Pandoc, and install the Python packages you need (markitdown, trafilatura, html-to-markdown, python-docx, Pillow) via python3 -m pip.

  2. 2. Choose the right path for your input

    Use markitdown for structured docs and API pages you query; use trafilatura for essays and blog posts you read; compile to HTML for web sharing or DOCX for editorial review.

  3. 3. Pick one of 4 themes and verify locally

    Open the generated self-contained HTML directly in any browser—no external CDN needed—or inspect the styled Word manuscript in Microsoft Word.

Copy-and-paste first prompt

Use huashu-md-html to convert [insert file path or URL] into clean Markdown, check that headings and tables stayed intact, and then compile two self-contained HTML previews using the article and report themes so I can compare typography and layout.

Real references and examples from the repo.

Frequently asked questions.

When converting a URL, should I use markitdown or trafilatura?

Use markitdown for structured reference pages (API docs, product specs) where fields and metadata matter; use trafilatura for long-form articles and blogs where you want navbars and ads stripped cleanly.

Do the compiled HTML files work offline?

Yes. All four themes inline a self-contained CSS stylesheet with zero external CDN dependencies.

Why build a dedicated md_to_docx.py instead of using Pandoc for Word?

Default Pandoc DOCX output lacks covers, styled tables, and publisher-ready typography. The custom python-docx script was battle-tested to compile a 158-page book manuscript with 57 figures in one command.

Can it combine multiple Markdown chapters into one Word book?

Yes. Pass multiple chapter files with the --book flag along with --title, --subtitle, --author, and --images-dir.

What is the most common setup issue on macOS?

Mismatched pip and python3 binaries. Always run python3 -m pip install so packages install into the same interpreter the scripts invoke.

Primary sources

Verified on . Capabilities and install commands follow the public repository; check GitHub for the latest changes.