Logo vun Md2html

Md2html

Communautéit
haidang1810
md2html

Convert long-form Markdown (plan, spec, system design, RFC, runbook, postmortem, brainstorm, notes) into a single self-contained HTML page with Mermaid diagrams, step timelines, callouts, sidebar TOC. Claude-orange light+dark theme. Multi-language. Portable across Claude Code / Codex / Antigravity / any AI agent.

Iwwersiicht

Editeurhaidang1810
Repositorymd2html
Skill-Nummmd2html
Stären
419
Forks
27
Matgeliwwert Fichieren
6
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 6 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum haidang1810 op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Md2html an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/haidang1810/md2html/tree/main
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/haidang1810/md2html.git \
  .claude/skills/md2html
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Md2html an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Md2html automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Md2html net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

/md2html

Convert a verbose Markdown document into a single, self-contained HTML file that a tired human can actually scan: diagrams instead of paragraphs, step cards instead of numbered lists, callouts for the parts that matter.

Usage

/md2html <file.md>             # output <file>.html next to source
/md2html <file.md> --out X.html # custom output path
/md2html                       # if no arg, ask user which file

Skill files (resolved relative to this SKILL.md)

  • template.html — HTML skeleton with embedded CSS (Claude orange light+dark), Mermaid CDN, theme toggle, TOC sidebar, footer. Contains {{PLACEHOLDER}} strings and <!-- COMMENT --> slots.
  • components.md — catalog of HTML snippets you must copy verbatim (step cards, callouts, mermaid blocks, pros-cons, comparison cards, collapsibles).
  • examples/ — at least one reference <doc>.md → <doc>.html pair. Read one to calibrate output quality before starting.

You MUST read all three before writing output. Do not invent CSS classes or skip the catalog.

What you must do when invoked

Follow these steps in order. Do not skip.

Step 1 — Resolve inputs

  1. Determine the source file from the user's invocation. If none given, ask: "Tệp .md nào cần convert?" and stop.
  2. Read the source .md fully.
  3. Read template.html and components.md from the same directory as this SKILL.md.
  4. Read one example pair under examples/ to calibrate.

Step 2 — Analyze the source document

Do this analysis silently in your head (or as one short summary line to the user). Identify:

  • Language of the source — detect from the actual prose, not the filename. Set <html lang="..."> to the ISO 639-1 code (en, vi, zh, ja, ko, es, fr, de, ru, ar, th, …) and translate every UI label to that language.

    Common samples (extend to any language using the same scheme):

    KeyENVIZH (中文)JA (日本語)KO (한국어)ES (Español)
    TOC titleContentsMục lục目录目次목차Contenido
    Read-time~N min read~N phút đọc~N 分钟阅读~N 分で読了~N분 소요~N min de lectura
    Recommended★ Recommended★ Đề xuất★ 推荐★ 推奨★ 추천★ Recomendado
    Key pointKey pointÝ chính要点要点핵심Idea clave
    Pros✓ Pros✓ Ưu điểm✓ 优点✓ 長所✓ 장점✓ Ventajas
    Cons✕ Cons✕ Nhược điểm✕ 缺点✕ 短所✕ 단점✕ Desventajas
    Print tooltipPrint / Save PDFIn / Lưu PDF打印 / 保存 PDF印刷 / PDF 保存인쇄 / PDF 저장Imprimir / Guardar
    Theme tooltipToggle themeĐổi theme切换主题テーマ切替테마 전환Cambiar tema
    Source: prefixSource:Nguồn:来源:ソース:소스:Fuente:

    For any language not listed, translate using the same conventions. The "Recommended" badge is configured via the --rec-label CSS variable set on <html> (no per-language CSS needed) — see {{REC_LABEL}} below.

    RTL languages (Arabic, Hebrew, Persian) — current template is LTR-only. If source is RTL, also add dir="rtl" to <html> and consider it a known visual limitation (sidebar will stay on the left).

  • Title — from first H1 or filename. Title should be ≤ 80 chars.

  • Subtitle — first paragraph after H1, or the document's TL;DR sentence. ≤ 200 chars.

  • Doc type — infer one of: PLAN, SPEC, SYSTEM DESIGN, RFC, RUNBOOK, POSTMORTEM, BRAINSTORM, NOTES. Pick the closest match based on the document's purpose, not its filename. Brainstorm = exploring options with rationale; Plan = ordered steps to a goal; Spec = exact behavior contract; System design = architecture + tradeoffs; RFC = proposal seeking feedback; Runbook = operational procedure; Postmortem = incident review. The uppercase code in the eyebrow stays universal; the topbar BRAND_LABEL localizes (Plan / Kế hoạch / 计划 / etc).

  • Reading time — words ÷ 250, round to nearest minute. Format: ~N min read (EN) or ~N phút đọc (VI).

  • Section map — walk each H2/H3 and tag with the BEST component using §11 cheatsheet in components.md:

    • numbered action list → Timeline
    • architecture/flow prose → Mermaid
    • "ưu/nhược", "pros/cons" → Pros-Cons
    • "option A vs B" → Comparison cards
    • critical conclusion → Key-point highlight
    • warnings/decisions → Callouts
    • long appendix → Collapsible
    • everything else → plain <h2> + <p>

