HTML::...Elinks(3pm)

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

okay bestie, gather round, because this little perl module is literally the moment. it's HTML::FormatText::Elinks, it lives in the perl docs as a 3pm page, and its whole job is turning HTML into plain text using the elinks program. no cap. πŸ¦‹


✨ NAME ✨

HTML::FormatText::Elinks β€” format HTML as plain text using elinks. that's it, that's the vibe. πŸ’…


🌸 SYNOPSIS 🌸

use HTML::FormatText::Elinks;
$text = HTML::FormatText::Elinks->format_file ($filename);
$text = HTML::FormatText::Elinks->format_string ($html_string);

$formatter = HTML::FormatText::Elinks->new (rightmargin => 60);
$tree = HTML::TreeBuilder->new_from_file ($filename);
$text = $formatter->format ($tree);

look at her go. four whole ways to use her, all iconic, all in the box. πŸ‘‘


πŸŽ€ DESCRIPTION πŸŽ€

so HTML::FormatText::Elinks takes your HTML and turns it into plain text, and it does it by handing the whole thing over to the elinks program. the way that it just... outsources the hard part? main character energy fr fr.

the elinks home is right here, go say hi:

<http://elinks.cz/>

the module interface is compatible with formatters like HTML::FormatText β€” same shape, same energy β€” but all the parsing and everything else is done by elinks. not by perl, not by this module, by elinks. πŸ’€

for the formatting functions and options, go read HTML::FormatExternal. HTML::FormatText::Elinks supports all of them, but with the following caveats, and you need to know these, okay? not optional reading. 🫢

  • input_charset β€” as of Elinks 0.12pre2 (Oct 2008), it has various unibyte input charsets, but the only multibyte input charset it accepts is utf-8. so if yours is something else multibyte, you could recode it to utf-8 yourself if you need to β€” but heads up, this module does not attempt to do that automatically. it's not gonna do it for you, bestie. 😭

also, elinks can be a little picky about its charset names. like, a tiny bit dramatic about it. this module tries to ease that pain by, for instance, turning latin-1 (which is not accepted) into latin1 (which is accepted). and a full name like ISO-8859-1 etc is accepted too. so you've got options. slay. ✨


πŸ¦‹ SEE ALSO πŸ¦‹


🌈 HOME PAGE 🌈

<http://user42.tuxfamily.org/html-formatexternal/index.html>

πŸ‘‘ LICENSE πŸ‘‘

Copyright 2008, 2009, 2010, 2012, 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/>.

periodt. πŸ’œ

and that's the whole page, bestie β€” no notes, ate, left no crumbs. πŸ“

this has been the HTML::...Elinks(3pm) page from perl v5.36.0, dated 2022-11-19, brought to you by User Contributed Perl Documentation. mwah. πŸ’–

πŸ“¦ where this page comes from