mdoc converts one Markdown file into one light, self-contained HTML file.
Flags can be placed before or after the input path.
mdoc notes.md
mdoc notes.md -o - # stdout
mdoc notes.md -o notes.html
mdoc notes.md --title "Field Notes"
mdoc notes.md --theme dark --highlight-style dracula
mdoc notes.md --no-highlight
mdoc --version
mdoc --help
mdoc --list-themes
mdoc --list-highlight-stylesThe output embeds its CSS and does not need external stylesheets, JavaScript, or a server.
GitHub-flavored markdown basics is supported, including tables, task lists, strikethrough, and automatic heading IDs.
Fenced code blocks are syntax highlighted by default when they include a language label.
Available themes are:
lightdarkpaper
make help
make run ARGS="notes.md --theme dark"
make test
make lint
make fmt
make modernize
make build
make build VERSION=0.1.0
make install
make cleanmake install builds mdoc, copies it to ~/.local/bin/mdoc, then removes the local bin/ build directory.
By default, builds use git describe --tags --always --dirty for the version when Git history is available, and fall back to dev otherwise.
Override it explicitly with VERSION:
make build VERSION=0.1.0
./bin/mdoc --version
make install VERSION=0.1.0
mdoc --versionFor release tracking, use Git tags:
git tag v0.1.0
make build
./bin/mdoc --versionAfter future commits, mdoc --version will include the nearest tag plus commit information. If tracked files have uncommitted changes, the version includes -dirty.
To try the CLI from source without installing it:
go run ./cmd/mdoc README.md -o ./readme.html