html2md
Skill8 starsChanged 3 months agoMITView on GitHub
Convert HTML to clean Markdown, optimized for slide-style presentation decks and huge files with inlined base64 images/videos. Strips data URIs BEFORE parsing (so a 10 MB deck converts in seconds, not minutes), detects `.slide` blocks and emits one `## Slide NN — Title` section per slide, and turns common deck semantic-divs (stat-num/stat-label, cards, timelines) into readable Markdown. Triggers: html2md, html to md, html→md, 转换 deck 为 markdown, deck 转 md, slide html to md.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- sunbos/sunbo-skillstheir own version, first seen Oct 25, 2026
- jiamiaomiao029-gif/xiaoshui-content-skilltheir own version, first seen Apr 30, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- jiamiaomiao029-gif/xiaoshui-content-skill★ 9same name
- sunbos/sunbo-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository32 other files it gives its agents.
- ai-genSkill
- any2mdSkill
- assignment-wordSkill
- cheatsheatSkill
- claude2antiSkill
- claude2codexSkill
- codex2claudeSkill
- fincomp-deckSkill
- github-trendingSkill
- git-pushSkill
- html2pdfSkill
- html2texSkill
- html-slidesSkill
- img-readerSkill
- latex-beamerSkill
- markitdownSkill
- md2docxSkill
- md2texSkill
- mergeSkill
- notesSkill
- paper-html-onepageSkill
- paper-reproSkill
- pdf2wordSkill
- pdf-readerSkill
- posterSkill
- repo-docsSkill
- repo-docs-zhSkill
- resume-builderSkill
- web-search-fallbackSkill
- word2htmlSkill
- word2mdSkill
- word2pdfSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 100
Read deck.md + the critique notes (e.g.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
html2md — HTML → Markdown (deck-aware, base64-safe)
A stdlib-only converter (html2md.py) tuned for two cases generic converters
choke on:
- Slide decks — a
.slide-per-page HTML presentation. A normal converter flattens it into one wall of text; this one keeps the slide structure and emits## Slide NN — Titleheaders. - Huge embedded HTML — decks saved as single
.htmlwith every image and video inlined as base64 (often 5–50 MB).markitdownand friends spend minutes decoding megabytes of base64 into useless inline blobs; this strips the data URIs first, then parses.
When to Use
- User mentions:
html2md,/html2md, "html to md", "html→md", "把 deck 转成 markdown", "deck 转 md" - You have a slide-style HTML deck (each slide is a
<div class="slide">/<section class="slide">) and want structured per-slide Markdown - You have a bloated HTML file (multi-MB) that is mostly base64 —
markitdownhangs or produces garbage - You want to extract the text content of a deck so an LLM can critique / revise it
When NOT to Use (use a different skill instead)
| Need | Better skill |
| Generic non-deck HTML page | markitdown (/markitdown) — broad format support |
| DOCX with math | /word2md (correct OMML→LaTeX) |
| PDF → Markdown | /any2md --pdf-backend pymupdf or /pdf-reader |
| Want to render a deck to PDF (md/html → pdf) | /html2pdf |
| A whole web page from a URL | the web_reader MCP tool |
How to Use
# Convert, write to a sibling .md file
PYTHONIOENCODING=utf-8 python ~/.claude/skills/html2md/html2md.py "deck.html" "deck.md"
# Convert, print to stdout
PYTHONIOENCODING=utf-8 python ~/.claude/skills/html2md/html2md.py "deck.html"
# Extract the base64 images/videos to disk and rewrite refs (instead of [IMAGE] placeholders)
PYTHONIOENCODING=utf-8 python ~/.claude/skills/html2md/html2md.py "deck.html" "deck.md" --extract-assets
# Drop [IMAGE]/[VIDEO] placeholders entirely (pure text)
PYTHONIOENCODING=utf-8 python ~/.claude/skills/html2md/html2md.py "deck.html" "deck.md" --no-assets
# Flat document — don't try to split slides
PYTHONIOENCODING=utf-8 python ~/.claude/skills/html2md/html2md.py "page.html" "page.md" --no-slidesAlways set PYTHONIOENCODING=utf-8 on Windows — Chinese/CJK decks mojibake
without it.
Arguments
| Arg | Required | Description |
input | yes | Input .html file |
output | no | Output .md path (default: stdout) |
--extract-assets | no | Save base64 blobs to <stem>_assets/ and reference them by path (default: replace with [IMAGE] / [VIDEO]) |
--no-assets | no | Omit asset placeholders entirely — pure text |
--no-slides | no | Don't split into per-slide sections; one flat document |
What It Detects
- Slide structure: any
<div class="…slide…">/<section class="…slide…">. Reads.slide-num,.slide-title,.slide-title-ento build the## Slide NN — Title / _EN subtitle_header. Falls back to<!-- === NN LABEL === -->HTML comments if classes are absent. - Semantic divs common in decks:
.stat-num+.stat-label,.phase-year/.phase-name/.phase-tag,.label/.source-link/.source-note,.maic-ms-*timeline milestones,.action-*5W1H cards. These become readable inline Markdown (**13%** — global ATP share) instead of being lost. - Source links:
<a class="source-link" href="…">Source: MIDA</a>→[→ Source: MIDA](url). - Tables:
<table>→ pipe tables. - Document
<title>: becomes the top-level# Title.
Dependencies
None. Pure Python 3 stdlib (html.parser, re, base64, hashlib).
Works on any machine with Python ≥ 3.8.
Notes / Gotchas
- The slide-splitter caps each slide's inner HTML at 200 KB to defeat greedy
regex across nested
<div>s. If a slide is genuinely larger than that, raise the limit insplit_slides(). --extract-assetsis the way to recover the inlined videos/images from a bloated deck: it writes each blob to<input-stem>_assets/<kind>_<hash>.<ext>and emits. Hashes dedupe identical assets.- For a dark/light themed BFLab deck with
.presentation { width:1280px; height:720px }and.slide { position:absolute }, the splitter works as-is. - This skill does not render HTML or produce PDF — for that use
/html2pdf(Chrome headless--print-to-pdf, one PDF page per slide).
Workflow: critique-then-revise a deck
A common use of this skill is to get the text of a deck out so it can be reviewed or rewritten:
html2md deck_embedded.html deck.md— extract clean per-slide Markdown.- Read
deck.md+ the critique notes (e.g.eunice_suggestion.md). - Author a revised deck HTML (a new file — don't edit the original).
/html2pdfthe revised HTML to PDF.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

