The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Syntax::Kamelon::Format::HTML4 - Formatting module for HTML output

SYNOPSIS

 my $kam = Syntax::Kamelon->new(
    syntax => 'Perl',
    formatter => ['HTML4',
       title => "Testing Plain/Theme DarkGray",
    ],
 );

DESCRIPTION

This module provides a basic formatting interface to creat HTML documents. It inherits Syntax::Kamelon::Format::Base and all of its options and methods.

It is set up to quickly put up a formatting interface in a simple manner. Even if you call this formatter without any options it will produce readable output.

If you intend to use Kamelon on your webserver you may be better of spending some time in writing your own templates. If you want to quickly produce some nicely formatted HTML then you use this module.

OPTIONS

The constructor is called with a paired list of options as parameters. You can use the following options.

foldmarkers => boolean

If set then the output produces clickable foldmarkers. By default 0. If set and the option foldingdepth is not specified then foldingdepth is set to 99.

Specify the footer template for the HTML output. If not used, it will use its internal footer template.

header => various

Specify the header template for the HTML output. If not used, it will use its internal header template.

inlinecss => boolean

Specifies if css should be internal in the HTML output or if an external stylesheet should be used.

javascript => various

Specify the javascript template for the HTML output. If not used, it will use its internal javascript template.

layoutcss filename

Specifies the css to be used for the layout and sizes in the HTML file. If not specified it will use the file "layout.css" it finds in the theme folder.

lineoffset integer

Specifies the starting line number of the output. By default 1.

plainpanel ref to hash

Specifies the data the module is using to create a plain panel. The hash looks like:

 {
    begin => "begin template",
    end => "end template",
 }

By default it uses some internally defined templates for the plain panel.

scrolled boolean

Specifies if a plain panel (0) or scrolled panel (1) should be used for the output. By default it is 0.

scrolledpanel ref to hash

Specifies the data the module is using to create a scrolled panel. The hash looks like:

 {
    begin => "begin template",
    end => "end template",
 }

By default it uses some internally defined templates for the scrolled panel.

sections boolean

If set it uses the top level fold information to divide the output in sections. By default 0.

theme name

Sets a prefedefined theme. Available themes are: Black, DarkGray, Gray, LightGray and White. By default DarkGray. If you specify the themecss option, this option is ignored.

themecss integer

Specifies the css to be used for coloring the output. If not specified it will use the file "DarkGray.css" it finds in the theme folder. Which is equal to setting the theme option to DarkGray.

themefolder integer

Points to the folder where it finds all the CSS files. By default it is set to Syntax/Kamelon/Format/HTML4 in @INC.

title string

Specifies the title that your output will display in a browser. By default 'Kamelon ouput'.

PUBLIC METHODS

FoldMarkers

Accessor. Corresponds with the foldmarkers option.

Format

Overwritten method. Usually called through Kamelon. It composes the HTML framework and formats the parsed text into it.

Accessor. Corresponds with the footer option.

GetData

Overwritten method of Syntax::Kamelon::Format::Base. Use this method if you want to use your own instance of Template Tooolkit instead of TT's internal one. It returns a data structure that looks like this:

 {
    folds => { #the keys of this hash are line numbers
            4 => {
          end => $endline,
                    depth => $folddepth,
                    line => $text,
                    region => $regionname,
            },
            ...
    },
    content => [
       [{ text => $snippet, tag => $tagname}, ...], #this is one line
       ...
    ],
    foldmarkers => 0, # or ofcourse 1
    header => "the processed header including javascript and css, this is no longer a template",
    footer => "the processed footer, this is no longer a template",
    panel => "The data of which a panel on which the hightlighted code is displayed. this is still a template",
    sections => 0, # or ofcourse 1
 }

Accessor. Corresponds with the header option.

InlineCSS

Accessor. Corresponds with the inlinecss option.

Javascript

Accessor. Corresponds with the javascript option.

LayoutCSS

Accessor. Corresponds with the layoutcss option.

PlainPanel

Accessor. Corresponds with the plainpanel option.

Scrolled

Accessor. Corresponds with the footer option.

ScrolledPanel

Accessor. Corresponds with the scrolledpanel option.

Sections

Accessor. Corresponds with the sections option.

ThemeCSS

Accessor. Corresponds with the themecss option.

ThemeFolder

Accessor. Corresponds with the themefolder option.

Title

Accessor. Corresponds with the title option.

LoadFile

Loads a plain text file and returns it in a scalar.

AUTHOR AND COPYRIGHT

This module is written and maintained by:

Hans Jeuken < hanje at cpan dot org >

Copyright (c) 2017 - 2023 by Hans Jeuken, all rights reserved.

Published under the same license as Perl.

SEE ALSO

Syntax::Kamelon, Syntax::Kamelon::Builder, Syntax::Kamelon::Debugger, Syntax::Kamelon::Diagnostics, Syntax::Kamelon::Indexer, Syntax::Kamelon::XMLData, Syntax::Kamelon::Format::Base, Syntax::Kamelon::Format::ANSI

1 POD Error

The following errors were encountered while parsing the POD:

Around line 216:

You forgot a '=back' before '=head1'