Simple ad hoc generation of Unix man pages from markdown files. It includes customizations and ability to supply additional information or formatting needed for man pages not found in traditional markdown. For example, you can add a synopsis section from a command’s help message, convert the title header into the name section, or add a description header before the first paragraph. This allows any markdown document to become a manual, including this very README.

Options

-c

Disable auto capitalization of titles and section headers.

-C

Enable auto capitalization of titles and section headers (default).

-t TITLE

Title displayed at top of man page, usually name of program. Defaults to file name or stdin.

-d DATE

Date man page was updated, displayed at bottom center. Defaults to current date in YYYY-MM-DD format.

-V VERSION

Version number of program being documented, displayed at bottom left.

-m MIDDLE

Text displayed at top middle of manual. Defaults to name of manual section.

-n

Convert the first header into a name section at the top of the man page.

-s SYNOPSIS

Text to be inserted as a synopsis section at the top of the man page, under name section.

-D

Add description header to the top of the man page, under name or synopsis sections if supplied. This allows most standard markdown documents to conform to the man page convention where the first paragraphs are in the description section.

-SECTION

Set man page section number, be can number from 1 to 8:

  • 1: General commands
  • 2: System calls
  • 3: Library functions (eg C standard library)
  • 4: Special files and drivers (eg /dev)
  • 5: File formats and conventions
  • 6: Games and screensavers
  • 7: Miscellaneous
  • 8: System admin commands and daemons

-h

Print help and exit.

-v

Print version info and exit.

Usage

Convert this README into a man page:

markman -Dn -s "`markman -h 2>&1 | cut -d' ' -f2-`" -t $(EXE) -d "`date '+%B %Y'`" -V $(VERSION) README.md > $(EXE).1

See Also

See project at https://edryd.org/projects/markman

View source code at https://git.edryd.org/markman

Projects which use markman to generate their man pages:

Pandoc is also a great alternative for a more general purpose markdown converter.

Author

Edryd van Bruggen ed@edryd.org

License

zlib License