grunt-contrib-jade
Advanced tools
Comparing version 0.3.1 to 0.4.0
@@ -1,1 +0,1 @@ | ||
Options are passed to [jade](https://github.com/visionmedia/jade#public-api). | ||
*This plugin was designed to work with Grunt 0.4.x. If you're still using grunt v0.3.x it's strongly recommended that [you upgrade](http://gruntjs.com/upgrading-from-0.3-to-0.4), but in case you can't please use [v0.3.1](https://github.com/gruntjs/grunt-contrib-jade/tree/grunt-0.3-stable).* |
{ | ||
"name": "grunt-contrib-jade", | ||
"description": "Compile Jade files to HTML.", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"homepage": "https://github.com/gruntjs/grunt-contrib-jade", | ||
@@ -23,5 +23,5 @@ "author": { | ||
], | ||
"main": "grunt.js", | ||
"main": "Gruntfile.js", | ||
"engines": { | ||
"node": "*" | ||
"node": ">= 0.8.0" | ||
}, | ||
@@ -32,12 +32,17 @@ "scripts": { | ||
"dependencies": { | ||
"jade": "~0.27.2", | ||
"grunt-lib-contrib": "~0.3.0" | ||
"jade": "~0.27.2" | ||
}, | ||
"devDependencies": { | ||
"grunt": "~0.3.15", | ||
"grunt-contrib-clean": "~0.3.0" | ||
"grunt-contrib-jshint": "~0.1.1", | ||
"grunt-contrib-nodeunit": "~0.1.2", | ||
"grunt-contrib-clean": "~0.4.0", | ||
"grunt-contrib-internal": "~0.4.2", | ||
"grunt": "~0.4.0" | ||
}, | ||
"peerDependencies": { | ||
"grunt": "~0.4.0" | ||
}, | ||
"keywords": [ | ||
"gruntplugin" | ||
] | ||
} | ||
} |
@@ -5,29 +5,43 @@ # grunt-contrib-jade [![Build Status](https://secure.travis-ci.org/gruntjs/grunt-contrib-jade.png?branch=master)](http://travis-ci.org/gruntjs/grunt-contrib-jade) | ||
### Overview | ||
Inside your `grunt.js` file add a section named `jade`. This section specifies files to compile and the options passed to [jade](https://github.com/visionmedia/jade#public-api). | ||
#### Parameters | ||
## Getting Started | ||
This plugin requires Grunt `~0.4.0` | ||
##### files ```object``` | ||
If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command: | ||
This defines what files this task will process and should contain key:value pairs. | ||
```shell | ||
npm install grunt-contrib-jade --save-dev | ||
``` | ||
The key (destination) should be an unique filepath (supports [grunt.template](https://github.com/gruntjs/grunt/blob/master/docs/api_template.md)) and the value (source) should be a filepath or an array of filepaths (supports [minimatch](https://github.com/isaacs/minimatch)). | ||
One the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript: | ||
Note: When the value contains an array of multiple filepaths, the contents are concatenated in the order passed. | ||
```js | ||
grunt.loadNpmTasks('grunt-contrib-jade'); | ||
``` | ||
##### options ```object``` | ||
*This plugin was designed to work with Grunt 0.4.x. If you're still using grunt v0.3.x it's strongly recommended that [you upgrade](http://gruntjs.com/upgrading-from-0.3-to-0.4), but in case you can't please use [v0.3.1](https://github.com/gruntjs/grunt-contrib-jade/tree/grunt-0.3-stable).* | ||
This controls how this task (and its helpers) operate and should contain key:value pairs, see options below. | ||
#### Options | ||
##### data ```object``` | ||
## Jade task | ||
_Run this task with the `grunt jade` command._ | ||
Sets the data passed to ```jade``` during template compilation. Any data can be passed to the template (including ```grunt``` templates). | ||
Task targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide. | ||
### Options | ||
#### Config Examples | ||
#### pretty | ||
Type: `Boolean` | ||
Default: false | ||
``` javascript | ||
Output indented HTML. | ||
#### data | ||
Type: `Object` | ||
Sets the data passed to `jade` during template compilation. Any data can be passed to the template (including `grunt` templates). | ||
### Usage Examples | ||
```js | ||
jade: { | ||
@@ -49,3 +63,3 @@ compile: { | ||
``` javascript | ||
```js | ||
jade: { | ||
@@ -77,3 +91,3 @@ debug: { | ||
``` javascript | ||
```js | ||
jade: { | ||
@@ -96,3 +110,3 @@ debug: { | ||
``` javascript | ||
```js | ||
jade: { | ||
@@ -113,4 +127,16 @@ debug: { | ||
-- | ||
*Task submitted by [Eric Woroshow](https://github.com/errcw).* | ||
## Release History | ||
* 2013-02-14 v0.4.0 First official release for Grunt 0.4.0. | ||
* 2013-01-23 v0.4.0rc7 Updating grunt/gruntplugin dependencies to rc7. Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions. | ||
* 2013-01-08 v0.4.0rc5 Updating to work with grunt v0.4.0rc5. Switching to this.files api. | ||
* 2012-10-11 v0.3.1 Rename grunt-contrib-lib dep to grunt-lib-contrib. | ||
* 2012-09-23 v0.3.0 Options no longer accepted from global config key. | ||
* 2012-09-09 v0.2.0 Refactored from grunt-contrib into individual repo. | ||
--- | ||
Task submitted by [Eric Woroshow](http://ericw.ca/) | ||
*This file was generated on Mon Feb 18 2013 08:40:02.* |
@@ -9,12 +9,8 @@ /* | ||
'use strict'; | ||
module.exports = function(grunt) { | ||
'use strict'; | ||
// TODO: ditch this when grunt v0.4 is released | ||
grunt.util = grunt.util || grunt.utils; | ||
grunt.registerMultiTask('jade', 'Compile Jade templates into HTML.', function() { | ||
var helpers = require('grunt-lib-contrib').init(grunt); | ||
var options = helpers.options(this, { | ||
var options = this.options({ | ||
data: {} | ||
@@ -25,20 +21,12 @@ }); | ||
// TODO: ditch this when grunt v0.4 is released | ||
this.files = this.files || helpers.normalizeMultiTaskFiles(this.data, this.target); | ||
this.files.forEach(function(f) { | ||
var output = f.src.map(function(file) { | ||
return compileJade(file, options, options.data); | ||
}).join(grunt.util.normalizelf(grunt.util.linefeed)); | ||
var srcFiles; | ||
var taskOutput; | ||
this.files.forEach(function(file) { | ||
srcFiles = grunt.file.expandFiles(file.src); | ||
taskOutput = []; | ||
srcFiles.forEach(function(srcFile) { | ||
taskOutput.push(compileJade(srcFile, options, options.data)); | ||
}); | ||
if (taskOutput.length > 0) { | ||
grunt.file.write(file.dest, taskOutput.join('\n')); | ||
grunt.log.writeln('File ' + file.dest.cyan + ' created.'); | ||
if (output.length < 1) { | ||
grunt.log.warn('Destination not written because compiled files were empty.'); | ||
} else { | ||
grunt.file.write(f.dest, output); | ||
grunt.log.writeln('File ' + f.dest.cyan + ' created.'); | ||
} | ||
@@ -61,2 +49,2 @@ }); | ||
}; | ||
}; | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
13338
25
138
5
2131
117
1
+ Addedabbrev@1.1.1(transitive)
+ Addedargparse@0.1.16(transitive)
+ Addedasync@0.1.22(transitive)
+ Addedcoffee-script@1.3.3(transitive)
+ Addedcolors@0.6.2(transitive)
+ Addeddateformat@1.0.2-1.2.3(transitive)
+ Addedesprima@1.0.4(transitive)
+ Addedeventemitter2@0.4.14(transitive)
+ Addedexit@0.1.2(transitive)
+ Addedfindup-sync@0.1.3(transitive)
+ Addedgetobject@0.1.0(transitive)
+ Addedglob@3.1.213.2.11(transitive)
+ Addedgraceful-fs@1.2.3(transitive)
+ Addedgrunt@0.4.5(transitive)
+ Addedgrunt-legacy-log@0.1.3(transitive)
+ Addedgrunt-legacy-log-utils@0.1.1(transitive)
+ Addedgrunt-legacy-util@0.2.0(transitive)
+ Addedhooker@0.2.3(transitive)
+ Addediconv-lite@0.2.11(transitive)
+ Addedinherits@1.0.22.0.4(transitive)
+ Addedjs-yaml@2.0.5(transitive)
+ Addedlodash@0.9.22.4.2(transitive)
+ Addedlru-cache@2.7.3(transitive)
+ Addedminimatch@0.2.140.3.0(transitive)
+ Addednopt@1.0.10(transitive)
+ Addedrimraf@2.2.8(transitive)
+ Addedsigmund@1.0.1(transitive)
+ Addedunderscore@1.7.0(transitive)
+ Addedunderscore.string@2.2.12.3.32.4.0(transitive)
+ Addedwhich@1.0.9(transitive)
- Removedgrunt-lib-contrib@~0.3.0
- Removedgrunt-lib-contrib@0.3.1(transitive)