/dsh-deeptutor:html-docfrom dsh-deeptutor
Generates self-contained HTML files from Markdown with dark/light theme toggle, collapsible quiz answers, and print-friendly layout. Useful for study notes, documentation, and exercise sheets.
Ships in dsh-deeptutor. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Convert Markdown into a beautiful, self-contained local HTML file (single file, inline CSS/JS, no network needed to open). Ideal for study notes, knowledge summaries, and self-test question sheets.
html-doc/
├── SKILL.md # this file
├── scripts/
│ └── md-to-html.js # zero-dependency Markdown → HTML converter (Node ≥ 20.11)
└── assets/
└── template.html # default HTML template (CSS + JS, customizable)
# Basic: write Markdown to a file, then convert
node scripts/md-to-html.js notes.md --out notes.html --title "C# 抽象类学习笔记"
# From stdin (any tool output piped in)
cat notes.md | node scripts/md-to-html.js --title "Quiz" --theme dark --out quiz.html
# Options
# --out <file> output path (default: <input>.html)
# --title <text> page title (default: input filename or "Document")
# --theme <mode> dark | light (default: light; user can toggle in-page anyway)
# --toc generate a table of contents from headings (h2/h3)
# --lang <code> html lang attribute (default: zh-CN)
# --no-collapse disable <details> wrapping for quiz answers (default: collapse enabled)
# --template <file> HTML template to use (default: the assets/ copy next to the
# script, or $HTML_DOC_TEMPLATE when that is set)
ATX headings (#–######), fenced code blocks (``` with optional language), inline code, bold, italic, links, unordered/ordered lists, task lists (- [ ] / - [x]), blockquotes, tables (pipe syntax), horizontal rules, paragraphs.
Anything unsupported falls back to a plain <p> — output always stays valid.
~/study/abstract-class/:
knowledge.md — the deep-solve explanationquiz.md — the self-test questions (mark answers inside <details> blocks so they collapse)node scripts/md-to-html.js knowledge.md --out knowledge.html --title "C# 抽象类 · 知识点" --toc
node scripts/md-to-html.js quiz.md --out quiz.html --title "C# 抽象类 · 自测题" --toc
The converter auto-detects quiz structure: any heading containing "答案" / "Answer" / "解析" / "Explanation" starts a <details> block whose following content (until the next heading) is collapsed. Also, a heading line that is immediately followed by content gets wrapped when the heading matches. This keeps the quiz readable while hiding answers until clicked.
To be explicit, authors can also wrap answers manually:
<details><summary>答案:C</summary>
解析:...
</details>
Raw <details>/<summary> blocks are the only raw HTML the converter understands, and they are rebuilt rather than passed through: attributes are dropped (only a bare open is kept), the summary text is HTML-escaped and gets inline formatting, and the body is parsed as Markdown (so fences, lists and bold render, and any HTML inside it is escaped). Everything else is treated as Markdown/text and HTML-escaped.
Edit assets/template.html — it uses {{TITLE}}, {{BODY}}, {{THEME}}, {{LANG}}, {{TOC}}, {{GENERATED}} placeholders. Keep placeholders intact; the converter does simple string replacement. The built-in template includes:
The converter resolves the template in this order (first hit wins); the --out
log line names the file it used, and deeptutor_run's html note prints it too:
--template <file> on the command line,$HTML_DOC_TEMPLATE,assets/template.html next to the script (the copy shipped in this skill),../.agents/skills/html-doc/assets/template.html from a package-root duplicate.An explicitly requested template (1 or 2) that does not exist is an error instead of a silent fallback, so a typo cannot produce pages from the default template.
deeptutor_run's html path resolves this in the host, not inside this
script: it prefers the installed skill at <DSH_HOME>/skills/html-doc/ over
the copy bundled in the plugin package (with $HTML_DOC_SCRIPT/$HTML_DOC_TEMPLATE
as explicit overrides), then hands the winning template to the converter as
--template. Editing the installed template therefore changes the next render —
no plugin edit needed. (Re-running the installer copies the bundled skill files
back over the installed ones, so keep a copy of a heavily customised template
outside <DSH_HOME>/skills/ and point $HTML_DOC_TEMPLATE at it.)
node (≥ 20.11, uses import.meta.dirname) is required; no npm install needed<details>/<summary> tags are rebuilt without their attributes and their content is escaped, since deeptutor_run feeds model/web_search-sourced answers into this converter automatically — a wider tag whitelist would let untrusted <script>/on*= content ride along into the generated local HTML.What SKILL.md sets; muted values are Claude Code's defaults
2 skills in this plugin
npx claudepluginhub tecfancy/dsh-deeptutor --plugin dsh-deeptutorOther plugins' skills for the same job