.\" This documentation was last modified by .\" Eugene V. Lyubimkin .\" on Sep 20, 2008 .\" .\" Comments and suggestions are welcome. .\" .TH html2text 1 2008\-09\-20 .SH NAME html2text \- an advanced HTML\-to\-text converter .SH SYNOPSIS .B html2text -help .br .B html2text -version .br .B html2text [ .B \-unparse | .B \-check ] [ .B \-debug\-scanner ] [ .B \-debug\-parser ] [ .B \-rcfile .I path ] [ .B \-style ( .B compact | .B pretty ) ] [ .B \-width .I width ] [ .B \-o .I output-file ] [ .B \-nobs ] [ .B \-ascii | .B \-utf8 ] [ .B \-nometa ] [ .IR input-file " ..." ] .SH DESCRIPTION .B html2text reads HTML documents from the .IR input-file s, formats each of them into a stream of plain text characters, and writes the result to standard output (or into .IR output-file , if the .B -o command line option is used). .P If no .IR input-file s are specified on the command line, .B html2text reads from standard input. A dash as the .I input-file is an alternate way to specify standard input. .P .B html2text understands all HTML 3.2 constructs, but can render only part of them due to the limitations of the text output format. However, the program attempts to provide good substitutes for the elements it cannot render. .B html2text parses HTML 4 input, too, but not always as successful as other HTML processors. It also accepts syntactically incorrect input, and attempts to interpret it "reasonably". .P The way .B html2text formats the HTML documents is controlled by formatting properties read from an RC file. .B html2text attempts to read .I $HOME/.html2textrc (or the file specified by the .B -rcfile command line option); if that file cannot be read, .B html2text attempts to read .IR /etc/html2textrc . If no RC file can be read (or if the RC file does not override all formatting properties), then "reasonable" defaults are assumed. The RC file format is described in the .BR html2textrc (5) manual page. .P Debian version of \fBhtml2text\fP also can do input and output recoding (see /usr/share/doc/html2text/README.Debian for more info). \fBhtml2text\fP tries to fetch encoding from HTML document. If encoding is not specified, you can use \fB\-ascii\fP and \fB\-utf8\fP options. Output is converted to user's locale charset (LC_CTYPE). .SH OPTIONS .TP .B \-nometa By default, Debian version of \fBhtml2text\fP use 'meta http-equiv' tag for input recoding. This option cancels this behavior. .TP .B \-ascii By default, when \fB\-nometa\fP is supplied, .B html2text uses .B UTF-8 for the output. Specifying this option, plain .B ASCII is used instead. To find out how non\-ASCII characters are rendered, refer to the file "ascii.substitutes". .TP .B \-utf8 By default, when \fB\-nometa\fP is supplied, .B html2text uses .B ISO 8859\-1 for the input. Specifying this option, .B UTF-8 is used instead (both for input and output). This option implies \fB\-nobs\fP. . .TP .B \-check This option is for diagnostic purposes: The HTML document is only parsed and not processed otherwise. In this mode of operation, .B html2text will report on parse errors and scan errors, which it does not in other modes of operation. Note that parse and scan errors are not fatal for .BR html2text , but may cause mis-interpretation of the HTML code and/or portions of the document being swallowed. .TP .B \-debug\-parser Let .B html2text report on the tokens being shifted, rules being applied, etc., while scanning the HTML document. This option is for diagnostic purposes. .TP .B \-debug\-scanner Let .B html2text report on each lexical token scanned, while scanning the HTML document. This option is for diagnostic purposes. .TP .B \-help Print command line summary and exit. .TP .B \-nobs By default, original .B html2text renders underlined letters with sequences like "underscore-backspace-character" and boldface letters like "character-backspace-character". Because of issues with UTF-8, Debian version of \fBhtml2text\fP doesn't produce backspaces, so this option really does nothing. .TP .BI \-o " output\-file" Write the output to .I output\-file instead of standard output. A dash as the .I output\-file is an alternate way to specify the standard output. .TP .BI \-rcfile " path" Attempt to read the file specified in .I path as RC file. .TP .BR \-style " ( " compact " | " pretty " )" Style .B pretty changes some of the default values of the formatting parameters documented in .BR html2textrc (5). To find out which and how the formatting parameter defaults are changed, check the file "pretty.style". If this option is omitted, style .B compact is assumed as default. .TP .B \-unparse This option is for diagnostic purposes: Instead of formatting the parsed document, generate HTML code, that is guaranteed to be syntactically correct. If .B html2text has problems parsing a syntactically incorrect HTML document, this option may help you to understand what .B html2text thinks that the original HTML code means. .TP .B \-version Print program version and exit. .TP .BI \-width " width" By default, .B html2text formats the HTML documents for a screen width of 79 characters. If redirecting the output into a file, or if your terminal has a width other than 80 characters, or if you just want to get an idea how .B html2text deals with large tables and different terminal widths, you may want to specify a different .IR width . .SH FILES .TP .I /etc/html2textrc System wide parser configuration file. .TP .I $HOME/.html2textrc Personal parser configuration file, overrides the system wide values. .SH "CONFORMING TO" .B "HTML 3.2" (HTML 3.2 Reference Specification \- http://www.w3.org/TR/REC-html32), .SH RESTRICTIONS Debian version of .B html2text have no http support. Use \fBhtml2text\fP through pipes with curl or wget instead. See README.Debian for more information. .P .B html2text was written to convert HTML 3.2 documents. When using it with HTML 4 or even XHTML 1 documents, some constructs present only in these HTML versions might not be rendered. .SH AUTHOR .B html2text was written up to version 1.2.2 by Arno Unkrig for GMRS Software GmbH, Unterschleissheim. .P Current maintainer and primary download location is: .br Martin Bayer .br .UR http://www.mbayer.de/html2text/files.shtml .P This man page was modified for Debian by Eugene V. Lyubimkin .UE .SH SEE ALSO .BR html2textrc (5), .BR less (1), .BR more (1)