HTML::Revelation

Table of contents

NAME
Synopsis
Description
Constructor and initialization
Method: add_caption()
Method: build_css_file()
Method: load_colors()
Method: run()
FAQ
Modules Used
Author
Copyright

NAME

HTML::Revelation - Reveal HTML document structure in a myriad of colors

Synopsis

        #!/usr/bin/env perl

        use strict;
        use warnings;

        use HTML::Revelation;

        # -------------------

        my($reveal) = HTML::Revelation -> new
        (
         caption          => 1,
         comment          => "DBIx::Admin::CreateTable's POD converted to HTML with my pod2html.pl",
         css_output_file  => 'CreateTable.css',
         css_url          => '/',
         html_output_file => 'CreateTable.html',
         input_file       => 'misc/CreateTable.html',
        );

        $reveal -> run();

Sample output:

http://savage.net.au/Perl-modules/html/CreateTable.html

Description

HTML::Revelation is a pure Perl module.

Constructor and initialization

new() returns a HTML::Revelation object.

This is the class's contructor.

You must pass a hash to new().

Options:

caption => 0 | 1

Use this key to display or suppress a caption (a table of information) at the start of the HTML output file.

The default is 0.

This key is optional.

comment => $s

Use this key to add a comment to the caption (if displayed).

The default is '' (the empty string).

This key is optional.

css_output_file => $s

Use this key to specify the name of the CSS output file.

The default is '' (the empty string).

This key is mandatory.

css_url => $s

Use this key to specify the URL of the CSS output file.

This URL is written into the HTML output file.

The default is '' (the empty string).

This key is mandatory.

html_output_file => $s

Use this key to specify the name of the HTML output file.

The default is '' (the empty string).

This key is mandatory.

input_file => $s

Use this key to specify the name of the HTML input file.

The default is '' (the empty string).

This key is mandatory.

Method: add_caption()

Factor out the code which formats the caption.

Method: build_css_file()

Factor out the code which build the body of the CSS output file.

Method: load_colors()

Factor out the code which stores the data defining the available colors.

Method: run()

As shown in the synopsis, you must call run() on your HTML::Revelation object in order to generate the output files.

FAQ

Where did the colors come from?

From the Image::Magick web site. I extracted them from a web page there using the amazing HTML::TreeBuilder module. See scripts/extract.colors.pl.

Why do you discard the first 220 colors?

Because they are too dark for my liking.

Why does the caption use CSS class c0003?

I like that color - it's nice and restful. I seriously considered using c0201.

I want to know which CSS class produces which color.

Patch line 743 to put ' $class_name' just inside the '|' at the end of the line.

Modules Used

accessors::classic
File::Spec
HTML::Entities::Interpolate
HTML::Tagset
HTML::TreeBuilder
List::Cycle

Author

HTML::Revelation was written by Ron Savage in 2008.

Home page: http://savage.net.au/index.html

Copyright

        Australian copyright © 2008,  Ron Savage.
        All Programs of mine are 'OSI Certified Open Source Software';
        you can redistribute them and/or modify them under the terms of
        the Artistic or the GPL licences, copies of which is available at:
        http://www.opensource.org/licenses/index.html