Markde...ocument(3pm)
β¨ NAME β¨
Markdent::Handler::HTMLStream::Document β bestie, this is the 3pm page for it (User Contributed Perl Documentation, iykyk). It turns Markdent events into a whole entire HTML document π
π VERSION π
version 0.40 β yes, that's the one, no cap.
πΈ DESCRIPTION πΈ
Okay so picture this: you've got an event stream justβ¦ sitting there, doing its little event-stream thing. This class takes that stream and turns it into a complete HTML document. That's it, that's the job, and it ate. π
π¦ METHODS π¦
This role provides the following methods, and honestly? They're giving main character energy:
β¨ Markdent::Handler::HTMLStream::Document->new(...) β¨
This method creates a new handler. It accepts the following parameters β listen up, bestie, because each one matters:
title => $titleβ The title of the document. This one is required, so likeβ¦ don't skip it, fr fr. π«Άcharset => $charsetβ If you provide it, a<meta charset="...">tag gets added to the document's<head>. Cute, right? β¨language => $languageβ If you provide it, alangattribute gets added to the document's<html>tag. Lowkey important for accessibility, highkey slay. πoutput => $fhβ The file handle or object that the HTML output gets streamed to. Now, if you wanna capture the output in a string, you can open a filehandle to a string like this:
my $buffer = q{};
open my $fh, '>', \$buffer;
If you pass a file handle (or an IO::Handle object), then all calls to print() will be checked, and an error will be thrown. π
You can pass an object of any other class β it just has to implement its own print() method, and error handling is left up to that method. So it's on them, not us. π€·ββοΈ
π ROLES π
This class does the Markdent::Role::HTMLStream, Markdent::Role::EventsAsMethods, and Markdent::Role::Handler roles. Three roles, one icon. π
π BUGS π
See Markdent for bug reporting details.
Bugs may be submitted at <https://github.com/houseabsolute/Markdent/issues>.
I am also usually active on IRC as 'autarch' on irc://irc.perl.org.
π¦ SOURCE π¦
The source code repository for Markdent can be found at <https://github.com/houseabsolute/Markdent>. Go peek, it's right there. π
β AUTHOR β
Dave Rolsky <autarch@urth.org> β legend behavior, honestly.
π 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 was perl v5.32.1, dated 2021-08-31, from the User Contributed Perl Documentation corner of the universe. go forth and stream some HTML, you've got this π«Άβ¨π
π¦ 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