xxx2lout version 1.35

SUMMARY

The following little perl programs are included:
* html2lout - Converts HTML to lout
* pod2lout  - Removed -- use Lout's prg2lout program; lout 1.21 or later
* txt2lout  - Converts plain text to lout
* perl2lout - Removed -- use Lout's prg2lout program; lout 1.21 or later
* xml2lout  - Converts XML to lout (alpha) *NEW*
* lout2html - Converts a subset of lout to HTML (very alpha!)

Lout is a typesetting language similar in principle to LaTeX and groff, but in
my view a lot easier to learn and use.

txt2lout can be used as a nice filter, say in vi, with ".,$!txt2lout -w 0" for
example.

html2lout (i.e. HTML/LoutParser.pm) now does tables - its very crude and
simple; you'll almost certainly have to hand tweak the output. Its a little
fragile but does most of the donkey work.

lout2html is very crude - it doesn't do tables, diagrams, graphics, macros,
definitions, etc. - but for lots of text and lists it will do the bulk
conversion, but you'll need to hand fix. I'd really only recommend this for
the desperate!

xml2lout is very simple, basically for each XML tag it creates a lout def like
this:
    def @tagTAGNAME right x { x @LP }
You can then edit this definition to have each of your tags do whatever you
want. If your tag has attributes the definition should be something like this:
    def @tagTAGNAME 
        named @argATTRIBA {} 
        named @argATTRIBB {} 
        right x 
    { 
    @Tbl 
        rule { single }
        aformat { @Cell A | @Cell B }
    {
        @Rowa A { @I ATTRIBA } B { @argATTRIBA }
        @Rowa A { @I ATTRIBB } B { @argATTRIBB }
    }
    @LLP
    x 
    @LP
    }
In both cases the `x' is the text that comprises the body of the tag (if any).
Clearly the body should be a galley since XML is a recursive structure and
therefore the outermost tag will contain the entire document. A replacement
def which will do this would be most welcome...


Even if they don't give you exactly the results you want they may be enough to
knock your text into a usable form.

The programs are supported by two modules which can be used by perl
programmers doing their own lout processing:
* Lout.pm - this provides the txt2lout function used by the first three
            converters, and a supporting set_option function; it also
            provides htmlentity2lout used by html2lout. Its also used by
            lout2html.
* HTML/LoutParser.pm - this provides the routines for the hooks in the 
            HTML/Parser.pm module.


CHANGES

See separate CHANGES file

INSTALLING

As for installing just create a directory somewhere and unzip and untar the 
lot, e.g.

tar xvfz xxx2lout-VERSION.tar.gz

or

gunzip xxx2lout-VERSION.tar.gz
tar xvf xxx2lout-VERSION.tar

then either put this directory in your PATH or create some soft links from
somewhere on your path to the xxx2lout scripts you want.

Note: You must have Perl 5.004 or later; and to use html2lout you must have
HTML::Parser and to use lout2html you must have HTML::Entities both of which
come in the libwww-perl library; you'll also need Text::Wrap which comes with
Perl. To use the macro facility in mkall you will need my Text::MacroScript
package. xml2lout requires some standard modules plus XML::Parser.

LICENCE

These are quick scripts, but if you have comments, improvements etc send them
to <summer@perlpress.com> with 'xxx2lout' in the subject line.

Copyright (c) 1999-2000 Mark Summerfield. All Rights Reserved.
May be used/distributed under the GPL or LGPL as per the licence in each
component, or under the GPL where not specified. 

