HTML::...::Links(3pm)
πΈ HTML::FormatText::Links β the vibe β¨
okay so bestie, this is HTML::FormatText::Links from the HTML::...::Links family (that's the 3pm manual page, section 3, you know the drill π
) β it formats HTML as plain text using links. Yes, the program. We'll get there π«Ά
β¨ SYNOPSIS β¨
use HTML::FormatText::Links;
$text = HTML::FormatText::Links->format_file ($filename);
$text = HTML::FormatText::Links->format_string ($html_string);
$formatter = HTML::FormatText::Links->new (rightmargin => 60);
$tree = HTML::TreeBuilder->new_from_file ($filename);
$text = $formatter->format ($tree);
look at that. four lines and you're already formatting. we love a low-effort queen π
π DESCRIPTION π
so HTML::FormatText::Links literally takes HTML and turns it into plain text, and it does it by using the links program. iconic behaviour honestly.
<http://links.twibright.com/>
the module interface is compatible with formatters like HTML::FormatText, but here's the tea: all parsing etc is done by links. not the module. links. it's giving delegation, it's giving "I don't do the work, I know a guy" π
go check out HTML::FormatExternal for the formatting functions and options β all of them are supported by HTML::FormatText::Links, with the following caveats. and bestie, you KNOW we're about to read the caveats. no skipping. π
π leftmargin, rightmargin
in past versions of links without the -html-margin option, you always get an extra 3 spaces within the requested left and right margins. so like, your margins aren't exactly your margins. that's just how it was. periodt. β¨
π¦ input_charset, output_charset
an output charset requires Links 2.0 or higher (or some such version), and as of 2.2 the output cannot be UTF-8 (though the input can be, slay). various unicode inputs do get turned into reasonable output though β for example, smiley face U+263A becomes :-). not me getting emotional over a character encoding conversion ππ
ngl, Links can be a bit picky about its charset names. this module attempts to ease that by for instance turninglatin-1(not accepted) intolatin1(which is accepted). a fullISO-8859-1etc is accepted too. so it's like, the module is your translator bestie holding your hand through it π«Ά
π SEE ALSO π
HTML::FormatExternallinks(1)
go read them, they're right there, I promise it's worth it π
π HOME PAGE π
<http://user42.tuxfamily.org/html-formatexternal/index.html>
that's the house. come through. π
π LICENSE π
Copyright 2008, 2009, 2010, 2013, 2015 Kevin Ryde
HTML-FormatExternal is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
HTML-FormatExternal is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with HTML-FormatExternal. If not, see <http://www.gnu.org/licenses/>.
fr fr read the license, it's not optional and it's not a suggestion β οΈβ¨
aaaand that's the page bestie π this was perl v5.36.0, dated 2022-11-19, from the HTML::...::Links(3pm) manual. mwah π go format something pretty π
π
π¦ where this page comes from
- debian bookworm: libhtml-formatexternal-perl 26-6 Β· GPL-3.0-or-later
- debian trixie: libhtml-formatexternal-perl 26-6 Β· GPL-3.0-or-later
- ubuntu noble: libhtml-formatexternal-perl 26-6 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms