mirror of
https://github.com/KevinMidboe/inline-html.git
synced 2025-10-29 17:40:29 +00:00
Updated README.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# inline-html
|
# inline-html
|
||||||
|
|
||||||
Embed local assets into an HTML document.
|
Embed local assets in an HTML document.
|
||||||
|
|
||||||
[]()
|
[]()
|
||||||
[]()
|
[]()
|
||||||
@@ -16,7 +16,6 @@ Embed local assets into an HTML document.
|
|||||||
This:
|
This:
|
||||||
|
|
||||||
var inlineHtml = require('inline-html');
|
var inlineHtml = require('inline-html');
|
||||||
|
|
||||||
inlineHtml('path/to/file.html').then(function (html) {
|
inlineHtml('path/to/file.html').then(function (html) {
|
||||||
...
|
...
|
||||||
});
|
});
|
||||||
@@ -44,12 +43,12 @@ Into this:
|
|||||||
|
|
||||||
Where:
|
Where:
|
||||||
|
|
||||||
`main.less`
|
- `main.less`
|
||||||
|
|
||||||
@import (inline) 'main.css';
|
@import (inline) 'main.css';
|
||||||
div { background-image: url('path/to/file'); }
|
div { background-image: url('path/to/file'); }
|
||||||
|
|
||||||
`main.css`
|
- `main.css`
|
||||||
|
|
||||||
@font-face { src: url('path/to/file'); }
|
@font-face { src: url('path/to/file'); }
|
||||||
|
|
||||||
@@ -84,5 +83,7 @@ Returns a `Promise` that is fulfilled with an `html` string or a `results` objec
|
|||||||
|
|
||||||
#### Results object
|
#### Results object
|
||||||
|
|
||||||
|
The `Promise` returned by this function is optionally fulfilled with a `results` object that has the following properties:
|
||||||
|
|
||||||
- `html` - The inlined html
|
- `html` - The inlined html
|
||||||
- `files` - An array of filenames of the inlined local assets.
|
- `files` - An array of filenames of the inlined local assets.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "inline-html",
|
"name": "inline-html",
|
||||||
"version": "0.1.1",
|
"version": "0.1.1",
|
||||||
"description": "Inline an html file.",
|
"description": "Embed local assets in an HTML document.",
|
||||||
"repository": "panosoft/inline-html",
|
"repository": "panosoft/inline-html",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user