mandown
Pandoc template and filters for converting markdown to man
pages.
Filters can be specified individually with --lua-filter filter
, but the default mandown filter is recommended to apply all of the filters, in appropriate order:
Filter .lua |
Description |
---|---|
mandown | Applies all filters in appropriate order. |
metadata | Extract the below metadata as Pandoc variables. |
code-bold | Render inline and fenced code blocks as bold. |
refs | Add man page section (n) references to applicable command s, and ensure a SEE ALSO section listing them. |
links | Underline http links, and ensure a SEE ALSO section listing all reference links. |
headings | UPPERCASE, replace, and set the correct ## level for headings. |
--metadata
/--variable
s can be passed directly on the command line, else are extracted from the markdown source as follows:
Variable | Source |
---|---|
author |
Extract GIT_AUTHOR details from the latest GitHub Release commit . |
date |
Latest GitHub Release date. |
title |
The command first described in the SYNOPSIS section. |
section |
Any (n) immediately following command , else (1) . |
header |
Taken from the main h1 header, and stripped of any formatting. |
footer |
Semantic version tag v0.0.0 of the latest GitHub Release. |
pandoc --from gfm src.md --lua-filter mandown --to man --template mandown > bin.1
easily with Homebrew:
brew tap danielbayley/pandoc
brew install pandoc pandoc-mandown
then, in your formula:
depends_on "pandoc" #=> :build
depends_on "danielbayley/pandoc/pandoc-mandown" #=> :build