[Top][All Lists]

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

Re: [Groff] Regarding HTML rendering

From: Ralph Corderoy
Subject: Re: [Groff] Regarding HTML rendering
Date: Thu, 17 Aug 2017 14:27:32 +0100

Hi Mikkel,

Peter wrote:
> Ingo wrote:
> > So technically, the best way to transform groff_mom(7) documents
> > into HTML would be to parse a high-level MOM node tree and convert
> > that directly to HTML, without going through troff(1) at all, like
> > mandoc(1) does it for the mdoc(7) language.
> Precisely.
> > But i'm not aware that anybody did the work of writing a semantic
> > MOM parser yet.
> Not to my knowledge, either.  It wouldn't be too much of a challenge.
> I've done it myself ad hoc with nothing more than sed(1).  The mom
> macros were designed to make semantic parsing easy.

That would be my suggestion too.  You're the author of the -mom-using
source, so you can make sure it matches what your translation can handle
if it can't do everything.  -Thtml produces quite old-looking HTML
whereas your solution could rely on using `class' to describe the
semantic content with a separate style sheet setting the appearance.
And if anything is particularly awkward to translate across then you can
special case it, e.g. by having comments in your troff source that your
translator spots.

Though keep up the low-level troff playing too.  :-)

Cheers, Ralph.

reply via email to

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