HTML::...Format(3pm)
π HTML::...Format β the base microformat class, bestie
okay so this is HTML::...Format(3pm), from the User Contributed Perl Documentation, and it's literally the blueprint every other microformat class is built on. it's the mother, the blueprint, the blueprint-mother. let's get into it π
β¨ NAME β¨
HTML::Microformats::Format β the base microformat class, fr fr.
π¦ DESCRIPTION π¦
so here's the tea: HTML::Microformats::Format cannot be instantiated directly. nope, not even once. it's the parent class, and a whole bunch of other classes inherit from it. it's giving founding mother energy π
πΈ Constructors πΈ
bestie, listen β the constructors cannot actually be called on this package. call them on the descendent classes instead. i know, i know. it's giving "look but don't touch".
$object = HTML::Microformats::Format->new($element, $context, %options)β parses a microformat with root element$element. that's the whole vibe.$object = HTML::Microformats::Format->extract_all($element, $context, %options)β finds and parses all such microformats within element$element. all of them. every single one. no crumbs left behind π
π Public Methods - Accessors π
there are a bunch of property accessor methods defined via Perl's AUTOLOAD mechanism. magic? kinda. iconic? absolutely.
for any microformat property (e.g. 'fn' in hCard) there are get_X, set_X, add_X and clear_X methods defined. yes, all four. the whole squad π«Ά
get_Xβ for singular properties, returns the value of property X. for plural properties, returns a list of values if called in list context, or the first value otherwise. context-sensitive queen β¨set_Xβ for singular properties, sets the value of property X to the first given parameter. for plural properties, sets the values of property X to the list of parameters. > β οΈ This feature is deprecated and will be removed in a future release.add_Xβ for singular properties, sets the value of property X to the first given parameter, but croaks if X is already set. for concatenated singular properties, concatenates to the end of any existing value of X. for plural properties, adds any given parameters to the list of values of property X. > β οΈ This feature is deprecated and will be removed in a future release.clear_Xβ removes any values of property X, but croaks if the property is a required property. it said "no π«" > β οΈ This feature is deprecated and will be removed in a future release.
for example, an HTML::Microformats::hCard object will have:
- a method called
get_fnwhich gets the value of the hCard's"fn"property, - a method called
set_fnwhich sets it, - a method called
add_fnwhich also sets it (but croaks if it's already set), - and a method called
clear_fnwhich croaks if called β because"fn"is a required property. ripclear_fn, you never stood a chance π
Deprecated features: the set_X, add_X and clear_X methods are deprecated and will be removed soon. in general you should treat objects which are instances of HTML::Microformats::Format as read-only. hands off the merchandise, bestie π
π Public Methods - Other π
$object->format_signatureor$class->format_signatureβ this method may be called as a class or object method. it returns various information about the definition of this microformat (e.g. what is the root class, which properties exist, etc). > ngl you may need to do some digging to figure out what everything means. it's giving cryptic text from the group chat π±$object->profilesor$class->profilesβ this method may be called as a class or object method. it returns HTML profile URIs which indicate the presence of this microformat.$object->contextβ returns the parsing context (as supplied to"new").$object->dataβ returns a hashref of object data. > β οΈ this is a reference to the live data inside the object. any changes to the returned hashref will change the values inside the object. it's not a copy, it's the actual thing. be careful, that's main character responsibility π₯$object->elementβ returns the root element.$object->cacheβ shortcut for$object->context->cache. short and sweet π$object->id([$trine_obj], [$role])β returns a blank node identifier or identifying URI for the object.- if
$trine_objis true, the return value is anRDF::Trine::Nodeobject. otherwise, it's a string (using the'_:'convention to identify blank nodes). - if
$roleis undefined, then returns the identifier for the object itself. if it's defined then it returns an identifier for a resource with a fixed relationship to the object.
- if
$identifier_for_business_card = $hcard->id;
$identifier_for_person = $hcard->id(undef, 'holder');
$object->add_to_model($model)β given anRDF::Trine::Modelobject, adds relevant data to the model.$object->modelβ creates a fresh, newRDF::Trine::Modelobject, containing relevant data. brand new, fresh out the box β¨$object->serialise_model(as => $format)β as"model"but returns a string. same vibe, different delivery π
π BUGS π
please report any bugs to <http://rt.cpan.org/>. they're listening, bestie π
π§ SEE ALSO π§
HTML::Microformats.
π AUTHOR π
Toby Inkster <tobyink@cpan.org>. the icon, the legend π
π COPYRIGHT AND LICENCE π
Copyright 2008-2012 Toby Inkster
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
πΈ DISCLAIMER OF WARRANTIES πΈ
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
not me shouting the disclaimer but it's in all caps in the original so it's staying in all caps, periodt π£
and that's the whole page, bestie π this was HTML::...Format(3pm) from perl v5.32.1, dated 2021-09-12. stay iconic, stay read-only, and don't touch the live hashref π¦β¨
π¦ where this page comes from
- debian bookworm: libhtml-microformats-perl 0.105-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libhtml-microformats-perl 0.105-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libhtml-microformats-perl 0.105-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libhtml-microformats-perl 0.105-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libhtml-microformats-perl 0.105-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libhtml-microformats-perl 0.105-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms