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.
https://plus.google.com/+RalphCorderoy

Reply via email to