An open API service indexing awesome lists of open source software.

https://github.com/r32/html-inline

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

Last synced: about 1 year ago
JSON representation

minify HTML and inline JS and CSS

Awesome Lists containing this project

README

          

html-inline
-------

* minify HTML: It will remove all extra spaces and comments.

* minify scripts and css by [java YUI Compressor](https://github.com/yui/yuicompressor)

### Installation

Available on haxelib, simply run the following command:

```bash
haxelib install html-inline
```

### Usage

```bash
Inline all script/css to HTML. version : 0.5.0
Usage: haxelib run html-inline [Options]
Options:
-h, --help : help informations
-s, --only-spaces : removes extra spaces only
-m, --no-merge : don't merge style/script tags
-k, --hook : an easy way to modify the parsed XML
```

sample:

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

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

html file:

```html
<!-- DEFAULT: all scripts and styles will be mifinied by yuicompressor and inline to HTML -->
<link href="style.css" />

<!-- hi-skip: Do nothing -->
<link href="style.css" hi-skip />

<!-- hi-mini: Minify(style.css) => (style.min.css) and update href -->
<link href="style.css" hi-mini />

<!-- hi-inline: Explicitly inline js/css even --only-spaces is specified -->
<link href="style.css" hi-inline />
```

example:

```html
<html>
<head>
<link rel="stylesheet" href="normal.css" />
<link rel="stylesheet" href="base.css" />
<title>test</title>
</head>
<body>
<script src="hi.js">
console.log("hello world!");