groff
[Top][All Lists]
Advanced

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

Re: [Groff] html internals?


From: Gaius Mulley
Subject: Re: [Groff] html internals?
Date: 08 Apr 2003 21:56:05 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

"Robert D. Goulding" <address@hidden> writes:

> I'd like to try `html-izing' the other macro sets, beginning with -me.  Is
> there any documentation on the HTML-TAG macro - essentially, what
> information do I need to add to e.tmac for grohtml to deal with it
> correctly?
> 

Hi,

go for it! Sadly there is no documentation regarding these
macros. However the www.tmac file is reasonably well commented. There
are two kinds of html tag macros: HTML-TAG and HTML-TAG-NS. The
HTML-TAG emits a tag and generates a newline. Whereas HTML-TAG-NS
emits the tag without the line break (its main purpose is to handle
indented paragraphs correctly).

A good place to start would be to examine s.tmac. The easy tags
to generate are the 

  .HTML-TAG ".SH 1"
  .HTML-TAG ".tl"
  .HTML-TAG ".NH \\$1"

variety. Some of the harder ones I suspect are when interfacing with
references (handling .IP) and eqn (handling images).  These are also
present in s.tmac of course but occasionally they are surrounded by
device specific tests (normally as a workaround for diversion problems).

Also remember that groff runs troff twice, once to generate text and
positions for grohtml; once to generate images (via postscript).  You
can detect the postscript pass by testing the register ps4html.  Each
pass must have the same number of

  .HTML-IMAGE             and .HTML-IMAGE-END
 (or HTML-IMAGE-LEFT
     HTML-IMAGE-RIGHT
     HTML-IMAGE-INLINE)

macros and in the same order. These macros generate img tags for html
and the actual images when ps4html is set. ps4html is documented in
the excellent groff.texinfo and so are the \O[n] escapes which the
above macros use.

At present the Achilles heel of grohtml is its handling (or
mishandling of diversions - as it sometimes introduces incorrect line
breaks and extra spaces). This is currently under heavy investigation
:-)

Hope this is of some use..

Gaius

reply via email to

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