HTML::LoL

HTML::LoL is a Perl module that can construct HTML from pleasing Perl data structures.
Download

HTML::LoL Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Bob Glickstein
  • Publisher web site:
  • http://search.cpan.org/~bobg/HTML-LoL-1.3/lib/HTML/LoL.pm

HTML::LoL Tags


HTML::LoL Description

HTML::LoL is a Perl module that can construct HTML from pleasing Perl data structures. HTML::LoL is a Perl module that can construct HTML from pleasing Perl data structures.SYNOPSIS use HTML::LoL; &hl(sub { print shift }, , ...]);This module allows you to use Perl syntax to express HTML. The function hl() converts Perl list-of-list structures into HTML strings.The first argument to hl() is a callback function that's passed one argument: a fragment of generated HTML. This callback is invoked repeatedly with successive fragments until all the HTML is generated; the callback is responsible for assembling the fragments in the desired output location (e.g., a string or file).The remaining arguments to hl() are Perl objects representing HTML, as follows:TAG is a string (the name of an HTML element); remaining list items are any of the forms described herein. Corresponds to < TAG >...< /TAG >. If TAG is an "empty element" according to %HTML::Tagset::emptyElement, then the < /TAG > is omitted.Corresponds to < TAG ATTR1="VAL1" ATTR2="VAL2" ... >...< /TAG >. (As above, < /TAG > is omitted if TAG is an "empty element.") Each ATTR is a string. Each VAL is either a string, in which case the value gets HTML-entity-encoded when copied to the output, or a list reference containing a single string (viz. ) in which case the value is copied literally.Finally, for boolean-valued attributes, VAL may be hl_bool(BOOLEAN), where BOOLEAN is a Perl expression. If BOOLEAN is true, the attribute is included in the output; otherwise it's omitted.Any stringStrings are copied verbatim to the output after entity-encoding.hl_noquote(...)Suppresses entity-encoding of its arguments.hl_requote(...)Reenables entity-encoding of its arguments (use it inside a call to hl_noquote()).hl_preserve(...)Normally, HTML::LoL tries to optimize the whitespace in the HTML it emits (without changing the meaning of the HTML). This suppresses that behavior within its arguments.hl_entity(NAME)Includes the HTML character-entity named NAME.The return value of hl() is the result of the last call to the callback function. This means it's possible to write &hl(sub { $accumulator .= shift }, ...)to have hl() return a string containing the completely rendered HTML. Requirements: · Perl


HTML::LoL Related Software