Hi John,
At 2021-02-22T10:49:52-0500, John P. Linderman wrote:
I can imagine a simple perl (or python or whatever)
script that would
run through groff input, determine which preprocessors are *actually*
needed, and set up a pipeline to run through (only) the needed
preprocessors in the proper order.
This is _almost_ what the groff grog(1) command does. It's been present
as far back as our history goes, to groff 1.02 in June 1991.
* It's a Perl script.
* It uses pattern-matching heuristics to infer which arguments groff(1)
will need to format the document (not just for preprocessors, but
macro packages as well).
* Depending on its own options, it writes the constructed command to
stderr, executes it, or both.
The only thing it doesn't handle is ordering, because groff(1) already
takes care of that.
I wouldn't have to tell groff what preprocessors
I think are needed,
and groff wouldn't have to change (although my script would) when
another preprocessor comes into existence. Modern processors are fast
enough, and groff input small enough, that the "extra" pass wouldn't
be burdensome. And it would take the burden off me to remember exactly
which preprocessors are essential. -- jpl
We don't get a lot of bug reports about grog. Maybe it's not given
enough prominence in groff's own documentation.
Regards,
Branden