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


HTML-Revelation documentation  | view source Contained in the HTML-Revelation distribution.

Index


NAME

Top

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

Synopsis

Top

	#!/usr/bin/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

Top

HTML::Revelation is a pure Perl module.

Constructor and initialization

Top

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()

Top

Factor out the code which formats the caption.

Method: build_css_file()

Top

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

Method: load_colors()

Top

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

Method: run()

Top

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

FAQ

Top

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

Top

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

Author

Top

HTML::Revelation was written by Ron Savage <ron@savage.net.au> in 2008.

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

Copyright

Top


HTML-Revelation documentation  | view source Contained in the HTML-Revelation distribution.