grunt-asset-inliner
v0.1.2
Published
Grunt plugin that parses your markup and replaces references to external assets with inline code.
Downloads
2
Maintainers
Readme
grunt-asset-inliner
Grunt plugin that parses your markup and replaces references to external assets with inline code.
Getting Started
This plugin requires Grunt ~0.4.1
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-asset-inliner --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks( "grunt-asset-inliner" );
Inliner task
Run this task with the grunt inliner
command.
Task targets, files and options may be specified according to the grunt Configuring tasks guide.
Assets are inlined with asset-inliner.
Usage
Inline the assets from a single file.
inliner: {
single: {
files: {
"path/to/output.html", [ "path/to/input.html" ]
}
}
}
Inline the assets from all the files in a directory.
inliner: {
multi: {
files: [
{
expand: true,
cwd: "input/directory",
src: [ "*.html" ],
dest: "ouput/directory"
}
]
}
}
Options
Name | Type | Argument | Default | Description
-------|-----------|--------------|---------|------------
manual | boolean
| <optional>
| false
| Manually define the assets that should be inlined by appending data-inline="true"
to an elements(s) markup.
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
License
Copyright (c) 2014 Jason Bellamy
Licensed under the MIT license.