Hi,

I was missing a HTML compress feature, so I used the tiny-html-minifier from https://github.com/jenstornell/tiny-html-minifier

tiny-html-minifier.zip
Tiny Html Minifier
(2.67 KiB) Downloaded 5 times


Installation:

  1. Download Add-On
  2. Extract directory `tiny-html-minifier` in 'couch/addons' folder.
  3. Add the following entry in 'couch/addons/kfunctions.php' file (if this file is not found, rename the kfunctions.example.php file to kfunctions.php)
    Code: Select all
    require_once( K_COUCH_DIR.'addons/tiny-html-minifier/TinyMinify.php' );

Usage
This addon makes available a new tag called compress. It is very simple to use:

Code: Select all
<cms:compress>
    <!-- here comes your HTML and CMS code :) -->
    <p>Compression works:</p>
    <ul>
        <li>
            Really?
        </li>
        <li>
            Really!
        </li>
    </ul>
</cms:compress>


Code will minified to:
Code: Select all
<p>Compression works:</p> <ul> <li> Really? </li> <li> Really! </li> </ul> 


Requirements
PHP7+

When I have more time, I will integrate the params 'collapse_whitespace' and 'disable_comments'.

Hope, you like and need it ;)