Markde...Methods(3pm)
π Markdent::Role::EventsAsMethods β the Markde...Methods(3pm) era π
okay bestie, so this is a Perl manual page, 3pm section, and it's about a role called Markdent::Role::EventsAsMethods. it turns events into method calls. that's the whole vibe. β¨
πΈ NAME πΈ
Markdent::Role::EventsAsMethods β Turns events into method calls π
π VERSION π
version 0.40 β yes she's got a version number, we love a numbered queen π
π¦ DESCRIPTION π¦
okay so here's the tea π: this role takes an object that does the Markdent::Role::Event role and turns it into a method call. that's it. that's the job. it's giving "glow up via indirection" and honestly? iconic. π
β¨ METHODS β¨
this role provides the following methods, and there's literally one of them, so pay attention:
π $object->handle_event($event)
given an object which does the Markdent::Role::Event role, this method makes a method call on $object based on the event's name. simple. elegant. slay. π
the method name is the same as the value of $event->event_name. and the hash reference returned by $event->attributes gets turned into a set of named parameters for that method. cute, right? π«Ά
BUT β and this is the part where you gotta lock in π₯ β any keys starting with ! in the attributes will not be passed to the method. they get left at the door. no invite. blocked. π
so for example, a Markdent::Event::StartLink event turns into a method call like this:
$handler->start_link(
uri => $event->uri,
title => $title, # optional
id => $id, # optional
is_implicit_id => $event->is_implicit_id,
);
see how uri and is_implicit_id are just chillin' there, and title and id are marked # optional? yeah. that's the move. π
π§ ROLES π§
this role does the Markdent::Role::Handler role. yes, roles doing roles. it's a whole ecosystem, iykyk. π«
π BUGS π
see Markdent for bug reporting details. (the main character holds the receipts.)
bugs may be submitted at <https://github.com/houseabsolute/Markdent/issues>.
also, and this is lowkey adorable β "I am also usually active on IRC as 'autarch' on irc://irc.perl.org." so if you need them, they're around. no cap. π«Ά
β SOURCE β
the source code repository for Markdent can be found at <https://github.com/houseabsolute/Markdent>. go forth and peruse, bestie. πβ¨
π AUTHOR π
Dave Rolsky <autarch@urth.org> β the legend themselves. ate. π
π COPYRIGHT AND LICENSE π
this software is copyright (c) 2021 by Dave Rolsky.
this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. periodt. π
the full text of the license can be found in the LICENSE file included with this distribution. it's right there, in the repo, waiting for you. πΈ
and that's the whole page, bestie!! π¦ this was perl v5.32.1, dated 2021-08-31, and it's the Markde...Methods(3pm) page β short, sweet, and absolutely serving. mwah. πβ¨
π¦ where this page comes from
- debian bookworm: libmarkdent-perl 0.40-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libmarkdent-perl 0.40-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libmarkdent-perl 0.40-1 Β· 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