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

grunt-xjade

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-xjade

Compile XJade templates with grunt.

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status Dependency Status

grunt-xjade

Compile XJade templates with grunt.

Getting Started

This plugin requires Grunt ~0.4.4

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-xjade --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-xjade');

The "XJade" task

Run this task with the grunt xjade command.

Task targets, files and options may be specified according to the grunt Configuring tasks guide. XJade specific options are described below. For more information about XJade Template Language visit project homepage: (https://github.com/dorny/xjade).

Options

compile

Type: String
Default: js

Sets the XJade compiler option:

  • js - generate JavaScript code
  • html - generate HTML from in-memory compiled & executed template(s)
data

Type: Any

Sets the data passed to executed template as argument.

doctype

Type: String
Default: 5

Sets the doctype for generated HTML.
Doctype can be any string or shortcut: '5', 'strict', 'transitional', 'xhtml'.

pretty

Type: Boolean
Default: false

Output indented HTML.

Usage Examples

Generate index.html from our root tempate:

grunt.initConfig({
  index: {
    src: 'index.js-tpl',
    dest: 'index.html',
    options: {
      compile: 'html',
      data: { sitename:"XJade Example"}
      pretty: true,
      doctype: '5'
    }
  },
});

Compile all templates inside "tpl" directories to standard JavaScript code for browser usage:

grunt.initConfig({
  client: {
    options: {
      compile: 'js'
    },
    files: [{
      expand: true,
      src: 'views/tpl/*.js-tpl',
      ext: '.js',
    }]
  },
});

Compile and concat all templates inside "templates" directory:

grunt.initConfig({
  templates: {
    src: 'src/templates/*.js-tpl',
    dest: 'www/templates.js',
    options: {
      compile: 'js',
    }
  },
});

Keywords

FAQs

Package last updated on 09 Apr 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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