I've noticed that grog(1) will suggest options for preprocessors
irrespective of whether they're even available on the user's system. Some
aren't part of Groff, like grap(1). Others are excluded from certain base
installations — Ubuntu Server, for example, ships with pic(1) and tbl(1),
but omits chem(1), refer(1) and grn(1). Finally, one of the preprocessors
considered by grog while scanning *doesn't even exist*: gideal, hidden
behind an undocumented `-J` switch in the main groff(1) executable:

$ groff -J
groff: couldn't exec gideal: No such file or directory

$ printf 'Foo\n.IS\n.IE\nBar\n' | grog
groff -T ps -J -p -


It's debatable whether or not Grog should concern itself with site-specific
matters like this. After all, an error at the command-line isn't a big
deal. Most Troff-savvy users probably have a complete Groff installation on
their site anyway. Troff-savviness can be reasonably assumed of anybody
running the grog(1) command from their terminal.

The problem is when users aren't Troff-savvy, and document formatting is
performed by a GUI without user intervention. That's exactly half of what
Roff.js <https://github.com/Alhadis/Roff.js> exists to do — the code
talking to Groff
<https://github.com/Alhadis/Roff.js/blob/8678ef365626e049c58b4ad65d62383fe7db49b9/lib/adapters/troff/groff.mjs>
from the browser is substantially more complex than it should be, due to
the translation layers involved...

So. Thoughts?

Reply via email to