7 Commits

Author SHA1 Message Date
Alexandre Gigliotti
dff5f1160b 0.1.5 2015-08-10 08:55:48 -07:00
Alexandre Gigliotti
abb3dd95a7 Updated README. 2015-08-10 08:55:40 -07:00
Alexandre Gigliotti
8f27f9d04f Updated README. 2015-08-06 08:37:37 -07:00
Alexandre Gigliotti
76ff6ca703 Updated README. 2015-08-05 16:16:35 -07:00
Alexandre Gigliotti
8e3a9b0390 0.1.4 2015-08-05 16:14:58 -07:00
Alexandre Gigliotti
56a6f43657 0.1.3 2015-08-05 16:10:27 -07:00
Alexandre Gigliotti
d5c6a6b540 Updated license. 2015-08-05 16:10:21 -07:00
2 changed files with 37 additions and 26 deletions

View File

@@ -1,8 +1,9 @@
# inline-html
Embed local assets in an HTML document.
Inline local assets referenced in an HTML document.
[![npm](https://img.shields.io/npm/v/inline-html.svg)]()
[![npm](https://img.shields.io/npm/l/inline-html.svg)]()
[![Travis](https://img.shields.io/travis/panosoft/inline-html.svg)]()
[![David](https://img.shields.io/david/panosoft/inline-html.svg)]()
[![npm](https://img.shields.io/npm/dm/inline-html.svg)]()
@@ -15,42 +16,52 @@ Embed local assets in an HTML document.
This:
var inlineHtml = require('inline-html');
inlineHtml('path/to/file.html').then(function (html) {
...
});
```js
var inlineHtml = require('inline-html');
inlineHtml('path/to/file.html').then(function (html) {
...
});
```
Turns this:
<link rel="stylesheet/less" href="main.less" />
<style>
div { background-image: url('path/to/file'); }
</style>
<div style="background-image: url('path/to/file');"></div>
<img src="path/to/file" />
```html
<link rel="stylesheet/less" href="main.less"/>
<style>
div { background-image: url('path/to/file'); }
</style>
<div style="background-image: url('path/to/file');"></div>
<img src="path/to/file"/>
```
Into this:
<style>
@font-face { src: url('data:...'); }
div { background-image: url('data:...'); }
</style>
<style>
div { background-image: url('data:...'); }
</style>
<div style="background-image: url('data:...');"></div>
<img src="data:..." />
```html
<style>
@font-face { src: url('data:...'); }
div { background-image: url('data:...'); }
</style>
<style>
div { background-image: url('data:...'); }
</style>
<div style="background-image: url('data:...');"></div>
<img src="data:..."/>
```
Where:
- `main.less`
@import (inline) 'main.css';
div { background-image: url('path/to/file'); }
```css
@import (inline) 'main.css';
div { background-image: url('path/to/file'); }
```
- `main.css`
@font-face { src: url('path/to/file'); }
```css
@font-face { src: url('path/to/file'); }
```
## API

View File

@@ -1,14 +1,14 @@
{
"name": "inline-html",
"version": "0.1.2",
"description": "Embed local assets in an HTML document.",
"version": "0.1.5",
"description": "Inline local assets referenced in an HTML document.",
"repository": "panosoft/inline-html",
"main": "lib/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"license": "MIT",
"dependencies": {
"cheerio": "^0.19.0",
"co": "^4.6.0",