Refactored.

This commit is contained in:
Alexandre Gigliotti
2015-07-23 08:28:22 -07:00
parent e5e1f08fba
commit f4085786f6
13 changed files with 180 additions and 65 deletions

View File

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

@@ -1,13 +1,11 @@
<!doctype html>
<html>
<head>
<link rel="stylesheet/less" href="main.less"/>
<style>
div {
padding-left: 2em;
}
</style>
<link rel="stylesheet/less" href="main.less"/>
<style>
#style {
background-image: url('./assets/person.png');
background-size: contain;

View File

@@ -2,11 +2,9 @@ var inline = require('../lib');
var path = require('path');
var fs = require('fs');
var filepath = path.resolve(__dirname, './index.html');
var filepath = path.resolve(__dirname, './fixtures/index.html');
var options = {};
/**
* html -> async -> inlined html
*/
inline(filepath, options)
.then(function (html) {
console.log(html);

7
test/inline-css-url.js Normal file
View File

@@ -0,0 +1,7 @@
var inline = require('../lib/inline-css-url');
var fs = require('fs');
var filePath = './fixtures/assets/imported.css';
var css = fs.readFileSync(filePath, 'utf8');
css = inline(css, filePath);
console.log(css);

10
test/inline-link-less.js Normal file
View File

@@ -0,0 +1,10 @@
var inline = require('../lib/inline-link-less');
var fs = require('fs');
var path = require('path');
var filepath = path.resolve(__dirname, './fixtures/index.html');
var html = fs.readFileSync(filepath, 'utf8');
inline(html, filepath, {})
.then(console.log)
.catch(console.error);