A command line tool of Tijs Verkoyen's Css To Inline Styles, so that we can use it in builds.
git clone https://github.com/turanct/css-inliner.git /usr/local/css-inliner && cd /usr/local/css-inliner && curl -sS https://getcomposer.org/installer | php && php composer.phar install && ln -s /usr/local/css-inliner/css-inliner /usr/local/bin/css-inliner && cd -
{
"require-dev": {
"turanct/css-inliner": "dev-master"
},
"config": {
"bin-dir": "bin"
}
}
/path/to/css-inliner --help
/path/to/css-inliner file.html
cat file.html | /path/to/css-inliner
If you want to write to a file, you can just redirect the STDOUT to a file:
cat file.html | /path/to/css-inliner > inlined.html
@tijsverkoyen
This code is provided under the MIT license.