GitHub-flavored Markdown to styled HTML — pipe it like jq.
Statically linked, zero dependencies at runtime, cross-compiles to every major platform.
Generated with Claude Opus 4.6
# From source (requires Go 1.26+)
go install github.com/polera/mdhtml/cmd@latest# Pipe from stdin
cat README.md | mdhtml > readme.html
# File argument(s)
mdhtml README.md > out.html
mdhtml part1.md part2.md > combined.html
# Dark theme
echo "# Hello World" | mdhtml -t dark > hello.html
# HTML fragment only (no <html> wrapper) — great for embedding
mdhtml -f < notes.md
# Combine with other tools
curl -s https://raw.githubusercontent.com/golang/go/master/README.md | mdhtml -t dark | tee go-readme.html
# Preview in browser (macOS)
mdhtml README.md | tee /tmp/preview.html && open /tmp/preview.html| Flag | Short | Default | Description |
|---|---|---|---|
--theme |
-t |
light |
CSS theme: light, dark, none |
--fragment |
-f |
false |
Emit inner HTML only (no wrapper) |
--unsafe |
false |
Allow raw HTML passthrough in Markdown | |
--syntax-theme |
github |
Chroma syntax-highlight style | |
--title |
mdhtml |
<title> in full-document mode |
|
--version |
-v |
Print version and exit |
- Tables
- Strikethrough (
~~text~~) - Autolinks
- Task lists (
- [x] done) - Fenced code blocks with syntax highlighting
- Footnotes
- Definition lists
- Heading auto-IDs
All binaries are statically linked (CGO_ENABLED=0), no libc dependency:
make build # current platform
make dist # all platforms → dist/
make checksums # SHA256SUMS
make install # go installTargets: linux/amd64, linux/arm64, darwin/amd64, darwin/arm64, windows/amd64, freebsd/amd64.
MIT