tags:

views:

57

answers:

4

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

A: 

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.

George Edison
Doxygen is a powerful system, but it's not clear to me how I get it to emit nice man pages for command line options and such.
vy32
Ya. Probably you need something else.
George Edison
You can get doxygen to output man formatted pages by setting GENERATE_MAN and then optionally MAN-OUTPUT (to set location of output) in the doxygen configuration file:http://www.doxygen.nl/config.html#cfg_man_outputAs mentioned in docs, if you leave the man-output value blank it will default to putting the man pages under a subdir called 'man'
DEzra
A: 

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.

Sid H
docbook doesn't produce man pages. It can ingest them, but not produce them.
vy32
+1  A: 

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

DEzra
+1 even though it's not really the tool for *writing* them so much as formatting them.
Donal Fellows
true, good point :-)
DEzra
A: 

A tool that is commonly used in the Tcl community is doctools which can produce a restricted (but useful) subset of the manpage format, suitable for rendering with groff or nroff. It can also generate both plain text and HTML directly.

Donal Fellows