Index of every page on this site: llms.txt
All skills
github avatar

/markdown-to-html

@f10fdb8 official
by githubgithub/awesome-copilot42k stars
5,426
Run it yourself

Convert Markdown files to HTML similar to `marked.js`, `pandoc`, `gomarkdown/markdown`, or similar tools; or writing custom script to convert markdown to html and/or working on web template systems like `jekyll/jekyll`, `gohugoio/hugo`, or similar web templating systems that utilize markdown documents, converting them to html. Use when asked to "convert markdown to html", "transform md to html", "render markdown", "generate html from markdown", or when working with .md files and/or web a templating system that converts markdown to HTML output. Supports CLI and Node.js workflows with GFM, CommonMark, and standard Markdown flavors.

Use this Skill: https://skilld.dev/gh/github/awesome-copilot/markdown-to-html

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencespandoc.md

≈1k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Pandoc Reference

Pandoc is a universal document converter that can convert between numerous markup formats, including Markdown, HTML, LaTeX, Word, and many more.

Installation

Windows

# Using Chocolatey
choco install pandoc

# Using Scoop
scoop install pandoc

# Or download installer from https://pandoc.org/installing.html

macOS

# Using Homebrew
brew install pandoc

Linux

# Debian/Ubuntu
sudo apt-get install pandoc

# Fedora
sudo dnf install pandoc

# Or download from https://pandoc.org/installing.html

Basic Usage

Convert Markdown to HTML

# Basic conversion
pandoc input.md -o output.html

# Standalone document with headers
pandoc input.md -s -o output.html

# With custom CSS
pandoc input.md -s --css=style.css -o output.html

Convert to Other Formats

# To PDF (requires LaTeX)
pandoc input.md -s -o output.pdf

# To Word
pandoc input.md -s -o output.docx

# To LaTeX
pandoc input.md -s -o output.tex

# To EPUB
pandoc input.md -s -o output.epub

Convert from Other Formats

# HTML to Markdown
pandoc -f html -t markdown input.html -o output.md

# Word to Markdown
pandoc input.docx -o output.md

# LaTeX to HTML
pandoc -f latex -t html input.tex -o output.html

Common Options

Option Description
-f, --from <format> Input format
-t, --to <format> Output format
-s, --standalone Produce standalone document
-o, --output <file> Output file
--toc Include table of contents
--toc-depth <n> TOC depth (default: 3)
-N, --number-sections Number section headings
--css <url> Link to CSS stylesheet
--template <file> Use custom template
--metadata <key>=<value> Set metadata
--mathml Use MathML for math
--mathjax Use MathJax for math
-V, --variable <key>=<value> Set template variable

Markdown Extensions

Pandoc supports many markdown extensions:

# Enable specific extensions
pandoc -f markdown+emoji+footnotes input.md -o output.html

# Disable specific extensions
pandoc -f markdown-pipe_tables input.md -o output.html

# Use strict markdown
pandoc -f markdown_strict input.md -o output.html

Common Extensions

Extension Description
pipe_tables Pipe tables (default on)
footnotes Footnote support
emoji Emoji shortcodes
smart Smart quotes and dashes
task_lists Task list checkboxes
strikeout Strikethrough text
superscript Superscript text
subscript Subscript text
raw_html Raw HTML passthrough

Templates

Using Built-in Templates

# View default template
pandoc -D html

# Use custom template
pandoc --template=mytemplate.html input.md -o output.html

Template Variables

<!DOCTYPE html>
<html>
<head>
  <title>$title$</title>
  $for(css)$
  <link rel="stylesheet" href="$css$">
  $endfor$
</head>
<body>
$body$
</body>
</html>

YAML Metadata

Include metadata in your markdown files:

---
title: My Document
author: John Doe
date: 2025-01-28
abstract: |
  This is the abstract.
---

# Introduction

Document content here...

Filters

Using Lua Filters

pandoc --lua-filter=filter.lua input.md -o output.html

Example Lua filter (filter.lua):

function Header(el)
  if el.level == 1 then
    el.classes:insert("main-title")
  end
  return el
end

Using Pandoc Filters

pandoc --filter pandoc-citeproc input.md -o output.html

Batch Conversion

Bash Script

#!/bin/bash
for file in *.md; do
  pandoc "$file" -s -o "${file%.md}.html"
done

PowerShell Script

Get-ChildItem -Filter *.md | ForEach-Object {
  $output = $_.BaseName + ".html"
  pandoc $_.Name -s -o $output
}

Resources

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning12d5 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    The skill provides a comprehensive guide for converting Markdown to HTML using industry-standard tools and libraries. It includes appropriate security warnings and detailed remediation steps for handling untrusted input.

  • Socket12d

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

  • Runlayer9mo

    13/16 files flagged

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at f10fdb8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 days ago.

Activeupdated 7 months ago
  • markdown
  • html
  • conversion
  • marked
  • pandoc
  • static-site-generator
  • jekyll
  • hugo
  • gfm

README badge

README badge for github/awesome-copilot/markdown-to-html

Converts Markdown files to HTML using marked.js, pandoc, or custom scripts, with support for GFM, CommonMark, and standard Markdown flavors. Handles single files, batch conversions, code blocks, tables, collapsed sections, and mathematical expressions. Suitable for static site generators like Jekyll and Hugo, or building custom markdown-to-HTML conversion tools.

Generated from the current SKILL.md.

Does this skill support GitHub Flavored Markdown?
Yes. The skill supports GFM, CommonMark, and standard Markdown flavors, with GFM enabled via the `gfm: true` option in marked.js or equivalent settings in pandoc.
What tools does this skill cover?
The skill provides guidance for marked.js (Node.js and CLI), pandoc (command-line tool), and custom conversion scripts. It also references jekyll and hugo for templating systems that convert markdown to HTML.
Does marked.js sanitize HTML output?
No. Marked does not sanitize output HTML. The skill recommends using DOMPurify, sanitize-html, or js-xss to sanitize untrusted markdown before display.
Can this skill handle batch conversions and advanced features like tables and math expressions?
Yes. The skill covers single and batch file conversions, tables with alignment, code blocks with language tags, collapsed sections (details/summary), and mathematical expressions with MathML rendering.
Does pandoc require additional software for PDF output?
Yes. Pandoc requires a LaTeX installation (MacTeX on macOS, MiKTeX on Windows, texlive on Linux) to generate PDF output from markdown.

Generated from the current SKILL.md. These answers refresh after source changes.