<commit_before># Groundskeeper

[![Latest Version on Packagist][ico-version]][link-packagist]
[![Software License][ico-license]](LICENSE.md)
[![Build Status][ico-travis]][link-travis]
[![Coverage Status][ico-scrutinizer]][link-scrutinizer]
[![Quality Score][ico-code-quality]][link-code-quality]
[![Total Downloads][ico-downloads]][link-downloads]

Groundskeeper will clean your weedy HTML.

## Install

Via Composer

``` bash
$ composer require kevintweber/groundskeeper
```

## Usage

Here is a simple example:

``` php
use Groundskeeper\Groundskeeper;

$groundskeeper = new Groundskeeper(array(
    'output'   => 'pretty',
    'strategy' => 'standard'
));
$cleanHtml = $groundskeeper->clean($dirtyHtml);
```
### Options
| Key     | Option  | Description                            |
|:------- |:------- |:-------------------------------------- |
| indent-spaces | <int> | The number of spaces for indentation when using pretty output. Default: 4 |
| output |   |   |
|        | compact | Will remove all whitespace between elements. |
|        | pretty  | One element per line with indentation. Handy for debugging. |
| throw-on-error | <boolean> | If true, will throw an error when malformed HTML is encountered.  Default: false |

## Change log
<commit_msg>Improve the readme.<commit_after># Groundskeeper

[![Latest Version on Packagist][ico-version]][link-packagist]
[![Software License][ico-license]](LICENSE.md)
[![Build Status][ico-travis]][link-travis]
[![Coverage Status][ico-scrutinizer]][link-scrutinizer]
[![Quality Score][ico-code-quality]][link-code-quality]
[![Total Downloads][ico-downloads]][link-downloads]

Groundskeeper will clean your weedy HTML.

## Install

Via Composer

``` bash
$ composer require kevintweber/groundskeeper
```

## Usage

Here is a simple example:

``` php
use Groundskeeper\Groundskeeper;

$groundskeeper = new Groundskeeper(array(
    'output'   => 'pretty',
    'strategy' => 'standard'
));
$cleanHtml = $groundskeeper->clean($dirtyHtml);
```
### Options
| Key     | Options  | Description                            |
|:------- |:------- |:-------------------------------------- |
| indent-spaces | &lt;int&gt; | The number of spaces for indentation when using pretty output. Default: 4 |
| output | "compact","pretty" | Compact: Will remove all whitespace between elements.<br/>Pretty: One element per line with indentation. Handy for debugging. |
| remove-types | none or comma seperated list of any one of the following: cdata,comment,doctype,element,text | This token type will be removed during cleaning. |
| strategy | "none","standard" | The cleaning strategy to use. Default: standard |
| throw-on-error | &lt;boolean&gt; | If true, will throw an error when malformed HTML is encountered.  Default: false |

## Change log

{'fraction_non_alphanumeric': 0.17308384310903202, 'fraction_numerical': 0.0007196833393306944, 'mean_word_length': 3.6102819237147594, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6753822', 'n_tokens_mistral': 864, 'n_tokens_neox': 823, 'n_words': 232}