Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-contrib-jade

Package Overview
Dependencies
Maintainers
3
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-contrib-jade - npm Package Compare versions

Comparing version 0.3.1 to 0.4.0

.jshintrc

2

docs/overview.md

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc