grunt-robot

0.1.2 • Public • Published

grunt-robot

Grunt task for Robot, a Mustache template HTML generator

Allows the generation of HTML templates from a given folder structure.

The Grunt integration is not complete, configuration is done in a separate .json file.

The task comes without tests, haven't that figured out, yet.

data/
layouts/
partials/
templates/
pages/

These folders are required and cannot be changed.

The location of the folder structure and the rendered output is configurable, see below, "The robot task".

Getting Started

This plugin requires Grunt ~0.4.1

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-robot --save-dev

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

grunt.loadNpmTasks('grunt-robot');

The "robot" task

Overview

In your project's Gruntfile, add a section named robot to the data object passed into grunt.initConfig().

grunt.initConfig({
  robot: {}
})

Create the following file/folder structure in the project root:

robot/
  robot.json
  output/
  source/
    data/
    layouts/
    partials/
    templates/
    pages/

The file robot.json

{
  "source": "source/",
  "output": "output/"
}

Options

You can change the name / location of the source and output folders in the robot.json file.

You can change the name / location of the folder robot

grunt.initConfig({
  robot: {
    options: {
      templateRoot: 'relative/path/from/grunt/root'
    }
  },
})

The Robot project

The Project Homepage
The npm package

Release History

version 0.1.2 2013-04-22 Take out unused option rootPath, caused sometimes run errors, add links to Robot project version 0.1.1 2013-03-16 Second try version 0.1.0 2013-03-16 First publication, broken !!

Readme

Keywords

none

Package Sidebar

Install

npm i grunt-robot

Weekly Downloads

0

Version

0.1.2

License

MIT

Last publish

Collaborators

  • tomcode