HTML::...::Lynx(3pm)
π HTML::FormatText::Lynx β the whole vibe π
okay bestie, so this is HTML::FormatText::Lynx(3pm) and it's literally a Perl module that takes HTML and turns it into plain text, using the actual lynx program to do the heavy lifting. no cap. let's get into it π¦
β¨ NAME β¨
HTML::FormatText::Lynx β format HTML as plain text using lynx. that's it, that's the whole job description, and it slays π
π SYNOPSIS π
here's how you use it, fr fr:
use HTML::FormatText::Lynx;
$text = HTML::FormatText::Lynx->format_file ($filename);
$text = HTML::FormatText::Lynx->format_string ($html_string);
$formatter = HTML::FormatText::Lynx->new (rightmargin => 60);
$tree = HTML::TreeBuilder->new_from_file ($filename);
$text = $formatter->format ($tree);
see? you got your format_file, your format_string, and if you're feeling fancy you can make a new formatter with a rightmargin and feed it a whole HTML::TreeBuilder tree. main character energy honestly π
πΈ DESCRIPTION πΈ
so HTML::FormatText::Lynx turns HTML into plain text using the lynx program. iconic behavior. the home of that program is right here:
<http://lynx.isc.org/>
the module interface is compatible with formatters like HTML::FormatText, bestie β same vibe, same shape β but all the parsing and everything else is done by lynx, not by Perl. that's the plot twist π¦
now go look at HTML::FormatExternal for the formatting functions and options. all of them are supported by HTML::FormatText::Lynx, no notes. but there are a couple of caveats, and the caveats are important, so don't skip this part π
leftmargin, rightmargin
before the -nomargins option showed up in Lynx 2.8.6dev.12 (June 2005), an extra 3 space margin is always applied within whatever left and right positions you asked for. so like, old lynx gonna old lynx, and you just have to live with those 3 extra spaces π
input_charset, output_charset
heads up:latin-1and friends are not accepted here. it's gotta beiso-8859-1and friends. no shortcuts, bestie, the strict name is the whole point.
also, output_charset becomes the -display_charset option, which means it can't be used on very old lynx that doesn't even have that option (like, say, lynx circa 2.8.1). rip. and maybe someday output_charset could be dropped if it's already whatever will be output anyway, or a Perl error could get thrown when it's unsupported β but that's future talk, not current facts, iykyk.
π Extra Options π
these are the bonus little treats this module gives you on top of the standard set π
justify(boolean) β if it's true then-justifygets passed to lynx, which pads out all the lines in the paragraph with extra spaces up to the givenrightmargin(or the default right margin if you didn't set one). very neat, very aligned β¨unique_links(boolean) β if it's true then-unique_urlsgets passed, so lynx gives its link footnotes just once for each distinct URL and then re-uses them whenever the same URL shows up again in the document. and just so you know: this module option is perHTML::FormatText::WithLinks. noted π
π¦ SEE ALSO π¦
HTML::FormatExternallynx(1)
go read them, they're good for you, it's giving well-informed π
π HOME PAGE π
<http://user42.tuxfamily.org/html-formatexternal/index.html>
that's the house this module lives in, come visit β
π 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/>.
so yeah, that's the whole thing. free software, GPL v3 or later, no warranty, all the legal bits intact because we respect the paperwork around here π«Ά
and that's a wrap, bestie β this page was served up by perl v5.36.0 on 2022-11-19, and it's the HTML::...::Lynx(3pm) manpage, now with 100% more sparkle and exactly the same amount of facts. periodt π
π¦ 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