Step 3 — Build the output HTML

  1. Copy the full template.html content into a string. Do NOT use Read-then-Edit on a file you haven't created; instead, build the output buffer in memory then Write once.
  2. Replace placeholders in the template (all values come from Step 2 analysis, language-matched):
    • {{LANG}} → ISO 639-1 code: en / vi / zh / ja / ko / es / …
    • {{REC_LABEL}} → text shown on the "Recommended" comparison-card badge, e.g. ★ Recommended / ★ Đề xuất / ★ 推荐 / ★ 추천. Sets the --rec-label CSS variable on <html>. If you forget this, CSS falls back to ★ Recommended.
    • {{TITLE}} (appears twice: <title> and .doc-title)
    • {{SUBTITLE}}
    • {{DOC_TYPE}} → universal uppercase code: PLAN, SPEC, SYSTEM DESIGN, RFC, RUNBOOK, POSTMORTEM, BRAINSTORM, NOTES
    • {{SOURCE_FILE}} → basename of source (e.g. plan.md)
    • {{DATE}} → ISO date or localized "Updated "
    • {{READ_TIME}} → localized reading time, e.g. ~3 min read / ~3 phút đọc / ~3 分钟阅读
    • {{BRAND_LABEL}} → localized doc-type label for the topbar
    • {{TOC_TITLE}} → localized "Contents" (also used as aria-label for the TOC drawer)
    • {{PRINT_TOOLTIP}} → localized print tooltip
    • {{THEME_TOOLTIP}} → localized theme-toggle tooltip
    • {{CLOSE_LABEL}} → localized "Close" (used for the mobile TOC drawer close button), e.g. Close / Đóng / 关闭 / 閉じる
    • {{SKIP_LINK_LABEL}} → localized skip-to-content link text, e.g. Skip to content / Bỏ qua menu / 跳到正文
    • {{FOOTER_NOTE}} → localized source attribution (e.g. Source: plan.md / Nguồn: plan.md / 来源: plan.md)
  3. Replace <!-- TOC_ENTRIES --> with one <a> per H2/H3 (see §2 in components.md). Generate stable kebab-case id from heading text.
  4. Replace the slot between <!-- CONTENT_START --> and <!-- CONTENT_END --> with the document body, section by section, using components from components.md. Each section must:
    • Start with <h2 id="..."> (matching the TOC entry).
    • Use ONE primary component per logical chunk (don't stack 3 callouts in a row).
    • Preserve original meaning — do not summarize away technical detail; condense only filler/repetition.
  5. Write the assembled HTML to the output path.

Step 4 — Verify

After writing, do ONE quick sanity check by re-reading just the section you generated (not the whole file):

  • Every id="..." referenced in the TOC exists on a heading.
  • No leftover {{PLACEHOLDER}} strings.
  • Mermaid blocks have valid syntax (use flowchart, sequenceDiagram, erDiagram, stateDiagram-v2, or gantt — never bare graph without direction).
  • No <script> tags added beyond what template.html already includes.

Report back to the user with:

  • Output file path
  • 1-line summary of what changed (e.g. "Rendered 7 sections: 1 mermaid flow, 2 step timelines, 4 callouts. ~6 phút đọc.")
  • A reminder they can open it with xdg-open <file>.html (Linux) / open <file>.html (mac).

Critical rules

  1. Never paraphrase technical content into vague prose. A step chạy migration 0042_user_schema.sql must remain that exact filename — don't change to chạy migration mới.
  2. One component per chunk. Don't wrap a callout inside a step card inside a collapsible. Keep nesting flat.
  3. Mermaid > prose for any flow ≥ 3 hops. If the source says "A gọi B, B gọi C, C ghi DB", make a diagram.
  4. Key-point highlights are rare. Max 1 per H2 section, ideally 2-3 total per document.
  5. UI text follows the detected source language — including for non-EN/non-VI sources (Chinese, Japanese, Korean, Spanish, etc). Use the language sample table in Step 2 or translate equivalently. Code, commands, file names, library names, error messages stay verbatim regardless of language.
  6. Self-contained output. No external file references except the CDN scripts already in template.html.
  7. Do not modify template.html or components.md — those are the skill's source of truth. Only Write the output .html.
  8. Use SVG icons only — never emojis. Every icon is <svg class="..."><use href="#i-NAME"/></svg> referencing the sprite at the top of <body>. See §13 in components.md for the catalog. No emoji glyphs anywhere in callouts, doc-meta, topbar, or body content.
  9. Anchor links and copy-to-clipboard auto-inject via JS — do NOT add them manually. Just give H2/H3 a proper id, and put code in <pre><code>. The template's boot script handles the rest.
  10. Wrap wide tables in .table-wrap — see components.md §14b. Tables ≥ 4 columns or with long cells need the wrapper for mobile scroll.
  11. Use <figure> + <figcaption> for images with descriptive alt. See components.md §14a.

Cross-AI compatibility

This skill is designed to run identically on:

  • Claude Code — install at ~/.claude/skills/md2html/ (this directory, symlinked or copied). Invoke with /md2html <file>.
  • Codex CLI — copy SKILL.md content to ~/.codex/prompts/md2html.md, keep template.html and components.md at a stable absolute path, update the file references in SKILL.md if needed. Invoke with /md2html.
  • Antigravity — add SKILL.md as a custom prompt/agent instruction, ensure the agent has Read/Write tool access to the skill folder.

The only external dependency is mermaid via CDN (resolved at HTML open time, not at skill execution time). No npm/pip install required for the skill itself.

Edge cases

  • Source has no headings — wrap content in one <h2 id="content">Nội dung</h2> and infer logical breaks from blank lines + topic shifts.
  • Source has existing mermaid code blocks — keep them, just rewrap in <figure class="diagram"> with caption.
  • Source has HTML embedded — pass through as-is inside <div> if safe, else escape.
  • Source is very short (< 200 words) — skip TOC sidebar (delete <aside class="toc"> block), render as single column.
  • Source is very long (> 5000 words) — collapse low-priority sections by default with <details>.
  • Output file already exists — overwrite. The source .md is canonical; HTML is regenerated artifact.

Anti-patterns

  • ❌ Generating the HTML in many small Edit calls — produces drift. Build full string, Write once.
  • ❌ Adding new CSS via <style> — extend template.html instead and tell the user.
  • ❌ Translating proper nouns or code identifiers.
  • ❌ "Improving" the source by adding info not in the original.
  • ❌ Reporting success without running Step 4 verification.

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Md2html?

Convert long-form Markdown (plan, spec, system design, RFC, runbook, postmortem, brainstorm, notes) into a single self-contained HTML page with Mermaid diagrams, step timelines, callouts, sidebar TOC. Claude-orange light+dark theme. Multi-language. Portable across Claude Code / Codex / Antigravity / any AI agent.

Firwat Md2html op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Md2html besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Md2html an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/haidang1810/md2html/tree/main an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Md2html benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Md2html benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Md2html domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Md2html gratis?

Jo. De Skill gëtt vum haidang1810 ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