WEBDUMP(1)		  BSD General Commands Manual		    WEBDUMP(1)

NAME
     webdump -- convert HTML to plain-text

SYNOPSIS
     webdump [-8adiIlrx] [-b baseurl] [-s selector] [-u selector]
	     [-w termwidth]

DESCRIPTION
     webdump reads UTF-8 HTML data from stdin.	It converts and writes the
     output as plain-text to stdout.  A baseurl can be specified if the links
     in the feed are relative URLs.  This must be an absolute URI.

     The options are as follows:

     -8	     Use UTF-8 symbols for certain items like bullet items and rulers
	     to make the output fancier.

     -a	     Toggle ANSI escape codes usage, by default it is not enabled.

     -b baseurl
	     Base URL of links.	 This is used to make links absolute.  The
	     specified URL is always preferred over the value in a <base/>
	     tag.

     -d	     Deduplicate link references.  When a duplicate link reference is
	     found reuse the same link reference number.

     -i	     Toggle if link reference numbers are displayed inline or not, by
	     default it is not enabled.

     -I	     Toggle if URLs for link reference are displayed inline or not, by
	     default it is not enabled.

     -l	     Toggle if link references are displayed at the bottom or not, by
	     default it is not enabled.

     -r	     Toggle if line-wrapping mode is enabled, by default it is not en-
	     abled.

     -s	     CSS-like selectors, this sets a reader mode to show only content
	     matching the selector, see the section SELECTOR SYNTAX for the
	     syntax.  Multiple selectors can be specified by separating them
	     with a comma.

     -u	     CSS-like selectors, this sets a reader mode to hide content
	     matching the selector, see the section SELECTOR SYNTAX for the
	     syntax.  Multiple selectors can be specified by separating them
	     with a comma.

     -w termwidth
	     The terminal width.  The default is 77 characters.

     -x	     Write resources as TAB-separated lines to file descriptor 3.

SELECTOR SYNTAX
     The syntax has some inspiration from CSS, but it is more limited.	Some
     examples:

     "main" would match on the "main" tags.

     "#someid" would match on any tag which has the id attribute set to
     "someid".

     ".someclass" would match on any tag which has the class attribute set to
     "someclass".

     "main#someid" would match on the "main" tag which has the id attribute
     set to "someid".

     "main.someclass" would match on the "main" tags which has the class at-
     tribute set to "someclass".

     "ul li" would match on any "li" tag which also has a parent "ul" tag.

     "li@0" would match on any "li" tag which is also the first child element
     of its parent container.  Note that this differs from filtering on a col-
     lection of "li" elements.

EXIT STATUS
     The webdump utility exits 0 on success, and >0 if an error occurs.

EXAMPLES
     url='https://codemadness.org/sfeed.html'

     curl -s "$url" | webdump -r -b "$url" | less

     curl -s "$url" | webdump -8 -a -i -l -r -b "$url" | less -R

     curl -s "$url" | webdump -s 'main' -8 -a -i -l -r -b "$url" | less -R

     To use webdump as a HTML to text filter for example in the mutt mail
     client, change in ~/.mailcap:

     text/html; webdump -i -l -r < %s; needsterminal; copiousoutput

SEE ALSO
     curl(1), xmllint(1), xmlstarlet(1), ftp(1)

AUTHORS
     Hiltjo Posthuma <hiltjo@codemadness.org>

BSD				October 6, 2023				   BSD
