groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [groff] Of grog, preprocessors, and missing programs


From: Ralph Corderoy
Subject: Re: [groff] Of grog, preprocessors, and missing programs
Date: Fri, 09 Aug 2019 10:07:22 +0100

Hi John,

> I've noticed that grog(1) will suggest options for preprocessors
> irrespective of whether they're even available on the user's system.

That seems fair enough.  The rest of the system is used to being asked
to run programs that don't exist and report that to the user in a
familiar manner.

> 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...

loadVersion()'s regexp can be simplified because `xx*' is `x+'.  :-)

I didn't read all the way through that page and ended up skimming it.
You use grog if it's available, falling back on your own logic to
analyse the troff source.  Either way, you check the resulting guesses
against what's available:
https://github.com/Alhadis/Roff.js/blob/8678ef365626e049c58b4ad65d62383fe7db49b9/lib/adapters/troff/groff.mjs#L575
What's the problem with grog suggesting something that isn't installed?

-- 
Cheers, Ralph.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]