Skip to content

polera/mdhtml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mdhtml

GitHub-flavored Markdown to styled HTML — pipe it like jq.

Statically linked, zero dependencies at runtime, cross-compiles to every major platform.

LLM Disclaimer

Generated with Claude Opus 4.6

Install

# From source (requires Go 1.26+)
go install github.com/polera/mdhtml/cmd@latest

Usage

# 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

Options

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

GFM Features Supported

  • Tables
  • Strikethrough (~~text~~)
  • Autolinks
  • Task lists (- [x] done)
  • Fenced code blocks with syntax highlighting
  • Footnotes
  • Definition lists
  • Heading auto-IDs

Cross-Compilation

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 install

Targets: linux/amd64, linux/arm64, darwin/amd64, darwin/arm64, windows/amd64, freebsd/amd64.

License

MIT

About

Markdown to HTML utility

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors