HTML-EasyTags

 view release on metacpan or  search on metacpan

ChangeLog  view on Meta::CPAN


	* Minor documentation update in the README file so that someone can get an 
	idea what this module does after looking only at the README.  Also an update 
	to say how to install to a different directory than the default.  Also an 
	update in the "TO DO" section.

2001-09-02   Darren Duncan <perl@DarrenDuncan.net>

	* Release 1.06.

	* This release adds support for the stricter requirements of W3C's XHTML 
	standard where possible.  See "http://www.w3.org/TR/xhtml1" for details on 
	how this standard compares to HTML 4.  As a result, the default output from 
	this class is now slightly different from before.  However, the changes 
	should be backwards-compatible with older user agents (web browsers).

	* HTML tag and attribute names are now made lowercased instead of uppercased.  
	While HTML 4 is not case sensitive, XHTML requires lowercased names.

	* XHTML requires "minimized" tags, which are tags that do not come as a pair 
	of "start/end" tags, to have a different format than "start" tags.  Such 
	tags include ["br", "img", "input"].  This class now creates such tags like 
	"<br />" instead of "<br>".  Tags as pairs remain the same, "<p></p>".

	* There is a new autoloaded method suffix for forcing construction of tag 
	parts that are different than the usual, called "mini".  (The others were 
	["pair", "start", "end"].)  The new "mini" suffix will force minimized 
	format, such as "<p />", which is different from "start", which continues to 
	force "<p>".  From now on, "mini" is meant for tags you are using as singles, 
	where "start" is meant where you will also use an "end" later to pair it up.

ReadMe  view on Meta::CPAN

* Keeping Up To Date
* Requirements
* Installation
* Support
* To Do
* Author

PREFACE

This distribution features the Perl 5 module named "HTML::EasyTags", 
for making well-formed XHTML or HTML 4 tags/lists/parts easily.

All of my modules have complete POD inside of them, so please refer to that for a
description of the module itself.

This Read Me document concerns itself mainly with installation and support
issues, and also includes any "To Do" lists.

KEEPING UP TO DATE

My module set is constantly under development.  You should be able to find the

lib/HTML/EasyTags.pm  view on Meta::CPAN

=head1 NAME

HTML::EasyTags - Make well-formed XHTML or HTML 4 tags, lists

=cut

######################################################################

package HTML::EasyTags;
require 5.004;

# Copyright (c) 1999-2003, Darren R. Duncan.  All rights reserved.  This module
# is free software; you can redistribute it and/or modify it under the same terms

lib/HTML/EasyTags.pm  view on Meta::CPAN

				-value => ['red', 'green', 'blue', 'chartreuse'], 
				-text => ['Red', 'Green', 'Blue', 'Chartreuse'] ) .
			$html->select_end
		),
		$html->input( type => 'submit' ),
		$html->form_end,
		$html->end_html;

=head1 DESCRIPTION

This Perl 5 object class can be used to generate any well-formed XHTML or HTML
tags in a format that is consistent with the W3C XHTML 1.0 or HTML 4.01
standards.  See B<http://www.w3.org/TR/xhtml1> and B<http://www.w3c.org/MarkUp>
for references.  There are no restrictions on what tags are named, however; you
can ask for any new or unsupported tag that comes along from Netscape or
Microsoft, and it will be made.  Additionally, you can generate lists of said
tags with one method call, or just parts of said tags (but not both at once).

This module's purpose is to be lightweight, easy to use, and whose results are
well-formed and pretty-printed (should humans wish to read or debug
it).  At the same time, it is supportive of your existing knowledge of HTML and 
as such its interface closely mirrors the actual appearance of the resulting 

lib/HTML/EasyTags.pm  view on Meta::CPAN


In this implementation, "well formed" means that tags are made as pairs by
default, which look like "<tag></tag>", unless they are known to be "no pair"
tags, in which case they look like "<tag />".  Tags that I know to be "no pair"
are [basefont, img, area, param, br, hr, input, option, tbody, frame, comment,
isindex, base, link, meta].  However, you can force any tag to be "pair" or
"start only" or "end only" by appropriately modifying your call to the tag making
method.

Also, "well formed" means that tag attributes are formatted as "key=value". While
the HTML standard allowed there to be "no value" attributes, XHTML does not. 
These were formatted simply as "key" because their very presence indicates
positive assertion, while their absense means otherwise.  Before release 1-06,
attributes that were known to be "no value" attributes were formatted as "key" by
default.  Modifiers that I know to be "no value" are [ismap, noshade, compact,
checked, multiple, selected, nowrap, noresize, param].  As of release 1-06, "no
value" attributes are formatted as 'key="1"' when they are true and they are
absent when false, to keep backwards compatability.  "Well formed" means that 
attribute values will always become bounded by quotes, which ensures they work 
with both string and numerical quantities (eg: key="value").

lib/HTML/EasyTags.pm  view on Meta::CPAN

	}
	return( $self->{$KEY_AUTO_GROUP} );
}

######################################################################

=head2 prologue_tag([ VALUE ])

This method is an accessor for the scalar "prologue tag" property of this object,
which it returns.  If VALUE is defined, this property is set to it. This property
is meant to be used literally and be the very first thing in an XHTML or HTML
document.  It tells the web browser such things as what version of the HTML
standard we are adhering to.  Citing backwards compatability with earlier
versions of this class, the default prologue tag we make is for HTML version 4.0
and looks like '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">'.

=cut

######################################################################

sub prologue_tag {

lib/HTML/EasyTags.pm  view on Meta::CPAN

When writing this module, I used the Bare Bones reference to verify the
consistant formatting used by all HTML tags, including how tag attributes are
formatted.  I could see the proper formatting for prologue and comment tags as
well; their formats are unique compared to all the other tags.  The other main
uses I had for the document was in determining all the HTML tags which were not
used as a pair (most use pairs, few don't), and for determining which tag
attributes made a positive assertion just by their presence, without need for any
associated values (most have values, few don't).

Thanks to W3C for publishing their standards documents in an easy-to-understand 
manner.  I made good use of their XHTML primer document when making release 1-06 
of this module.  The most recent version is at "http://www.w3.org/TR/xhtml1".  
The full title is "XHTML(TM) 1.0: The Extensible HyperText Markup Language -- 
A Reformulation of HTML 4 in XML 1.0 -- W3C Recommendation 26 January 2000".  
I used this document to determine what changes I needed to make for this 
module's output to easily support the new XHTML standard as it supported HTML 4 
and previous versions before, while keeping backwards compatability.

Thanks to B<Lincoln D. Stein> for setting a good interface standard in the
HTML-related methods of his CGI.pm module.  I was heavily influenced by his
interfaces when designing my own.  Thanks also because I borrowed ideas for my
Synopsis program from his aforementioned module.

=head1 SEE ALSO

perl(1), HTML::FormTemplate, CGI::Portable, CGI::FormMagick, CGI.



( run in 1.594 second using v1.01-cache-2.11-cpan-411bb0df24b )