Templa...ToText(3pm)
π Templa...ToText(3pm) π
okay bestie, welcome to the group chat β¨ this one lives in the User Contributed Perl Documentation section of your man pages, and it's here to make your templates spit out nice plain text instead of a whole HTML situation. it's giving "unstyled but iconic". let's go π«Ά
πΈ NAME πΈ
Template::Plugin::HtmlToText β a plugin interface to HTML::FormatText. literally that's the whole vibe, no cap π
β¨ SYNOPSIS β¨
so the original is like "quick summary of what the module does" and "perhaps a little code snippet" and honestly? slay, here's the snippet, copied exactly, character for character, don't @ me:
[% USE HtmlToText %]
# use html2text FILTER to var 'myhtml' or 'myhtmltext'
[% myhtml FILTER html2text(leftmargin => 0, rightmargin => 50) %]
[% myhtmltext | html2text %]
# not to a var, but to html code
[% FILTER html2text %]
<b>heavy</b>
[% END %]
[%# output is "heavy", no <b></b> %]
okay so what's happening here π§ you USE HtmlToText, then you got the html2text FILTER and you can send it to a var like myhtml or myhtmltext, and you can pass it args like leftmargin => 0, rightmargin => 50. OR β main character move β you can run [% FILTER html2text %] over a block of actual HTML and get plain text back. and bestie, [%# output is "heavy", no <b></b> %] β the tags are GONE, the text stays, periodt πβ¨
π¦ DESCRIPTION π¦
this plugin is the little matchmaker between your templates and the HTML::FormatText module π and what does HTML::FormatText do? it formats HTML as plaintext. that's it. that's the job. lowkey essential, highkey underrated. obsessed π
π AUTHOR π
Fayland Lam, "<fayland>" π
π COPYRIGHT & LICENSE π
Copyright 2006 Fayland Lam, all rights reserved. β
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. π«Ά (yes bestie, same terms as Perl itself, go wild, but like, responsibly π )
and that's a wrap, bestie!! this page came to you courtesy ofperl v5.36.0and the date2023-02-18β that footer ate and left no crumbs πβ¨ no cap, go format some HTML into text and be the main character of your own template π¦πΈ
π¦ where this page comes from
- debian trixie: libtemplate-plugin-htmltotext-perl 0.03-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtemplate-plugin-htmltotext-perl 0.03-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtemplate-plugin-htmltotext-perl 0.03-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtemplate-plugin-htmltotext-perl 0.03-2 Β· 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