md-to-html

Convert Markdown to self-contained HTML with a table of contents.

1|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/cr330326/AgentSkill --skill md-to-html
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: md-to-html
Source: https://github.com/cr330326/AgentSkill/tree/main/validate/skill-generator-workspace/iteration-1/eval-3-md-to-html/without_skill/outputs
Command: npx skills add https://github.com/cr330326/AgentSkill --skill md-to-html

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires marked, highlight.js, katex.

What problem does it solve?

Converts Markdown into standalone HTML pages with an auto-generated table of contents, syntax-highlighted code blocks, and KaTeX math rendering, so you can share styled Markdown output without managing assets.

Core Features & Use Cases

  • Auto-generated Table of Contents (TOC) from headings (h2-h4)
  • Syntax-highlighted code blocks via highlight.js
  • KaTeX rendering for inline and display math
  • Use Case: Imagine preparing project documentation or notes in Markdown and distributing a self-contained HTML file that looks polished and works offline.

Quick Start

Run the convert.mjs script with your input Markdown and an output HTML path to generate a self-contained HTML file.

Frequently Asked Questions about md-to-html

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert Markdown to a self-contained HTML file with a table of contents?

You can convert Markdown to a self-contained HTML file with a table of contents by running a script that parses headings to auto-generate a TOC and bundles styling directly into the output document.

Can I render KaTeX math equations and syntax-highlighted code blocks in Markdown to HTML?

Yes, rendering KaTeX math equations and syntax-highlighted code blocks in Markdown to HTML is supported natively using the katex and highlight.js libraries to process and style mathematical formulas and code.

Does this Markdown to HTML conversion process work for offline documentation?

This Markdown to HTML conversion process works for offline documentation by generating a standalone HTML file that embeds all required assets, ensuring the styled output functions without an internet connection.

What is the best way to share styled Markdown output without managing external assets?

The best way to share styled Markdown output without managing external assets is to generate a self-contained HTML document that integrates all TOC navigation, code highlighting, and math rendering directly.

How do I generate a table of contents from Markdown headings for an HTML document?

To generate a table of contents from Markdown headings for an HTML document, the conversion process automatically extracts h2 through h4 heading tags and builds a navigable TOC structure within the final output.