Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mdoc

AI-Driven Development

mdoc converts one Markdown file into one light, self-contained HTML file.

Usage

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-styles

The output embeds its CSS and does not need external stylesheets, JavaScript, or a server.

Markdown

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.

Themes

Available themes are:

  • light
  • dark
  • paper
light dark paper

Development

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 clean

make 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 --version

For release tracking, use Git tags:

git tag v0.1.0
make build
./bin/mdoc --version

After 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

About

CLI tool to convert a markdown file into a light, self-contained HTML file

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages