groff
[Top][All Lists]
Advanced

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

Re: [Groff] Extending .tm to allow for file handles-- The ulterior motiv


From: Tom Borawski
Subject: Re: [Groff] Extending .tm to allow for file handles-- The ulterior motive revealed
Date: Thu, 18 Feb 2010 18:52:36 -0500 (EST)

Larry I guess I should confess my ulterior motive: the addition of
a generalized set of macros to support the integration of perl into
groff.


As a background-- I recently used the whole toolchain on a recent project.
That includes Refer and pdfmark. I also attempted to produce both pdf and html outputs.

It is my opinion that no package will produce out-of-the-box usable HTML. It will always require tweaking.

I found that refer is frustrating to use.  Refer actually had me looking
at Bibtex (every few years I take
a look at Latex, silently calculate the medical costs of carpal tunnel syndrome treatment for the verbose keystroking required to use it and then
go back to groff).

There are many good packages available with perl.  I thought a formalized
set of perl support macros would be all that is required.

(BTW: I am stuck at work using windows. makefiles tend not play well
in all dos boxes)

The specific capability I was thinking about would be if a particular
register name in groff (\*[register-name]) could be used within a
perl script as $register-name. This would be a perl "global groff-ARGV"
type of solution.

The tool chain would create the environment through a -mPerl macro set.

Another approach could be to consider a macro to run a specific script on
a local area of the document with live register values passed in a "@_"
style

e.g.

blah blah blah...
.PERLSTART scriptname.pl \*[register1] \*[register2] ...

section of document that scriptname.pl works on with registers passed
in ARGV

.PERLEND


The great thing about groff: so many projects for
our copious free time !

On Thu, 18 Feb 2010, Larry Kollar wrote:



Tom Borawski wrote:

I was wondering if their is any possibility having .tm write
to anything other than STDOUT ? It would make managing forward
references (when used with 2 groff passes) much easier.

In my Makefile, I use 2> to redirect stderr to a file:

        groff $(FLAGS) -rTocGen=1 -z stuff bookfile.ms 2>bookfile.aux
        ## do stuff with the aux file ##
        groff $(FLAGS) stuff bookfile.ms >bookfile.ps 2>bookfile.err

The TocGen register turns on all the stuff needed for contents, cross-refs, and index; it's all output using .tm.

I for one won't turn on -U on a file from just anyone until I understand what's going to happen. :-)

        Larry




reply via email to

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