Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to author man pages?

Tags:

manpage

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

like image 844
vy32 Avatar asked May 01 '10 03:05

vy32


People also ask

How are man pages written?

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.

How do I print my man page?

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.


3 Answers

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

like image 60
DEzra Avatar answered Sep 28 '22 21:09

DEzra


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.

like image 39
Nathan Osman Avatar answered Sep 28 '22 22:09

Nathan Osman


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.

like image 29
Sid Heroor Avatar answered Sep 28 '22 23:09

Sid Heroor