1
0
Fork
You've already forked htmlfilt
0
No description
  • C 89.3%
  • Makefile 6.2%
  • Shell 4.5%
2026年05月31日 15:39:47 +02:00
include htmlfilt: initial commit 2026年05月31日 08:55:04 +02:00
libhtml Fix out-of-source builds 2026年05月31日 15:24:14 +02:00
man drop the ANSI build option which is a remnant of a previous life of this code 2026年05月31日 15:39:00 +02:00
mk Fix out-of-source builds 2026年05月31日 15:24:14 +02:00
src Fix out-of-source builds 2026年05月31日 15:24:14 +02:00
tests Fix out-of-source builds 2026年05月31日 15:24:14 +02:00
.editorconfig feat: add editorconfig 2026年05月31日 08:55:04 +02:00
.gitignore update .gitignore 2026年05月31日 15:26:25 +02:00
configure Sync with latest bbuild 2026年05月31日 10:33:00 +02:00
configure.def Release 0.3.0 2026年05月31日 15:39:47 +02:00
Kyuafile Allow make test and make distcheck 2026年05月31日 15:36:25 +02:00
LICENSE Add BSD 2-Clause license file 2026年05月31日 08:56:51 +02:00
Makefile.in Allow make test and make distcheck 2026年05月31日 15:36:25 +02:00
README.md htmlfilt: initial commit 2026年05月31日 08:55:04 +02:00

htmlfilt

A command-line HTML to plain text converter for FreeBSD.

htmlfilt parses HTML documents, applies CSS styling, and renders the content as formatted text in the terminal, with optional ANSI escape codes for visual formatting.

Features

  • HTML parsing with support for most common elements (headings, paragraphs, lists, tables, links, blockquotes, preformatted text, etc.)
  • CSS stylesheet parsing and inline style support
  • ANSI escape code output for bold, italic, colors, text decoration, and background colors (enabled by default, disable with -a)
  • Capsicum sandboxing for privilege separation on FreeBSD
  • Configurable output width (default 80 columns)
  • Input from stdin or file

Usage

htmlfilt [-a] [-w width] [file]

Options

Option Description
-a Disable ANSI escape codes
-w Set terminal width (default 80)

Examples

Read from stdin:

echo '<h1>Hello World</h1>' | htmlfilt

Read from a file:

htmlfilt document.html

Disable ANSI formatting:

htmlfilt -a document.html

Set a custom width:

htmlfilt -w 60 document.html

Building

Prerequisites

  • A C compiler (GCC or Clang)
  • POSIX make
  • Optionally ATF (Automated Test Framework) for tests

Build steps

./configure
make

This produces the src/htmlfilt binary and the libhtml/libhtml.a static library.

Tests

If ATF is available on the system, tests are automatically enabled. Run them with:

make test