Thanks to visit codestin.com
Credit goes to lib.rs

2 releases

Uses new Rust 2024

0.17.1 Apr 19, 2026
0.17.0 Apr 19, 2026

#2364 in Text processing

28 downloads per month

MIT license

430KB
12K SLoC

html2text

A command-line tool to convert HTML into text in various forms. Supports some CSS including colours with default features.

The default, which gives text with ASCII annotations similar to (but not exactly) markdown for things like <strong> elements and lists, and table formatting. It defaults to reading from standard input and writing to standard output.

html2text foo.html

For a more fancy terminal output, including ANSI colours, syntax highlighting using syntect (css_ext cargo feature required) and added CSS rules:

html2text --colour --css --syntax --agent-css 'pre.rust { x-syntax: rs; }' < file_with_rust_code.html

Dependencies

~4–7.5MB
~128K SLoC