Markdent::Parser(3pm)
π Markdent::Parser π
okay bestie, gather round, because this is the one. this is Markdent::Parser, a markdown parser, and it's giving main character energy from the very first line. β¨
this is version 0.40, just so we're both on the same page. π
πΈ SYNOPSIS πΈ
like, here's the vibe in code form:
my $handler = Markdent::Handler::HTMLStream->new( ... );
my $parser = Markdent::Parser->new(
dialect => ...,
handler => $handler,
);
$parser->parse( markdown => $markdown );
no notes. iconic. π
π¦ DESCRIPTION π¦
so this class is the primary interface for making a parser. that's the whole girlboss job. it takes a block parser and a span parser and ties them together with a handler β like a little friendship bracelet of parsing. π«Ά
by default, it parses the standard Markdown dialect, no cap. but you can hand it alternate block parser or span parser classes if you're feeling spicy. π₯
π METHODS π
here's what this class can do for you, bestie:
Markdent::Parser->new(...)
this method creates a new parser. it accepts the following parameters:
dialects => $nameor[ $name1, $name2 ]β you can use this to apply dialect roles to the standard parser class. if a dialect name doesn't contain a namespace separator (::), the constructor looks for roles namedMarkdent::Dialect::${dialect}::BlockParserandMarkdent::Dialect::${dialect}::SpanParser. if a dialect name does contain a namespace separator, it gets used as a prefix β$dialect::BlockParserand$dialect::SpanParser. if any relevant roles are found, the parser uses them. and it's totally okay if a given dialect only provides a block parser or a span parser, but not both. we don't gatekeep. πblock_parser_class => $classβ this defaults toMarkdent::Parser::BlockParser, but honestly it can be any class that implements theMarkdent::Role::BlockParserrole. your choice, your rules. πspan_parser_class => $classβ this defaults toMarkdent::Parser::SpanParser, but it can be any class that implements theMarkdent::Role::SpanParserrole. slay. β¨handler => $handlerβ this can be any object that implements theMarkdent::Role::Handlerrole. it is required, so don't forget it, fr fr. π
$parser->parse( markdown => $markdown )
this method parses the given document. the parsing will cause events to be fired, and those events get passed to the parser's handler. it's giving cause and effect. π«
π§ ROLES π§
this class does the Markdent::Role::EventsAsMethods and Markdent::Role::Handler roles. iykyk. π
π BUGS π
see Markdent for bug reporting details.
bugs may be submitted at <https://github.com/houseabsolute/Markdent/issues>.
i'm also usually active on IRC as 'autarch' on "irc://irc.perl.org". come say hi. π«Ά
π SOURCE π
the source code repository for Markdent can be found at <https://github.com/houseabsolute/Markdent>. go look, bestie. π
β AUTHOR β
Dave Rolsky <autarch@urth.org> π
π 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.
the full text of the license can be found in the LICENSE file included with this distribution.
and that's the whole page, bestie! π this gorgeous little manual came from perl v5.32.1, dated 2021-08-31, and it lives at Markdent::Parser(3pm) β go forth and parse, you absolute icon. ππ β¨
π¦ 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