HTML::...::Links(3pm)

πŸ“¦
version 26 Β· 5 versions
, in debian bookworm, debian trixie, ubuntu noble

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 turning latin-1 (not accepted) into latin1 (which is accepted). a full ISO-8859-1 etc is accepted too. so it's like, the module is your translator bestie holding your hand through it 🫢

πŸ‘€ SEE ALSO πŸ‘€

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