UNPKG

ink-docstrap

Version:

[![NPM](https://nodei.co/npm/ink-docstrap.png?downloads=true)](https://nodei.co/npm/ink-docstrap/)

1,902 lines (688 loc) 26.9 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>DocStrap Module: Gruntfile</title> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/sunlight.default.css"> <link type="text/css" rel="stylesheet" href="styles/site.cerulean.css"> </head> <body> <div class="container-fluid"> <div class="navbar navbar-fixed-top navbar-inverse"> <div class="navbar-inner"> <a class="brand" href="index.html">DocStrap</a> <ul class="nav"> <li class="dropdown"> <a href="modules.list.html" class="dropdown-toggle" data-toggle="dropdown">Modules<b class="caret"></b></a> <ul class="dropdown-menu "> <li> <a href="module-Gruntfile.html">Gruntfile</a> </li> <li> <a href="publish.html">template/publish</a> </li> </ul> </li> </ul> </div> </div> <div class="row-fluid"> <div class="span8"> <div id="main"> <h1 class="page-title">Module: Gruntfile</h1> <section> <header> <h2> Gruntfile </h2> </header> <article> <div class="container-overview"> <div class="description"><p>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.</p> <p>Install grunt:</p> <pre><code> npm install -g grunt-cli </code></pre><p>Then in the directory where you found this file:</p> <pre><code> npm install </code></pre><p>And you are all set. See the individual tasks for details.</p></div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="gruntfile.js.html">gruntfile.js</a>, <a href="gruntfile.js.html#sunlight-1-line-2">line 2</a> </li> </ul> </dd> </dl> </div> <h3 class="subsection-title">Requires</h3> <ul> <li>module:path</li> <li>module:lodash</li> <li>module:http</li> <li>module:async</li> <li>module:fs</li> </ul> <h3 class="subsection-title">Members</h3> <dl> <dt> <h4 class="name" id="apply"><span class="type-signature">&lt;static> </span>apply<span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>TASK: Applies the theme in the conf file and applies it to the styles directory.</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="gruntfile.js.html">gruntfile.js</a>, <a href="gruntfile.js.html#sunlight-1-line-217">line 217</a> </li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="bootswatch"><span class="type-signature">&lt;static> </span>bootswatch<span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>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 &quot;apply&quot; afterwards</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="gruntfile.js.html">gruntfile.js</a>, <a href="gruntfile.js.html#sunlight-1-line-230">line 230</a> </li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="build"><span class="type-signature">&lt;static> </span>build<span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>TASK: Builds the whole shebang. Which means creating testdocs, the bootswatch fixtures and then resetting the styles directory.</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="gruntfile.js.html">gruntfile.js</a>, <a href="gruntfile.js.html#sunlight-1-line-210">line 210</a> </li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="dev"><span class="type-signature">&lt;static> </span>dev<span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Compile the CSS and create the project documentation</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="gruntfile.js.html">gruntfile.js</a>, <a href="gruntfile.js.html#sunlight-1-line-198">line 198</a> </li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="docs"><span class="type-signature">&lt;static> </span>docs<span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Builds the project's documentation</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="gruntfile.js.html">gruntfile.js</a>, <a href="gruntfile.js.html#sunlight-1-line-192">line 192</a> </li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="examples"><span class="type-signature">&lt;static> </span>examples<span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>TASK:Create fixtures from the themes. The files must have been built first from the bootswatch task.</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="gruntfile.js.html">gruntfile.js</a>, <a href="gruntfile.js.html#sunlight-1-line-261">line 261</a> </li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="jsdoc:testdocs"><span class="type-signature">&lt;static> </span>jsdoc:testdocs<span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>TASK: Create the a documentation set for testing changes to the template</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="gruntfile.js.html">gruntfile.js</a>, <a href="gruntfile.js.html#sunlight-1-line-106">line 106</a> </li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="less"><span class="type-signature">&lt;static> </span>less<span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>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.</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="gruntfile.js.html">gruntfile.js</a>, <a href="gruntfile.js.html#sunlight-1-line-136">line 136</a> </li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="shell:dox"><span class="type-signature">&lt;static> </span>shell:dox<span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>TASK: Create project documentation</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="gruntfile.js.html">gruntfile.js</a>, <a href="gruntfile.js.html#sunlight-1-line-114">line 114</a> </li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="testdocs"><span class="type-signature">&lt;static> </span>testdocs<span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>TASK: Builds the main less file and then generates the test documents</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="gruntfile.js.html">gruntfile.js</a>, <a href="gruntfile.js.html#sunlight-1-line-204">line 204</a> </li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="jsdocExamplePages"><span class="type-signature">&lt;private, inner> </span>jsdocExamplePages<span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>The definition to run the sample files. This runs the files in <code>fixtures</code> with the sample's <code>conf.json</code> file. No task directly exposes this configuration. The <code>fixtures</code> task modifies this for each swatch it finds and then run the docs command against it.</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="gruntfile.js.html">gruntfile.js</a>, <a href="gruntfile.js.html#sunlight-1-line-55">line 55</a> </li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="jsdocTestPages"><span class="type-signature">&lt;private, inner> </span>jsdocTestPages<span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>The definition to run the development test files. This runs the files in <code>fixtures</code> with the project's <code>conf.json</code> file.</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="gruntfile.js.html">gruntfile.js</a>, <a href="gruntfile.js.html#sunlight-1-line-41">line 41</a> </li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="projectDocs"><span class="type-signature">&lt;private, inner> </span>projectDocs<span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>This definition provides the project's main, published documentation.</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="gruntfile.js.html">gruntfile.js</a>, <a href="gruntfile.js.html#sunlight-1-line-68">line 68</a> </li> </ul> </dd> </dl> </dd> </dl> <h3 class="subsection-title">Methods</h3> <dl> <dt> <h4 class="name" id="applyTheme"><span class="type-signature">&lt;private, inner> </span>applyTheme<span class="signature">(grunt, definition)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Applies one of the Bootswatch themes to the working <code>styles</code> directory. When you want to modify a particular theme, this where you get the basis for it. The files are written to <code>./styles/variables.less</code> and <code>./styles/bootswatch.less</code>. The <code>./styles/main.less</code> file includes them directly, so after you apply the theme, modify <code>main.less</code> to your heart's content and then run the <code>less</code> task as in</p> <pre><code> grunt less </code></pre> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>grunt</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"><p>The grunt object reference</p></td> </tr> <tr> <td class="name"><code>definition</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"><p>The swatch definition files</p> <h6>Properties</h6> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>less</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"><p>The url to the <code>bootswatch.less</code> file</p></td> </tr> <tr> <td class="name"><code>lessVariables</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"><p>The url to the <code>variables.less</code> file</p></td> </tr> </tbody> </table> </td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="gruntfile.js.html">gruntfile.js</a>, <a href="gruntfile.js.html#sunlight-1-line-311">line 311</a> </li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="getBootSwatchComponent"><span class="type-signature">&lt;private, inner> </span>getBootSwatchComponent<span class="signature">(url, done)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>This method will get one of the components from Bootswatch, which is generally a <code>less</code> file or a <code>lessVariables</code> file.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>url</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"><p>The url to retreive from</p></td> </tr> <tr> <td class="name"><code>done</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"><p>The callback when complete</p> <h6>Properties</h6> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>err</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> &lt;nullable><br> </td> <td class="description last"><p>If an error occurred, you will find it here.</p></td> </tr> <tr> <td class="name"><code>responseText</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> </td> <td class="description last"><p>The body of whatever was returned</p></td> </tr> </tbody> </table> </td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="gruntfile.js.html">gruntfile.js</a>, <a href="gruntfile.js.html#sunlight-1-line-380">line 380</a> </li> </ul> </dd> <dt class="tag-see">See:</dt> <dd class="tag-see"> <ul> <li><a href="http://news.bootswatch.com/post/22193315172/bootswatch-api">http://news.bootswatch.com/post/22193315172/bootswatch-api</a></li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="getBootSwatchList"><span class="type-signature">&lt;private, inner> </span>getBootSwatchList<span class="signature">(done)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Gets the list of available Bootswatches from, well, Bootswatch.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>done</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"><p>The callback when complete</p> <h6>Properties</h6> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>err</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> &lt;nullable><br> </td> <td class="description last"><p>If an error occurred, you will find it here.</p></td> </tr> <tr> <td class="name"><code>responseBody</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> </td> <td class="description last"><p>This is a parsed edition of the bootswatch server's response. It's format it defined by the return message from <a href="http://api.bootswatch.com/">here</a></p></td> </tr> </tbody> </table> </td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="gruntfile.js.html">gruntfile.js</a>, <a href="gruntfile.js.html#sunlight-1-line-342">line 342</a> </li> </ul> </dd> <dt class="tag-see">See:</dt> <dd class="tag-see"> <ul> <li><a href="http://news.bootswatch.com/post/22193315172/bootswatch-api">http://news.bootswatch.com/post/22193315172/bootswatch-api</a></li> </ul> </dd> </dl> </dd> <dt> <h4 class="name" id="jsdocCommand"><span class="type-signature">&lt;inner> </span>jsdocCommand<span class="signature">(jsdoc)</span><span class="type-signature"> &rarr; {string}</span></h4> </dt> <dd> <div class="description"> <p>Normalizes all paths from a JSDoc task definition and and returns an executable string that can be passed to the shell.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>jsdoc</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"><p>A JSDoc definition</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="gruntfile.js.html">gruntfile.js</a>, <a href="gruntfile.js.html#sunlight-1-line-82">line 82</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> </dd> </dl> </article> </section> </div> <div class="clearfix"></div> <footer> <span class="copyright"> DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. </span> <br /> <span class="jsdoc-message"> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha5</a> on Mon Jun 2nd 2014 using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. </span> </footer> </div> <div class="span3"> <div id="toc"></div> </div> <br clear="both"> </div> </div> <!--<script src="scripts/sunlight.js"></script>--> <script src="scripts/docstrap.lib.js"></script> <script src="scripts/bootstrap-dropdown.js"></script> <script src="scripts/toc.js"></script> <script> $( function () { $( "#toc" ).toc( { anchorName : function ( i, heading, prefix ) { return $( heading ).attr( "id" ) || ( prefix + i ); }, selectors : "h1,h2,h3,h4", showAndHide : false, scrollTo : 60 } ); $( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" ); $( "#main span[id^='toc']" ).addClass( "toc-shim" ); $('.dropdown-toggle').dropdown(); // $( ".tutorial-section pre, .readme-section pre" ).addClass( "sunlight-highlight-javascript" ).addClass( "linenums" ); $( ".tutorial-section pre, .readme-section pre" ).each( function () { var $this = $( this ); var example = $this.find("code" ); exampleText = example.html(); var lang = /{@lang (.*?)}/.exec( exampleText ); if ( lang && lang[1] ) { exampleText = exampleText.replace( lang[0], "" ); example.html(exampleText); lang = lang[1]; } else { lang = "javascript"; } if ( lang ) { $this .addClass( "sunlight-highlight-" + lang ) .addClass( "linenums" ) .html( example.html() ); } } ); Sunlight.highlightAll( { lineNumbers : true, showMenu:true, enableDoclinks:true } ); } ); </script> <!--Google Analytics--> <!--Navigation and Symbol Display--> </body> </html>