grunt-htmlgen
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -57,2 +57,8 @@ module.exports = function(grunt) { | ||
}, | ||
custom_charset: { | ||
dest: 'tmp/custom_charset.html', | ||
options: { | ||
charset: 'tis-620' | ||
} | ||
}, | ||
sample: { | ||
@@ -72,2 +78,3 @@ dest: 'tmp/sample.html', | ||
], | ||
body: '<div id="appContainer"></div>' | ||
} | ||
@@ -74,0 +81,0 @@ } |
{ | ||
"name": "grunt-htmlgen", | ||
"description": "Grunt task to generate HTML files with stylesheet and script elements.", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"author": { | ||
@@ -26,3 +26,6 @@ "name": "Jatesadakarn Seangrat", | ||
"grunt-contrib-nodeunit": "~0.1" | ||
}, | ||
"scripts": { | ||
"test": "grunt test" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# grunt-htmlgen | ||
# grunt-htmlgen [![Build Status](https://travis-ci.org/champjss/grunt-htmlgen.png?branch=master)](https://travis-ci.org/champjss/grunt-htmlgen) | ||
@@ -25,8 +25,14 @@ [Grunt](http://gruntjs.com) (0.4.x) task to generate HTML files with stylesheet and script elements. | ||
### options | ||
### options (optional) | ||
#### title | ||
#### charset (optional) | ||
Type: `String` | ||
Character set of the page (will be used in meta element). Default value is ``utf-8`` | ||
#### title (optional) | ||
Type: `String` | ||
Title of the page to generate. | ||
@@ -46,2 +52,8 @@ | ||
#### body (optional) | ||
Type: `String` | ||
Body HTML to include in the page. | ||
## Samples | ||
@@ -106,4 +118,5 @@ | ||
* 2013-02-18 v0.1.2 Add charset and body options | ||
* 2013-02-18 v0.1.1 Update development dependencies for Grunt 0.4.0 | ||
* 2013-02-14 v0.1.0 Change the configuration by moving title, css, js options into the options. | ||
* 2013-02-14 v0.0.1 First release. |
@@ -14,4 +14,7 @@ 'use strict'; | ||
content += '<head>' + linefeed; | ||
content += '<meta charset="utf-8">' + linefeed; | ||
if (kindOf(options.charset) === 'string') { | ||
content += '<meta charset="' + options.charset + '">' + linefeed; | ||
} | ||
if (kindOf(options.title) === 'string') { | ||
@@ -30,2 +33,6 @@ content += '<title>' + options.title + '</title>' + linefeed; | ||
if (kindOf(options.body) === 'string') { | ||
content += options.body + linefeed; | ||
} | ||
recurse(options.js, function(src) { | ||
@@ -44,3 +51,5 @@ if (kindOf(src) === 'string') { | ||
grunt.registerMultiTask('htmlgen', 'Generate HTML', function() { | ||
var options = this.options(), | ||
var options = this.options({ | ||
charset: 'utf-8' | ||
}), | ||
content = createHTMLString(options); | ||
@@ -47,0 +56,0 @@ |
@@ -53,2 +53,14 @@ var grunt = require('grunt'); | ||
custom_charset: function(test) { | ||
'use strict'; | ||
test.expect(1); | ||
var actual = grunt.file.read('tmp/custom_charset.html'); | ||
var expected = grunt.file.read('test/expected/custom_charset.html'); | ||
test.equal(actual, expected, 'should generate a HTML with no script and style'); | ||
test.done(); | ||
}, | ||
sample: function(test) { | ||
@@ -55,0 +67,0 @@ 'use strict'; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11301
13
187
120