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
- Host: GitHub
- URL: https://github.com/r32/html-inline
- Owner: R32
- Created: 2018-05-19T09:17:46.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-07-07T12:06:59.000Z (almost 3 years ago)
- Last Synced: 2025-02-12T03:17:18.802Z (over 1 year ago)
- Language: Haxe
- Size: 741 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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!");