I would like to parse man pages into a more structure form, but I'm unable to find a proper specification for the data format under use by man pages. Should I be looking for troff or nroff or groff or something else? groff(7) says
The groff system has all features of the classical roff, but adds many extensions.
Are these extensions the various preprocessors like tbl or something else?
So far I've found the following resources:
troff.org - This has historical notes and some tutorials, and some dead links.
roff(7) (OpenBSD, Linux) - Doesn't really have a specification, only a brief overview and bunch of history.
man-pages(7) (Linux) - This provides guidelines about sections in man pages (which is useful), but it doesn't talk about the data format.
A Typesetter-independent TROFF and Troff User's Manual - these are fairly old, so I can't really judge what the differences are between the troff in those papers and in practice.
Is there a clear specification somewhere for the exact format under use by man pages?
*roff
variants use the same instructions. Man pages add to those instructions a set of macros to do common things. But individual manpages may use either the underlying instructions or the macros or both with no consistency. ivanivan's answer, for example, is all about macros. But some pages hardly use the macros.