HTML::...Netrik(3pm)
π HTML::FormatText::Netrik π
okay bestie, so this is a Perl module β part of the User Contributed Perl Documentation β and its whole vibe is: HTML::FormatText::Netrik β format HTML as plain text using netrik. that's the name, that's the game, periodt. β¨
πΈ SYNOPSIS πΈ
here's the whole thing in action, no cap:
use HTML::FormatText::Netrik;
$text = HTML::FormatText::Netrik->format_file ($filename);
$text = HTML::FormatText::Netrik->format_string ($html_string);
$formatter = HTML::FormatText::Netrik->new;
$tree = HTML::TreeBuilder->new_from_file ($filename);
$text = $formatter->format ($tree);
like, that's literally it. you hand it a file or a string, you get text back. π«Ά
π¦ DESCRIPTION π¦
so HTML::FormatText::Netrik takes HTML and turns it into plain text, and it does this by using the netrik program. the way that it outsources all the hard work is honestly iconic of it. π
the official netrik spot is right here:
<http://netrik.sourceforge.net/>
the module interface is compatible with formatters like HTML::FormatText, but bestie, listen β all parsing etc is done by netrik. it's not doing any of that itself, it's just the messenger. π
now, netrik normally emits colour escape sequences (so fancy π) but that is disabled here β via its --bw option β so you actually get plain text. black and white, no drama, no escape codes, just vibes. π
if you wanna know about the formatting functions and options, go look at HTML::FormatExternal, but heads up, there are caveats:
β οΈ the caveats (read these, fr fr)
input_charset,output_charsetβ these charset overrides have no effect. π input might be single-byte only, and output probably follows the input (as of netrik 1.15.7). so don't come for these options expecting a glow-up, they simply do not do anything.
π BUGS π
okay so this one's a whole situation, ngl.
netrik version 1.16.1 initializes curses even when doing just a --dump β so if you have a TERM environment variable set, then it must be a terminal type known to curses (check terminfo(5) for the lore). π
but if you have no TERM setting at all? then HTML::FormatText::Netrik runs netrik with TERM=dumb, so the code here works in a bare environment. she's prepared, she's adaptable. πͺ
but no attempt is made here to validate or correct an existingTERMvalue. so if yourTERMis weird, that's between you and curses. π¬
π SEE ALSO π
HTML::FormatExternalnetrik(1)
π HOME PAGE π
<http://user42.tuxfamily.org/html-formatexternal/index.html>
go visit, she's got lore. πβ¨
π 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/>.
and that's the whole page, bestie!! π this one shipped with perl v5.36.0 and is dated 2022-11-19, so it's giving vintage-but-still-slaying. stay formatted, stay plain-text, mwah ππ¦β¨
π¦ 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