# hyperbuild A fast one-pass in-place HTML minifier written in C with advanced whitespace handling. Currently in beta, working on documentation and tests. Issues and pull requests welcome! ## Features - Minification is done in one pass with no backtracking or DOM/AST building. - No dynamic memory is allocated during processing, which increases safety and performance. - Advanced whitespace handling options allow maximum minification while retaining valid spaces. ## Usage This is the library. To use hyperbuild, you'll probably need one of these: - [hyperbuild CLI](https://github.com/wilsonzlin/hyperbuild-cli) Documentation for the library itself is currently WIP. hyperbuild uses the following dependencies, which are included as submodules: - [nicehash](https://github.com/wilsonzlin/nicehash) ## Minification Guide below is currently WIP. ### Whitespace hyperbuild has advanced whitespace minification that can allow strategies such as: - leave whitespace untouched in `pre` and `code`, which are whitespace sensitive - trim and collapse whitespace in content tags, as whitespace is collapsed anyway when rendered - remove whitespace in layout tags, which allows the use of inline layouts while keeping formatted code #### Beginning and end ```html

↵ ··The·quick·brown·fox↵

``` #### Between text and tags ```html

The·quick·brown·fox·jumps·over·the·lazy·dog.

``` #### Contiguous ```html ``` #### Whole text ```html

↵ ···↵

``` ### Tag classification |Type|Content| |---|---| |Formatting tags|Text nodes| |Content tags|Formatting tags, text nodes| |Layout tags|Layout tags, content tags| |Content-first tags|Content of content tags or layout tags (but not both)| #### Specific tags Tags not in one of the categories below are **specific tags**. #### Formatting tags ```html moat ``` #### Content tags ```html

Some content

``` #### Content-first tags ```html
  • Anthony
  • ``` ```html
  • ``` #### Layout tags ```html
    ``` ## Development Currently, hyperbuild has a few limitations: - Only UTF-8 is supported. - Not aware of exotic Unicode whitespace characters. - Follows HTML5 only. - Only works on Linux. Patches to change any of these welcome!