Templa...t::HTML(3pm)

πŸ“¦
version 0.47 Β· 2 versions
  • 0.47 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.47 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Template::Declare::TagSet::HTML β€” the HTML tag set for Template::Declare πŸ’–

okay bestie, welcome to Template::Declare::HTML (that's the manual page for Template::Declare::TagSet::HTML, from the User Contributed Perl Documentation corner of the universe 🫢). This is the tag set that gives Template::Declare every single HTML tag you could ever want. Let's get into it ✨


🌸 NAME 🌸

Template::Declare::TagSet::HTML β€” the Template::Declare tag set for HTML. it's giving "I contain multitudes, and the multitudes are all <div>s" πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

normal use, like, the way you'd actually touch this on the user side:

# normal use on the user side:
use base 'Template::Declare';
use Template::Declare::Tags 'HTML';

template foo => sub {
    html {
        body {
        }
    }
};

and here's the deeper lore, the stuff happening inside Template::Declare::Tags:

# in Template::Declare::Tags:

use Template::Declare::TagSet::HTML;
my $tagset = Template::Declare::TagSet::HTML->new({
    package   => 'MyHTML',
    namespace => 'html',
});
my $list = $tagset->get_tag_list();
print $_, $/ for @{ $list };

if ( $altern = $tagset->get_alternate_spelling('tr') ) {
    print $altern;
}

if ( $tagset->can_combine_empty_tags('img') ) {
    print q{<img src="blah.gif" />};
}

✨ DESCRIPTION ✨

so Template::Declare::TagSet::HTML defines a full set of HTML tags for use in Template::Declare templates. all the elements for HTML 2, HTML 3, HTML 4, and XHTML 1 are in here. no cap, all of them 🫢

most of the time you will not use this module directly β€” you'll load it via:

use Template::Declare::Tags 'HTML';

that's the move. that's the whole vibe. 😌


πŸ’… METHODS πŸ’…

πŸ¦‹ new( PARAMS )

my $html_tag_set = Template::Declare::TagSet->new({
    package   => 'MyHTML',
    namespace => 'html',
});

constructor, inherited from Template::Declare::TagSet. it's the glow-up your tag set gets before it does anything at all πŸ’–

πŸ¦‹ get_tag_list

my $list = $tag_set->get_tag_list();

returns an array ref of all the HTML tags defined by Template::Declare::TagSet::HTML. and here's the complete list, bestie, every single one, we do not gatekeep in this house πŸ‘‘

  • h1
  • h2
  • h3
  • h4
  • h5
  • h6
  • p
  • br
  • hr
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • menu
  • code
  • var
  • strong
  • em
  • tt
  • u
  • i
  • b
  • blockquote
  • pre
  • img
  • a
  • address
  • cite
  • samp
  • dfn
  • html
  • head
  • base
  • body
  • link
  • nextid
  • title
  • meta
  • kbd
  • start_html
  • end_html
  • input
  • select
  • option
  • comment
  • charset
  • escapehtml
  • div
  • table
  • caption
  • th
  • td
  • tr
  • tr
  • sup
  • sub
  • strike
  • applet
  • param
  • nobr
  • embed
  • basefont
  • style
  • span
  • layer
  • ilayer
  • font
  • frameset
  • frame
  • script
  • small
  • big
  • area
  • map
  • abbr
  • acronym
  • bdo
  • col
  • colgroup
  • del
  • fieldset
  • iframe
  • ins
  • label
  • legend
  • noframes
  • noscript
  • object
  • optgroup
  • q
  • thead
  • tbody
  • tfoot
  • blink
  • fontsize
  • center
  • textfield
  • textarea
  • filefield
  • password_field
  • hidden
  • checkbox
  • checkbox_group
  • submit
  • reset
  • defaults
  • radio_group
  • popup_menu
  • button
  • autoescape
  • scrolling_list
  • image_button
  • start_form
  • end_form
  • startform
  • endform
  • start_multipart_form
  • end_multipart_form
  • isindex
  • tmpfilename
  • uploadinfo
  • url_encoded
  • multipart
  • form
  • canvas
  • section
  • article
  • aside
  • hgroup
  • header
  • footer
  • nav
  • figure
  • figcaption
  • video
  • audio
  • embed
  • mark
  • progress
  • meter
  • time
  • ruby
  • rt
  • rp
  • bdi
  • wbr
  • command
  • details
  • datalist
  • keygen
  • output
and yes bestie, tr really does show up twice and embed really does show up twice in that list. that's not a typo on my end, that's canon. we reproduce the canon fr fr πŸ™ˆ

πŸ¦‹ get_alternate_spelling( TAG )

$bool = $obj->get_alternate_spelling($tag);

returns the alternative spelling for a given tag if there is one, or undef otherwise. currently the mappings are:

  • tr β†’ row
  • td β†’ cell
  • q β†’ quote
  • base β†’ html_base
  • time β†’ datetime

why tho? because the alternates are there to avoid conflicts with the Perl tr and q operators, the time function, and the base module β€” and td got changed so it stays consistent with table rows. iconic reasoning, honestly 🌈

πŸ¦‹ can_combine_empty_tags( TAG )

$bool = $obj->can_combine_empty_tags($tag);

tells you whether <tag></tag> can be squished down into a single token, <tag />. currently only a few HTML tags are allowed to be combined, and they are:

  • base
  • meta
  • link
  • hr
  • br
  • param
  • img
  • area
  • input
  • col

short list, elite list. periodt πŸ’…


πŸ‘‘ AUTHOR πŸ‘‘

Agent Zhang <agentzh@yahoo.cn>


🫢 SEE ALSO 🫢

Template::Declare::TagSet, Template::Declare::TagSet::XUL, Template::Declare::TagSet::RDF, Template::Declare::Tags, Template::Declare.


and that's the whole page, bestie πŸŽ€ this was perl v5.34.0, dated 2022-06-17, straight out of Templa...t::HTML(3pm) β€” go forth and <div> responsibly, you absolute icon πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from