Hi Doug,
I can imagine
a simple perl (or python or whatever) script that
would run through groff input [and] determine which preprocessors
are actually needed ...
Brian imagined such and implemented it way back when. Though I used
it, I've forgotten its name.
Was it ‘doctype’? That's what it's called in Kernighan & Pike's ‘Unix
Programming Environment’, pp. 306-8. Groff had something similar called
grog(1) which had flaws when I rewrote it in sh and mainly awk back
in 2002. (My version never made it in because an FSF copyright
assignment was required and their answers to some of my questions meant
I wouldn't sign.) Someone else since rewrote Groff's in Perl.
defensive groff -pet that I often use
I've taken to putting the information needed as a comment at the start
of the main source file whence it's picked up by a generic run-off
script. Similar to man(1) looking for a «'\"» comment with code
letters: ‘p’ for pic, ‘v’ for vgrind, etc.
--
Cheers, Ralph.