| Crates.io | mandate |
| lib.rs | mandate |
| version | 0.1.0 |
| created_at | 2025-12-28 18:07:45.199842+00 |
| updated_at | 2025-12-28 18:07:45.199842+00 |
| description | Convert Markdown or YAML manuals into roff manpages |
| homepage | https://github.com/claylo/mandate |
| repository | https://github.com/claylo/mandate |
| max_upload_size | |
| id | 2009219 |
| size | 317,269 |
Mandate converts Markdown or YAML-with-Markdown into roff manpages. Think of it as a small
translator that speaks both CommonMark and man, with just enough schema validation to keep
things civil.
Prebuilt binaries:
brew install claylo/brew/mandate
cargo binstall mandate
From a local checkout:
cargo install --path .
Or run without installing:
cargo run -- --help
# Markdown in, roff out
mandate -i README.md -p mandate -s 1 -t "Mandate Manual"
# YAML in, roff out
mandate -i docs/mandate.yml -p mandate -s 1 -t "Mandate Manual"
# stdin if you're feeling bold (or piping)
echo '# mytool(1) -- Example tool' | mandate -i - -p mytool -s 1 -t "Mytool Manual"
mandate -i <input> -p <program> -s <section> -t <title> [options]
Notes:
manual.md/manual.markdown → Markdown input.manual.yml/manual.yaml → YAML input.- reads from stdin and auto-detects format.--validate checks YAML against the embedded schema (or --schema override).-i, --input path to manual.yml or manual.md (use - for stdin)-p, --program program name-s, --section man section (default: 1)-t, --title manpage title-m, --manual-section manual section label (optional)--source source string (optional)-o, --output output file path (default: stdout)--validate validate YAML input against the built-in schema--schema path to an alternate schema to use with --validatedocs/mandate.ymldocs/decisions/CHANGELOG.mdPLAN.mdmandate is pre-1.0. Expect the occasional sharp edge, but nothing a comment and a sigh
can’t smooth out.
Validation:
just check
just test
just cov
Build the manpage used by releases:
cargo run --bin mandate -- -i docs/mandate.yml -p mandate -s 1 -t "Mandate Manual" -o target/man/mandate.1
Open a PR with a clear intent and keep changes focused. If you touch behavior, add tests in the same change. (Future you will say thanks, and present you can pretend this was inevitable.)
Licensed under either of:
LICENSE-APACHE)LICENSE-MIT)at your option.