NAME
Lout.pm - Module providing txt2lout, htmlentity2lout and pod2lout functions
SYNOPSIS
use Lout ;
$lout = Lout::txt2lout( $text ) ;
$lout = Lout::pod2lout( $pod ) ;
$lout = Lout::htmlentity2lout( $html ) ;
# If doing lots of htmlentity2lout this is faster:
Lout::set_option( -html => 1 ) ;
foreach $html ( @html ) {
$lout .= Lout::txt2lout( $html ) ;
}
DESCRIPTION
Lout::txt2lout
This function converts a plain text string into a string of lout. It is influenced by the following options (all of which are set by calling Lout::set_option
once for each option - defaults are shown):
Lout::set_option( -html => 0)
- Treat the input as plain text.
Lout::set_option( -smartquotes => 1)
- Convert single and double quotes to `smart' quotes.
Lout::set_option( -superscripts => 1)
- Convert the letters after numbers to superscripts, e.g. for 1st, 2nd, 3rd, 4th, etc.
Lout::set_option( -tex => 0)
- Convert TeX and LaTeX to @TeX and @LaTeX; this assumes that you are using a lout document type which has these macros defined.
Lout::htmlentity2lout
This is merely a wrapper around Lout::txt2lout
which effectively calls Lout::set_option( -html => 1)
first. For processing lots of html entity strings it is quicker to set the option once and call Lout::txt2lout
direct.
NB This is the equivalent of Gisle Aas HTML::Entities::decode except that it produces Lout instead of plain text. It does not deal with HTML tags - use my HTML::LoutParser.pm
module for that.
Lout::pod2lout
This calls Lout::txt2lout
(so all the options which are set apply), and then performs pod-specific translations.
NB This only translates pod `entities' like E>gt<, etc. For full pod translation use my pod2lout
program.
Lout::set_option
(This sets the options used by Lout::txt2lout
and Lout::htmlentity2lout
as described above.)
EXAMPLES
(See DESCRIPTION.)
BUGS
None that I know of!
CHANGES
1999/07/18 First properly documented release.
AUTHOR
Mark Summerfield. I can be contacted as <mark.summerfield@chest.ac.uk> - please include the word 'lout' in the subject line.
COPYRIGHT
Copyright (c) Mark Summerfield 1999. All Rights Reserved.
This module may be used/distributed/modified under the same terms as Perl itself.