mdtool

Write in Markdown. Publish in PDF or HTML.

Generate manuals, reports and handbooks from Markdown. Use Go templates for content you reuse and generate a table of contents from the headings.

notes.md
# Field notes

[[TOC fromLevel:2]]

## Observations

- Check the input.
- Record the result.

$ mdtool convert notes.md

Rendered document

Field notes

Observations

Observations

  • Check the input.
  • Record the result.

Features

Reuse document structure

Use Go templates, YAML data and includes to keep repeated sections and values in one place.

Build navigation from headings

Add a table of contents, numbered captions and cross-references that follow the document as it changes.

Render technical content

Include math with KaTeX, PlantUML diagrams and citations. PlantUML needs Java, and citations need Pandoc 3.13 or newer.

Install

macOS

Homebrew cask for Apple Silicon.

Install · macOS
brew install --cask pidrakin/dotfiles/mdtool

Linux

Download an AMD64 or ARM64 archive, or choose a .deb, .rpm or .apk package for your distribution.

Releases

Windows

Extract the AMD64 ZIP from GitLab and add its folder to your user Path.

Releases

Docker

Use the Linux AMD64 or ARM64 image. It bundles the browser and the runtimes for citations and diagrams.

Installation guide

Render your first document.

Save the example as notes.md and run either conversion. mdtool writes notes.html or notes.pdf alongside it.

PDF needs Chrome or Chromium. On Windows, Edge also works. This HTML example needs only mdtool.

notes.md
# Field notes

[[TOC fromLevel:2]]

## Observations

- Check the input.
- Record the result.
Terminal
mdtool convert notes.md --html
mdtool convert notes.md