html2jsfile
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -32,3 +32,3 @@ /* | ||
// Configuration to be run (and then tested). | ||
html2js: { | ||
html2jsfile: { | ||
default_options: { | ||
@@ -59,3 +59,3 @@ options: {}, | ||
// plugin's task(s), then test the result. | ||
grunt.registerTask('test', ['clean', 'html2js', 'nodeunit']); | ||
grunt.registerTask('test', ['clean', 'html2jsfile', 'nodeunit']); | ||
@@ -62,0 +62,0 @@ // By default, lint and run all tests. |
{ | ||
"name": "html2jsfile", | ||
"description": "The best Grunt plugin ever.", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"homepage": "https://github.com/imbolo/html2jsfile", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -1,2 +0,2 @@ | ||
# html2js | ||
# html2jsfile | ||
@@ -11,3 +11,3 @@ > The best Grunt plugin ever. | ||
```shell | ||
npm install html2js --save-dev | ||
npm install html2jsfile --save-dev | ||
``` | ||
@@ -18,19 +18,19 @@ | ||
```js | ||
grunt.loadNpmTasks('html2js'); | ||
grunt.loadNpmTasks('html2jsfile'); | ||
``` | ||
## The "html2js" task | ||
## The "html2jsfile" task | ||
### Overview | ||
In your project's Gruntfile, add a section named `html2js` to the data object passed into `grunt.initConfig()`. | ||
In your project's Gruntfile, add a section named `html2jsfile` to the data object passed into `grunt.initConfig()`. | ||
```js | ||
grunt.initConfig({ | ||
html2js: { | ||
html2jsfile: { | ||
options: { | ||
// Task-specific options go here. | ||
}, | ||
your_target: { | ||
// Target-specific file lists and/or options go here. | ||
}, | ||
files: { | ||
'test/html/build.js': 'test/html/*.html' | ||
} | ||
}, | ||
@@ -40,49 +40,14 @@ }); | ||
### Options | ||
#### options.separator | ||
Type: `String` | ||
Default value: `', '` | ||
A string value that is used to do something with whatever. | ||
#### options.punctuation | ||
Type: `String` | ||
Default value: `'.'` | ||
A string value that is used to do something else with whatever else. | ||
### Usage Examples | ||
#### Default Options | ||
In this example, the default options are used to do something with whatever. So if the `testing` file has the content `Testing` and the `123` file had the content `1 2 3`, the generated result would be `Testing, 1 2 3.` | ||
```js | ||
grunt.initConfig({ | ||
html2js: { | ||
options: {}, | ||
files: { | ||
'dest/default_options': ['src/testing', 'src/123'], | ||
}, | ||
}, | ||
}); | ||
``` | ||
#### Custom Options | ||
In this example, custom options are used to do something else with whatever else. So if the `testing` file has the content `Testing` and the `123` file had the content `1 2 3`, the generated result in this case would be `Testing: 1 2 3 !!!` | ||
```js | ||
grunt.initConfig({ | ||
html2js: { | ||
options: { | ||
separator: ': ', | ||
punctuation: ' !!!', | ||
}, | ||
files: { | ||
'dest/default_options': ['src/testing', 'src/123'], | ||
}, | ||
}, | ||
}); | ||
``` | ||
html2jsfile: { | ||
default_options: { | ||
options: {}, | ||
files: { | ||
'test/html/build.js': 'test/html/{,*/}*.html' | ||
} | ||
} | ||
} | ||
It will convert all .html file to js String in file named 'build.js' | ||
## Contributing | ||
@@ -89,0 +54,0 @@ 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](http://gruntjs.com/). |
9127
55