#html-formatter #html

sys tidy-sys

Raw FFI bindings to the Tidy C library

16 releases

0.8.4 Jan 9, 2026
0.8.2 Aug 27, 2024
0.8.1 Jan 21, 2024
0.7.1 Dec 23, 2023

#229 in Internationalization (i18n)

Download history 75/week @ 2025-10-14 65/week @ 2025-10-21 56/week @ 2025-10-28 91/week @ 2025-11-04 25/week @ 2025-11-11 72/week @ 2025-11-18 152/week @ 2025-11-25 42/week @ 2025-12-02 43/week @ 2025-12-09 60/week @ 2025-12-16 28/week @ 2025-12-23 24/week @ 2025-12-30 92/week @ 2026-01-06 915/week @ 2026-01-13 157/week @ 2026-01-20 104/week @ 2026-01-27

1,272 downloads per month
Used in 3 crates (via tidier)

MIT license

3MB
57K SLoC

C 34K SLoC // 0.1% comments PO File 20K SLoC // 0.3% comments Ruby 1.5K SLoC // 0.2% comments Batch 898 SLoC Shell 367 SLoC // 0.1% comments Rust 140 SLoC Ruby HTML 66 SLoC C++ 30 SLoC // 0.2% comments

tidy-sys

Rust bindings for the HTML Tidy library.

Documentation

Note About Vendored Dependencies

The source code for Tidy is vendored in this repository for ease of use, under the vendor/ directory. Otherwise this is an unassociated project.

Also note that Tidy has its own license; this crate's license is for files excluding the vendor/ directory.

Requirements

This crate will build the Tidy library from source and generate bindings depending on the target platform. Some external tools are required:

  • CMake (Tidy uses CMake as the build system)
  • A C compiler (to compile Tidy)
  • Clang (as bindgen needs it)

The Default Build Configuration

Tidy will be built with:

  • -DNDEBUG, regardless of the rust profile (not setting it causes Tidy to debug-log to stderr uncontrollably)
  • CMake profile always set to Release as other values cause problems with Visual Studio generators
  • Optimization level matching the rust build's opt-level (overwritten with CFLAGS and TIDY_SYS_CFLAGS)

Setting Build Options

This crate respects the standard environment variables used by C compilers and related tools, such as CC, CFLAGS, LD etc.

In addition, you can set the TIDY_SYS_CFLAGS environment variable; the values will be appended to CFLAGS while building Tidy.

Crate Features

Currently there's only one feature, by default disabled:

  • localization: Enable multi-language support in Tidy (sets the SUPPORT_LOCALIZATIONS option to on with CMake).

No runtime deps

~0–2.2MB
~43K SLoC