md-document
БесплатноЗапускает вложенные скриптыНе проверенConvert authored markdown into a polished self-contained HTML document with a table of contents, numbered figures and tables, cross-references, footnotes, and…
от borghei★ 1 250 звёзд на GitHubОб этом скилле
Markdown Document Publishing
Turn an authored markdown file into a single HTML document you can email, host, or print — semantic structure, an automatic table of contents, figures and tables numbered and referenceable by number, footnotes, and a print stylesheet that survives contact with a PDF exporter. One file out, no runtime dependencies, no external assets.
When to use this skill
- Publishing a report or whitepaper that must arrive as one file, not a folder
- Producing a PDF from markdown without a LaTeX or Pandoc toolchain
- Numbering figures and tables so prose can reference them instead of saying "below"
- Converting untrusted or contributed markdown where injection safety matters
- Standardizing a document series so every issue looks like the same publication
- Catching broken cross-references before a document reaches readers
Inputs the skill expects
- A markdown source file, optionally with YAML frontmatter
- Figure images as relative paths, or as base64 data URIs (PNG, JPEG, GIF, WebP or AVIF) for true single-file output
- The intended output: screen, print, or both
- Document length and whether a table of contents is warranted
- Page geometry, if printing: size, margins, single- or double-sided
- A stylesheet, if not using the bundled theme
Clarify First
Before converting, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.
- Screen, print, or both: why it changes the output: print needs a page profile, forced light colors, and break control; skipping it produces a document that looks right on screen and breaks on paper.
- Whether images must be embedded: why it changes the output: relative image paths mean the HTML file is not actually self-contained, which defeats the point if it will be emailed.
- Document length and TOC expectation: why it changes the output: a TOC on a two-page memo is noise; depth 3 on a long report produces a TOC longer than some sections.
- Whether the markdown is trusted: why it changes the output: it does not change escaping (always on), but it determines whether a review gate should run first.
Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.
Workflows
Workflow 1 — Convert a document to self-contained HTML
- Audit labels and references first — the converter's gate reports broken references, but the auditor explains what to do about each one.
- Convert. The bundled theme is inlined automatically; pass
--cssto override. - Check the gate. A non-zero exit means the rendered document contains visible
[?fig:name]markers where numbers should be.
python3 markdown-html/md-document/scripts/crossref_auditor.py \
--input markdown-html/md-document/assets/sample_document.md --format text
python3 markdown-html/md-document/scripts/md_to_html.py \
--input markdown-html/md-document/assets/sample_document.md \
--out build/report.html --toc-depth 2 --format text
Workflow 2 — Produce a print-ready PDF
- Generate the print block from a page profile and append it to the theme, so the exported file carries its own print rules.
- Convert with the extended stylesheet.
- Open in a browser, print to PDF with margins set to Default — a browser
margin setting overrides
@pageand will clip content.
python3 markdown-html/md-document/scripts/print_profile.py \
--input markdown-html/md-document/assets/sample_print_profile.json \
--out build/print.css --format text
cat markdown-html/md-document/assets/document_theme.css build/print.css > build/full.css
python3 markdown-html/md-document/scripts/md_to_html.py \
--input markdown-html/md-document/assets/sample_document.md \
--css build/full.css --out build/report.html
Workflow 3 — Gate a document series in CI
- Run the auditor at
warningseverity so unlabelled figures block, not just broken references. - Run the conversion gate; it fails on unresolved references and undefined footnotes — both render as visible defects.
- Emit JSON for both so a CI job can annotate the diff.
python3 markdown-html/md-document/scripts/crossref_auditor.py \
--input markdown-html/md-document/assets/sample_document.md --max-severity warning --format json
python3 markdown-html/md-document/scripts/md_to_html.py \
--input markdown-html/md-document/assets/sample_document.md --out build/report.html --format json
Decision frameworks
Table-of-contents depth
| Document length | TOC | --toc-depth |
|---|---|---|
| Under 3 pages | none — omit [TOC] |
n/a |
| 3-10 pages | yes | 1 (## only) |
| 10-30 pages | yes | 2 (default) [PROVEN] |
| Over 30 pages | yes | 2, plus per-section navigation |
If the TOC exceeds one screen, r
Установить md-document в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл md-document?
Convert authored markdown into a polished self-contained HTML document with a table of contents, numbered figures and tables, cross-references, footnotes, and print-ready CSS. Use when publishing a report, whitepaper, or memo.
Как установить скилл md-document?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл md-document запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic