[
  {
    "path": ".dokker.json",
    "content": "{\n  \"dir\": \"docs\",\n  \"literate\": {\n    \"source\": \"dokker.js\",\n    \"dir\": \"annotated\"\n  },\n  \"jsdoc\": {\n    \"title\": \"Dokker.js\",\n    \"source\": \"dokker.js\",\n    \"markdown\": \"README.md\",\n    \"html\": \"index.html\",\n    \"readme\": \"README.md\",\n    \"template\": \"templates/index.ejs.html\",\n    \"github\": \"https://github.com/oceanhouse21/dokker/blob/master/dokker.js\",\n    \"site\": \"http://dokkerjs.com\"\n  },\n  \"mocha\": {\n    \"command\": \"mocha --reporter doc\",\n    \"test\": \"test/dokker.js\",\n    \"path\": \"tests.html\",\n    \"template\": \"templates/tests.ejs.html\"\n  }\n}\n"
  },
  {
    "path": ".gitignore",
    "content": ".tmp\nnode_modules\n"
  },
  {
    "path": ".jshintrc",
    "content": "{\n  \"node\": true,\n  \"mocha\": true\n}\n"
  },
  {
    "path": ".travis.yml",
    "content": "language: node_js\nnode_js:\n  - \"0.12\"\n  - \"0.11\"\n  - \"0.10\"\n  - \"iojs\"\n  - \"iojs-v1.0.4\"\n"
  },
  {
    "path": "LICENSE",
    "content": "Copyright 2014-2015 Oceanhouse21 <http://oceanhouse21.com/>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "![dokker logo](https://raw.githubusercontent.com/oceanhouse21/dokker/master/templates/logo.png)\n\nDokker.js creates professional Javascript code documentations.\n\n[See Dokker.js documentation as example.](http://dokkerjs.com)\n\n[![Build Status](https://travis-ci.org/oceanhouse21/dokker.svg?branch=master)](https://travis-ci.org/oceanhouse21/dokker)\n\n\n## Features\n\n * Create or [HTML](http://dokkerjs.com/) or [markdown](https://github.com/oceanhouse21/dokker/tree/master/docs#dokkerjs-api-documentation) documentation from [JSDOC](http://usejsdoc.org/) tags\n * Support for [literate programming](https://en.wikipedia.org/?title=Literate_programming) documentation\n * Live edit source code and watch changes\n * Include link to your Github repository\n * Customize your own templates with [ejs](http://www.embeddedjs.com/) or use default style\n * Create feature description from [mocha test suite](http://mochajs.org/)\n * Automagically include your README.md into the documentation\n * Use your own logo to make an astonishing impression\n * Deploy documentation to Github pages on the fly\n\n## Community\n\n[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/oceanhouse21/dokker?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)\n\n## Installation\n\nDokker is available as npm package. So the easiest way is to install dokker as global module into your project:\n\n```\nnpm install -g dokker\n```\n\n## Usage\n\nAfter installation you can execute Dokker with the help of several terminal commands.\n\n**Bootstrap Dokker project**\n\nDokker needs a configuration file to execute, such as a [.travis](https://travis-ci.org/) or [.jshintrc](http://jshint.com/docs/). You can easily create .dokker.json file with the ```dokker-init``` command from the root directory of your project or copy an [example file](https://github.com/oceanhouse21/dokker/blob/master/.dokker.json).\n\nDokker provides a default template for your project. The template is based on an [ejs](http://www.embeddedjs.com/) file. Either you use the default template or modify it. If you choose for the latter you can copy the [templates directory](https://github.com/oceanhouse21/dokker/tree/master/templates) and tweak the ejs files how you like.\n\n**Create documentation**\n\nCreating a documentation is really simple with the help of Dokker. You just configure the [.dokker.json](https://github.com/oceanhouse21/dokker/blob/master/.dokker.json) file and execute ```dokker```. Then you're done.\n\n**Live edit your documentation**\n\nIf you want to work on your source file and see how the documentation evolves, you can do ```dokker-watch``` and it will open a browser with live preview.\n\n<!-- Node.js/Express server is started for you that serves your Dokker project at [localhost:9000](http://localhost:9000).\n\nIf you want to use the live edit function please install the [LiveReload](http://livereload.com/) plugin for your browser. You can then even start a ```nodemon docs/app.js``` and whenever you hit save the HTML site is reloading. But before you might need ```npm install -g nodemon```. -->\n\n**Deploy to Github Pages**\n\nIf you want to deploy your documentation to Github Pages, run ```gh-pages```. Finally a separate branch, named ```gh-pages``` is created from the ```docs``` folder. That is enough for Github to serve your documentation. Please do not forget to ```git commit``` your changes before your run ```gh-pages``` command.\n\n## Dokker in the wild\nSome examples by our users. Let us know what you did with Dokker too!\n\n- [Dokker.js](http://dokkerjs.com)\n- [lomath](http://kengz.github.io/lomath/)\n\n## Further Reading\n\n  * [API Documentation](http://dokkerjs.com)\n  * [Changelog](https://github.com/oceanhouse21/dokker/wiki/Changelog)\n  * [Release Notes](https://github.com/oceanhouse21/dokker/releases)\n  * [Roadmap](https://github.com/oceanhouse21/dokker/wiki/Roadmap)\n  * [More Resources](https://github.com/oceanhouse21/dokker/wiki/Resources)\n\n## Contributors\n\nDokker.js was originally created by [georgschlenkhoff](https://github.com/georgschlenkhoff), and transferred to [kengz](https://github.com/kengz) on 16 Jun 2016 for further development.\n\n * [georgschlenkhoff](https://github.com/georgschlenkhoff) *(original author)*\n * [kengz](https://github.com/kengz)\n"
  },
  {
    "path": "bin/dokker",
    "content": "#!/usr/bin/env node\n\nvar path = require('path');\nvar Dokker = require('../dokker');\nvar options;\nreturn Dokker.configure()\n.then(function(data) {\n  options = data;\n  return Dokker.mkdir(path.join(process.cwd(), options.dir));\n}).then(function() {\n  return Dokker.jsdocMarkdown(options.jsdoc);\n}).then(function() {\n  return Dokker.jsdocHtml(options.jsdoc);\n}).then(function() {\n  return Dokker.injectTemplate(options.jsdoc);\n}).then(function() {\n  return Dokker.createTests(options.mocha);\n}).then(function() {\n  return Dokker.literate(options.literate);\n}).then(function() {\n  console.log('Dokker executed successfully');\n}).done();\n"
  },
  {
    "path": "bin/dokker-init",
    "content": "#!/usr/bin/env node\n\nvar Dokker = require('../dokker');\nvar path = require('path');\nvar options;\n\nreturn Dokker.init()\n.then(function(){\n  return Dokker.configure();\n}).then(function(data){\n  options = data;\n  return Dokker.mkdir(path.join(process.cwd(), options.dir));\n}).then(function(){\n  return Dokker.copyTemplate(options);\n}).then(function(){\n  console.log('Templates copied sucessfully');\n}).done();\n"
  },
  {
    "path": "bin/dokker-watch",
    "content": "#!/usr/bin/env node\n\nvar Dokker = require('../dokker');\nvar options = Dokker.configure()\n.then(function(data){\n  return Dokker.watch(data);\n}).then(function(){\n  console.log('Watching for changes');\n}).done();\n"
  },
  {
    "path": "bin/gh-pages",
    "content": "#!/usr/bin/env node\n\nvar dokker = require('../dokker');\nreturn dokker.ghPages()\n.then(function(){\n  console.log('Successfully created gh-pages branch');\n}).done();\n"
  },
  {
    "path": "docs/CNAME",
    "content": "dokkerjs.com\n"
  },
  {
    "path": "docs/README.md",
    "content": "# dokker.js API documentation\n\n<!-- div class=\"toc-container\" -->\n\n<!-- div -->\n\n## `Github Pages`\n* <a href=\"#Dokker-ghPages\">`Dokker.ghPages`</a>\n\n<!-- /div -->\n\n<!-- div -->\n\n## `JSDoc`\n* <a href=\"#Dokker-injectTemplate\">`Dokker.injectTemplate`</a>\n* <a href=\"#Dokker-jsdocHtml\">`Dokker.jsdocHtml`</a>\n* <a href=\"#Dokker-jsdocMarkdown\">`Dokker.jsdocMarkdown`</a>\n\n<!-- /div -->\n\n<!-- div -->\n\n## `Literate programming`\n* <a href=\"#Dokker-literate\">`Dokker.literate`</a>\n\n<!-- /div -->\n\n<!-- div -->\n\n## `Mocha`\n* <a href=\"#Dokker-createTests\">`Dokker.createTests`</a>\n\n<!-- /div -->\n\n<!-- div -->\n\n## `Utility`\n* <a href=\"#Dokker-configure\">`Dokker.configure`</a>\n* <a href=\"#Dokker-copyTemplate\">`Dokker.copyTemplate`</a>\n* <a href=\"#Dokker-init\">`Dokker.init`</a>\n* <a href=\"#Dokker-watch\">`Dokker.watch`</a>\n\n<!-- /div -->\n\n<!-- div -->\n\n## `Methods`\n\n<!-- /div -->\n\n<!-- div -->\n\n## `Properties`\n* <a href=\"#Dokker-VERSION\">`Dokker.VERSION`</a>\n\n<!-- /div -->\n\n<!-- /div -->\n\n<!-- div class=\"doc-container\" -->\n\n<!-- div -->\n\n## `“Github Pages” Methods`\n\n<!-- div -->\n\n### <a id=\"Dokker-ghPages\"></a>`Dokker.ghPages()`\n<a href=\"#Dokker-ghPages\">#</a> [&#x24C8;](https://github.com/oceanhouse21/dokker/blob/master/dokker.js#L152 \"View in source\") [&#x24C9;][1]\n\nRuns a terminal shell with the git command to extract the docs branch\ninto a seperate gh-pages branch and finally pushes that branch to Github,\nso that the Github page is updated.\n\n#### Returns\n*(Promise)*:  Returns a resolved promise if file was created.\n\n#### Example\n```js\nDokker.ghPages()\n.then(function(){\n  // => resolved promise\n});\n```\n* * *\n\n<!-- /div -->\n\n<!-- /div -->\n\n<!-- div -->\n\n## `“JSDoc” Methods`\n\n<!-- div -->\n\n### <a id=\"Dokker-injectTemplate\"></a>`Dokker.injectTemplate([options])`\n<a href=\"#Dokker-injectTemplate\">#</a> [&#x24C8;](https://github.com/oceanhouse21/dokker/blob/master/dokker.js#L56 \"View in source\") [&#x24C9;][1]\n\nCreates a HTML file that transcludes the HTML snippet that was created\nby the docdown module into an ejs template which is defined by the \n.dokker.json configuration file.\n\n#### Arguments\n1. `[options]` *(Object)*: The options object.\n2. `[options.template='template/index.ejs.html']` *(String)*: The path to the ejs template file.\n3. `[options.html='docs/index.html']` *(string)*: The path to the docdown generated JSDoc documentation.\n4. `[options.readme='README.md']` *(string)*: The path to the README.md file.\n5. `[options.title='']` *(string)*: The title for the documentation.\n\n#### Returns\n*(Promise)*:  Returns a resolved promise if file was created.\n\n#### Example\n```js\nvar options = {\n  template: 'template/index.ejs.html',\n  html: 'docs/index.html',\n  readme: 'docs/README.md',\n  title: 'Dokker.js API Documentation'\n};\nDokker.injectTemplate(options)\n.then(function(){\n  // => resolved promise\n});\n```\n* * *\n\n<!-- /div -->\n\n<!-- div -->\n\n### <a id=\"Dokker-jsdocHtml\"></a>`Dokker.jsdocHtml([options])`\n<a href=\"#Dokker-jsdocHtml\">#</a> [&#x24C8;](https://github.com/oceanhouse21/dokker/blob/master/dokker.js#L288 \"View in source\") [&#x24C9;][1]\n\nCreate an HTML file from the Markdown file that was create with \n[Dokker.jsdocMarkdown()](#Dokker-jsdocMarkdown)\n\n#### Arguments\n1. `[options]` *(Object)*: The options object.\n2. `[options.markdown='docs/READMDE.md']` *(string)*: The path where to save the Markdown file.\n\n#### Returns\n*(Promise)*:  Returns a resolved promise if file was created.\n\n#### Example\n```js\nvar options = {\n  markdown: 'docs/README.md'\n};\nDokker.jsdocHtml()\n.then(function(){\n  // => resolved promise\n});\n```\n* * *\n\n<!-- /div -->\n\n<!-- div -->\n\n### <a id=\"Dokker-jsdocMarkdown\"></a>`Dokker.jsdocMarkdown([options])`\n<a href=\"#Dokker-jsdocMarkdown\">#</a> [&#x24C8;](https://github.com/oceanhouse21/dokker/blob/master/dokker.js#L237 \"View in source\") [&#x24C9;][1]\n\nCreate a Markdown file from JSDoc tags.\n\n#### Arguments\n1. `[options]` *(Object)*: The options object.\n2. `[options.source='app.js']` *(String)*: The path the source code with JSDoc tags.\n3. `[options.github ='']` *(String)*: The path the Github repository.\n4. `[options.markdown='docs/READMDE.md']` *(string)*: The path where to save the Markdown file.\n\n#### Returns\n*(Promise)*:  Returns a resolved promise if file was created.\n\n#### Example\n```js\nvar options = {\n  source: 'app.js',\n  markdown: 'docs/README.md'\n};\nDokker.jsdocMarkdown()\n.then(function(){\n  // => resolved promise\n});\n```\n* * *\n\n<!-- /div -->\n\n<!-- /div -->\n\n<!-- div -->\n\n## `“Literate programming” Methods`\n\n<!-- div -->\n\n### <a id=\"Dokker-literate\"></a>`Dokker.literate([options])`\n<a href=\"#Dokker-literate\">#</a> [&#x24C8;](https://github.com/oceanhouse21/dokker/blob/master/dokker.js#L189 \"View in source\") [&#x24C9;][1]\n\nCreate a styled HTML file from your source code with the help of **docco**\nmodule.\n\n#### Arguments\n1. `[options]` *(Object)*: The options object.\n2. `[options.source='app.js']` *(String)*: The path the source code with comments\n3. `[options.dir='docs/annotated']` *(string)*: The directory where to save the generated HTML file.\n\n#### Returns\n*(Promise)*:  Returns a resolved promise if file was created.\n\n#### Example\n```js\nvar options = {\n  dir: 'docs',\n  source: 'app.js'\n};\nDokker.literate()\n.then(function(){\n  // => resolved promise\n});\n```\n* * *\n\n<!-- /div -->\n\n<!-- /div -->\n\n<!-- div -->\n\n## `“Mocha” Methods`\n\n<!-- div -->\n\n### <a id=\"Dokker-createTests\"></a>`Dokker.createTests([options])`\n<a href=\"#Dokker-createTests\">#</a> [&#x24C8;](https://github.com/oceanhouse21/dokker/blob/master/dokker.js#L113 \"View in source\") [&#x24C9;][1]\n\nCreates an HTML file to describe the features of your module from your\n**Mocha** tests. The module is using the mocha **doc** reporter to\ngenerate the HTML contents.\n\n#### Arguments\n1. `[options]` *(Object)*: The options object.\n2. `[options.path='docs.html']` *(String)*: The path where to save the HTML file\n\n#### Returns\n*(Promise)*:  Returns a resolved promise if file was created.\n\n#### Example\n```js\nvar options = {\n  path: 'docs/tests.html',\n};\nDokker.createTests(options)\n.then(function(){\n  // => resolved promise\n});\n```\n* * *\n\n<!-- /div -->\n\n<!-- /div -->\n\n<!-- div -->\n\n## `“Utility” Methods`\n\n<!-- div -->\n\n### <a id=\"Dokker-configure\"></a>`Dokker.configure([options])`\n<a href=\"#Dokker-configure\">#</a> [&#x24C8;](https://github.com/oceanhouse21/dokker/blob/master/dokker.js#L361 \"View in source\") [&#x24C9;][1]\n\nHelper function that takes a couple of options arguments and\nnormalises them and subsequently returns them.\n\n#### Arguments\n1. `[options]` *(Object)*: The options object.\n2. `[options.li.markdown='docs/READMDE.md']` *(string)*: The path where to\n3. `[options.source='app.js']` *(String)*: The path the source code with JSDoc tags.\n4. `[options.jsdoc.markdown='docs/READMDE.md']` *(string)*: The path where to save the Markdown file.\n5. `[options.jsdoc.README ='READMDE.md']` *(string)*: The path to the project's README.md file\n6. `[options.jsodc.template ='templates/index.ejs.html']` *(String)*: The path to the ejs template.\n7. `[options.mocha.template='templates/tests.ejs.html']` *(String)*: The path to the mocha template.\n8. `[options.dir='docs']` *(String)*: The path where to store the generated files\n\n#### Returns\n*(Promise)*:  Returns a resolved promise with edited options object\n\n#### Example\n```js\nvar options = {\n  dir: 'docs',\n  literate: {\n    source: 'dokker.js',\n    dir: 'annotated'\n  },\n  jsdoc: {\n    title: 'Dokker.js',\n    source: 'dokker.js',\n    markdown: 'README.md',\n    html: 'index.html',\n    readme: 'README.md',\n  }\n};\nDokker.jsdocHtml()\n.then(function(){\n  // => object with absolute pathes to the directory from\n  // which the command was executed\n});\n```\n* * *\n\n<!-- /div -->\n\n<!-- div -->\n\n### <a id=\"Dokker-copyTemplate\"></a>`Dokker.copyTemplate([options])`\n<a href=\"#Dokker-copyTemplate\">#</a> [&#x24C8;](https://github.com/oceanhouse21/dokker/blob/master/dokker.js#L403 \"View in source\") [&#x24C9;][1]\n\nCopy the template to local directory so that one can make changes to ejs\nfiles.\n\n#### Arguments\n1. `[options]` *(Object)*: The options object.\n2. `[options.dir='templates']` *(string)*: The path where to save the template files\n\n#### Returns\n*(Promise)*:  Returns a resolved promise if files were created.\n\n#### Example\n```js\nvar options = {\n  dir: 'template'\n};\nDokker.copyTemplate()\n.then(function(){\n  // => resolved promise\n});\n```\n* * *\n\n<!-- /div -->\n\n<!-- div -->\n\n### <a id=\"Dokker-init\"></a>`Dokker.init()`\n<a href=\"#Dokker-init\">#</a> [&#x24C8;](https://github.com/oceanhouse21/dokker/blob/master/dokker.js#L437 \"View in source\") [&#x24C9;][1]\n\nCreate a .dokker.json file to bootstrap any Dokker project\n\n#### Returns\n*(Promise)*:  Returns a resolved promise if files were created.\n\n#### Example\n```js\nDokker.init()\n.then(function(){\n  // => resolved promise\n});\n```\n* * *\n\n<!-- /div -->\n\n<!-- div -->\n\n### <a id=\"Dokker-watch\"></a>`Dokker.watch()`\n<a href=\"#Dokker-watch\">#</a> [&#x24C8;](https://github.com/oceanhouse21/dokker/blob/master/dokker.js#L462 \"View in source\") [&#x24C9;][1]\n\nStarts a Node.js/Express webserver in docs directory to watch\nthe build Dokker project\n\n#### Returns\n*(Promise)*:  Returns a resolved promise if files were created.\n\n#### Example\n```js\nDokker.init()\n.then(function(){\n  // => resolved promise\n});\n```\n* * *\n\n<!-- /div -->\n\n<!-- /div -->\n\n<!-- div -->\n\n## `Methods`\n\n<!-- /div -->\n\n<!-- div -->\n\n## `Properties`\n\n<!-- div -->\n\n### <a id=\"Dokker-VERSION\"></a>`Dokker.VERSION`\n<a href=\"#Dokker-VERSION\">#</a> [&#x24C8;](https://github.com/oceanhouse21/dokker/blob/master/dokker.js#L23 \"View in source\") [&#x24C9;][1]\n\n(string): The semantic version number.\n\n* * *\n\n<!-- /div -->\n\n<!-- /div -->\n\n<!-- /div -->\n\n [1]: #github pages \"Jump back to the TOC.\"\n"
  },
  {
    "path": "docs/annotated/docco.css",
    "content": "/*--------------------- Typography ----------------------------*/\n\n@font-face {\n    font-family: 'aller-light';\n    src: url('public/fonts/aller-light.eot');\n    src: url('public/fonts/aller-light.eot?#iefix') format('embedded-opentype'),\n         url('public/fonts/aller-light.woff') format('woff'),\n         url('public/fonts/aller-light.ttf') format('truetype');\n    font-weight: normal;\n    font-style: normal;\n}\n\n@font-face {\n    font-family: 'aller-bold';\n    src: url('public/fonts/aller-bold.eot');\n    src: url('public/fonts/aller-bold.eot?#iefix') format('embedded-opentype'),\n         url('public/fonts/aller-bold.woff') format('woff'),\n         url('public/fonts/aller-bold.ttf') format('truetype');\n    font-weight: normal;\n    font-style: normal;\n}\n\n@font-face {\n    font-family: 'roboto-black';\n    src: url('public/fonts/roboto-black.eot');\n    src: url('public/fonts/roboto-black.eot?#iefix') format('embedded-opentype'),\n         url('public/fonts/roboto-black.woff') format('woff'),\n         url('public/fonts/roboto-black.ttf') format('truetype');\n    font-weight: normal;\n    font-style: normal;\n}\n\n/*--------------------- Layout ----------------------------*/\nhtml { height: 100%; }\nbody {\n  font-family: \"aller-light\";\n  font-size: 14px;\n  line-height: 18px;\n  color: #30404f;\n  margin: 0; padding: 0;\n  height:100%;\n}\n#container { min-height: 100%; }\n\na {\n  color: #000;\n}\n\nb, strong {\n  font-weight: normal;\n  font-family: \"aller-bold\";\n}\n\np {\n  margin: 15px 0 0px;\n}\n  .annotation ul, .annotation ol {\n    margin: 25px 0;\n  }\n    .annotation ul li, .annotation ol li {\n      font-size: 14px;\n      line-height: 18px;\n      margin: 10px 0;\n    }\n\nh1, h2, h3, h4, h5, h6 {\n  color: #112233;\n  line-height: 1em;\n  font-weight: normal;\n  font-family: \"roboto-black\";\n  text-transform: uppercase;\n  margin: 30px 0 15px 0;\n}\n\nh1 {\n  margin-top: 40px;\n}\nh2 {\n  font-size: 1.26em;\n}\n\nhr {\n  border: 0;\n  background: 1px #ddd;\n  height: 1px;\n  margin: 20px 0;\n}\n\npre, tt, code {\n  font-size: 12px; line-height: 16px;\n  font-family: Menlo, Monaco, Consolas, \"Lucida Console\", monospace;\n  margin: 0; padding: 0;\n}\n  .annotation pre {\n    display: block;\n    margin: 0;\n    padding: 7px 10px;\n    background: #fcfcfc;\n    -moz-box-shadow:    inset 0 0 10px rgba(0,0,0,0.1);\n    -webkit-box-shadow: inset 0 0 10px rgba(0,0,0,0.1);\n    box-shadow:         inset 0 0 10px rgba(0,0,0,0.1);\n    overflow-x: auto;\n  }\n    .annotation pre code {\n      border: 0;\n      padding: 0;\n      background: transparent;\n    }\n\n\nblockquote {\n  border-left: 5px solid #ccc;\n  margin: 0;\n  padding: 1px 0 1px 1em;\n}\n  .sections blockquote p {\n    font-family: Menlo, Consolas, Monaco, monospace;\n    font-size: 12px; line-height: 16px;\n    color: #999;\n    margin: 10px 0 0;\n    white-space: pre-wrap;\n  }\n\nul.sections {\n  list-style: none;\n  padding:0 0 5px 0;;\n  margin:0;\n}\n\n/*\n  Force border-box so that % widths fit the parent\n  container without overlap because of margin/padding.\n\n  More Info : http://www.quirksmode.org/css/box.html\n*/\nul.sections > li > div {\n  -moz-box-sizing: border-box;    /* firefox */\n  -ms-box-sizing: border-box;     /* ie */\n  -webkit-box-sizing: border-box; /* webkit */\n  -khtml-box-sizing: border-box;  /* konqueror */\n  box-sizing: border-box;         /* css3 */\n}\n\n\n/*---------------------- Jump Page -----------------------------*/\n#jump_to, #jump_page {\n  margin: 0;\n  background: white;\n  -webkit-box-shadow: 0 0 25px #777; -moz-box-shadow: 0 0 25px #777;\n  -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px;\n  font: 16px Arial;\n  cursor: pointer;\n  text-align: right;\n  list-style: none;\n}\n\n#jump_to a {\n  text-decoration: none;\n}\n\n#jump_to a.large {\n  display: none;\n}\n#jump_to a.small {\n  font-size: 22px;\n  font-weight: bold;\n  color: #676767;\n}\n\n#jump_to, #jump_wrapper {\n  position: fixed;\n  right: 0; top: 0;\n  padding: 10px 15px;\n  margin:0;\n}\n\n#jump_wrapper {\n  display: none;\n  padding:0;\n}\n\n#jump_to:hover #jump_wrapper {\n  display: block;\n}\n\n#jump_page_wrapper{\n  position: fixed;\n  right: 0;\n  top: 0;\n  bottom: 0;\n}\n\n#jump_page {\n  padding: 5px 0 3px;\n  margin: 0 0 25px 25px;\n  max-height: 100%;\n  overflow: auto;\n}\n\n#jump_page .source {\n  display: block;\n  padding: 15px;\n  text-decoration: none;\n  border-top: 1px solid #eee;\n}\n\n#jump_page .source:hover {\n  background: #f5f5ff;\n}\n\n#jump_page .source:first-child {\n}\n\n/*---------------------- Low resolutions (> 320px) ---------------------*/\n@media only screen and (min-width: 320px) {\n  .pilwrap { display: none; }\n\n  ul.sections > li > div {\n    display: block;\n    padding:5px 10px 0 10px;\n  }\n\n  ul.sections > li > div.annotation ul, ul.sections > li > div.annotation ol {\n    padding-left: 30px;\n  }\n\n  ul.sections > li > div.content {\n    overflow-x:auto;\n    -webkit-box-shadow: inset 0 0 5px #e5e5ee;\n    box-shadow: inset 0 0 5px #e5e5ee;\n    border: 1px solid #dedede;\n    margin:5px 10px 5px 10px;\n    padding-bottom: 5px;\n  }\n\n  ul.sections > li > div.annotation pre {\n    margin: 7px 0 7px;\n    padding-left: 15px;\n  }\n\n  ul.sections > li > div.annotation p tt, .annotation code {\n    background: #f8f8ff;\n    border: 1px solid #dedede;\n    font-size: 12px;\n    padding: 0 0.2em;\n  }\n}\n\n/*----------------------  (> 481px) ---------------------*/\n@media only screen and (min-width: 481px) {\n  #container {\n    position: relative;\n  }\n  body {\n    background-color: #F5F5FF;\n    font-size: 15px;\n    line-height: 21px;\n  }\n  pre, tt, code {\n    line-height: 18px;\n  }\n  p, ul, ol {\n    margin: 0 0 15px;\n  }\n\n\n  #jump_to {\n    padding: 5px 10px;\n  }\n  #jump_wrapper {\n    padding: 0;\n  }\n  #jump_to, #jump_page {\n    font: 10px Arial;\n    text-transform: uppercase;\n  }\n  #jump_page .source {\n    padding: 5px 10px;\n  }\n  #jump_to a.large {\n    display: inline-block;\n  }\n  #jump_to a.small {\n    display: none;\n  }\n\n\n\n  #background {\n    position: absolute;\n    top: 0; bottom: 0;\n    width: 350px;\n    background: #fff;\n    border-right: 1px solid #e5e5ee;\n    z-index: -1;\n  }\n\n  ul.sections > li > div.annotation ul, ul.sections > li > div.annotation ol {\n    padding-left: 40px;\n  }\n\n  ul.sections > li {\n    white-space: nowrap;\n  }\n\n  ul.sections > li > div {\n    display: inline-block;\n  }\n\n  ul.sections > li > div.annotation {\n    max-width: 350px;\n    min-width: 350px;\n    min-height: 5px;\n    padding: 13px;\n    overflow-x: hidden;\n    white-space: normal;\n    vertical-align: top;\n    text-align: left;\n  }\n  ul.sections > li > div.annotation pre {\n    margin: 15px 0 15px;\n    padding-left: 15px;\n  }\n\n  ul.sections > li > div.content {\n    padding: 13px;\n    vertical-align: top;\n    border: none;\n    -webkit-box-shadow: none;\n    box-shadow: none;\n  }\n\n  .pilwrap {\n    position: relative;\n    display: inline;\n  }\n\n  .pilcrow {\n    font: 12px Arial;\n    text-decoration: none;\n    color: #454545;\n    position: absolute;\n    top: 3px; left: -20px;\n    padding: 1px 2px;\n    opacity: 0;\n    -webkit-transition: opacity 0.2s linear;\n  }\n    .for-h1 .pilcrow {\n      top: 47px;\n    }\n    .for-h2 .pilcrow, .for-h3 .pilcrow, .for-h4 .pilcrow {\n      top: 35px;\n    }\n\n  ul.sections > li > div.annotation:hover .pilcrow {\n    opacity: 1;\n  }\n}\n\n/*---------------------- (> 1025px) ---------------------*/\n@media only screen and (min-width: 1025px) {\n\n  body {\n    font-size: 16px;\n    line-height: 24px;\n  }\n\n  #background {\n    width: 525px;\n  }\n  ul.sections > li > div.annotation {\n    max-width: 525px;\n    min-width: 525px;\n    padding: 10px 25px 1px 50px;\n  }\n  ul.sections > li > div.content {\n    padding: 9px 15px 16px 25px;\n  }\n}\n\n/*---------------------- Syntax Highlighting -----------------------------*/\n\ntd.linenos { background-color: #f0f0f0; padding-right: 10px; }\nspan.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }\n/*\n\ngithub.com style (c) Vasily Polovnyov <vast@whiteants.net>\n\n*/\n\npre code {\n  display: block; padding: 0.5em;\n  color: #000;\n  background: #f8f8ff\n}\n\npre .hljs-comment,\npre .hljs-template_comment,\npre .hljs-diff .hljs-header,\npre .hljs-javadoc {\n  color: #408080;\n  font-style: italic\n}\n\npre .hljs-keyword,\npre .hljs-assignment,\npre .hljs-literal,\npre .hljs-css .hljs-rule .hljs-keyword,\npre .hljs-winutils,\npre .hljs-javascript .hljs-title,\npre .hljs-lisp .hljs-title,\npre .hljs-subst {\n  color: #954121;\n  /*font-weight: bold*/\n}\n\npre .hljs-number,\npre .hljs-hexcolor {\n  color: #40a070\n}\n\npre .hljs-string,\npre .hljs-tag .hljs-value,\npre .hljs-phpdoc,\npre .hljs-tex .hljs-formula {\n  color: #219161;\n}\n\npre .hljs-title,\npre .hljs-id {\n  color: #19469D;\n}\npre .hljs-params {\n  color: #00F;\n}\n\npre .hljs-javascript .hljs-title,\npre .hljs-lisp .hljs-title,\npre .hljs-subst {\n  font-weight: normal\n}\n\npre .hljs-class .hljs-title,\npre .hljs-haskell .hljs-label,\npre .hljs-tex .hljs-command {\n  color: #458;\n  font-weight: bold\n}\n\npre .hljs-tag,\npre .hljs-tag .hljs-title,\npre .hljs-rules .hljs-property,\npre .hljs-django .hljs-tag .hljs-keyword {\n  color: #000080;\n  font-weight: normal\n}\n\npre .hljs-attribute,\npre .hljs-variable,\npre .hljs-instancevar,\npre .hljs-lisp .hljs-body {\n  color: #008080\n}\n\npre .hljs-regexp {\n  color: #B68\n}\n\npre .hljs-class {\n  color: #458;\n  font-weight: bold\n}\n\npre .hljs-symbol,\npre .hljs-ruby .hljs-symbol .hljs-string,\npre .hljs-ruby .hljs-symbol .hljs-keyword,\npre .hljs-ruby .hljs-symbol .hljs-keymethods,\npre .hljs-lisp .hljs-keyword,\npre .hljs-tex .hljs-special,\npre .hljs-input_number {\n  color: #990073\n}\n\npre .hljs-builtin,\npre .hljs-constructor,\npre .hljs-built_in,\npre .hljs-lisp .hljs-title {\n  color: #0086b3\n}\n\npre .hljs-preprocessor,\npre .hljs-pi,\npre .hljs-doctype,\npre .hljs-shebang,\npre .hljs-cdata {\n  color: #999;\n  font-weight: bold\n}\n\npre .hljs-deletion {\n  background: #fdd\n}\n\npre .hljs-addition {\n  background: #dfd\n}\n\npre .hljs-diff .hljs-change {\n  background: #0086b3\n}\n\npre .hljs-chunk {\n  color: #aaa\n}\n\npre .hljs-tex .hljs-formula {\n  opacity: 0.5;\n}\n"
  },
  {
    "path": "docs/annotated/dokker.html",
    "content": "<!DOCTYPE html>\n\n<html>\n<head>\n  <title>dokker.js</title>\n  <meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;\">\n  <link rel=\"stylesheet\" media=\"all\" href=\"docco.css\" />\n</head>\n<body>\n  <div id=\"container\">\n    <div id=\"background\"></div>\n    \n    <ul class=\"sections\">\n        \n          <li id=\"title\">\n              <div class=\"annotation\">\n                  <h1>dokker.js</h1>\n              </div>\n          </li>\n        \n        \n        \n        <li id=\"section-1\">\n            <div class=\"annotation\">\n              \n              <div class=\"pilwrap \">\n                <a class=\"pilcrow\" href=\"#section-1\">&#182;</a>\n              </div>\n              <pre><code>Dokker.js <span class=\"hljs-number\">0.0</span>.1\nhttp:<span class=\"hljs-comment\">//dokker.oceanhouse21.com</span>\n(c) <span class=\"hljs-number\">2014</span>-<span class=\"hljs-number\">2015</span> Georg Schlenkhoff and Oceanhouse21\nDokker.js may be freely distributed under the MIT license.\n</code></pre>\n            </div>\n            \n            <div class=\"content\"><div class='highlight'><pre><span class=\"hljs-pi\">\n'use strict'</span>;</pre></div></div>\n            \n        </li>\n        \n        \n        <li id=\"section-2\">\n            <div class=\"annotation\">\n              \n              <div class=\"pilwrap \">\n                <a class=\"pilcrow\" href=\"#section-2\">&#182;</a>\n              </div>\n              <p>Define required dependencies</p>\n\n            </div>\n            \n            <div class=\"content\"><div class='highlight'><pre><span class=\"hljs-keyword\">var</span> <span class=\"hljs-built_in\">Promise</span> = <span class=\"hljs-built_in\">require</span>(<span class=\"hljs-string\">'promise'</span>);\n<span class=\"hljs-keyword\">var</span> fs = <span class=\"hljs-built_in\">require</span>(<span class=\"hljs-string\">'fs'</span>);\n<span class=\"hljs-keyword\">var</span> path = <span class=\"hljs-built_in\">require</span>(<span class=\"hljs-string\">'path'</span>);\n<span class=\"hljs-keyword\">var</span> read = <span class=\"hljs-built_in\">Promise</span>.denodeify(fs.readFile);\n<span class=\"hljs-keyword\">var</span> write = <span class=\"hljs-built_in\">Promise</span>.denodeify(fs.writeFile);\n<span class=\"hljs-keyword\">var</span> docco = <span class=\"hljs-built_in\">require</span>(<span class=\"hljs-string\">'docco'</span>);\n<span class=\"hljs-keyword\">var</span> docdown = <span class=\"hljs-built_in\">require</span>(<span class=\"hljs-string\">'docdown'</span>);\n<span class=\"hljs-keyword\">var</span> marked = <span class=\"hljs-built_in\">require</span>(<span class=\"hljs-string\">'marked'</span>);\n<span class=\"hljs-keyword\">var</span> ejs = <span class=\"hljs-built_in\">require</span>(<span class=\"hljs-string\">'ejs'</span>);\n<span class=\"hljs-keyword\">var</span> cheerio = <span class=\"hljs-built_in\">require</span>(<span class=\"hljs-string\">'cheerio'</span>);\n<span class=\"hljs-keyword\">var</span> exec = <span class=\"hljs-built_in\">require</span>(<span class=\"hljs-string\">'child_process'</span>).exec;\n<span class=\"hljs-keyword\">var</span> Dokker = {};\nDokker.VERSION = <span class=\"hljs-string\">'0.1.2'</span>;</pre></div></div>\n            \n        </li>\n        \n        \n        <li id=\"section-3\">\n            <div class=\"annotation\">\n              \n              <div class=\"pilwrap \">\n                <a class=\"pilcrow\" href=\"#section-3\">&#182;</a>\n              </div>\n              <p>Transclude in a ejs template file the HTML snippet that was ultimately\ncreated with docdown. Also tweak the HTML page a bit and finally\ninject the README.md.</p>\n\n            </div>\n            \n            <div class=\"content\"><div class='highlight'><pre>Dokker.injectTemplate = <span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">options</span>) </span>{\n  <span class=\"hljs-keyword\">return</span> <span class=\"hljs-keyword\">new</span> <span class=\"hljs-built_in\">Promise</span>(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">resolve, reject</span>) </span>{\n    <span class=\"hljs-keyword\">var</span> template, body, html, readme, $;\n    <span class=\"hljs-keyword\">return</span> read(options.template, <span class=\"hljs-string\">'utf8'</span>)\n    .then(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">data</span>) </span>{\n      template = data;\n      <span class=\"hljs-keyword\">return</span> read(options.readme, <span class=\"hljs-string\">'utf8'</span>);\n    }).then(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">data</span>) </span>{\n      readme = marked(data);\n      $ = cheerio.load(readme);\n      $(<span class=\"hljs-string\">'h1'</span>).remove();\n      readme = $.html();\n      <span class=\"hljs-keyword\">return</span> read(options.html, <span class=\"hljs-string\">'utf8'</span>);\n    }).then(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">data</span>) </span>{\n      $ = cheerio.load(data);\n      <span class=\"hljs-keyword\">return</span> ejs.render(template, {\n        apiToc: $(<span class=\"hljs-string\">'.toc-container'</span>).html(),\n        readme: readme,\n        apiDoc: $(<span class=\"hljs-string\">'.doc-container'</span>).html(),</pre></div></div>\n            \n        </li>\n        \n        \n        <li id=\"section-4\">\n            <div class=\"annotation\">\n              \n              <div class=\"pilwrap \">\n                <a class=\"pilcrow\" href=\"#section-4\">&#182;</a>\n              </div>\n              <p>correctly setting links to your github/pages</p>\n\n            </div>\n            \n            <div class=\"content\"><div class='highlight'><pre>        page_url: options.site,\n        title: options.title,\n        github_url: options.github,</pre></div></div>\n            \n        </li>\n        \n        \n        <li id=\"section-5\">\n            <div class=\"annotation\">\n              \n              <div class=\"pilwrap \">\n                <a class=\"pilcrow\" href=\"#section-5\">&#182;</a>\n              </div>\n              <p>fixed reference to generated annotation\nthe ‘literate’ in .dokker.json shall not require a source since it’s never used.</p>\n\n            </div>\n            \n            <div class=\"content\"><div class='highlight'><pre>        annotated_path: <span class=\"hljs-string\">'annotated/'</span>+options.source\n      });\n    }).then(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">data</span>) </span>{\n      <span class=\"hljs-keyword\">return</span> write(options.html, data, <span class=\"hljs-string\">'utf8'</span>);\n    }).then(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\"></span>) </span>{\n      resolve();\n    }).then(<span class=\"hljs-literal\">null</span>, <span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">err</span>) </span>{\n      reject(err);\n    });\n  });\n};</pre></div></div>\n            \n        </li>\n        \n        \n        <li id=\"section-6\">\n            <div class=\"annotation\">\n              \n              <div class=\"pilwrap \">\n                <a class=\"pilcrow\" href=\"#section-6\">&#182;</a>\n              </div>\n              <p>Create a HTML site from any mocha tests find when executing mocha\n—reporter doc terminal command.</p>\n\n            </div>\n            \n            <div class=\"content\"><div class='highlight'><pre>Dokker.createTests = <span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">options</span>) </span>{\n  <span class=\"hljs-keyword\">return</span> <span class=\"hljs-keyword\">new</span> <span class=\"hljs-built_in\">Promise</span>(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">resolve, reject</span>) </span>{\n    <span class=\"hljs-keyword\">var</span> template, tests;</pre></div></div>\n            \n        </li>\n        \n        \n        <li id=\"section-7\">\n            <div class=\"annotation\">\n              \n              <div class=\"pilwrap \">\n                <a class=\"pilcrow\" href=\"#section-7\">&#182;</a>\n              </div>\n              <p>allows specification of mocha.command in .dokker.json, e.g. ‘mocha -u tdd —reporter doc’</p>\n\n            </div>\n            \n            <div class=\"content\"><div class='highlight'><pre>    <span class=\"hljs-keyword\">var</span> cmd = options.command || <span class=\"hljs-string\">'mocha --reporter doc'</span>;\n    exec(cmd, {cwd: process.cwd()}, <span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">error, stdout</span>) </span>{\n      <span class=\"hljs-keyword\">if</span>(error) <span class=\"hljs-keyword\">return</span> reject(error);\n      tests = stdout;\n      <span class=\"hljs-keyword\">return</span> read(options.template, <span class=\"hljs-string\">'utf8'</span>)\n      .then(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">data</span>) </span>{\n        template = data;\n        <span class=\"hljs-keyword\">return</span> ejs.render(template, {tests: tests});\n      }).then(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">data</span>) </span>{\n        <span class=\"hljs-keyword\">return</span> write(options.path, data, <span class=\"hljs-string\">'utf8'</span>);\n      }).then(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\"></span>) </span>{\n        resolve();\n      }).then(<span class=\"hljs-literal\">null</span>, <span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">err</span>) </span>{\n        reject(err);\n      });\n    });\n  });\n};</pre></div></div>\n            \n        </li>\n        \n        \n        <li id=\"section-8\">\n            <div class=\"annotation\">\n              \n              <div class=\"pilwrap \">\n                <a class=\"pilcrow\" href=\"#section-8\">&#182;</a>\n              </div>\n              <p>Extract docs folder to separate git branch and finally push branch to\nGithub repository</p>\n\n            </div>\n            \n            <div class=\"content\"><div class='highlight'><pre>Dokker.ghPages = <span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\"></span>)</span>{\n  <span class=\"hljs-keyword\">return</span> <span class=\"hljs-keyword\">new</span> <span class=\"hljs-built_in\">Promise</span>(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">resolve, reject</span>) </span>{\n    exec(<span class=\"hljs-string\">'git subtree split -P docs -b gh-pages'</span>, <span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">error, stdout, stderr</span>) </span>{\n      <span class=\"hljs-keyword\">if</span>(error) <span class=\"hljs-keyword\">return</span> reject(stderr);\n      exec(<span class=\"hljs-string\">'git push origin gh-pages'</span>, <span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">error, stdout, stderr</span>) </span>{\n        <span class=\"hljs-keyword\">if</span>(error) <span class=\"hljs-keyword\">return</span> reject(stderr);\n        resolve();\n      });\n    });\n  });\n};</pre></div></div>\n            \n        </li>\n        \n        \n        <li id=\"section-9\">\n            <div class=\"annotation\">\n              \n              <div class=\"pilwrap \">\n                <a class=\"pilcrow\" href=\"#section-9\">&#182;</a>\n              </div>\n              <p>Create an HTML file from any source code comments in the style of\n<a href=\"https://de.wikipedia.org/wiki/Literate_programming\">literate programming</a></p>\n\n            </div>\n            \n            <div class=\"content\"><div class='highlight'><pre>Dokker.literate = <span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span> (<span class=\"hljs-params\">options</span>) </span>{\n  <span class=\"hljs-keyword\">return</span> <span class=\"hljs-keyword\">new</span> <span class=\"hljs-built_in\">Promise</span>(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">resolve, reject</span>) </span>{\n    <span class=\"hljs-keyword\">var</span> tmpDir = path.join(process.cwd(), <span class=\"hljs-string\">'/.tmp'</span>);\n    <span class=\"hljs-keyword\">var</span> tmpFile = path.join(tmpDir, options.source);\n    <span class=\"hljs-keyword\">var</span> sourceFile = (options.cwd) ?\n      path.join(process.cwd(), options.cwd, options.source) :\n      path.join(process.cwd(), options.source);\n    <span class=\"hljs-keyword\">return</span> read(sourceFile, <span class=\"hljs-string\">'utf8'</span>)\n    .then(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">data</span>) </span>{\n      <span class=\"hljs-keyword\">var</span> source = data.replace(<span class=\"hljs-regexp\">/^\\s*(\\*|\\/\\*).*[\\r\\n]/gm</span>, <span class=\"hljs-string\">''</span>);\n      <span class=\"hljs-keyword\">return</span> Dokker.mkdir(tmpDir)\n      .then(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\"></span>) </span>{\n        <span class=\"hljs-keyword\">return</span> write(tmpFile, source, <span class=\"hljs-string\">'utf8'</span>);\n      }).then(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\"></span>)</span>{\n        docco.run([<span class=\"hljs-string\">''</span>, <span class=\"hljs-string\">''</span>, tmpFile, <span class=\"hljs-string\">'-o'</span>, options.dir]);\n        resolve();\n      });\n    }).then(<span class=\"hljs-literal\">null</span>, <span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">err</span>) </span>{\n      <span class=\"hljs-keyword\">if</span> (err) <span class=\"hljs-keyword\">return</span> reject(err);\n    });\n  });\n};</pre></div></div>\n            \n        </li>\n        \n        \n        <li id=\"section-10\">\n            <div class=\"annotation\">\n              \n              <div class=\"pilwrap \">\n                <a class=\"pilcrow\" href=\"#section-10\">&#182;</a>\n              </div>\n              <p>Convert markdown from any source code comments with docdown module.</p>\n\n            </div>\n            \n            <div class=\"content\"><div class='highlight'><pre>Dokker.jsdocMarkdown = <span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span> (<span class=\"hljs-params\">options</span>) </span>{\n  <span class=\"hljs-keyword\">return</span> <span class=\"hljs-keyword\">new</span> <span class=\"hljs-built_in\">Promise</span>(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">resolve, reject</span>) </span>{\n    <span class=\"hljs-keyword\">var</span> source, tmpFile, tmpDir;\n    <span class=\"hljs-keyword\">var</span> sourceFile = (options.cwd) ?\n      path.join(process.cwd(), options.cwd, options.source) :\n      path.join(process.cwd(), options.source);\n    <span class=\"hljs-keyword\">return</span> read(sourceFile, <span class=\"hljs-string\">'utf8'</span>)\n    .then(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">data</span>)</span>{\n      source = data.replace(<span class=\"hljs-regexp\">/^\\s*(\\/\\/).*[\\r\\n]/gm</span>, <span class=\"hljs-string\">''</span>);\n      tmpDir = path.join(process.cwd(), <span class=\"hljs-string\">'/.tmp'</span>);\n      <span class=\"hljs-keyword\">return</span> Dokker.mkdir(tmpDir);\n    }).then(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\"></span>)</span>{\n      tmpFile = path.join(tmpDir, options.source);\n      <span class=\"hljs-keyword\">return</span> write(tmpFile, source, <span class=\"hljs-string\">'utf8'</span>);\n    }).then(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\"></span>)</span>{\n      <span class=\"hljs-keyword\">var</span> markdown = docdown({\n        <span class=\"hljs-string\">'path'</span>: tmpFile,\n        <span class=\"hljs-string\">'url'</span>: options.github,\n        <span class=\"hljs-string\">'toc'</span>: <span class=\"hljs-string\">'categories'</span>\n      });\n      <span class=\"hljs-keyword\">return</span> write(options.markdown, markdown, <span class=\"hljs-string\">'utf8'</span>);\n    }).then(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\"></span>) </span>{\n      resolve();\n    }).then(<span class=\"hljs-literal\">null</span>, <span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">err</span>) </span>{\n      reject(err);\n    });\n  });\n};</pre></div></div>\n            \n        </li>\n        \n        \n        <li id=\"section-11\">\n            <div class=\"annotation\">\n              \n              <div class=\"pilwrap \">\n                <a class=\"pilcrow\" href=\"#section-11\">&#182;</a>\n              </div>\n              <p>Create an HTML file from any source code comments in the style of\n<a href=\"https://de.wikipedia.org/wiki/Literate_programming\">literate programming</a></p>\n\n            </div>\n            \n            <div class=\"content\"><div class='highlight'><pre>Dokker.jsdocHtml = <span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span> (<span class=\"hljs-params\">options</span>) </span>{\n  <span class=\"hljs-keyword\">return</span> <span class=\"hljs-keyword\">new</span> <span class=\"hljs-built_in\">Promise</span>(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">resolve, reject</span>) </span>{\n    <span class=\"hljs-keyword\">return</span> read(options.markdown, <span class=\"hljs-string\">'utf8'</span>)\n    .then(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">data</span>) </span>{\n      <span class=\"hljs-keyword\">var</span> html = marked(data).replace(<span class=\"hljs-regexp\">/&lt;!-- /g</span>,<span class=\"hljs-string\">'&lt;'</span>).replace(<span class=\"hljs-regexp\">/ --&gt;/g</span>,<span class=\"hljs-string\">'&gt;'</span>);\n      <span class=\"hljs-keyword\">return</span> write(options.html, html, <span class=\"hljs-string\">'utf8'</span>);\n    }).then(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\"></span>) </span>{\n      resolve();\n    }).then(<span class=\"hljs-literal\">null</span>, <span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">err</span>) </span>{\n      reject(err);\n    });\n  });\n};</pre></div></div>\n            \n        </li>\n        \n        \n        <li id=\"section-12\">\n            <div class=\"annotation\">\n              \n              <div class=\"pilwrap \">\n                <a class=\"pilcrow\" href=\"#section-12\">&#182;</a>\n              </div>\n              <p>Internal helper function that creates any directory if not existing.</p>\n\n            </div>\n            \n            <div class=\"content\"><div class='highlight'><pre>Dokker.mkdir = <span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">dir</span>) </span>{\n  <span class=\"hljs-keyword\">return</span> <span class=\"hljs-keyword\">new</span> <span class=\"hljs-built_in\">Promise</span>(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">resolve, reject</span>) </span>{\n    fs.exists(dir, <span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">exists</span>) </span>{\n      <span class=\"hljs-keyword\">if</span> (exists) {\n        resolve();\n      } <span class=\"hljs-keyword\">else</span> {\n        fs.mkdir(dir, <span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">err</span>) </span>{\n          <span class=\"hljs-keyword\">if</span> (err) <span class=\"hljs-keyword\">return</span> reject(err);\n          resolve();\n        });\n      }\n    });\n  });\n};</pre></div></div>\n            \n        </li>\n        \n        \n        <li id=\"section-13\">\n            <div class=\"annotation\">\n              \n              <div class=\"pilwrap \">\n                <a class=\"pilcrow\" href=\"#section-13\">&#182;</a>\n              </div>\n              <p>Parses the options file, .Dokker.json, and sets the default parameters.</p>\n\n            </div>\n            \n            <div class=\"content\"><div class='highlight'><pre>Dokker.configure = <span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">options</span>) </span>{\n  <span class=\"hljs-keyword\">return</span> <span class=\"hljs-keyword\">new</span> <span class=\"hljs-built_in\">Promise</span>(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">resolve, reject</span>)</span>{\n    <span class=\"hljs-keyword\">var</span> file = path.join(process.cwd(), <span class=\"hljs-string\">'.dokker.json'</span>);\n    <span class=\"hljs-keyword\">return</span> read(file, <span class=\"hljs-string\">'utf8'</span>)\n    .then(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">data</span>) </span>{\n      data = <span class=\"hljs-built_in\">JSON</span>.parse(data);\n      data.jsdoc.template = (data.jsdoc.template) ? path.join(process.cwd(), data.jsdoc.template) : path.join(__dirname, <span class=\"hljs-string\">'templates/index.ejs.html'</span>);\n      data.mocha.template = (data.mocha.template) ? path.join(process.cwd(), data.mocha.template) : path.join(__dirname, <span class=\"hljs-string\">'templates/tests.ejs.html'</span>);\n      data.mocha.path = path.join(process.cwd(), data.dir, data.mocha.path);</pre></div></div>\n            \n        </li>\n        \n        \n        <li id=\"section-14\">\n            <div class=\"annotation\">\n              \n              <div class=\"pilwrap \">\n                <a class=\"pilcrow\" href=\"#section-14\">&#182;</a>\n              </div>\n              <p>mocha.command commented out to fix build-breaking bug\nspecifies mocha command in .dokker.json; e.g. mocha -u tdd -R spec\ndata.mocha.command = path.join(process.cwd(), data.dir, data.mocha.command);</p>\n\n            </div>\n            \n            <div class=\"content\"><div class='highlight'><pre>      data.literate.dir = path.join(process.cwd(), data.dir, data.literate.dir);\n      data.jsdoc.markdown = path.join(process.cwd(), data.dir, data.jsdoc.markdown);\n      data.jsdoc.html = path.join(process.cwd(), data.dir, data.jsdoc.html);\n      data.jsdoc.readme = path.join(process.cwd(), data.jsdoc.readme);\n      resolve(data);\n    }).then(<span class=\"hljs-literal\">null</span>, <span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">err</span>) </span>{\n      reject(err);\n    });\n  });\n};</pre></div></div>\n            \n        </li>\n        \n        \n        <li id=\"section-15\">\n            <div class=\"annotation\">\n              \n              <div class=\"pilwrap \">\n                <a class=\"pilcrow\" href=\"#section-15\">&#182;</a>\n              </div>\n              <p>Copy starter template to bootstrap any Dokker project.</p>\n\n            </div>\n            \n            <div class=\"content\"><div class='highlight'><pre>Dokker.copyTemplate = <span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">options</span>) </span>{\n  <span class=\"hljs-keyword\">return</span> <span class=\"hljs-keyword\">new</span> <span class=\"hljs-built_in\">Promise</span>(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">resolve, reject</span>) </span>{\n    <span class=\"hljs-keyword\">var</span> templatesDir = path.join(process.cwd(), <span class=\"hljs-string\">'templates'</span>);\n    <span class=\"hljs-keyword\">return</span> Dokker.mkdir(templatesDir)\n    .then(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\"></span>) </span>{\n      <span class=\"hljs-keyword\">var</span> oldStyle = path.join(__dirname, <span class=\"hljs-string\">'templates'</span>, <span class=\"hljs-string\">'styles.css'</span>);\n      <span class=\"hljs-keyword\">var</span> newStyle = path.join(process.cwd(), options.dir, <span class=\"hljs-string\">'styles.css'</span>);\n      fs.createReadStream(oldStyle).pipe(fs.createWriteStream(newStyle));\n      <span class=\"hljs-keyword\">var</span> oldLogo = path.join(__dirname, <span class=\"hljs-string\">'templates'</span>, <span class=\"hljs-string\">'logo.png'</span>);\n      <span class=\"hljs-keyword\">var</span> newLogo = path.join(process.cwd(), options.dir, <span class=\"hljs-string\">'logo.png'</span>);\n      fs.createReadStream(oldLogo).pipe(fs.createWriteStream(newLogo));\n      <span class=\"hljs-keyword\">var</span> oldApp = path.join(__dirname, <span class=\"hljs-string\">'templates'</span>, <span class=\"hljs-string\">'app.js'</span>);\n      <span class=\"hljs-keyword\">var</span> newApp = path.join(process.cwd(), options.dir, <span class=\"hljs-string\">'app.js'</span>);\n      fs.createReadStream(oldApp).pipe(fs.createWriteStream(newApp));\n      resolve();\n    });\n  });\n};</pre></div></div>\n            \n        </li>\n        \n        \n        <li id=\"section-16\">\n            <div class=\"annotation\">\n              \n              <div class=\"pilwrap \">\n                <a class=\"pilcrow\" href=\"#section-16\">&#182;</a>\n              </div>\n              <p>Copies the .Dokker.json file to bootstrap any Dokker project.</p>\n\n            </div>\n            \n            <div class=\"content\"><div class='highlight'><pre>Dokker.init = <span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\"></span>)</span>{\n  <span class=\"hljs-keyword\">return</span> <span class=\"hljs-keyword\">new</span> <span class=\"hljs-built_in\">Promise</span>(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">resolve, reject</span>) </span>{\n    <span class=\"hljs-keyword\">var</span> oldDok = path.join(__dirname, <span class=\"hljs-string\">'.dokker.json'</span>);\n    <span class=\"hljs-keyword\">var</span> newDok = path.join(process.cwd(), <span class=\"hljs-string\">'.dokker.json'</span>);\n    fs.createReadStream(oldDok).pipe(fs.createWriteStream(newDok));\n    resolve();\n  });\n};</pre></div></div>\n            \n        </li>\n        \n        \n        <li id=\"section-17\">\n            <div class=\"annotation\">\n              \n              <div class=\"pilwrap \">\n                <a class=\"pilcrow\" href=\"#section-17\">&#182;</a>\n              </div>\n              <p>Starts the Node.js/Express server to watch Dokker.js project\ndocumentation.</p>\n\n            </div>\n            \n            <div class=\"content\"><div class='highlight'><pre>Dokker.watch = <span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\">options</span>) </span>{\n  <span class=\"hljs-keyword\">var</span> gulpex = <span class=\"hljs-built_in\">require</span>(__dirname + <span class=\"hljs-string\">'/gulpfile.js'</span>).gulpex;\n  <span class=\"hljs-keyword\">return</span> gulpex();</pre></div></div>\n            \n        </li>\n        \n        \n        <li id=\"section-18\">\n            <div class=\"annotation\">\n              \n              <div class=\"pilwrap \">\n                <a class=\"pilcrow\" href=\"#section-18\">&#182;</a>\n              </div>\n              <p>return new Promise(function(resolve, reject){ \n  exec(‘DIR=’+ options.dir + ‘ node ‘ + options.dir + ‘/app.js’, function(error, stdout, stderr){\n    if(error) return reject(stderr);\n  });\n});</p>\n\n            </div>\n            \n            <div class=\"content\"><div class='highlight'><pre>};\n\n<span class=\"hljs-built_in\">module</span>.exports = Dokker;</pre></div></div>\n            \n        </li>\n        \n    </ul>\n  </div>\n</body>\n</html>\n"
  },
  {
    "path": "docs/annotated/public/stylesheets/normalize.css",
    "content": "/*! normalize.css v2.0.1 | MIT License | git.io/normalize */\n\n/* ==========================================================================\n   HTML5 display definitions\n   ========================================================================== */\n\n/*\n * Corrects `block` display not defined in IE 8/9.\n */\n\narticle,\naside,\ndetails,\nfigcaption,\nfigure,\nfooter,\nheader,\nhgroup,\nnav,\nsection,\nsummary {\n    display: block;\n}\n\n/*\n * Corrects `inline-block` display not defined in IE 8/9.\n */\n\naudio,\ncanvas,\nvideo {\n    display: inline-block;\n}\n\n/*\n * Prevents modern browsers from displaying `audio` without controls.\n * Remove excess height in iOS 5 devices.\n */\n\naudio:not([controls]) {\n    display: none;\n    height: 0;\n}\n\n/*\n * Addresses styling for `hidden` attribute not present in IE 8/9.\n */\n\n[hidden] {\n    display: none;\n}\n\n/* ==========================================================================\n   Base\n   ========================================================================== */\n\n/*\n * 1. Sets default font family to sans-serif.\n * 2. Prevents iOS text size adjust after orientation change, without disabling\n *    user zoom.\n */\n\nhtml {\n    font-family: sans-serif; /* 1 */\n    -webkit-text-size-adjust: 100%; /* 2 */\n    -ms-text-size-adjust: 100%; /* 2 */\n}\n\n/*\n * Removes default margin.\n */\n\nbody {\n    margin: 0;\n}\n\n/* ==========================================================================\n   Links\n   ========================================================================== */\n\n/*\n * Addresses `outline` inconsistency between Chrome and other browsers.\n */\n\na:focus {\n    outline: thin dotted;\n}\n\n/*\n * Improves readability when focused and also mouse hovered in all browsers.\n */\n\na:active,\na:hover {\n    outline: 0;\n}\n\n/* ==========================================================================\n   Typography\n   ========================================================================== */\n\n/*\n * Addresses `h1` font sizes within `section` and `article` in Firefox 4+,\n * Safari 5, and Chrome.\n */\n\nh1 {\n    font-size: 2em;\n}\n\n/*\n * Addresses styling not present in IE 8/9, Safari 5, and Chrome.\n */\n\nabbr[title] {\n    border-bottom: 1px dotted;\n}\n\n/*\n * Addresses style set to `bolder` in Firefox 4+, Safari 5, and Chrome.\n */\n\nb,\nstrong {\n    font-weight: bold;\n}\n\n/*\n * Addresses styling not present in Safari 5 and Chrome.\n */\n\ndfn {\n    font-style: italic;\n}\n\n/*\n * Addresses styling not present in IE 8/9.\n */\n\nmark {\n    background: #ff0;\n    color: #000;\n}\n\n\n/*\n * Corrects font family set oddly in Safari 5 and Chrome.\n */\n\ncode,\nkbd,\npre,\nsamp {\n    font-family: monospace, serif;\n    font-size: 1em;\n}\n\n/*\n * Improves readability of pre-formatted text in all browsers.\n */\n\npre {\n    white-space: pre;\n    white-space: pre-wrap;\n    word-wrap: break-word;\n}\n\n/*\n * Sets consistent quote types.\n */\n\nq {\n    quotes: \"\\201C\" \"\\201D\" \"\\2018\" \"\\2019\";\n}\n\n/*\n * Addresses inconsistent and variable font size in all browsers.\n */\n\nsmall {\n    font-size: 80%;\n}\n\n/*\n * Prevents `sub` and `sup` affecting `line-height` in all browsers.\n */\n\nsub,\nsup {\n    font-size: 75%;\n    line-height: 0;\n    position: relative;\n    vertical-align: baseline;\n}\n\nsup {\n    top: -0.5em;\n}\n\nsub {\n    bottom: -0.25em;\n}\n\n/* ==========================================================================\n   Embedded content\n   ========================================================================== */\n\n/*\n * Removes border when inside `a` element in IE 8/9.\n */\n\nimg {\n    border: 0;\n}\n\n/*\n * Corrects overflow displayed oddly in IE 9.\n */\n\nsvg:not(:root) {\n    overflow: hidden;\n}\n\n/* ==========================================================================\n   Figures\n   ========================================================================== */\n\n/*\n * Addresses margin not present in IE 8/9 and Safari 5.\n */\n\nfigure {\n    margin: 0;\n}\n\n/* ==========================================================================\n   Forms\n   ========================================================================== */\n\n/*\n * Define consistent border, margin, and padding.\n */\n\nfieldset {\n    border: 1px solid #c0c0c0;\n    margin: 0 2px;\n    padding: 0.35em 0.625em 0.75em;\n}\n\n/*\n * 1. Corrects color not being inherited in IE 8/9.\n * 2. Remove padding so people aren't caught out if they zero out fieldsets.\n */\n\nlegend {\n    border: 0; /* 1 */\n    padding: 0; /* 2 */\n}\n\n/*\n * 1. Corrects font family not being inherited in all browsers.\n * 2. Corrects font size not being inherited in all browsers.\n * 3. Addresses margins set differently in Firefox 4+, Safari 5, and Chrome\n */\n\nbutton,\ninput,\nselect,\ntextarea {\n    font-family: inherit; /* 1 */\n    font-size: 100%; /* 2 */\n    margin: 0; /* 3 */\n}\n\n/*\n * Addresses Firefox 4+ setting `line-height` on `input` using `!important` in\n * the UA stylesheet.\n */\n\nbutton,\ninput {\n    line-height: normal;\n}\n\n/*\n * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\n *    and `video` controls.\n * 2. Corrects inability to style clickable `input` types in iOS.\n * 3. Improves usability and consistency of cursor style between image-type\n *    `input` and others.\n */\n\nbutton,\nhtml input[type=\"button\"], /* 1 */\ninput[type=\"reset\"],\ninput[type=\"submit\"] {\n    -webkit-appearance: button; /* 2 */\n    cursor: pointer; /* 3 */\n}\n\n/*\n * Re-set default cursor for disabled elements.\n */\n\nbutton[disabled],\ninput[disabled] {\n    cursor: default;\n}\n\n/*\n * 1. Addresses box sizing set to `content-box` in IE 8/9.\n * 2. Removes excess padding in IE 8/9.\n */\n\ninput[type=\"checkbox\"],\ninput[type=\"radio\"] {\n    box-sizing: border-box; /* 1 */\n    padding: 0; /* 2 */\n}\n\n/*\n * 1. Addresses `appearance` set to `searchfield` in Safari 5 and Chrome.\n * 2. Addresses `box-sizing` set to `border-box` in Safari 5 and Chrome\n *    (include `-moz` to future-proof).\n */\n\ninput[type=\"search\"] {\n    -webkit-appearance: textfield; /* 1 */\n    -moz-box-sizing: content-box;\n    -webkit-box-sizing: content-box; /* 2 */\n    box-sizing: content-box;\n}\n\n/*\n * Removes inner padding and search cancel button in Safari 5 and Chrome\n * on OS X.\n */\n\ninput[type=\"search\"]::-webkit-search-cancel-button,\ninput[type=\"search\"]::-webkit-search-decoration {\n    -webkit-appearance: none;\n}\n\n/*\n * Removes inner padding and border in Firefox 4+.\n */\n\nbutton::-moz-focus-inner,\ninput::-moz-focus-inner {\n    border: 0;\n    padding: 0;\n}\n\n/*\n * 1. Removes default vertical scrollbar in IE 8/9.\n * 2. Improves readability and alignment in all browsers.\n */\n\ntextarea {\n    overflow: auto; /* 1 */\n    vertical-align: top; /* 2 */\n}\n\n/* ==========================================================================\n   Tables\n   ========================================================================== */\n\n/*\n * Remove most spacing between table cells.\n */\n\ntable {\n    border-collapse: collapse;\n    border-spacing: 0;\n}"
  },
  {
    "path": "docs/app.js",
    "content": "var express = require('express');\nvar app = express();\nvar path = require('path');\nvar livereload = require('livereload');\nvar path = path.join(process.cwd(), process.env.DIR);\nlivereload.createServer({exts: ['applyJSLive']}).watch(path);\napp.use(express.static(path));\napp.listen(9000);\n"
  },
  {
    "path": "docs/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\" id=\"docs\">\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\n  <meta name=\"author\" content=\"Dokker.js\">\n  <meta name=\"description\" content=\"This API documentation is built with Dokker.js at dokkerjs.com\">\n  <title>Dokker.js</title>\n  <link href='http://fonts.googleapis.com/css?family=Source+Code+Pro' rel='stylesheet' type='text/css'>\n  <link rel=\"stylesheet\" href=\"styles.css\" media=\"all\">\n  <link rel=\"stylesheet\" href=\"//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.6/styles/default.min.css\">\n</head>\n<body>\n  <div class=\"toc-container\">\n    <h2><code><a href=http://dokkerjs.com>Dokker.js</a></code></h2>\n    <ul>\n      <li><a href=\"#\">Introduction</a></li>\n      <li><a href=https://github.com/oceanhouse21/dokker/blob/master/dokker.js>Github Repository</a></li>\n      <li><a href=\"tests.html\">Test suite</a></li>\n      <li><a href=annotated/dokker.js>Annotated Source</a></li>\n    </ul>\n    \n<div>\n<h2 id=\"-github-pages-\"><code>Github Pages</code></h2>\n<ul>\n<li><a href=\"#Dokker-ghPages\"><code>Dokker.ghPages</code></a></li>\n</ul>\n</div>\n<div>\n<h2 id=\"-jsdoc-\"><code>JSDoc</code></h2>\n<ul>\n<li><a href=\"#Dokker-injectTemplate\"><code>Dokker.injectTemplate</code></a></li>\n<li><a href=\"#Dokker-jsdocHtml\"><code>Dokker.jsdocHtml</code></a></li>\n<li><a href=\"#Dokker-jsdocMarkdown\"><code>Dokker.jsdocMarkdown</code></a></li>\n</ul>\n</div>\n<div>\n<h2 id=\"-literate-programming-\"><code>Literate programming</code></h2>\n<ul>\n<li><a href=\"#Dokker-literate\"><code>Dokker.literate</code></a></li>\n</ul>\n</div>\n<div>\n<h2 id=\"-mocha-\"><code>Mocha</code></h2>\n<ul>\n<li><a href=\"#Dokker-createTests\"><code>Dokker.createTests</code></a></li>\n</ul>\n</div>\n<div>\n<h2 id=\"-utility-\"><code>Utility</code></h2>\n<ul>\n<li><a href=\"#Dokker-configure\"><code>Dokker.configure</code></a></li>\n<li><a href=\"#Dokker-copyTemplate\"><code>Dokker.copyTemplate</code></a></li>\n<li><a href=\"#Dokker-init\"><code>Dokker.init</code></a></li>\n<li><a href=\"#Dokker-watch\"><code>Dokker.watch</code></a></li>\n</ul>\n</div>\n<div>\n<h2 id=\"-methods-\"><code>Methods</code></h2>\n</div>\n<div>\n<h2 id=\"-properties-\"><code>Properties</code></h2>\n<ul>\n<li><a href=\"#Dokker-VERSION\"><code>Dokker.VERSION</code></a></li>\n</ul>\n</div>\n\n  </div>\n  <div class=\"doc-container\">\n    <div>  \n      <p><img src=\"https://raw.githubusercontent.com/oceanhouse21/dokker/master/templates/logo.png\" alt=\"dokker logo\"></p>\n<p>Dokker.js creates professional Javascript code documentations.</p>\n<p><a href=\"http://dokkerjs.com\">See Dokker.js documentation as example.</a></p>\n<p><a href=\"https://travis-ci.org/oceanhouse21/dokker\"><img src=\"https://travis-ci.org/oceanhouse21/dokker.svg?branch=master\" alt=\"Build Status\"></a></p>\n<h2 id=\"features\">Features</h2>\n<ul>\n<li>Create or <a href=\"http://dokkerjs.com/\">HTML</a> or <a href=\"https://github.com/oceanhouse21/dokker/tree/master/docs#dokkerjs-api-documentation\">markdown</a> documentation from <a href=\"http://usejsdoc.org/\">JSDOC</a> tags</li>\n<li>Support for <a href=\"https://en.wikipedia.org/?title=Literate_programming\">literate programming</a> documentation</li>\n<li>Live edit source code and watch changes</li>\n<li>Include link to your Github repository</li>\n<li>Customize your own templates with <a href=\"http://www.embeddedjs.com/\">ejs</a> or use default style</li>\n<li>Create feature description from <a href=\"http://mochajs.org/\">mocha test suite</a></li>\n<li>Automagically include your README.md into the documentation</li>\n<li>Use your own logo to make an astonishing impression</li>\n<li>Deploy documentation to Github pages on the fly</li>\n</ul>\n<h2 id=\"community\">Community</h2>\n<p><a href=\"https://gitter.im/oceanhouse21/dokker?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge\"><img src=\"https://badges.gitter.im/Join%20Chat.svg\" alt=\"Gitter\"></a></p>\n<h2 id=\"installation\">Installation</h2>\n<p>Dokker is available as npm package. So the easiest way is to install dokker as global module into your project:</p>\n<pre><code>npm install -g dokker\n</code></pre><h2 id=\"usage\">Usage</h2>\n<p>After installation you can execute Dokker with the help of several terminal commands.</p>\n<p><strong>Bootstrap Dokker project</strong></p>\n<p>Dokker needs a configuration file to execute, such as a <a href=\"https://travis-ci.org/\">.travis</a> or <a href=\"http://jshint.com/docs/\">.jshintrc</a>. You can easily create .dokker.json file with the <code>dokker-init</code> command from the root directory of your project or copy an <a href=\"https://github.com/oceanhouse21/dokker/blob/master/.dokker.json\">example file</a>.</p>\n<p>Dokker provides a default template for your project. The template is based on an <a href=\"http://www.embeddedjs.com/\">ejs</a> file. Either you use the default template or modify it. If you choose for the latter you can copy the <a href=\"https://github.com/oceanhouse21/dokker/tree/master/templates\">templates directory</a> and tweak the ejs files how you like.</p>\n<p><strong>Create documentation</strong></p>\n<p>Creating a documentation is really simple with the help of Dokker. You just configure the <a href=\"https://github.com/oceanhouse21/dokker/blob/master/.dokker.json\">.dokker.json</a> file and execute <code>dokker</code>. Then you&#x2019;re done.</p>\n<p><strong>Live edit your documentation</strong></p>\n<p>If you want to work on your source file and see how the documentation evolves, you can do <code>dokker-watch</code> and it will open a browser with live preview.</p>\n<!-- Node.js/Express server is started for you that serves your Dokker project at [localhost:9000](http://localhost:9000).\n\nIf you want to use the live edit function please install the [LiveReload](http://livereload.com/) plugin for your browser. You can then even start a ```nodemon docs/app.js``` and whenever you hit save the HTML site is reloading. But before you might need ```npm install -g nodemon```. -->\n<p><strong>Deploy to Github Pages</strong></p>\n<p>If you want to deploy your documentation to Github Pages, run <code>gh-pages</code>. Finally a separate branch, named <code>gh-pages</code> is created from the <code>docs</code> folder. That is enough for Github to serve your documentation. Please do not forget to <code>git commit</code> your changes before your run <code>gh-pages</code> command.</p>\n<h2 id=\"dokker-in-the-wild\">Dokker in the wild</h2>\n<p>Some examples by our users. Let us know what you did with Dokker too!</p>\n<ul>\n<li><a href=\"http://dokkerjs.com\">Dokker.js</a></li>\n<li><a href=\"http://kengz.github.io/lomath/\">lomath</a></li>\n</ul>\n<h2 id=\"further-reading\">Further Reading</h2>\n<ul>\n<li><a href=\"http://dokkerjs.com\">API Documentation</a></li>\n<li><a href=\"https://github.com/oceanhouse21/dokker/wiki/Changelog\">Changelog</a></li>\n<li><a href=\"https://github.com/oceanhouse21/dokker/releases\">Release Notes</a></li>\n<li><a href=\"https://github.com/oceanhouse21/dokker/wiki/Roadmap\">Roadmap</a></li>\n<li><a href=\"https://github.com/oceanhouse21/dokker/wiki/Resources\">More Resources</a></li>\n</ul>\n<h2 id=\"contributors\">Contributors</h2>\n<ul>\n<li><a href=\"https://github.com/georgschlenkhoff\">georgschlenkhoff</a></li>\n<li><a href=\"https://github.com/kengz\">kengz</a></li>\n</ul>\n\n      <h2>API documentation</h2>\n      \n<div>\n<h2 id=\"-github-pages-methods-\"><code>&#x201C;Github Pages&#x201D; Methods</code></h2>\n<div>\n<h3 id=\"-a-id-dokker-ghpages-a-dokker-ghpages-\"><a id=\"Dokker-ghPages\"></a><code>Dokker.ghPages()</code></h3>\n<p><a href=\"#Dokker-ghPages\">#</a> <a href=\"https://github.com/oceanhouse21/dokker/blob/master/dokker.js#L152\" title=\"View in source\">&#x24C8;</a> [&#x24C9;][1]</p>\n<p>Runs a terminal shell with the git command to extract the docs branch\ninto a seperate gh-pages branch and finally pushes that branch to Github,\nso that the Github page is updated.</p>\n<h4 id=\"returns\">Returns</h4>\n<p><em>(Promise)</em>:  Returns a resolved promise if file was created.</p>\n<h4 id=\"example\">Example</h4>\n<pre><code class=\"lang-js\">Dokker.ghPages()\n.then(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\"></span>)</span>{\n  <span class=\"hljs-comment\">// =&gt; resolved promise</span>\n});\n</code></pre>\n<hr>\n</div>\n</div>\n<div>\n<h2 id=\"-jsdoc-methods-\"><code>&#x201C;JSDoc&#x201D; Methods</code></h2>\n<div>\n<h3 id=\"-a-id-dokker-injecttemplate-a-dokker-injecttemplate-options-\"><a id=\"Dokker-injectTemplate\"></a><code>Dokker.injectTemplate([options])</code></h3>\n<p><a href=\"#Dokker-injectTemplate\">#</a> <a href=\"https://github.com/oceanhouse21/dokker/blob/master/dokker.js#L56\" title=\"View in source\">&#x24C8;</a> [&#x24C9;][1]</p>\n<p>Creates a HTML file that transcludes the HTML snippet that was created\nby the docdown module into an ejs template which is defined by the \n.dokker.json configuration file.</p>\n<h4 id=\"arguments\">Arguments</h4>\n<ol>\n<li><code>[options]</code> <em>(Object)</em>: The options object.</li>\n<li><code>[options.template=&apos;template/index.ejs.html&apos;]</code> <em>(String)</em>: The path to the ejs template file.</li>\n<li><code>[options.html=&apos;docs/index.html&apos;]</code> <em>(string)</em>: The path to the docdown generated JSDoc documentation.</li>\n<li><code>[options.readme=&apos;README.md&apos;]</code> <em>(string)</em>: The path to the README.md file.</li>\n<li><code>[options.title=&apos;&apos;]</code> <em>(string)</em>: The title for the documentation.</li>\n</ol>\n<h4 id=\"returns\">Returns</h4>\n<p><em>(Promise)</em>:  Returns a resolved promise if file was created.</p>\n<h4 id=\"example\">Example</h4>\n<pre><code class=\"lang-js\"><span class=\"hljs-keyword\">var</span> options = {\n  template: <span class=\"hljs-string\">&apos;template/index.ejs.html&apos;</span>,\n  html: <span class=\"hljs-string\">&apos;docs/index.html&apos;</span>,\n  readme: <span class=\"hljs-string\">&apos;docs/README.md&apos;</span>,\n  title: <span class=\"hljs-string\">&apos;Dokker.js API Documentation&apos;</span>\n};\nDokker.injectTemplate(options)\n.then(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\"></span>)</span>{\n  <span class=\"hljs-comment\">// =&gt; resolved promise</span>\n});\n</code></pre>\n<hr>\n</div>\n<div>\n<h3 id=\"-a-id-dokker-jsdochtml-a-dokker-jsdochtml-options-\"><a id=\"Dokker-jsdocHtml\"></a><code>Dokker.jsdocHtml([options])</code></h3>\n<p><a href=\"#Dokker-jsdocHtml\">#</a> <a href=\"https://github.com/oceanhouse21/dokker/blob/master/dokker.js#L288\" title=\"View in source\">&#x24C8;</a> [&#x24C9;][1]</p>\n<p>Create an HTML file from the Markdown file that was create with \n<a href=\"#Dokker-jsdocMarkdown\">Dokker.jsdocMarkdown()</a></p>\n<h4 id=\"arguments\">Arguments</h4>\n<ol>\n<li><code>[options]</code> <em>(Object)</em>: The options object.</li>\n<li><code>[options.markdown=&apos;docs/READMDE.md&apos;]</code> <em>(string)</em>: The path where to save the Markdown file.</li>\n</ol>\n<h4 id=\"returns\">Returns</h4>\n<p><em>(Promise)</em>:  Returns a resolved promise if file was created.</p>\n<h4 id=\"example\">Example</h4>\n<pre><code class=\"lang-js\"><span class=\"hljs-keyword\">var</span> options = {\n  markdown: <span class=\"hljs-string\">&apos;docs/README.md&apos;</span>\n};\nDokker.jsdocHtml()\n.then(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\"></span>)</span>{\n  <span class=\"hljs-comment\">// =&gt; resolved promise</span>\n});\n</code></pre>\n<hr>\n</div>\n<div>\n<h3 id=\"-a-id-dokker-jsdocmarkdown-a-dokker-jsdocmarkdown-options-\"><a id=\"Dokker-jsdocMarkdown\"></a><code>Dokker.jsdocMarkdown([options])</code></h3>\n<p><a href=\"#Dokker-jsdocMarkdown\">#</a> <a href=\"https://github.com/oceanhouse21/dokker/blob/master/dokker.js#L237\" title=\"View in source\">&#x24C8;</a> [&#x24C9;][1]</p>\n<p>Create a Markdown file from JSDoc tags.</p>\n<h4 id=\"arguments\">Arguments</h4>\n<ol>\n<li><code>[options]</code> <em>(Object)</em>: The options object.</li>\n<li><code>[options.source=&apos;app.js&apos;]</code> <em>(String)</em>: The path the source code with JSDoc tags.</li>\n<li><code>[options.github =&apos;&apos;]</code> <em>(String)</em>: The path the Github repository.</li>\n<li><code>[options.markdown=&apos;docs/READMDE.md&apos;]</code> <em>(string)</em>: The path where to save the Markdown file.</li>\n</ol>\n<h4 id=\"returns\">Returns</h4>\n<p><em>(Promise)</em>:  Returns a resolved promise if file was created.</p>\n<h4 id=\"example\">Example</h4>\n<pre><code class=\"lang-js\"><span class=\"hljs-keyword\">var</span> options = {\n  source: <span class=\"hljs-string\">&apos;app.js&apos;</span>,\n  markdown: <span class=\"hljs-string\">&apos;docs/README.md&apos;</span>\n};\nDokker.jsdocMarkdown()\n.then(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\"></span>)</span>{\n  <span class=\"hljs-comment\">// =&gt; resolved promise</span>\n});\n</code></pre>\n<hr>\n</div>\n</div>\n<div>\n<h2 id=\"-literate-programming-methods-\"><code>&#x201C;Literate programming&#x201D; Methods</code></h2>\n<div>\n<h3 id=\"-a-id-dokker-literate-a-dokker-literate-options-\"><a id=\"Dokker-literate\"></a><code>Dokker.literate([options])</code></h3>\n<p><a href=\"#Dokker-literate\">#</a> <a href=\"https://github.com/oceanhouse21/dokker/blob/master/dokker.js#L189\" title=\"View in source\">&#x24C8;</a> [&#x24C9;][1]</p>\n<p>Create a styled HTML file from your source code with the help of <strong>docco</strong>\nmodule.</p>\n<h4 id=\"arguments\">Arguments</h4>\n<ol>\n<li><code>[options]</code> <em>(Object)</em>: The options object.</li>\n<li><code>[options.source=&apos;app.js&apos;]</code> <em>(String)</em>: The path the source code with comments</li>\n<li><code>[options.dir=&apos;docs/annotated&apos;]</code> <em>(string)</em>: The directory where to save the generated HTML file.</li>\n</ol>\n<h4 id=\"returns\">Returns</h4>\n<p><em>(Promise)</em>:  Returns a resolved promise if file was created.</p>\n<h4 id=\"example\">Example</h4>\n<pre><code class=\"lang-js\"><span class=\"hljs-keyword\">var</span> options = {\n  dir: <span class=\"hljs-string\">&apos;docs&apos;</span>,\n  source: <span class=\"hljs-string\">&apos;app.js&apos;</span>\n};\nDokker.literate()\n.then(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\"></span>)</span>{\n  <span class=\"hljs-comment\">// =&gt; resolved promise</span>\n});\n</code></pre>\n<hr>\n</div>\n</div>\n<div>\n<h2 id=\"-mocha-methods-\"><code>&#x201C;Mocha&#x201D; Methods</code></h2>\n<div>\n<h3 id=\"-a-id-dokker-createtests-a-dokker-createtests-options-\"><a id=\"Dokker-createTests\"></a><code>Dokker.createTests([options])</code></h3>\n<p><a href=\"#Dokker-createTests\">#</a> <a href=\"https://github.com/oceanhouse21/dokker/blob/master/dokker.js#L113\" title=\"View in source\">&#x24C8;</a> [&#x24C9;][1]</p>\n<p>Creates an HTML file to describe the features of your module from your\n<strong>Mocha</strong> tests. The module is using the mocha <strong>doc</strong> reporter to\ngenerate the HTML contents.</p>\n<h4 id=\"arguments\">Arguments</h4>\n<ol>\n<li><code>[options]</code> <em>(Object)</em>: The options object.</li>\n<li><code>[options.path=&apos;docs.html&apos;]</code> <em>(String)</em>: The path where to save the HTML file</li>\n</ol>\n<h4 id=\"returns\">Returns</h4>\n<p><em>(Promise)</em>:  Returns a resolved promise if file was created.</p>\n<h4 id=\"example\">Example</h4>\n<pre><code class=\"lang-js\"><span class=\"hljs-keyword\">var</span> options = {\n  path: <span class=\"hljs-string\">&apos;docs/tests.html&apos;</span>,\n};\nDokker.createTests(options)\n.then(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\"></span>)</span>{\n  <span class=\"hljs-comment\">// =&gt; resolved promise</span>\n});\n</code></pre>\n<hr>\n</div>\n</div>\n<div>\n<h2 id=\"-utility-methods-\"><code>&#x201C;Utility&#x201D; Methods</code></h2>\n<div>\n<h3 id=\"-a-id-dokker-configure-a-dokker-configure-options-\"><a id=\"Dokker-configure\"></a><code>Dokker.configure([options])</code></h3>\n<p><a href=\"#Dokker-configure\">#</a> <a href=\"https://github.com/oceanhouse21/dokker/blob/master/dokker.js#L361\" title=\"View in source\">&#x24C8;</a> [&#x24C9;][1]</p>\n<p>Helper function that takes a couple of options arguments and\nnormalises them and subsequently returns them.</p>\n<h4 id=\"arguments\">Arguments</h4>\n<ol>\n<li><code>[options]</code> <em>(Object)</em>: The options object.</li>\n<li><code>[options.li.markdown=&apos;docs/READMDE.md&apos;]</code> <em>(string)</em>: The path where to</li>\n<li><code>[options.source=&apos;app.js&apos;]</code> <em>(String)</em>: The path the source code with JSDoc tags.</li>\n<li><code>[options.jsdoc.markdown=&apos;docs/READMDE.md&apos;]</code> <em>(string)</em>: The path where to save the Markdown file.</li>\n<li><code>[options.jsdoc.README =&apos;READMDE.md&apos;]</code> <em>(string)</em>: The path to the project&#x2019;s README.md file</li>\n<li><code>[options.jsodc.template =&apos;templates/index.ejs.html&apos;]</code> <em>(String)</em>: The path to the ejs template.</li>\n<li><code>[options.mocha.template=&apos;templates/tests.ejs.html&apos;]</code> <em>(String)</em>: The path to the mocha template.</li>\n<li><code>[options.dir=&apos;docs&apos;]</code> <em>(String)</em>: The path where to store the generated files</li>\n</ol>\n<h4 id=\"returns\">Returns</h4>\n<p><em>(Promise)</em>:  Returns a resolved promise with edited options object</p>\n<h4 id=\"example\">Example</h4>\n<pre><code class=\"lang-js\"><span class=\"hljs-keyword\">var</span> options = {\n  dir: <span class=\"hljs-string\">&apos;docs&apos;</span>,\n  literate: {\n    source: <span class=\"hljs-string\">&apos;dokker.js&apos;</span>,\n    dir: <span class=\"hljs-string\">&apos;annotated&apos;</span>\n  },\n  jsdoc: {\n    title: <span class=\"hljs-string\">&apos;Dokker.js&apos;</span>,\n    source: <span class=\"hljs-string\">&apos;dokker.js&apos;</span>,\n    markdown: <span class=\"hljs-string\">&apos;README.md&apos;</span>,\n    html: <span class=\"hljs-string\">&apos;index.html&apos;</span>,\n    readme: <span class=\"hljs-string\">&apos;README.md&apos;</span>,\n  }\n};\nDokker.jsdocHtml()\n.then(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\"></span>)</span>{\n  <span class=\"hljs-comment\">// =&gt; object with absolute pathes to the directory from</span>\n  <span class=\"hljs-comment\">// which the command was executed</span>\n});\n</code></pre>\n<hr>\n</div>\n<div>\n<h3 id=\"-a-id-dokker-copytemplate-a-dokker-copytemplate-options-\"><a id=\"Dokker-copyTemplate\"></a><code>Dokker.copyTemplate([options])</code></h3>\n<p><a href=\"#Dokker-copyTemplate\">#</a> <a href=\"https://github.com/oceanhouse21/dokker/blob/master/dokker.js#L403\" title=\"View in source\">&#x24C8;</a> [&#x24C9;][1]</p>\n<p>Copy the template to local directory so that one can make changes to ejs\nfiles.</p>\n<h4 id=\"arguments\">Arguments</h4>\n<ol>\n<li><code>[options]</code> <em>(Object)</em>: The options object.</li>\n<li><code>[options.dir=&apos;templates&apos;]</code> <em>(string)</em>: The path where to save the template files</li>\n</ol>\n<h4 id=\"returns\">Returns</h4>\n<p><em>(Promise)</em>:  Returns a resolved promise if files were created.</p>\n<h4 id=\"example\">Example</h4>\n<pre><code class=\"lang-js\"><span class=\"hljs-keyword\">var</span> options = {\n  dir: <span class=\"hljs-string\">&apos;template&apos;</span>\n};\nDokker.copyTemplate()\n.then(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\"></span>)</span>{\n  <span class=\"hljs-comment\">// =&gt; resolved promise</span>\n});\n</code></pre>\n<hr>\n</div>\n<div>\n<h3 id=\"-a-id-dokker-init-a-dokker-init-\"><a id=\"Dokker-init\"></a><code>Dokker.init()</code></h3>\n<p><a href=\"#Dokker-init\">#</a> <a href=\"https://github.com/oceanhouse21/dokker/blob/master/dokker.js#L437\" title=\"View in source\">&#x24C8;</a> [&#x24C9;][1]</p>\n<p>Create a .dokker.json file to bootstrap any Dokker project</p>\n<h4 id=\"returns\">Returns</h4>\n<p><em>(Promise)</em>:  Returns a resolved promise if files were created.</p>\n<h4 id=\"example\">Example</h4>\n<pre><code class=\"lang-js\">Dokker.init()\n.then(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\"></span>)</span>{\n  <span class=\"hljs-comment\">// =&gt; resolved promise</span>\n});\n</code></pre>\n<hr>\n</div>\n<div>\n<h3 id=\"-a-id-dokker-watch-a-dokker-watch-\"><a id=\"Dokker-watch\"></a><code>Dokker.watch()</code></h3>\n<p><a href=\"#Dokker-watch\">#</a> <a href=\"https://github.com/oceanhouse21/dokker/blob/master/dokker.js#L462\" title=\"View in source\">&#x24C8;</a> [&#x24C9;][1]</p>\n<p>Starts a Node.js/Express webserver in docs directory to watch\nthe build Dokker project</p>\n<h4 id=\"returns\">Returns</h4>\n<p><em>(Promise)</em>:  Returns a resolved promise if files were created.</p>\n<h4 id=\"example\">Example</h4>\n<pre><code class=\"lang-js\">Dokker.init()\n.then(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function</span>(<span class=\"hljs-params\"></span>)</span>{\n  <span class=\"hljs-comment\">// =&gt; resolved promise</span>\n});\n</code></pre>\n<hr>\n</div>\n</div>\n<div>\n<h2 id=\"-methods-\"><code>Methods</code></h2>\n</div>\n<div>\n<h2 id=\"-properties-\"><code>Properties</code></h2>\n<div>\n<h3 id=\"-a-id-dokker-version-a-dokker-version-\"><a id=\"Dokker-VERSION\"></a><code>Dokker.VERSION</code></h3>\n<p><a href=\"#Dokker-VERSION\">#</a> <a href=\"https://github.com/oceanhouse21/dokker/blob/master/dokker.js#L23\" title=\"View in source\">&#x24C8;</a> [&#x24C9;][1]</p>\n<p>(string): The semantic version number.</p>\n<hr>\n</div>\n</div>\n\n    </div>\n  </div>\n  <script src=\"//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.6/highlight.min.js\"></script>\n</body>\n</html>\n"
  },
  {
    "path": "docs/styles.css",
    "content": "body,\nh1,\nh2,\nhtml,\np {\n    margin: 0;\n    padding: 0\n}\nhtml {\n    background: #d3d3d3;\n    height: 100%;\n    color: #222;\n    font-size: 100%\n}\nbody {\n    background: #fff;\n    width: 60em;\n    margin: 0 auto;\n    -webkit-box-shadow: 0 0 2.5em #5d656c;\n    -moz-box-shadow: 0 0 2.5em #5d656c;\n    box-shadow: 0 0 2.5em #5d656c;\n    font: 1em/1.7'Helvetica Neue', Helvetica, Arial, sans-serif;\n    min-height: 100%\n}\ncode {\n    /*font-family: 'Roboto', 'Helvetica Neue', sans-serif;*/\n    font-family: 'Source Code Pro', Consolas, 'Courier New', monospace;\n    letter-spacing: 0.03em;\n}\n.lang-js {\n  color: #78dbf9;\n}\nspan.hljs-number {\n  color: #d59cf6;\n}\nspan.hljs-string{\n  color: #8bdb97;\n}\nspan.hljs-regexp{\n  color: #dbad83;\n}\nspan.hljs-literal{\n  color: #e26a78;\n}\nspan.hljs-keyword{\n  color: #d59cf6;\n}\nspan.hljs-comment {\n  color: #99a4c7;\n}\nspan.hljs-special {\n  color: #bdc4df;\n}\npre {\n    box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.137255);\n    box-shadow: 0px 0px 2px 1px rgba(0, 0, 0, 0.0980392);\n    box-shadow: 0px 0px 5px 1px rgba(0, 0, 0, 0.0823529);\n    border-bottom-left-radius: 5px;\n    border-bottom-right-radius: 5px;\n    background: #2b303b;\n    margin: 1em 0;\n    padding: .5em 20px;\n    overflow-x: scroll;\n    -webkit-overflow-scrolling: touch\n}\npre.intro {\n    font-size: 1.2em\n}\npre::-webkit-scrollbar {\n    height: 8px\n}\npre::-webkit-scrollbar-thumb {\n    background: rgba(255, 255, 255, .8);\n    -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .5);\n    -webkit-border-radius: 10px;\n    border-radius: 10px\n}\npre::-webkit-scrollbar-thumb:window-inactive {\n    background: rgba(255, 255, 255, .4)\n}\nh1 span,\npre {\n    color: #ddd\n}\nh1,\nh2,\nh3,\nh4,\nol,\np,\nul {\n    font-weight: 400;\n    padding: 0 20px;\n    word-wrap: break-word\n}\nhgroup h1 {\n    display: inline\n}\nhgroup h2 {\n    font-size: 1.38em\n}\nh2,\nh3,\nh4 {\n    margin: 0 0 .5em\n}\nh4 {\n    font-weight: 700\n}\na {\n    color: #222;\n    border-bottom: 1px solid #ddd;\n    text-decoration: none\n}\na:focus,\na:hover {\n    border-color: #222\n}\na img {\n    border: 0\n}\nabbr[title] {\n    border-bottom: 1px dotted #ddd;\n    cursor: help\n}\nhr {\n    display: none\n}\np {\n    margin-bottom: 1em\n}\nol,\nul {\n    margin-left: 2em\n}\nol ol,\nul ul {\n    margin-left: 1em;\n    padding: 0\n}\nfooter {\n    display: block;\n    background: #eee;\n    padding: 1em 0;\n    text-align: center\n}\n.a-img {\n    border: 0\n}\n.a-img img {\n    padding: .5em 0 0\n}\n.description {\n    word-wrap: break-word\n}\n.multiline-items li {\n    padding-bottom: 1em\n}\n.multiline-items li.last-item {\n    padding-bottom: 0\n}\n.br0 {\n    color: #090\n}\n.co1 {\n    color: #060\n}\n.co2 {\n    color: #096\n}\n.kw1,\n.kw3 {\n    color: #006\n}\n.kw2 {\n    color: #036\n}\n.me1 {\n    color: #606\n}\n.nu0 {\n    color: #c00\n}\n.st0 {\n    color: #36c\n}\n.sy0 {\n    color: #393;\n    font-weight: 700\n}\npre .co1 {\n    color: #aeaeae\n}\n.es0,\npre .st0 {\n    color: #61ce3c\n}\npre .co2 {\n    color: #fff\n}\npre .kw2,\npre .kw3,\npre .nu0 {\n    color: #fbde2d\n}\npre .me1 {\n    color: #8da6ce\n}\npre .br0,\npre .kw1,\npre .sy0 {\n    color: #ddd\n}\n#docs {\n    background: #fff\n}\n#docs body {\n    font-size: .85em;\n    width: 100%\n}\n#docs a.alias {\n    opacity: .5\n}\n#docs div div div div {\n    box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.137255);\n    box-shadow: 0px 0px 2px 1px rgba(0, 0, 0, 0.0980392);\n    box-shadow: 0px 0px 5px 1px rgba(0, 0, 0, 0.0823529);\n    border-bottom-left-radius: 5px;\n    border-bottom-right-radius: 5px;\n}\n#docs div div div {\n    border-top: 0;\n    margin: 0 .5em 1em\n}\n#docs h1,\n#docs h2,\n#docs h3,\n#docs h4,\n#docs ol,\n#docs p,\n#docs ul {\n    padding: 0 10px\n}\n#docs pre {\n    margin: 0;\n    padding: .5em 10px\n}\n#docs ul li {\n    list-style-type: none;\n    margin: 0 0 0 -.9em\n}\n#docs h1 {\n    padding: 0 10px\n}\n#docs h2 {\n    margin: .5em 0 0\n}\n#docs h3 {\n    background: rgb(63, 107, 196);\n    border-radius: 3px 3px 0 0;\n    border: 1px solid rgba(75, 71, 71, 0.14);\n    margin: .5em 0;\n    padding: .8em 0 .8em 10px;\n    position: relative\n}\n#docs h3>code {\n    color: #fbfbfb\n}\n#docs h3 a {\n    position: absolute;\n    top: 0\n}\n#docs h3 .br0 {\n    color: #fc83ff\n}\n#docs h3 .kw2 {\n    color: #71d0c9\n}\n#docs h3 .me1 {\n    color: #fff\n}\n#docs h3 .nu0 {\n    color: #d0cb71\n}\n#docs h3 .sy0 {\n    color: #df74e2;\n    font-weight: 700\n}\n#docs footer {\n    height: 3em;\n    margin-top: 1.5em;\n    width: 100%\n}\n#social {\n    height: 20px\n}\n#social .twitter-follow-button {\n    width: 127px!important\n}\n#social .twitter-follow-button,\n.twitter-share-button {\n    font-size: .8em;\n    vertical-align: top\n}\n@media (max-width: 959px) {\n    body {\n        border: 0;\n        margin: 0;\n        -moz-box-shadow: none;\n        -webkit-box-shadow: none;\n        box-shadow: none;\n        width: auto\n    }\n    h1,\n    h2,\n    h3,\n    h4,\n    ol,\n    p,\n    ul {\n        padding: 0 10px\n    }\n    pre {\n        padding: 5px 10px!important\n    }\n    #social {\n        height: auto\n    }\n    .toc-container a {\n        display: block;\n        padding: 5px\n    }\n    .toc-container a:focus,\n    .toc-container a:hover {\n        background-color: #EEE\n    }\n    .toc-container a:active {\n        background-color: #CCC\n    }\n}\n@media (min-width: 960px) {\n    #docs body {\n        box-shadow: none;\n        height: 100%;\n        margin: 0\n    }\n    #docs a[href=\"#docs\"],\n    #docs footer {\n        display: none\n    }\n    #docs h1 {\n        position: fixed;\n        background-color: #fff;\n        top: 0;\n        left: 0;\n        right: 0;\n        z-index: 1\n    }\n    #docs h3 a {\n        display: block;\n        position: relative;\n        visibility: hidden;\n        top: -4em\n    }\n    #docs .toc-container {\n        background: #fff;\n        bottom: 0;\n        left: 0;\n        overflow-y: scroll;\n        overflow-x: hidden;\n        position: fixed;\n        top: 1.5em;\n        white-space: nowrap;\n        width: 20%;\n        -webkit-overflow-scrolling: touch\n    }\n    #docs .toc-container h2,\n    #docs .toc-container ul {\n        margin-top: 0;\n        padding: 0 10px\n    }\n    #docs .doc-container {\n        background: #fff;\n        width: 80%;\n        margin-left: 20%;\n        padding-top: 1.5em\n    }\n    #docs .doc-container .first-heading {\n        margin-top: 0\n    }\n}\n@media (-ms-high-contrast: active) and (max-width: 1280px),\n(-ms-high-contrast: none) and (max-width: 1280px) {\n    #docs .doc-container,\n    #docs .toc-container {\n        position: relative;\n        top: auto;\n        width: 100%\n    }\n    #docs .doc-container .first-heading {\n        margin-top: .5em\n    }\n    #docs a[href=\"#docs\"] {\n        display: inline\n    }\n    #docs footer {\n        display: block\n    }\n}\n@media (orientation: portrait) and (min-device-width: 720px) and (max-device-width: 768px),\n(orientation: landscape) and (device-width: 1280px) and (max-device-height: 768px) {\n    @-ms-viewport{width:80%}}\n"
  },
  {
    "path": "docs/tests.html",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <meta name=\"author\" content=\"Dokker.js\">\n    <meta name=\"description\" content=\"This API documentation is built with Dokker.js at dokkerjs.com\">\n    <title>Dokker.js</title>\n    <script src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js\"></script>\n    <style>\n      body {\n        font: 16px/1.6 \"Helvetica Neue\", arial, sans-serif;\n        padding: 60px;\n      }\n      pre { font-size: 14px; line-height: 1.3 }\n      code .init { color: #2F6FAD }\n      code .string { color: #5890AD }\n      code .keyword { color: #8A6343 }\n      code .number { color: #2F6FAD }\n    </style>\n    <script>\n      $(function(){\n        $('code').each(function(){\n          $(this).html(highlight($(this).text()));\n        });\n      });\n\n      function highlight(js) {\n        return js\n          .replace(/</g, '&lt;')\n          .replace(/>/g, '&gt;')\n          .replace(/\\/\\/(.*)/gm, '<span class=\"comment\">//$1</span>')\n          .replace(/('.*')/gm, '<span class=\"string\">$1</span>')\n          .replace(/(\\d+\\.\\d+)/gm, '<span class=\"number\">$1</span>')\n          .replace(/(\\d+)/gm, '<span class=\"number\">$1</span>')\n          .replace(/\\bnew *(\\w+)/gm, '<span class=\"keyword\">new</span> <span class=\"init\">$1</span>')\n          .replace(/\\b(function|new|throw|return|var|if|else)\\b/gm, '<span class=\"keyword\">$1</span>')\n      }\n    </script>\n  </head>\n  <body>\n        <section class=\"suite\">\n      <h1>Dokker</h1>\n      <dl>\n        <section class=\"suite\">\n          <h1>.literate()</h1>\n          <dl>\n            <dt>creates a HTML file from annotated source code</dt>\n            <dd><pre><code>return Dokker.literate(options.literate)\n.then(function(){\n  done();\n}).done();</code></pre></dd>\n          </dl>\n        </section>\n        <section class=\"suite\">\n          <h1>.jsdocMarkdown()</h1>\n          <dl>\ndocco: /Users/georgschlenkhoff/Downloads/dokker/.tmp/dokker.js -> /Users/georgschlenkhoff/Downloads/dokker/docs/annotated/dokker.html\n            <dt>creates a markdown file from JSDOC comments</dt>\n            <dd><pre><code>return Dokker.jsdocMarkdown(options.jsdoc)\n.then(function(){\n  return read(options.jsdoc.markdown);\n}).then(function(){\n  done();\n}).done();</code></pre></dd>\n          </dl>\n        </section>\n        <section class=\"suite\">\n          <h1>.jsdocHtml()</h1>\n          <dl>\n            <dt>creates a HTML file from JSDOC commments</dt>\n            <dd><pre><code>return Dokker.jsdocHtml(options.jsdoc)\n.then(function(){\n  return read(options.jsdoc.html);\n}).then(function(){\n  done();\n}).done();</code></pre></dd>\n          </dl>\n        </section>\n        <section class=\"suite\">\n          <h1>.injectTemplate()</h1>\n          <dl>\n            <dt>injects index.html file in ejs template</dt>\n            <dd><pre><code>return Dokker.injectTemplate(options.jsdoc)\n.then(function() {\n  return read(options.jsdoc.html, 'utf8');\n}).then(function(data){\n  assert(/&lt;!DOCTYPE html&gt;/.test(data));\n  done();\n}).done();</code></pre></dd>\n          </dl>\n        </section>\n        <section class=\"suite\">\n          <h1>.copyTemplate()</h1>\n          <dl>\n            <dt>copies styles and app.js from template folder</dt>\n            <dd><pre><code>return Dokker.copyTemplate(options)\n.then(function(){\n  return read(path.join(__dirname, '..', options.dir, 'styles.css'));\n}).then(function(data){\n  assert(data);\n  done();\n}).done();</code></pre></dd>\n          </dl>\n        </section>\n      </dl>\n    </section>\n\n  </body>\n</html>\n"
  },
  {
    "path": "dokker.js",
    "content": "//     Dokker.js 0.0.1\n//     http://dokker.oceanhouse21.com\n//     (c) 2014-2015 Georg Schlenkhoff and Oceanhouse21\n//     Dokker.js may be freely distributed under the MIT license.\n\n'use strict';\n\n// Define required dependencies\nvar Promise = require('promise');\nvar fs = require('fs');\nvar path = require('path');\nvar read = Promise.denodeify(fs.readFile);\nvar write = Promise.denodeify(fs.writeFile);\nvar docco = require('docco');\nvar docdown = require('docdown');\nvar marked = require('marked');\nvar ejs = require('ejs');\nvar cheerio = require('cheerio');\nvar exec = require('child_process').exec;\nvar Dokker = {};\n\n/**\n * The semantic version number.\n *\n * @static\n * @memberOf Dokker\n * @type string\n */\nDokker.VERSION = '0.1.2';\n\n/**\n * Creates a HTML file that transcludes the HTML snippet that was created\n * by the docdown module into an ejs template which is defined by the \n * .dokker.json configuration file.\n *\n * @static\n * @category JSDoc\n * @memberOf Dokker\n * @type Function\n * @param {Object} [options] The options object.\n * @param {String} [options.template='template/index.ejs.html'] The path to\n * the ejs template file.\n * @param {string} [options.html='docs/index.html'] The path to the docdown\n * generated JSDoc documentation.\n * @param {string} [options.readme='README.md'] The path to the README.md\n * file.\n * @param {string} [options.title=''] The title for the documentation.\n * @returns {Promise} Returns a resolved promise if file was created.\n * @example\n *\n * var options = {\n *   template: 'template/index.ejs.html',\n *   html: 'docs/index.html',\n *   readme: 'docs/README.md',\n *   title: 'Dokker.js API Documentation'\n * };\n * Dokker.injectTemplate(options)\n * .then(function(){\n *   // => resolved promise\n * });\n */\n// Transclude in a ejs template file the HTML snippet that was ultimately\n// created with docdown. Also tweak the HTML page a bit and finally\n// inject the README.md.\nDokker.injectTemplate = function(options) {\n  return new Promise(function(resolve, reject) {\n    var template, body, html, readme, $;\n    return read(options.template, 'utf8')\n    .then(function(data) {\n      template = data;\n      return read(options.readme, 'utf8');\n    }).then(function(data) {\n      readme = marked(data);\n      $ = cheerio.load(readme);\n      $('h1').remove();\n      readme = $.html();\n      return read(options.html, 'utf8');\n    }).then(function(data) {\n      $ = cheerio.load(data);\n      return ejs.render(template, {\n        apiToc: $('.toc-container').html(),\n        readme: readme,\n        apiDoc: $('.doc-container').html(),\n        // correctly setting links to your github/pages\n        page_url: options.site,\n        title: options.title,\n        github_url: options.github,\n        // fixed reference to generated annotation\n        // the 'literate' in .dokker.json shall not require a source since it's never used.\n        annotated_path: 'annotated/'+options.source\n      });\n    }).then(function(data) {\n      return write(options.html, data, 'utf8');\n    }).then(function() {\n      resolve();\n    }).then(null, function(err) {\n      reject(err);\n    });\n  });\n};\n\n/**\n * Creates an HTML file to describe the features of your module from your\n * **Mocha** tests. The module is using the mocha **doc** reporter to\n * generate the HTML contents.\n *\n * @static\n * @memberOf Dokker\n * @category Mocha\n * @type Function\n * @param {Object} [options] The options object.\n * @param {String} [options.path='docs.html'] The path where to save the\n * HTML file\n * @returns {Promise} Returns a resolved promise if file was created.\n * @example\n *\n * var options = {\n *   path: 'docs/tests.html',\n * };\n * Dokker.createTests(options)\n * .then(function(){\n *   // => resolved promise\n * });\n */\n// Create a HTML site from any mocha tests find when executing mocha\n// --reporter doc terminal command.\nDokker.createTests = function(options) {\n  return new Promise(function(resolve, reject) {\n    var template, tests;\n    // allows specification of mocha.command in .dokker.json, e.g. 'mocha -u tdd --reporter doc'\n    var cmd = options.command || 'mocha --reporter doc';\n    exec(cmd, {cwd: process.cwd()}, function(error, stdout) {\n      if(error) return reject(error);\n      tests = stdout;\n      return read(options.template, 'utf8')\n      .then(function(data) {\n        template = data;\n        return ejs.render(template, {tests: tests});\n      }).then(function(data) {\n        return write(options.path, data, 'utf8');\n      }).then(function() {\n        resolve();\n      }).then(null, function(err) {\n        reject(err);\n      });\n    });\n  });\n};\n\n/**\n * Runs a terminal shell with the git command to extract the docs branch\n * into a seperate gh-pages branch and finally pushes that branch to Github,\n * so that the Github page is updated.\n *\n * @static\n * @memberOf Dokker\n * @category Github Pages\n * @type Function\n * @returns {Promise} Returns a resolved promise if file was created.\n * @example\n *\n * Dokker.ghPages()\n * .then(function(){\n *   // => resolved promise\n * });\n */\n// Extract docs folder to separate git branch and finally push branch to\n// Github repository\nDokker.ghPages = function(){\n  return new Promise(function(resolve, reject) {\n    exec('git subtree split -P docs -b gh-pages', function(error, stdout, stderr) {\n      if(error) return reject(stderr);\n      exec('git push origin gh-pages', function(error, stdout, stderr) {\n        if(error) return reject(stderr);\n        resolve();\n      });\n    });\n  });\n};\n\n/**\n * Create a styled HTML file from your source code with the help of **docco**\n * module.\n *\n * @static\n * @memberOf Dokker\n * @category Literate programming\n * @type Function\n * @param {Object} [options] The options object.\n * @param {String} [options.source='app.js'] The path the source code with\n * comments\n * @param {string} [options.dir='docs/annotated'] The directory where to save\n * the generated HTML file.\n * @returns {Promise} Returns a resolved promise if file was created.\n * @example\n *\n * var options = {\n *   dir: 'docs',\n *   source: 'app.js'\n * };\n * Dokker.literate()\n * .then(function(){\n *   // => resolved promise\n * });\n */\n// Create an HTML file from any source code comments in the style of\n// [literate programming](https://de.wikipedia.org/wiki/Literate_programming)\nDokker.literate = function (options) {\n  return new Promise(function(resolve, reject) {\n    var tmpDir = path.join(process.cwd(), '/.tmp');\n    var tmpFile = path.join(tmpDir, options.source);\n    var sourceFile = (options.cwd) ?\n      path.join(process.cwd(), options.cwd, options.source) :\n      path.join(process.cwd(), options.source);\n    return read(sourceFile, 'utf8')\n    .then(function(data) {\n      var source = data.replace(/^\\s*(\\*|\\/\\*).*[\\r\\n]/gm, '');\n      return Dokker.mkdir(tmpDir)\n      .then(function() {\n        return write(tmpFile, source, 'utf8');\n      }).then(function(){\n        docco.run(['', '', tmpFile, '-o', options.dir]);\n        resolve();\n      });\n    }).then(null, function(err) {\n      if (err) return reject(err);\n    });\n  });\n};\n\n/**\n * Create a Markdown file from JSDoc tags.\n *\n * @static\n * @memberOf Dokker\n * @category JSDoc\n * @type Function\n * @param {Object} [options] The options object.\n * @param {String} [options.source='app.js'] The path the source code with\n * JSDoc tags.\n * @param {String} [options.github =''] The path the Github repository.\n * @param {string} [options.markdown='docs/READMDE.md'] The path where to\n * save the Markdown file.\n * @returns {Promise} Returns a resolved promise if file was created.\n * @example\n *\n * var options = {\n *   source: 'app.js',\n *   markdown: 'docs/README.md'\n * };\n * Dokker.jsdocMarkdown()\n * .then(function(){\n *   // => resolved promise\n * });\n */\n// Convert markdown from any source code comments with docdown module.\nDokker.jsdocMarkdown = function (options) {\n  return new Promise(function(resolve, reject) {\n    var source, tmpFile, tmpDir;\n    var sourceFile = (options.cwd) ?\n      path.join(process.cwd(), options.cwd, options.source) :\n      path.join(process.cwd(), options.source);\n    return read(sourceFile, 'utf8')\n    .then(function(data){\n      source = data.replace(/^\\s*(\\/\\/).*[\\r\\n]/gm, '');\n      tmpDir = path.join(process.cwd(), '/.tmp');\n      return Dokker.mkdir(tmpDir);\n    }).then(function(){\n      tmpFile = path.join(tmpDir, options.source);\n      return write(tmpFile, source, 'utf8');\n    }).then(function(){\n      var markdown = docdown({\n        'path': tmpFile,\n        'url': options.github,\n        'toc': 'categories'\n      });\n      return write(options.markdown, markdown, 'utf8');\n    }).then(function() {\n      resolve();\n    }).then(null, function(err) {\n      reject(err);\n    });\n  });\n};\n\n/**\n * Create an HTML file from the Markdown file that was create with \n * [Dokker.jsdocMarkdown()](#Dokker-jsdocMarkdown)\n *\n * @static\n * @memberOf Dokker\n * @category JSDoc\n * @type Function\n * @param {Object} [options] The options object.\n * @param {string} [options.markdown='docs/READMDE.md'] The path where to\n * save the Markdown file.\n * @returns {Promise} Returns a resolved promise if file was created.\n * @example\n *\n * var options = {\n *   markdown: 'docs/README.md'\n * };\n * Dokker.jsdocHtml()\n * .then(function(){\n *   // => resolved promise\n * });\n */\n// Create an HTML file from any source code comments in the style of\n// [literate programming](https://de.wikipedia.org/wiki/Literate_programming)\nDokker.jsdocHtml = function (options) {\n  return new Promise(function(resolve, reject) {\n    return read(options.markdown, 'utf8')\n    .then(function(data) {\n      var html = marked(data).replace(/<!-- /g,'<').replace(/ -->/g,'>');\n      return write(options.html, html, 'utf8');\n    }).then(function() {\n      resolve();\n    }).then(null, function(err) {\n      reject(err);\n    });\n  });\n};\n\n// Internal helper function that creates any directory if not existing.\nDokker.mkdir = function(dir) {\n  return new Promise(function(resolve, reject) {\n    fs.exists(dir, function(exists) {\n      if (exists) {\n        resolve();\n      } else {\n        fs.mkdir(dir, function(err) {\n          if (err) return reject(err);\n          resolve();\n        });\n      }\n    });\n  });\n};\n\n/**\n * Helper function that takes a couple of options arguments and\n * normalises them and subsequently returns them.\n *\n * @static\n * @memberOf Dokker\n * @category Utility\n * @type Function\n * @param {Object} [options] The options object.\n * @param {string} [options.li.markdown='docs/READMDE.md'] The path where to\n * @param {String} [options.source='app.js'] The path the source code with\n * JSDoc tags.\n * @param {string} [options.jsdoc.markdown='docs/READMDE.md'] The path where to\n * save the Markdown file.\n * @param {string} [options.jsdoc.README ='READMDE.md'] The path to the\n * project's README.md file\n * @param {String} [options.jsodc.template ='templates/index.ejs.html'] The\n * path to the ejs template.\n * @param {String} [options.mocha.template='templates/tests.ejs.html'] The\n * path to the mocha template.\n * @param {String} [options.dir='docs'] The path where to store the generated\n * files\n * @returns {Promise} Returns a resolved promise with edited options object\n * @example\n *\n * var options = {\n *   dir: 'docs',\n *   literate: {\n *     source: 'dokker.js',\n *     dir: 'annotated'\n *   },\n *   jsdoc: {\n *     title: 'Dokker.js',\n *     source: 'dokker.js',\n *     markdown: 'README.md',\n *     html: 'index.html',\n *     readme: 'README.md',\n *   }\n * };\n * Dokker.jsdocHtml()\n * .then(function(){\n *   // => object with absolute pathes to the directory from\n *   // which the command was executed\n * });\n */\n// Parses the options file, .Dokker.json, and sets the default parameters.\nDokker.configure = function(options) {\n  return new Promise(function(resolve, reject){\n    var file = path.join(process.cwd(), '.dokker.json');\n    return read(file, 'utf8')\n    .then(function(data) {\n      data = JSON.parse(data);\n      data.jsdoc.template = (data.jsdoc.template) ? path.join(process.cwd(), data.jsdoc.template) : path.join(__dirname, 'templates/index.ejs.html');\n      data.mocha.template = (data.mocha.template) ? path.join(process.cwd(), data.mocha.template) : path.join(__dirname, 'templates/tests.ejs.html');\n      data.mocha.path = path.join(process.cwd(), data.dir, data.mocha.path);\n      // mocha.command commented out to fix build-breaking bug\n      // specifies mocha command in .dokker.json; e.g. mocha -u tdd -R spec\n      // data.mocha.command = path.join(process.cwd(), data.dir, data.mocha.command);\n      data.literate.dir = path.join(process.cwd(), data.dir, data.literate.dir);\n      data.jsdoc.markdown = path.join(process.cwd(), data.dir, data.jsdoc.markdown);\n      data.jsdoc.html = path.join(process.cwd(), data.dir, data.jsdoc.html);\n      data.jsdoc.readme = path.join(process.cwd(), data.jsdoc.readme);\n      resolve(data);\n    }).then(null, function(err) {\n      reject(err);\n    });\n  });\n};\n\n/**\n * Copy the template to local directory so that one can make changes to ejs\n * files.\n *\n * @static\n * @memberOf Dokker\n * @category Utility\n * @type Function\n * @param {Object} [options] The options object.\n * @param {string} [options.dir='templates'] The path where to save the\n * template files\n * @returns {Promise} Returns a resolved promise if files were created.\n * @example\n *\n * var options = {\n *   dir: 'template'\n * };\n * Dokker.copyTemplate()\n * .then(function(){\n *   // => resolved promise\n * });\n */\n// Copy starter template to bootstrap any Dokker project.\nDokker.copyTemplate = function(options) {\n  return new Promise(function(resolve, reject) {\n    var templatesDir = path.join(process.cwd(), 'templates');\n    return Dokker.mkdir(templatesDir)\n    .then(function() {\n      var oldStyle = path.join(__dirname, 'templates', 'styles.css');\n      var newStyle = path.join(process.cwd(), options.dir, 'styles.css');\n      fs.createReadStream(oldStyle).pipe(fs.createWriteStream(newStyle));\n      var oldLogo = path.join(__dirname, 'templates', 'logo.png');\n      var newLogo = path.join(process.cwd(), options.dir, 'logo.png');\n      fs.createReadStream(oldLogo).pipe(fs.createWriteStream(newLogo));\n      var oldApp = path.join(__dirname, 'templates', 'app.js');\n      var newApp = path.join(process.cwd(), options.dir, 'app.js');\n      fs.createReadStream(oldApp).pipe(fs.createWriteStream(newApp));\n      resolve();\n    });\n  });\n};\n\n/**\n * Create a .dokker.json file to bootstrap any Dokker project\n *\n * @static\n * @memberOf Dokker\n * @category Utility\n * @type Function\n * @returns {Promise} Returns a resolved promise if files were created.\n * @example\n *\n * Dokker.init()\n * .then(function(){\n *   // => resolved promise\n * });\n */\n// Copies the .Dokker.json file to bootstrap any Dokker project.\nDokker.init = function(){\n  return new Promise(function(resolve, reject) {\n    var oldDok = path.join(__dirname, '.dokker.json');\n    var newDok = path.join(process.cwd(), '.dokker.json');\n    fs.createReadStream(oldDok).pipe(fs.createWriteStream(newDok));\n    resolve();\n  });\n};\n\n/**\n * Starts a Node.js/Express webserver in docs directory to watch\n * the build Dokker project\n *\n * @static\n * @memberOf Dokker\n * @category Utility\n * @type Function\n * @returns {Promise} Returns a resolved promise if files were created.\n * @example\n *\n * Dokker.init()\n * .then(function(){\n *   // => resolved promise\n * });\n */\n// Starts the Node.js/Express server to watch Dokker.js project\n// documentation.\nDokker.watch = function(options) {\n  var gulpex = require(__dirname + '/gulpfile.js').gulpex;\n  return gulpex();\n  // return new Promise(function(resolve, reject){ \n  //   exec('DIR='+ options.dir + ' node ' + options.dir + '/app.js', function(error, stdout, stderr){\n  //     if(error) return reject(stderr);\n  //   });\n  // });\n};\n\nmodule.exports = Dokker;\n"
  },
  {
    "path": "gulpfile.js",
    "content": "// dependencies\nvar browserSync = require('browser-sync').create();\nvar cp = require('child_process');\nvar gulp = require('gulp');\nvar path = require('path');\nvar q = require('q');\n\n// working path\nvar wpath = path.join(process.cwd());\n\n// gulp entry point\ngulp.task('default', ['start']);\ngulp.task('start', ['build', 'reload', 'watch']);\n\n// watch for file changes in wpath\ngulp.task('watch', ['reload'], function() {\n    gulp.watch(wpath + '/*.js', ['build', 'reload'])\n})\n\n// gulp.task('build', exec.bind('some build command here'))\ngulp.task('build', exec.bind((wpath+'/node_modules/dokker/bin/dokker').replace(/\\s/, '\\\\ ')))\n// Reloading browserSync\ngulp.task('reload', ['build'], reload);\n\n// reload browserSync\nfunction reload() {\n    var defer = q.defer();\n\n    if (browserSync.active) {\n        browserSync.reload();\n        defer.resolve();\n    } else\n    startServer().then(defer.resolve);\n\n    return defer.promise;\n}\n\n// start a browserSync server to index.html directly\nfunction startServer() {\n    var defer = q.defer();\n\n    var serverConfig = {\n        server: {\n            baseDir: wpath,\n            directory: true\n        },\n        startPath: 'docs/index.html',\n        // browser: \"google chrome\",\n        logPrefix: 'SERVER'\n    };\n    browserSync.init(serverConfig, defer.resolve);\n\n    return defer.promise;\n}\n\n// terminal exec task with promise: use as exec.bind(<command>)\nfunction exec() {\n    var defer = q.defer();\n    cp.exec(this, function(err, stdout, stderr) {\n        if (err) console.log('exec err: '+ err);\n        console.log(stdout);\n        defer.resolve(err)\n    })\n    return defer.promise;\n}\n\n// // export for normal render run\nfunction gulpex(options){\n\t// set process.env.DIR then run task\n\t// return exec.bind('DIR='+ options.dir)()\n\t// .done(gulp.start('default'))\n\treturn gulp.start('default')\n}\nexports.gulpex = gulpex;"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"dokker\",\n  \"version\": \"0.1.3\",\n  \"description\": \"Dokker.js creates professional Javascript code documentations.\",\n  \"preferGlobal\": true,\n  \"bin\": {\n    \"dokker\": \"./bin/dokker\",\n    \"gh-pages\": \"./bin/gh-pages\",\n    \"dokker-init\": \"./bin/dokker-init\",\n    \"dokker-watch\": \"./bin/dokker-watch\"\n  },\n  \"main\": \"dokker.js\",\n  \"scripts\": {\n    \"test\": \"mocha\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/oceanhouse21/dokker.git\"\n  },\n  \"keywords\": [\n    \"documentation\",\n    \"JSDOC\",\n    \"docca\",\n    \"Javascript\"\n  ],\n  \"author\": \"Georg Schlenkhoff\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/oceanhouse21/dokker/issues\"\n  },\n  \"homepage\": \"https://dokkerjs.com\",\n  \"dependencies\": {\n    \"browser-sync\": \"^2.7.12\",\n    \"cheerio\": \"^0.19.0\",\n    \"docco\": \"^0.7.0\",\n    \"docdown\": \"^0.2.0\",\n    \"ejs\": \"^2.3.1\",\n    \"gulp\": \"^3.9.0\",\n    \"lodash\": \"^3.9.3\",\n    \"marked\": \"^0.3.3\",\n    \"nodemon\": \"^1.3.7\",\n    \"promise\": \"^7.0.3\",\n    \"q\": \"^1.4.1\"\n  },\n  \"devDependencies\": {\n    \"express\": \"^4.13.0\",\n    \"mocha\": \"^2.2.5\"\n  }\n}\n"
  },
  {
    "path": "templates/app.js",
    "content": "var express = require('express');\nvar app = express();\nvar path = require('path');\nvar livereload = require('livereload');\nvar path = path.join(process.cwd(), process.env.DIR);\nlivereload.createServer({exts: ['applyJSLive']}).watch(path);\napp.use(express.static(path));\napp.listen(9000);\n"
  },
  {
    "path": "templates/index.ejs.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\" id=\"docs\">\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\n  <meta name=\"author\" content=\"Dokker.js\">\n  <meta name=\"description\" content=\"This API documentation is built with Dokker.js at dokkerjs.com\">\n  <title><%= title %></title>\n  <link href='http://fonts.googleapis.com/css?family=Source+Code+Pro' rel='stylesheet' type='text/css'>\n  <link rel=\"stylesheet\" href=\"styles.css\" media=\"all\">\n  <link rel=\"stylesheet\" href=\"//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.6/styles/default.min.css\">\n</head>\n<body>\n  <div class=\"toc-container\">\n    <h2><code><a href=<%= page_url %>><%= title %></a></code></h2>\n    <ul>\n      <li><a href=\"#\">Introduction</a></li>\n      <li><a href=<%= github_url %>>Github Repository</a></li>\n      <li><a href=\"tests.html\">Test suite</a></li>\n      <li><a href=<%= annotated_path %>>Annotated Source</a></li>\n    </ul>\n    <%- apiToc %>\n  </div>\n  <div class=\"doc-container\">\n    <div>  \n      <%- readme %>\n      <h2>API documentation</h2>\n      <%- apiDoc %>\n    </div>\n  </div>\n  <script src=\"//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.6/highlight.min.js\"></script>\n</body>\n</html>\n"
  },
  {
    "path": "templates/styles.css",
    "content": "body,\nh1,\nh2,\nhtml,\np {\n    margin: 0;\n    padding: 0\n}\nhtml {\n    background: #d3d3d3;\n    height: 100%;\n    color: #222;\n    font-size: 100%\n}\nbody {\n    background: #fff;\n    width: 60em;\n    margin: 0 auto;\n    -webkit-box-shadow: 0 0 2.5em #5d656c;\n    -moz-box-shadow: 0 0 2.5em #5d656c;\n    box-shadow: 0 0 2.5em #5d656c;\n    font: 1em/1.7'Helvetica Neue', Helvetica, Arial, sans-serif;\n    min-height: 100%\n}\ncode {\n    /*font-family: 'Roboto', 'Helvetica Neue', sans-serif;*/\n    font-family: 'Source Code Pro', Consolas, 'Courier New', monospace;\n    letter-spacing: 0.03em;\n}\n.lang-js {\n  color: #78dbf9;\n}\nspan.hljs-number {\n  color: #d59cf6;\n}\nspan.hljs-string{\n  color: #8bdb97;\n}\nspan.hljs-regexp{\n  color: #dbad83;\n}\nspan.hljs-literal{\n  color: #e26a78;\n}\nspan.hljs-keyword{\n  color: #d59cf6;\n}\nspan.hljs-comment {\n  color: #99a4c7;\n}\nspan.hljs-special {\n  color: #bdc4df;\n}\npre {\n    box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.137255);\n    box-shadow: 0px 0px 2px 1px rgba(0, 0, 0, 0.0980392);\n    box-shadow: 0px 0px 5px 1px rgba(0, 0, 0, 0.0823529);\n    border-bottom-left-radius: 5px;\n    border-bottom-right-radius: 5px;\n    background: #2b303b;\n    margin: 1em 0;\n    padding: .5em 20px;\n    overflow-x: scroll;\n    -webkit-overflow-scrolling: touch\n}\npre.intro {\n    font-size: 1.2em\n}\npre::-webkit-scrollbar {\n    height: 8px\n}\npre::-webkit-scrollbar-thumb {\n    background: rgba(255, 255, 255, .8);\n    -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .5);\n    -webkit-border-radius: 10px;\n    border-radius: 10px\n}\npre::-webkit-scrollbar-thumb:window-inactive {\n    background: rgba(255, 255, 255, .4)\n}\nh1 span,\npre {\n    color: #ddd\n}\nh1,\nh2,\nh3,\nh4,\nol,\np,\nul {\n    font-weight: 400;\n    padding: 0 20px;\n    word-wrap: break-word\n}\nhgroup h1 {\n    display: inline\n}\nhgroup h2 {\n    font-size: 1.38em\n}\nh2,\nh3,\nh4 {\n    margin: 0 0 .5em\n}\nh4 {\n    font-weight: 700\n}\na {\n    color: #222;\n    border-bottom: 1px solid #ddd;\n    text-decoration: none\n}\na:focus,\na:hover {\n    border-color: #222\n}\na img {\n    border: 0\n}\nabbr[title] {\n    border-bottom: 1px dotted #ddd;\n    cursor: help\n}\nhr {\n    display: none\n}\np {\n    margin-bottom: 1em\n}\nol,\nul {\n    margin-left: 2em\n}\nol ol,\nul ul {\n    margin-left: 1em;\n    padding: 0\n}\nfooter {\n    display: block;\n    background: #eee;\n    padding: 1em 0;\n    text-align: center\n}\n.a-img {\n    border: 0\n}\n.a-img img {\n    padding: .5em 0 0\n}\n.description {\n    word-wrap: break-word\n}\n.multiline-items li {\n    padding-bottom: 1em\n}\n.multiline-items li.last-item {\n    padding-bottom: 0\n}\n.br0 {\n    color: #090\n}\n.co1 {\n    color: #060\n}\n.co2 {\n    color: #096\n}\n.kw1,\n.kw3 {\n    color: #006\n}\n.kw2 {\n    color: #036\n}\n.me1 {\n    color: #606\n}\n.nu0 {\n    color: #c00\n}\n.st0 {\n    color: #36c\n}\n.sy0 {\n    color: #393;\n    font-weight: 700\n}\npre .co1 {\n    color: #aeaeae\n}\n.es0,\npre .st0 {\n    color: #61ce3c\n}\npre .co2 {\n    color: #fff\n}\npre .kw2,\npre .kw3,\npre .nu0 {\n    color: #fbde2d\n}\npre .me1 {\n    color: #8da6ce\n}\npre .br0,\npre .kw1,\npre .sy0 {\n    color: #ddd\n}\n#docs {\n    background: #fff\n}\n#docs body {\n    font-size: .85em;\n    width: 100%\n}\n#docs a.alias {\n    opacity: .5\n}\n#docs div div div div {\n    box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.137255);\n    box-shadow: 0px 0px 2px 1px rgba(0, 0, 0, 0.0980392);\n    box-shadow: 0px 0px 5px 1px rgba(0, 0, 0, 0.0823529);\n    border-bottom-left-radius: 5px;\n    border-bottom-right-radius: 5px;\n}\n#docs div div div {\n    border-top: 0;\n    margin: 0 .5em 1em\n}\n#docs h1,\n#docs h2,\n#docs h3,\n#docs h4,\n#docs ol,\n#docs p,\n#docs ul {\n    padding: 0 10px\n}\n#docs pre {\n    margin: 0;\n    padding: .5em 10px\n}\n#docs ul li {\n    list-style-type: none;\n    margin: 0 0 0 -.9em\n}\n#docs h1 {\n    padding: 0 10px\n}\n#docs h2 {\n    margin: .5em 0 0\n}\n#docs h3 {\n    background: rgb(63, 107, 196);\n    border-radius: 3px 3px 0 0;\n    border: 1px solid rgba(75, 71, 71, 0.14);\n    margin: .5em 0;\n    padding: .8em 0 .8em 10px;\n    position: relative\n}\n#docs h3>code {\n    color: #fbfbfb\n}\n#docs h3 a {\n    position: absolute;\n    top: 0\n}\n#docs h3 .br0 {\n    color: #fc83ff\n}\n#docs h3 .kw2 {\n    color: #71d0c9\n}\n#docs h3 .me1 {\n    color: #fff\n}\n#docs h3 .nu0 {\n    color: #d0cb71\n}\n#docs h3 .sy0 {\n    color: #df74e2;\n    font-weight: 700\n}\n#docs footer {\n    height: 3em;\n    margin-top: 1.5em;\n    width: 100%\n}\n#social {\n    height: 20px\n}\n#social .twitter-follow-button {\n    width: 127px!important\n}\n#social .twitter-follow-button,\n.twitter-share-button {\n    font-size: .8em;\n    vertical-align: top\n}\n@media (max-width: 959px) {\n    body {\n        border: 0;\n        margin: 0;\n        -moz-box-shadow: none;\n        -webkit-box-shadow: none;\n        box-shadow: none;\n        width: auto\n    }\n    h1,\n    h2,\n    h3,\n    h4,\n    ol,\n    p,\n    ul {\n        padding: 0 10px\n    }\n    pre {\n        padding: 5px 10px!important\n    }\n    #social {\n        height: auto\n    }\n    .toc-container a {\n        display: block;\n        padding: 5px\n    }\n    .toc-container a:focus,\n    .toc-container a:hover {\n        background-color: #EEE\n    }\n    .toc-container a:active {\n        background-color: #CCC\n    }\n}\n@media (min-width: 960px) {\n    #docs body {\n        box-shadow: none;\n        height: 100%;\n        margin: 0\n    }\n    #docs a[href=\"#docs\"],\n    #docs footer {\n        display: none\n    }\n    #docs h1 {\n        position: fixed;\n        background-color: #fff;\n        top: 0;\n        left: 0;\n        right: 0;\n        z-index: 1\n    }\n    #docs h3 a {\n        display: block;\n        position: relative;\n        visibility: hidden;\n        top: -4em\n    }\n    #docs .toc-container {\n        background: #fff;\n        bottom: 0;\n        left: 0;\n        overflow-y: scroll;\n        overflow-x: hidden;\n        position: fixed;\n        top: 1.5em;\n        white-space: nowrap;\n        width: 20%;\n        -webkit-overflow-scrolling: touch\n    }\n    #docs .toc-container h2,\n    #docs .toc-container ul {\n        margin-top: 0;\n        padding: 0 10px\n    }\n    #docs .doc-container {\n        background: #fff;\n        width: 80%;\n        margin-left: 20%;\n        padding-top: 1.5em\n    }\n    #docs .doc-container .first-heading {\n        margin-top: 0\n    }\n}\n@media (-ms-high-contrast: active) and (max-width: 1280px),\n(-ms-high-contrast: none) and (max-width: 1280px) {\n    #docs .doc-container,\n    #docs .toc-container {\n        position: relative;\n        top: auto;\n        width: 100%\n    }\n    #docs .doc-container .first-heading {\n        margin-top: .5em\n    }\n    #docs a[href=\"#docs\"] {\n        display: inline\n    }\n    #docs footer {\n        display: block\n    }\n}\n@media (orientation: portrait) and (min-device-width: 720px) and (max-device-width: 768px),\n(orientation: landscape) and (device-width: 1280px) and (max-device-height: 768px) {\n    @-ms-viewport{width:80%}}\n"
  },
  {
    "path": "templates/tests.ejs.html",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <meta name=\"author\" content=\"Dokker.js\">\n    <meta name=\"description\" content=\"This API documentation is built with Dokker.js at dokkerjs.com\">\n    <title>Dokker.js</title>\n    <script src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js\"></script>\n    <style>\n      body {\n        font: 16px/1.6 \"Helvetica Neue\", arial, sans-serif;\n        padding: 60px;\n      }\n      pre { font-size: 14px; line-height: 1.3 }\n      code .init { color: #2F6FAD }\n      code .string { color: #5890AD }\n      code .keyword { color: #8A6343 }\n      code .number { color: #2F6FAD }\n    </style>\n    <script>\n      $(function(){\n        $('code').each(function(){\n          $(this).html(highlight($(this).text()));\n        });\n      });\n\n      function highlight(js) {\n        return js\n          .replace(/</g, '&lt;')\n          .replace(/>/g, '&gt;')\n          .replace(/\\/\\/(.*)/gm, '<span class=\"comment\">//$1</span>')\n          .replace(/('.*')/gm, '<span class=\"string\">$1</span>')\n          .replace(/(\\d+\\.\\d+)/gm, '<span class=\"number\">$1</span>')\n          .replace(/(\\d+)/gm, '<span class=\"number\">$1</span>')\n          .replace(/\\bnew *(\\w+)/gm, '<span class=\"keyword\">new</span> <span class=\"init\">$1</span>')\n          .replace(/\\b(function|new|throw|return|var|if|else)\\b/gm, '<span class=\"keyword\">$1</span>')\n      }\n    </script>\n  </head>\n  <body>\n    <%- tests %>\n  </body>\n</html>\n"
  },
  {
    "path": "test/dokker.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\nvar Dokker = require('../dokker');\nvar Promise = require('promise');\nvar read = Promise.denodeify(fs.readFile);\nvar assert = require('assert');\nvar options;\n\ndescribe('Dokker', function(){\n\n  before(function(done){\n    Dokker.configure()\n    .then(function(data){\n      options = data;\n      done();\n    });\n  });\n\n  describe('.literate()', function(){\n    it('creates a HTML file from annotated source code', function(done){\n      return Dokker.literate(options.literate)\n      .then(function(){\n        done();\n      }).done();\n    });\n  });\n\n  describe('.jsdocMarkdown()', function() {\n    it('creates a markdown file from JSDOC comments', function(done){\n      return Dokker.jsdocMarkdown(options.jsdoc)\n      .then(function(){\n        return read(options.jsdoc.markdown);\n      }).then(function(){\n        done();\n      }).done();\n    });\n  });\n\n  describe('.jsdocHtml()', function() {\n    it('creates a HTML file from JSDOC commments', function(done){\n      return Dokker.jsdocHtml(options.jsdoc)\n      .then(function(){\n        return read(options.jsdoc.html);\n      }).then(function(){\n        done();\n      }).done();\n    });\n  });\n  \n  describe('.injectTemplate()', function(){\n    it('injects index.html file in ejs template', function(done){\n      return Dokker.injectTemplate(options.jsdoc)\n      .then(function() {\n        return read(options.jsdoc.html, 'utf8');\n      }).then(function(data){\n        assert(/<!DOCTYPE html>/.test(data));\n        done();\n      }).done();\n    });\n  });\n\n  describe('.copyTemplate()', function() {\n    it('copies styles and app.js from template folder', function(done){\n      return Dokker.copyTemplate(options)\n      .then(function(){\n        return read(path.join(__dirname, '..', options.dir, 'styles.css'));\n      }).then(function(data){\n        assert(data);\n        done();\n      }).done();\n    });\n  });\n\n});\n"
  }
]