groff
[Top][All Lists]
Advanced

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

[Groff] ideas for splitting -Thtml output


From: Dorai Sitaram
Subject: [Groff] ideas for splitting -Thtml output
Date: Wed, 25 Jun 2003 10:49:17 -0400 (EDT)

I am considering my gutting a copy of TeX2page, my
Scheme-based converter for TeX source to HTML
pages, in order to do the same for groff.  However...

Since the only serious feature I find missing in groff
-Thtml's is the ability to produce a set of small,
interlinked files (instead of a single big file), I'll
record my suggestion here.  It is probably much better
to get this feature into what is the canonical
groff-to-HTML converter instead of rolling my own.

Two things should be taken care for multiple-file
output:

1.  We need to know what to name these files.  
Since groff could take its input from stdin, there may
not be a canonical file name we can associate with the
input.  I suggest www.tmac supply a macro called
.JOBNAME that will allow the user to identify what the
basename of the intended output file should be.  (The
name .JOBNAME was only chosen in analogy to TeX's
\jobname,  you can use a better name.)  Output files
can be <jobname>.html followed by auxiliary files 
<jobname-Z-H-<num>>.html, where <num> is 1, 2, 3 ...
(Again I'm using my TeX2page convention, but it can 
be changed.)

If .JOBNAME is not specified, there will be only one
output file, as now.

2.  Any references to anchors in the groff input need
to be qualified with the name of the output file they
occur in.  This includes the <a name>'s used for
section-headings and referred to in the ToC.  It also
includes the anchors introduced by the .TAG macro.

.URL will continue to work for external links, but if
it refers to something internal, i.e., an anchor
specified by a .TAG, it may fail, because we need the
particular output HTML file the anchor is in.  We can
therefore have a www.tmac macro called .REF that is
specifically to refer to such internal anchors.

Changes to the HTML generator will essentially comprise
using the information from .JOBNAME to generate
the multiple output HTML files, and to keep track of
which output files each .TAG argument should go in.

Automatic HTML-page-breaking can occur as now at the
user-specified .NH and .SH level.  In addition there
can be an .HTMLEJECT macro that the user can use to
force an HTML page break at that point.

I'd appreciate any input on whether adding these
features to the -Thtml generator is feasible.  
Making sure that the <a href> pointing to an internal
TAG can include the correct output HTML filename
requires looking at the input twice, but it appears
that -Thtml is looking at the input document twice
anyway (for PostScript inclusion).

Again, nothing sacred about the macro names I used
here. 

Thanks for reading. 

reply via email to

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