What's the best way to author man pages? Should I write using the standard man macros, or is there some clever package available now that takes some kind of XML-ified source and can output man pages, HTML, ASCII, and what not?
Thanks
The default format of man pages is troff, with either the macro package man (appearance oriented) or mdoc (semantic oriented). This makes it possible to typeset a man page into PostScript, PDF, and various other formats for viewing or printing.
To print a man page to a PostScript printer:man -t command | lp For example, if you want a printed man page for the date command: man -t date | lp You are using the -t option of the man command to produce PostScript output and piping that into the lp command.
I have previously used the GNU version of nroff called groff to write man pages.
Nice intro article on it here:
http://www.linuxjournal.com/article/1158
Doxygen is what you are looking for. Keep in mind that it is designed to document source code but you could easily adapt it.
It can generate html, pdf, and latex documentation too.
If you are looking at writing once and generating different output formats such as manpages, HTML, plain txt, or even PDF, then docbook should work best.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With