> loadVersion()'s regexp can be simplified because `xx*' is `x+'. :-) Well-spotted refactoring error, thank you. ;-)
> 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. The fallback was necessitated because Fedora's Groff ships without a grog(1). > What's the problem with grog suggesting something that isn't installed? Rendering needs to succeed even if the necessary preprocessors aren't installed; the adapter makes sure to call Groff without options it knows are unsupported. This is a setting where an incorrect rendering is more tolerable than *no* rendering whatsoever; hence the song-and-dance routine. On Fri, 9 Aug 2019 at 19:08, Ralph Corderoy <ra...@inputplus.co.uk> wrote: > 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. > >