html-inline

minify HTML and inline JS and CSS
https://github.com/R32/html-inline/

To install, run:

haxelib install html-inline 0.1.0 

See using Haxelib in Haxelib documentation for more information.

README.md

html-inline

  • minify HTML: It will remove all extra spaces and comments(IE conditions comments will be preserved).

  • inline script and css. You should minify JS and CSS files by yourself More details on

if href="style.css" then the "style.min.css" will be loaded from the same directory as the disk.

if href="style.min.css" then still use "style.min.css".

example input file:

<html>
  <head>
    <link rel="stylesheet" href="normal.css" /> <!-- div{padding:0;} -->
    <link rel="stylesheet" href="base.css" />   <!-- .base{margin:0;} -->
    <title>test</title>
  </head>
  <body>
    <script src="hi.js"></script>               <!-- console.log("hello world!"); -->
  </body>
</html>

output: As you can see that the continuous, embeddable js/css will be combined into one tag.

<html><head><style type="text/css">div{padding:0;}
.base{margin:0;}</style><title>test</title></head><body><script type="text/javascript">console.log("hello world!");</script></body></html>

Installation

Available on haxelib, simply run the following command:

haxelib install html-inline

Usage

# The default will be output to stdout
haxelib run html-inline index.html

# or
haxelib run html-inline index.html > out.html

Other tools

Contributors
r32
Version
0.1.0
Published
3 weeks ago
License
MIT

All libraries are free

Every month, more than thousand developers use haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on Github!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on Github