Markde...ocument(3pm)

πŸ“¦
version 0.40 Β· 2 versions
, in debian bookworm, ubuntu jammy, ubuntu noble

✨ 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, a lang attribute 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.


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