# Module: Gruntfile

## Gruntfile

Gruntfile tasks. These tasks are intended to help you when modifying the template. If you are just using the template, don't sweat this stuff. To use these tasks, you must install grunt, if you haven't already, and install the dependencies. All of this requires node.js, of course.

Install grunt:

     npm install -g grunt-cli

Then in the directory where you found this file:

     npm install

And you are all set. See the individual tasks for details.

Source:
  - Gruntfile.js, line 2

### Requires

- module:path
- module:lodash
- module:http
- module:async
- module:fs

### Members

#### <static> apply

  TASK: Applies the theme in the conf file and applies it to the styles directory.

  Source:
    - Gruntfile.js, line 180

#### <static> bootswatch

  TASK: Grab all Bootswatch themes and create css from each one based on the main.less in the styles directory. NOTE that this will leave the last swatch downloaded in the styles directory, you will want to call "apply" afterwards

  Source:
    - Gruntfile.js, line 193

#### <static> build

  TASK: Builds the whole shebang. Which means creating testdocs, the bootswatch fixtures and then resetting the styles directory.

  Source:
    - Gruntfile.js, line 173

#### <static> dev

  Compile the CSS and create the project documentation

  Source:
    - Gruntfile.js, line 161

#### <static> docs

  Builds the project's documentation

  Source:
    - Gruntfile.js, line 155

#### <static> examples

  TASK:Create fixtures from the themes. The files must have been built first from the bootswatch task.

  Source:
    - Gruntfile.js, line 224

#### <static> less

  TASK: The less task creates the themed css file from main.less. The file is written to the template styles directory as site.[name of theme].css. Later the .conf file will look for the theme to apply based on this naming convention.

  Source:
    - Gruntfile.js, line 121

#### <static> shell:dox

  TASK: Create project documentation

  Source:
    - Gruntfile.js, line 112

#### <static> shell:testdocs

  TASK: Create the a documentation set for testing changes to the template

  Source:
    - Gruntfile.js, line 104

#### <static> testdocs

  TASK: Builds the main less file and then generates the test documents

  Source:
    - Gruntfile.js, line 167

#### <private, inner> jsdocExamplePages

  The definition to run the sample files. This runs the files in `fixtures` with the sample's `conf.json` file. No task directly exposes this configuration. The `fixtures` task modifies this for each swatch it finds and then run the docs command against it.

  Source:
    - Gruntfile.js, line 55

#### <private, inner> jsdocTestPages

  The definition to run the development test files. This runs the files in `fixtures` with the project's `conf.json` file.

  Source:
    - Gruntfile.js, line 41

#### <private, inner> projectDocs

  This definition provides the project's main, published documentation.

  Source:
    - Gruntfile.js, line 68

### Methods

#### <private, inner> applyTheme(grunt, definition)

  Applies one of the Bootswatch themes to the working `styles` directory. When you want to modify a particular theme, this where you get the basis for it. The files are written to `./styles/variables.less` and `./styles/bootswatch.less`. The `./styles/main.less` file includes them directly, so after you apply the theme, modify `main.less` to your heart's content and then run the `less` task as in

       grunt less

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `grunt` | object | The grunt object reference

  `definition`

  object

  The swatch definition files

  ###### Properties

  Name | Type | Description
  --- | --- | ---
  `less` | string | The url to the `bootswatch.less` file
  `lessVariables` | string | The url to the `variables.less` file

  Source:
    - Gruntfile.js, line 274

#### <private, inner> getBootSwatchComponent(url, done)

  This method will get one of the components from Bootswatch, which is generally a `less` file or a `lessVariables` file.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `url` | string | The url to retreive from

  `done`

  function

  The callback when complete

  ###### Properties

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `err` | object | <nullable> | If an error occurred, you will find it here.
  `responseText` | string |  | The body of whatever was returned

  Source:
    - Gruntfile.js, line 343
  See:
    - http://news.bootswatch.com/post/22193315172/bootswatch-api

#### <private, inner> getBootSwatchList(done)

  Gets the list of available Bootswatches from, well, Bootswatch.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---

  `done`

  function

  The callback when complete

  ###### Properties

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `err` | object | <nullable> | If an error occurred, you will find it here.
  `responseBody` | object |  | This is a parsed edition of the bootswatch server's response. It's format it defined by the return message from here

  Source:
    - Gruntfile.js, line 305
  See:
    - http://news.bootswatch.com/post/22193315172/bootswatch-api

#### <inner> jsdocCommand(jsdoc) → {string}

  Normalizes all paths from a JSDoc task definition and and returns an executable string that can be passed to the shell.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `jsdoc` | object | A JSDoc definition

  Source:
    - Gruntfile.js, line 82

  ##### Returns:

  Type
    string