diff --git a/.gitignore b/.gitignore index 6a818bb3..3afd533b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ -# 27 March 2015 +# 2016 October 17 # https://github.com/bevry/base # Temp Files +yarn.lock **/.docpad.db **/out.* **/*.log @@ -14,8 +15,12 @@ components/ bower_components/ node_modules/ out/ +*output/ coffeejs/ +coffee/ es5/ +es2015/ +esnext/ # Editor Caches .c9/ diff --git a/.npmignore b/.npmignore index a1c6c4bc..8402ff53 100644 --- a/.npmignore +++ b/.npmignore @@ -1,7 +1,8 @@ -# 27 March 2015 +# 2016 October 17 # https://github.com/bevry/base # Temp Files +yarn.lock **/.docpad.db **/out.* **/*.log @@ -17,19 +18,26 @@ node_modules/ # Private Files .env +# Documentation Files +docs/ +guides/ +BACKERS.md +CONTRIBUTING.md +HISTORY.md + # Development Files +web/ +**/example* +**/test* .editorconfig -.eslintrc +.eslintrc* .jshintrc -coffeelint.json +.jscrc +coffeelint* .travis* +nakefile* Cakefile Makefile -BACKERS.md -CONTRIBUTING.md -HISTORY.md -**/src/ -**/test/ # Other Package Definitions template.js diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 415fb5fe..65da7f69 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,136 @@ -# Contributing + -- [Contributing Guide](https://docpad.org/docs/contribute) -- [Support Channels](https://discuss.bevry.me/t/official-bevry-support-channels/63) - - We no longer use GitHub Issues as a support channel. Refer to the above instead. +# Before You Post! + +## Support + +We offer support through our [Official Support Channels](https://bevry.me/support). Do not use GitHub Issues for support, your issue will be closed. + + +## Contribute + +Our [Contributing Guide](https://learn.bevry.me/community/contribute) contains useful tips and suggestions for how to contribute to this project, it's worth the read. + + +## Development + +### Setup + +1. Install [Node.js](https://learn.bevry.me/node/install) + +1. Fork the project and clone your fork - [guide](https://help.github.com/articles/fork-a-repo/) + +1. Install local dependencies + + ``` bash + npm install + ``` + +1. Perform any other setup operations + + ``` bash + npm run-script setup + ``` + + +### Developing + +1. Compile changes + + ``` bash + npm run-script compile + ``` + +1. Run tests + + ``` bash + npm test + ``` + + +### Publishing + +Follow these steps in order to implement your changes/improvements into your desired project: + + +#### Preparation + +1. Make sure your changes are on their own branch that is branched off from master. + 1. You can do this by: `git checkout master; git checkout -b your-new-branch` + 1. And push the changes up by: `git push origin your-new-branch` + +1. Ensure all tests pass: + + ``` bash + npm test + ``` + + > If possible, add tests for your change, if you don't know how, mention this in your pull request + +1. Ensure the project is ready for publishing: + + ``` + git status + git diff + npm run-script prepare + ``` + + +#### Pull Request + +To send your changes for the project owner to merge in: + +1. Submit your pull request + 1. When submitting, if the original project has a `dev` or `integrate` branch, use that as the target branch for your pull request instead of the default `master` + 1. By submitting a pull request you agree for your changes to have the same license as the original plugin + + +#### Publish + +To publish your changes as the project owner: + +1. Switch to the master branch: + + ``` bash + git checkout master + ``` + +1. Merge in the changes of the feature branch (if applicable) + +1. Increment the version number in the `package.json` file according to the [semantic versioning](http://semver.org) standard, that is: + 1. `x.0.0` MAJOR version when you make incompatible API changes (note: DocPad plugins must use v2 as the major version, as v2 corresponds to the current DocPad v6.x releases) + 1. `x.y.0` MINOR version when you add functionality in a backwards-compatible manner + 1. `x.y.z` PATCH version when you make backwards-compatible bug fixes + +1. Add an entry to the changelog following the format of the previous entries, an example of this is: + + ``` markdown + ## v6.29.0 2013 April 1 + - Progress on [issue #474](https://github.com/bevry/docpad/issues/474) + - DocPad will now set permissions based on the process's ability + - Thanks to [Avi Deitcher](https://github.com/deitch), [Stephan Lough](https://github.com/stephanlough) for [issue #165](https://github.com/bevry/docpad/issues/165) + - Updated dependencies + ``` + + +1. Commit the changes with the commit title set to something like `v6.29.0. Bugfix. Improvement.` and commit description set to the changelog entry + + +1. Ensure the project is ready for publishing: + + ``` + git status + git diff + npm run-script prepare + ``` + +1. Prepare the release and publish it to npm and git: + + ``` bash + npm run-script release + ``` + + > A prompt will occur asking you for a git tag annotation, enter the changelog entry that we created earlier, save and exit the prompt. diff --git a/HISTORY.md b/HISTORY.md index 6bdcb75d..165af20f 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,11 @@ # History +## v6.79.0 2016 October 20 +- This is a beta release, use `npm install --save docpad@beta` to grab it +- Configuration loading is merged more accurately +- Updated majors of many dependencies + - Closes [issue #1045](https://github.com/docpad/docpad/issues/1045) + ## v6.78.5 2016 June 15 - Recompiled with latest dev dependencies diff --git a/README.md b/README.md index a68f07f7..828dd33d 100755 --- a/README.md +++ b/README.md @@ -195,10 +195,10 @@ These amazing people have contributed code to this project:
  • Stefanos Grammenosview contributions
  • Sven Vetschview contributions
  • Anton Wilhelm
  • -
  • Todd Anglinview contributions
  • +
  • Todd Anglin
  • Tatu Tamminenview contributions
  • Nick Matantsevview contributions
  • -
  • Vladislav Botvinview contributions
  • +
  • Vladislav Botvinview contributions
  • vsopvsopview contributions
  • Zearinview contributions
  • Firedeview contributions
  • @@ -208,7 +208,10 @@ These amazing people have contributed code to this project:
  • Ke Zhuview contributions
  • Morgan Larosaview contributions
  • Paul Armstrongview contributions
  • -
  • Prayag Vermaview contributions
  • +
  • Prayag Verma
  • +
  • Steve Mcview contributions
  • +
  • Todd Anglinview contributions
  • +
  • Prayag Vermaview contributions
  • Discover how you can contribute by heading on over to the CONTRIBUTING.md file. diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png old mode 100644 new mode 100755 diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png old mode 100644 new mode 100755 diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css old mode 100644 new mode 100755 diff --git a/docs/assets/favicon.ico b/docs/assets/favicon.ico old mode 100644 new mode 100755 diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif old mode 100644 new mode 100755 diff --git a/docs/assets/index.html b/docs/assets/index.html old mode 100644 new mode 100755 diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js old mode 100644 new mode 100755 diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js old mode 100644 new mode 100755 diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js old mode 100644 new mode 100755 diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js old mode 100644 new mode 100755 diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js old mode 100644 new mode 100755 diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html old mode 100644 new mode 100755 diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING old mode 100644 new mode 100755 diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html old mode 100644 new mode 100755 diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css old mode 100644 new mode 100755 diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js old mode 100644 new mode 100755 diff --git a/docs/classes/Docpad.html b/docs/classes/Docpad.html index 04c5737b..63a90c06 100644 --- a/docs/classes/Docpad.html +++ b/docs/classes/Docpad.html @@ -100,7 +100,7 @@

    Docpad Class

    - Defined in: src/lib/docpad.coffee:118 + Defined in: src/lib/docpad.coffee:77
    @@ -146,7 +146,7 @@

    Docpad

    Defined in - src/lib/docpad.coffee:118 + src/lib/docpad.coffee:77

    @@ -246,6 +246,10 @@

    Methods

  • createRegenerateTimer +
  • +
  • + createTaskGroup +
  • destroy @@ -767,9 +771,13 @@

    Methods

    watch
  • -
  • +
  • watchdir +
  • +
  • + watchdirs +
  • writeFiles @@ -1043,7 +1051,7 @@

    action

    Defined in - src/lib/docpad.coffee:461 + src/lib/docpad.coffee:421

    @@ -1103,7 +1111,7 @@

    addCollection

    Defined in - src/lib/docpad.coffee:763 + src/lib/docpad.coffee:723

    @@ -1162,7 +1170,7 @@

    addModel

    Defined in - src/lib/docpad.coffee:3749 + src/lib/docpad.coffee:3728

    @@ -1252,7 +1260,7 @@

    addModels

    Defined in - src/lib/docpad.coffee:3774 + src/lib/docpad.coffee:3753

    @@ -1330,7 +1338,7 @@

    attachModelEvents

    Defined in - src/lib/docpad.coffee:3690 + src/lib/docpad.coffee:3669

    @@ -1384,7 +1392,7 @@

    checkRequest

    Defined in - src/lib/docpad.coffee:3421 + src/lib/docpad.coffee:3400

    @@ -1542,7 +1550,7 @@

    compareVersion

    Defined in - src/lib/docpad.coffee:4231 + src/lib/docpad.coffee:4224

    @@ -1584,7 +1592,7 @@

    constructor

    Defined in - src/lib/docpad.coffee:1807 + src/lib/docpad.coffee:1820

    @@ -1664,7 +1672,7 @@

    contextualizeFiles

    Defined in - src/lib/docpad.coffee:4318 + src/lib/docpad.coffee:4311

    @@ -1749,7 +1757,7 @@

    createDocument

    Defined in - src/lib/docpad.coffee:3631 + src/lib/docpad.coffee:3610

    @@ -1831,7 +1839,7 @@

    createError

    Defined in - src/lib/docpad.coffee:3239 + src/lib/docpad.coffee:3218

    @@ -1909,7 +1917,7 @@

    createFile

    Defined in - src/lib/docpad.coffee:3618 + src/lib/docpad.coffee:3597

    @@ -1991,7 +1999,7 @@

    createModel

    Defined in - src/lib/docpad.coffee:3808 + src/lib/docpad.coffee:3787

    @@ -2112,7 +2120,7 @@

    createModels

    Defined in - src/lib/docpad.coffee:3792 + src/lib/docpad.coffee:3771

    @@ -2186,7 +2194,7 @@

    createProgress

    Defined in - src/lib/docpad.coffee:4648 + src/lib/docpad.coffee:4641

    @@ -2230,7 +2238,7 @@

    createRegenerateTimer

    Defined in - src/lib/docpad.coffee:4710 + src/lib/docpad.coffee:4703

    @@ -2245,6 +2253,70 @@

    createRegenerateTimer

    +
    +
    +

    createTaskGroup

    + +
    + (
      +
    • + opts +
    • +
    ) +
    + + + TaskGroup + + + + + + + + +
    +

    + Defined in + src/lib/docpad.coffee:1762 +

    + + + +
    + +
    +

    Create our own custom TaskGroup instance for DocPad. +That will listen to tasks as they execute and provide debugging information.

    + +
    + +
    +

    Parameters:

    + +
      +
    • + opts + Object + + +
      + +
      + +
    • +
    +
    + +
    +

    Returns:

    + +
    + TaskGroup: +
    +
    + +

    destroy

    @@ -2270,7 +2342,7 @@

    destroy

    Defined in - src/lib/docpad.coffee:2053 + src/lib/docpad.coffee:2011

    @@ -2341,7 +2413,7 @@

    destroyBlocks

    Defined in - src/lib/docpad.coffee:686 + src/lib/docpad.coffee:646

    @@ -2381,7 +2453,7 @@

    destroyCollection

    Defined in - src/lib/docpad.coffee:737 + src/lib/docpad.coffee:697

    @@ -2438,7 +2510,7 @@

    destroyCollections

    Defined in - src/lib/docpad.coffee:845 + src/lib/docpad.coffee:805

    @@ -2470,7 +2542,7 @@

    destroyDatabase

    Defined in - src/lib/docpad.coffee:577 + src/lib/docpad.coffee:537

    @@ -2502,7 +2574,7 @@

    destroyLoggers

    Defined in - src/lib/docpad.coffee:436 + src/lib/docpad.coffee:396

    @@ -2534,7 +2606,7 @@

    destroyPlugins

    Defined in - src/lib/docpad.coffee:4005 + src/lib/docpad.coffee:3994

    @@ -2575,7 +2647,7 @@

    destroyProgress

    Defined in - src/lib/docpad.coffee:4677 + src/lib/docpad.coffee:4670

    @@ -2632,7 +2704,7 @@

    destroyRegenerateTimer

    Defined in - src/lib/docpad.coffee:4693 + src/lib/docpad.coffee:4686

    @@ -2664,7 +2736,7 @@

    destroyServer

    Defined in - src/lib/docpad.coffee:389 + src/lib/docpad.coffee:349

    @@ -2696,7 +2768,7 @@

    destroyWatchers

    Defined in - src/lib/docpad.coffee:5318 + src/lib/docpad.coffee:5311

    @@ -2734,7 +2806,7 @@

    eachBlock

    Defined in - src/lib/docpad.coffee:677 + src/lib/docpad.coffee:637

    @@ -2787,7 +2859,7 @@

    eachCollection

    Defined in - src/lib/docpad.coffee:834 + src/lib/docpad.coffee:794

    @@ -2847,7 +2919,7 @@

    emitParallel

    Defined in - src/lib/docpad.coffee:2143 + src/lib/docpad.coffee:2101

    @@ -2938,7 +3010,7 @@

    emitSerial

    Defined in - src/lib/docpad.coffee:2111 + src/lib/docpad.coffee:2069

    @@ -3025,7 +3097,7 @@

    error

    Defined in - src/lib/docpad.coffee:3273 + src/lib/docpad.coffee:3252

    @@ -3090,7 +3162,7 @@

    extendCollections

    Defined in - src/lib/docpad.coffee:2760 + src/lib/docpad.coffee:2739

    @@ -3158,7 +3230,7 @@

    fatal

    Defined in - src/lib/docpad.coffee:3185 + src/lib/docpad.coffee:3164

    @@ -3215,7 +3287,7 @@

    fixNodePackageVersions

    Defined in - src/lib/docpad.coffee:3000 + src/lib/docpad.coffee:2979

    @@ -3293,7 +3365,7 @@

    generate

    Defined in - src/lib/docpad.coffee:4733 + src/lib/docpad.coffee:4726

    @@ -3366,7 +3438,7 @@

    getActionRunner

    Defined in - src/lib/docpad.coffee:454 + src/lib/docpad.coffee:414

    @@ -3418,7 +3490,7 @@

    getBlock

    Defined in - src/lib/docpad.coffee:629 + src/lib/docpad.coffee:589

    @@ -3488,7 +3560,7 @@

    getBlocks

    Defined in - src/lib/docpad.coffee:660 + src/lib/docpad.coffee:620

    @@ -3537,7 +3609,7 @@

    getCollection

    Defined in - src/lib/docpad.coffee:705 + src/lib/docpad.coffee:665

    @@ -3601,7 +3673,7 @@

    getCollections

    Defined in - src/lib/docpad.coffee:813 + src/lib/docpad.coffee:773

    @@ -3644,7 +3716,7 @@

    getConfig

    Defined in - src/lib/docpad.coffee:1736 + src/lib/docpad.coffee:1691

    @@ -3709,7 +3781,7 @@

    getConfigPath

    Defined in - src/lib/docpad.coffee:2717 + src/lib/docpad.coffee:2696

    @@ -3787,7 +3859,7 @@

    getDatabase

    Defined in - src/lib/docpad.coffee:562 + src/lib/docpad.coffee:522

    @@ -3821,7 +3893,7 @@

    getDatabaseSafe

    Defined in - src/lib/docpad.coffee:568 + src/lib/docpad.coffee:528

    @@ -3864,7 +3936,7 @@

    getDebugging

    Defined in - src/lib/docpad.coffee:3176 + src/lib/docpad.coffee:3155

    @@ -3905,7 +3977,7 @@

    getEnvironment

    Defined in - src/lib/docpad.coffee:1335 + src/lib/docpad.coffee:1295

    @@ -3949,7 +4021,7 @@

    getEnvironments

    Defined in - src/lib/docpad.coffee:1345 + src/lib/docpad.coffee:1305

    @@ -3992,7 +4064,7 @@

    getErrorRunner

    Defined in - src/lib/docpad.coffee:476 + src/lib/docpad.coffee:436

    @@ -4035,7 +4107,7 @@

    getEvents

    Defined in - src/lib/docpad.coffee:533 + src/lib/docpad.coffee:493

    @@ -4082,7 +4154,7 @@

    getExchange

    Defined in - src/lib/docpad.coffee:4270 + src/lib/docpad.coffee:4263

    @@ -4167,7 +4239,7 @@

    getFile

    Defined in - src/lib/docpad.coffee:879 + src/lib/docpad.coffee:839

    @@ -4258,7 +4330,7 @@

    getFileAtPath

    Defined in - src/lib/docpad.coffee:904 + src/lib/docpad.coffee:864

    @@ -4346,7 +4418,7 @@

    getFileById

    Defined in - src/lib/docpad.coffee:931 + src/lib/docpad.coffee:891

    @@ -4422,7 +4494,7 @@

    getFileByRoute

    Defined in - src/lib/docpad.coffee:954 + src/lib/docpad.coffee:914

    @@ -4512,7 +4584,7 @@

    getFileBySelector

    Defined in - src/lib/docpad.coffee:996 + src/lib/docpad.coffee:956

    @@ -4591,7 +4663,7 @@

    getFileByUrl

    Defined in - src/lib/docpad.coffee:918 + src/lib/docpad.coffee:878

    @@ -4673,7 +4745,7 @@

    getFiles

    Defined in - src/lib/docpad.coffee:861 + src/lib/docpad.coffee:821

    @@ -4764,7 +4836,7 @@

    getFilesAtPath

    Defined in - src/lib/docpad.coffee:891 + src/lib/docpad.coffee:851

    @@ -4843,7 +4915,7 @@

    getHostname

    Defined in - src/lib/docpad.coffee:1769 + src/lib/docpad.coffee:1724

    @@ -4884,7 +4956,7 @@

    getIgnoreOpts

    Defined in - src/lib/docpad.coffee:2179 + src/lib/docpad.coffee:2137

    @@ -4927,7 +4999,7 @@

    getLocale

    Defined in - src/lib/docpad.coffee:1286 + src/lib/docpad.coffee:1246

    @@ -4970,7 +5042,7 @@

    getLogger

    Defined in - src/lib/docpad.coffee:407 + src/lib/docpad.coffee:367

    @@ -5013,7 +5085,7 @@

    getLoggers

    Defined in - src/lib/docpad.coffee:414 + src/lib/docpad.coffee:374

    @@ -5056,7 +5128,7 @@

    getLogLevel

    Defined in - src/lib/docpad.coffee:3168 + src/lib/docpad.coffee:3147

    @@ -5105,7 +5177,7 @@

    getPlugin

    Defined in - src/lib/docpad.coffee:3987 + src/lib/docpad.coffee:3976

    @@ -5164,7 +5236,7 @@

    getPort

    Defined in - src/lib/docpad.coffee:1761 + src/lib/docpad.coffee:1716

    @@ -5207,7 +5279,7 @@

    getProcessPlatform

    Defined in - src/lib/docpad.coffee:328 + src/lib/docpad.coffee:288

    @@ -5248,7 +5320,7 @@

    getProcessVersion

    Defined in - src/lib/docpad.coffee:335 + src/lib/docpad.coffee:295

    @@ -5295,7 +5367,7 @@

    getServer

    Defined in - src/lib/docpad.coffee:358 + src/lib/docpad.coffee:318

    @@ -5360,7 +5432,7 @@

    getServerUrl

    Defined in - src/lib/docpad.coffee:1777 + src/lib/docpad.coffee:1732

    @@ -5424,7 +5496,7 @@

    getSimpleServerUrl

    Defined in - src/lib/docpad.coffee:1792 + src/lib/docpad.coffee:1747

    @@ -5500,7 +5572,7 @@

    getSkeletons

    Defined in - src/lib/docpad.coffee:1024 + src/lib/docpad.coffee:984

    @@ -5588,7 +5660,7 @@

    getTemplateData

    Defined in - src/lib/docpad.coffee:1161 + src/lib/docpad.coffee:1121

    @@ -5647,7 +5719,7 @@

    getTrackRunner

    Defined in - src/lib/docpad.coffee:490 + src/lib/docpad.coffee:450

    @@ -5696,7 +5768,7 @@

    getUrlPathname

    Defined in - src/lib/docpad.coffee:944 + src/lib/docpad.coffee:904

    @@ -5754,7 +5826,7 @@

    getVersion

    Defined in - src/lib/docpad.coffee:301 + src/lib/docpad.coffee:261

    @@ -5795,7 +5867,7 @@

    getVersionString

    Defined in - src/lib/docpad.coffee:310 + src/lib/docpad.coffee:270

    @@ -5836,7 +5908,7 @@

    hasPlugins

    Defined in - src/lib/docpad.coffee:3997 + src/lib/docpad.coffee:3986

    @@ -5881,7 +5953,7 @@

    identify

    Defined in - src/lib/docpad.coffee:3540 + src/lib/docpad.coffee:3519

    @@ -6040,7 +6112,7 @@

    initGitRepo

    Defined in - src/lib/docpad.coffee:2942 + src/lib/docpad.coffee:2921

    @@ -6205,7 +6277,7 @@

    initNodeModules

    Defined in - src/lib/docpad.coffee:2967 + src/lib/docpad.coffee:2946

    @@ -6385,7 +6457,7 @@

    inspector

    Defined in - src/lib/docpad.coffee:3212 + src/lib/docpad.coffee:3191

    @@ -6543,7 +6615,7 @@

    installNodeModule

    Defined in - src/lib/docpad.coffee:3029 + src/lib/docpad.coffee:3008

    @@ -6734,7 +6806,7 @@

    isIgnoredPath

    Defined in - src/lib/docpad.coffee:2187 + src/lib/docpad.coffee:2145

    @@ -6809,7 +6881,7 @@

    load

    Defined in - src/lib/docpad.coffee:2455 + src/lib/docpad.coffee:2434

    @@ -6900,7 +6972,7 @@

    loadAndRenderDocument

    Defined in - src/lib/docpad.coffee:5138 + src/lib/docpad.coffee:5131

    @@ -6997,7 +7069,7 @@

    loadConfigPath

    Defined in - src/lib/docpad.coffee:2652 + src/lib/docpad.coffee:2631

    @@ -7085,7 +7157,7 @@

    loadConfigUrl

    Defined in - src/lib/docpad.coffee:2621 + src/lib/docpad.coffee:2600

    @@ -7175,7 +7247,7 @@

    loadDocument

    Defined in - src/lib/docpad.coffee:5117 + src/lib/docpad.coffee:5110

    @@ -7271,7 +7343,7 @@

    loadedPlugin

    Defined in - src/lib/docpad.coffee:4060 + src/lib/docpad.coffee:4049

    @@ -7357,7 +7429,7 @@

    loadLocale

    Defined in - src/lib/docpad.coffee:1306 + src/lib/docpad.coffee:1266

    @@ -7426,7 +7498,7 @@

    loadPlugin

    Defined in - src/lib/docpad.coffee:4079 + src/lib/docpad.coffee:4068

    @@ -7511,7 +7583,7 @@

    loadPlugins

    Defined in - src/lib/docpad.coffee:4016 + src/lib/docpad.coffee:4005

    @@ -7580,7 +7652,7 @@

    loadPluginsIn

    Defined in - src/lib/docpad.coffee:4176 + src/lib/docpad.coffee:4165

    @@ -7654,7 +7726,7 @@

    logError

    Defined in - src/lib/docpad.coffee:3298 + src/lib/docpad.coffee:3277

    @@ -7711,7 +7783,7 @@

    mergeConfigurations

    Defined in - src/lib/docpad.coffee:2312 + src/lib/docpad.coffee:2291

    @@ -7777,7 +7849,7 @@

    notify

    Defined in - src/lib/docpad.coffee:3403 + src/lib/docpad.coffee:3382

    @@ -7842,7 +7914,7 @@

    notifyError

    Defined in - src/lib/docpad.coffee:3353 + src/lib/docpad.coffee:3332

    @@ -7898,7 +7970,7 @@

    parseDirectory

    Defined in - src/lib/docpad.coffee:3907 + src/lib/docpad.coffee:3886

    @@ -7987,7 +8059,7 @@

    parseDocumentDirectory

    Defined in - src/lib/docpad.coffee:3660 + src/lib/docpad.coffee:3639

    @@ -8113,7 +8185,7 @@

    parseFileDirectory

    Defined in - src/lib/docpad.coffee:3645 + src/lib/docpad.coffee:3624

    @@ -8205,7 +8277,7 @@

    ready

    Defined in - src/lib/docpad.coffee:2247 + src/lib/docpad.coffee:2226

    @@ -8294,7 +8366,7 @@

    render

    Defined in - src/lib/docpad.coffee:5275 + src/lib/docpad.coffee:5268

    @@ -8375,7 +8447,7 @@

    renderData

    Defined in - src/lib/docpad.coffee:5208 + src/lib/docpad.coffee:5201

    @@ -8478,7 +8550,7 @@

    renderDocument

    Defined in - src/lib/docpad.coffee:5162 + src/lib/docpad.coffee:5155

    @@ -8584,7 +8656,7 @@

    renderFiles

    Defined in - src/lib/docpad.coffee:4399 + src/lib/docpad.coffee:4392

    @@ -8667,7 +8739,7 @@

    renderPath

    Defined in - src/lib/docpad.coffee:5184 + src/lib/docpad.coffee:5177

    @@ -8769,7 +8841,7 @@

    renderText

    Defined in - src/lib/docpad.coffee:5239 + src/lib/docpad.coffee:5232

    @@ -8880,7 +8952,7 @@

    resetCollections

    Defined in - src/lib/docpad.coffee:2904 + src/lib/docpad.coffee:2883

    @@ -9031,7 +9103,7 @@

    scandir

    Defined in - src/lib/docpad.coffee:2198 + src/lib/docpad.coffee:2156

    @@ -9668,7 +9740,7 @@

    setBlock

    Defined in - src/lib/docpad.coffee:643 + src/lib/docpad.coffee:603

    @@ -9731,7 +9803,7 @@

    setBlocks

    Defined in - src/lib/docpad.coffee:667 + src/lib/docpad.coffee:627

    @@ -9787,7 +9859,7 @@

    setCollection

    Defined in - src/lib/docpad.coffee:773 + src/lib/docpad.coffee:733

    @@ -9866,7 +9938,7 @@

    setCollections

    Defined in - src/lib/docpad.coffee:821 + src/lib/docpad.coffee:781

    @@ -9907,7 +9979,7 @@

    setConfig

    Defined in - src/lib/docpad.coffee:2354 + src/lib/docpad.coffee:2333

    @@ -9995,7 +10067,7 @@

    setInstanceConfig

    Defined in - src/lib/docpad.coffee:2337 + src/lib/docpad.coffee:2316

    @@ -10053,7 +10125,7 @@

    setLoggers

    Defined in - src/lib/docpad.coffee:421 + src/lib/docpad.coffee:381

    @@ -10116,7 +10188,7 @@

    setLogLevel

    Defined in - src/lib/docpad.coffee:3148 + src/lib/docpad.coffee:3127

    @@ -10169,7 +10241,7 @@

    setServer

    Defined in - src/lib/docpad.coffee:372 + src/lib/docpad.coffee:332

    @@ -10381,7 +10453,7 @@

    subscribe

    Defined in - src/lib/docpad.coffee:3444 + src/lib/docpad.coffee:3423

    @@ -10452,7 +10524,7 @@

    track

    Defined in - src/lib/docpad.coffee:3483 + src/lib/docpad.coffee:3462

    @@ -10538,7 +10610,7 @@

    trackError

    Defined in - src/lib/docpad.coffee:3329 + src/lib/docpad.coffee:3308

    @@ -10676,7 +10748,7 @@

    uninstallNodeModule

    Defined in - src/lib/docpad.coffee:3092 + src/lib/docpad.coffee:3071

    @@ -10851,7 +10923,7 @@

    updateUserConfig

    Defined in - src/lib/docpad.coffee:2589 + src/lib/docpad.coffee:2568

    @@ -11125,7 +11197,7 @@

    warn

    Defined in - src/lib/docpad.coffee:3377 + src/lib/docpad.coffee:3356

    @@ -11201,7 +11273,7 @@

    watch

    Defined in - src/lib/docpad.coffee:5340 + src/lib/docpad.coffee:5333

    @@ -11254,13 +11326,19 @@

    Parameters:

    -
    +

    watchdir

    (
    • - [opts={}] + path +
    • +
    • + listeners +
    • +
    • + next
    )
    @@ -11270,6 +11348,7 @@

    watchdir

    + private @@ -11278,7 +11357,7 @@

    watchdir

    Defined in - src/lib/docpad.coffee:2210 + src/lib/docpad.coffee:2168

    @@ -11291,10 +11370,6 @@

    watchdir

    internally by DocPad to watch project documents and files and then activate the regeneration process when any of those items are updated.

    -

    Although it is possible to pass a range of options to watchdir -in practice these options are provided as part of -the DocPad config object with a number of default options -specified in the DocPad config.

    @@ -11303,184 +11378,145 @@

    Parameters:

    • - [opts={}] - Object - optional + path + String
      - -
      +
        +
      • the path to watch
      • +
      -
        -
      • - [path] - String - optional +
    -
    -

    a single path to watch.

    +
  • +
  • + listeners + Object -
  • - -
  • - [paths] - Array - optional +
    + -
    -

    an array of paths to watch.

    +
    -
    +
  • +
  • + next + Function -
  • -
  • - [listener] - Function - optional -
    -

    a single change listener to fire when a change occurs.

    +
    +
      +
    • completion callback accepting error
    • +
    -
    +
    -
  • -
  • - [listeners] - Array - optional +
  • + + -
    -

    an array of listeners.

    +
    +

    Returns:

    -
    +
    + Object: +

    the watcher

    - -
  • - [next] - Function - optional +
  • +
    -
    -

    callback.

    -
    + +
    +

    watchdirs

    - -
  • - [stat] - Object - optional +
    + (
      +
    • + paths +
    • +
    • + listeners +
    • +
    • + next +
    • +
    ) +
    -
    -

    a file stat object to use for the path, instead of fetching a new one.

    -
    -
  • -
  • - [interval=5007] - Number - optional + private -
    -

    for systems that poll to detect file changes, how often should it poll in millseconds.

    -
    -
  • -
  • - [catupDelay=200] - Number - optional -
    -

    handles system swap file deletions and renaming

    -
    +
    +

    + Defined in + src/lib/docpad.coffee:2190 +

    -
  • -
  • - [preferredMethods=['watch','watchFile'] - Array - optional -
    -

    which order should we prefer our watching methods to be tried?.

    -
    +
  • - -
  • - [followLinks=true] - Boolean - optional +
    +

    Watch Directories. Wrapper around watchdir.

    -
    -

    follow symlinks, i.e. use stat rather than lstat.

    +
    -
    +
    +

    Parameters:

    -
  • -
  • - [ignorePaths=false] - Boolean | Array - optional +
  • -
    -

    Returns:

    - -
    - Object: -

    the watcher

    - -
    -
    @@ -11509,7 +11545,7 @@

    writeFiles

    Defined in - src/lib/docpad.coffee:4523 + src/lib/docpad.coffee:4516

    @@ -11581,7 +11617,7 @@

    actionRunnerInstance

    Defined in - src/lib/docpad.coffee:447 + src/lib/docpad.coffee:407

    @@ -11606,7 +11642,7 @@

    BasePlugin

    Defined in - src/lib/docpad.coffee:284 + src/lib/docpad.coffee:244

    @@ -11633,7 +11669,7 @@

    blocks

    Defined in - src/lib/docpad.coffee:612 + src/lib/docpad.coffee:572

    @@ -11658,7 +11694,7 @@

    Collection

    Defined in - src/lib/docpad.coffee:195 + src/lib/docpad.coffee:155

    @@ -11687,7 +11723,7 @@

    collections

    Defined in - src/lib/docpad.coffee:698 + src/lib/docpad.coffee:658

    @@ -11713,7 +11749,7 @@

    config

    Defined in - src/lib/docpad.coffee:1374 + src/lib/docpad.coffee:1334

    @@ -11747,7 +11783,7 @@

    corePath

    Defined in - src/lib/docpad.coffee:1100 + src/lib/docpad.coffee:1060

    @@ -11773,7 +11809,7 @@

    database

    Defined in - src/lib/docpad.coffee:547 + src/lib/docpad.coffee:507

    @@ -11799,7 +11835,7 @@

    databaseTempCache FileCollection of models

    Defined in - src/lib/docpad.coffee:554 + src/lib/docpad.coffee:514

    @@ -11825,7 +11861,7 @@

    debugLogPath

    Defined in - src/lib/docpad.coffee:1131 + src/lib/docpad.coffee:1091

    @@ -11850,7 +11886,7 @@

    DocumentModel

    Defined in - src/lib/docpad.coffee:224 + src/lib/docpad.coffee:184

    @@ -11877,7 +11913,7 @@

    ElementsCollection

    Defined in - src/lib/docpad.coffee:243 + src/lib/docpad.coffee:203

    @@ -11904,7 +11940,7 @@

    errorRunnerInstance

    Defined in - src/lib/docpad.coffee:470 + src/lib/docpad.coffee:430

    @@ -11929,7 +11965,7 @@

    Events

    Defined in - src/lib/docpad.coffee:180 + src/lib/docpad.coffee:139

    @@ -11955,7 +11991,7 @@

    exchange

    Defined in - src/lib/docpad.coffee:1091 + src/lib/docpad.coffee:1051

    @@ -11980,7 +12016,7 @@

    FileModel

    Defined in - src/lib/docpad.coffee:216 + src/lib/docpad.coffee:176

    @@ -12008,7 +12044,7 @@

    filesByOutPath

    Defined in - src/lib/docpad.coffee:605 + src/lib/docpad.coffee:565

    @@ -12034,7 +12070,7 @@

    filesBySelector

    Defined in - src/lib/docpad.coffee:598 + src/lib/docpad.coffee:558

    @@ -12060,7 +12096,7 @@

    filesByUrl

    Defined in - src/lib/docpad.coffee:591 + src/lib/docpad.coffee:551

    @@ -12085,7 +12121,7 @@

    FilesCollection

    Defined in - src/lib/docpad.coffee:235 + src/lib/docpad.coffee:195

    @@ -12113,7 +12149,7 @@

    generated

    Defined in - src/lib/docpad.coffee:4640 + src/lib/docpad.coffee:4633

    @@ -12140,7 +12176,7 @@

    generateEnded

    Defined in - src/lib/docpad.coffee:4626 + src/lib/docpad.coffee:4619

    @@ -12166,7 +12202,7 @@

    generateStarted

    Defined in - src/lib/docpad.coffee:4619 + src/lib/docpad.coffee:4612

    @@ -12192,7 +12228,7 @@

    generating

    Defined in - src/lib/docpad.coffee:4633 + src/lib/docpad.coffee:4626

    @@ -12218,7 +12254,7 @@

    initialConfig

    Defined in - src/lib/docpad.coffee:1434 + src/lib/docpad.coffee:1394

    @@ -12246,7 +12282,7 @@

    initialTemplateData

    Defined in - src/lib/docpad.coffee:1147 + src/lib/docpad.coffee:1107

    @@ -12272,7 +12308,7 @@

    instanceConfig

    Defined in - src/lib/docpad.coffee:1389 + src/lib/docpad.coffee:1349

    @@ -12298,7 +12334,7 @@

    libPath

    Defined in - src/lib/docpad.coffee:1106 + src/lib/docpad.coffee:1066

    @@ -12323,7 +12359,7 @@

    loadedPlugins

    Defined in - src/lib/docpad.coffee:1085 + src/lib/docpad.coffee:1045

    @@ -12349,7 +12385,7 @@

    locale

    Defined in - src/lib/docpad.coffee:1278 + src/lib/docpad.coffee:1238

    @@ -12374,7 +12410,7 @@

    localePath

    Defined in - src/lib/docpad.coffee:1125 + src/lib/docpad.coffee:1085

    @@ -12399,7 +12435,7 @@

    log

    Defined in - src/lib/docpad.coffee:3225 + src/lib/docpad.coffee:3204

    @@ -12438,7 +12474,7 @@

    loggerInstances

    Defined in - src/lib/docpad.coffee:400 + src/lib/docpad.coffee:360

    @@ -12463,7 +12499,7 @@

    mainPath

    Defined in - src/lib/docpad.coffee:1113 + src/lib/docpad.coffee:1073

    @@ -12488,7 +12524,7 @@

    MetaCollection

    Defined in - src/lib/docpad.coffee:251 + src/lib/docpad.coffee:211

    @@ -12515,7 +12551,7 @@

    Model

    Defined in - src/lib/docpad.coffee:186 + src/lib/docpad.coffee:146

    @@ -12543,7 +12579,7 @@

    packagePath

    Defined in - src/lib/docpad.coffee:1119 + src/lib/docpad.coffee:1079

    @@ -12568,7 +12604,7 @@

    PluginLoader

    Defined in - src/lib/docpad.coffee:275 + src/lib/docpad.coffee:235

    @@ -12597,7 +12633,7 @@

    pluginsTemplateData

    Defined in - src/lib/docpad.coffee:1154 + src/lib/docpad.coffee:1114

    @@ -12622,7 +12658,7 @@

    pluginVersion

    Defined in - src/lib/docpad.coffee:321 + src/lib/docpad.coffee:281

    @@ -12647,7 +12683,7 @@

    QueryCollection

    Defined in - src/lib/docpad.coffee:204 + src/lib/docpad.coffee:164

    @@ -12676,7 +12712,7 @@

    regenerateTimer

    Defined in - src/lib/docpad.coffee:1728 + src/lib/docpad.coffee:1683

    @@ -12702,7 +12738,7 @@

    ScriptsCollection

    Defined in - src/lib/docpad.coffee:259 + src/lib/docpad.coffee:219

    @@ -12730,7 +12766,7 @@

    serverExpress

    Defined in - src/lib/docpad.coffee:342 + src/lib/docpad.coffee:302

    @@ -12757,7 +12793,7 @@

    serverHttp

    Defined in - src/lib/docpad.coffee:350 + src/lib/docpad.coffee:310

    @@ -12784,7 +12820,7 @@

    skeletonsCollection

    Defined in - src/lib/docpad.coffee:1017 + src/lib/docpad.coffee:977

    @@ -12809,7 +12845,7 @@

    slowPlugins

    Defined in - src/lib/docpad.coffee:1079 + src/lib/docpad.coffee:1039

    @@ -12835,7 +12871,7 @@

    string array of event names

    Defined in - src/lib/docpad.coffee:498 + src/lib/docpad.coffee:458

    @@ -12863,7 +12899,7 @@

    string constant

    Defined in - src/lib/docpad.coffee:1359 + src/lib/docpad.coffee:1319

    @@ -12889,7 +12925,7 @@

    StylesCollection

    Defined in - src/lib/docpad.coffee:267 + src/lib/docpad.coffee:227

    @@ -12917,7 +12953,7 @@

    trackRunnerInstance

    Defined in - src/lib/docpad.coffee:483 + src/lib/docpad.coffee:443

    @@ -12943,7 +12979,7 @@

    userConfig

    Defined in - src/lib/docpad.coffee:1405 + src/lib/docpad.coffee:1365

    @@ -12969,7 +13005,7 @@

    userConfigPath

    Defined in - src/lib/docpad.coffee:1137 + src/lib/docpad.coffee:1097

    @@ -12995,7 +13031,7 @@

    version

    Defined in - src/lib/docpad.coffee:294 + src/lib/docpad.coffee:254

    @@ -13021,7 +13057,7 @@

    watchers

    Defined in - src/lib/docpad.coffee:5311 + src/lib/docpad.coffee:5304

    @@ -13047,7 +13083,7 @@

    websiteConfig

    Defined in - src/lib/docpad.coffee:1397 + src/lib/docpad.coffee:1357

    @@ -13074,7 +13110,7 @@

    websitePackageConfig

    Defined in - src/lib/docpad.coffee:1367 + src/lib/docpad.coffee:1327

    diff --git a/docs/classes/DocumentModel.html b/docs/classes/DocumentModel.html index 38e0b561..ca025599 100644 --- a/docs/classes/DocumentModel.html +++ b/docs/classes/DocumentModel.html @@ -100,7 +100,7 @@

    DocumentModel Class

    @@ -161,7 +161,7 @@

    DocumentModel

    Defined in - src/lib/models/document.coffee:26 + src/lib/models/document.coffee:25

    @@ -581,7 +581,7 @@

    action

    FileModel but overwritten in - src/lib/interfaces/console.coffee:694 + src/lib/interfaces/console.coffee:690

    @@ -644,7 +644,7 @@

    addUrl

    Inherited from FileModel: - src/lib/models/file.coffee:761 + src/lib/models/file.coffee:760

    @@ -707,7 +707,7 @@

    choose

    Defined in - src/lib/interfaces/console.coffee:652 + src/lib/interfaces/console.coffee:648

    @@ -791,7 +791,7 @@

    clean

    Defined in - src/lib/interfaces/console.coffee:893 + src/lib/interfaces/console.coffee:889

    @@ -841,7 +841,7 @@

    clone

    Inherited from FileModel: - src/lib/models/file.coffee:237 + src/lib/models/file.coffee:236

    @@ -891,7 +891,7 @@

    confirm

    Defined in - src/lib/interfaces/console.coffee:625 + src/lib/interfaces/console.coffee:621

    @@ -1038,7 +1038,7 @@

    contextualize

    FileModel but overwritten in - src/lib/models/document.coffee:375 + src/lib/models/document.coffee:374

    @@ -1109,7 +1109,7 @@

    delete

    Inherited from FileModel: - src/lib/models/file.coffee:1334 + src/lib/models/file.coffee:1333

    @@ -1177,7 +1177,7 @@

    deleteSource

    Inherited from FileModel: - src/lib/models/file.coffee:1380 + src/lib/models/file.coffee:1379

    @@ -1242,7 +1242,7 @@

    destroy

    Defined in - src/lib/interfaces/console.coffee:252 + src/lib/interfaces/console.coffee:248

    @@ -1299,7 +1299,7 @@

    encode

    Inherited from FileModel: - src/lib/models/file.coffee:416 + src/lib/models/file.coffee:415

    @@ -1363,7 +1363,7 @@

    extractConfig

    Defined in - src/lib/interfaces/console.coffee:361 + src/lib/interfaces/console.coffee:357

    @@ -1430,7 +1430,7 @@

    extractOptions

    Inherited from FileModel: - src/lib/models/file.coffee:165 + src/lib/models/file.coffee:164

    @@ -1490,7 +1490,7 @@

    generate

    Defined in - src/lib/interfaces/console.coffee:715 + src/lib/interfaces/console.coffee:711

    @@ -1540,7 +1540,7 @@

    getActionRunner

    Inherited from FileModel: - src/lib/models/file.coffee:834 + src/lib/models/file.coffee:833

    @@ -1586,7 +1586,7 @@

    getAttributes

    Inherited from FileModel: - src/lib/models/file.coffee:500 + src/lib/models/file.coffee:499

    @@ -1648,7 +1648,7 @@

    getBuffer

    Inherited from FileModel: - src/lib/models/file.coffee:461 + src/lib/models/file.coffee:460

    @@ -1690,7 +1690,7 @@

    getCommander

    Defined in - src/lib/interfaces/console.coffee:244 + src/lib/interfaces/console.coffee:240

    @@ -1732,7 +1732,7 @@

    getContent

    Inherited from FileModel: - src/lib/models/file.coffee:717 + src/lib/models/file.coffee:716

    @@ -1776,7 +1776,7 @@

    getEve

    Defined in - src/lib/models/document.coffee:469 + src/lib/models/document.coffee:468

    @@ -1843,7 +1843,7 @@

    getExtensions

    Inherited from FileModel: - src/lib/models/file.coffee:698 + src/lib/models/file.coffee:697

    @@ -1911,7 +1911,7 @@

    getFilename

    Inherited from FileModel: - src/lib/models/file.coffee:650 + src/lib/models/file.coffee:649

    @@ -1980,7 +1980,7 @@

    getFilePath

    Inherited from FileModel: - src/lib/models/file.coffee:676 + src/lib/models/file.coffee:675

    @@ -2046,7 +2046,7 @@

    getLayout

    Defined in - src/lib/models/document.coffee:429 + src/lib/models/document.coffee:428

    @@ -2101,7 +2101,7 @@

    getLocale

    Inherited from FileModel: - src/lib/models/file.coffee:133 + src/lib/models/file.coffee:132

    @@ -2148,7 +2148,7 @@

    getMeta

    Inherited from FileModel: - src/lib/models/file.coffee:535 + src/lib/models/file.coffee:534

    @@ -2209,7 +2209,7 @@

    getOptions

    Inherited from FileModel: - src/lib/models/file.coffee:140 + src/lib/models/file.coffee:139

    @@ -2254,7 +2254,7 @@

    getOutContent

    FileModel but overwritten in - src/lib/models/document.coffee:149 + src/lib/models/document.coffee:148

    @@ -2309,7 +2309,7 @@

    getPath

    Inherited from FileModel: - src/lib/models/file.coffee:803 + src/lib/models/file.coffee:802

    @@ -2378,7 +2378,7 @@

    getStat

    Inherited from FileModel: - src/lib/models/file.coffee:492 + src/lib/models/file.coffee:491

    @@ -2419,7 +2419,7 @@

    hasLayout

    Defined in - src/lib/models/document.coffee:419 + src/lib/models/document.coffee:418

    @@ -2463,7 +2463,7 @@

    help

    Defined in - src/lib/interfaces/console.coffee:724 + src/lib/interfaces/console.coffee:720

    @@ -2516,7 +2516,7 @@

    info

    Defined in - src/lib/interfaces/console.coffee:735 + src/lib/interfaces/console.coffee:731

    @@ -2569,7 +2569,7 @@

    init

    Defined in - src/lib/interfaces/console.coffee:706 + src/lib/interfaces/console.coffee:702

    @@ -2625,7 +2625,7 @@

    initialize

    Inherited from FileModel: - src/lib/models/file.coffee:847 + src/lib/models/file.coffee:846

    @@ -2692,7 +2692,7 @@

    install

    Defined in - src/lib/interfaces/console.coffee:772 + src/lib/interfaces/console.coffee:768

    @@ -2752,7 +2752,7 @@

    isBinary

    Inherited from FileModel: - src/lib/models/file.coffee:743 + src/lib/models/file.coffee:742

    @@ -2792,7 +2792,7 @@

    isBufferOutdated

    Inherited from FileModel: - src/lib/models/file.coffee:470 + src/lib/models/file.coffee:469

    @@ -2840,7 +2840,7 @@

    isOption

    Inherited from FileModel: - src/lib/models/file.coffee:152 + src/lib/models/file.coffee:151

    @@ -2897,7 +2897,7 @@

    isText

    Inherited from FileModel: - src/lib/models/file.coffee:734 + src/lib/models/file.coffee:733

    @@ -2944,7 +2944,7 @@

    load

    Inherited from FileModel: - src/lib/models/file.coffee:884 + src/lib/models/file.coffee:883

    @@ -3016,7 +3016,7 @@

    normalize

    FileModel but overwritten in - src/lib/models/document.coffee:345 + src/lib/models/document.coffee:344

    @@ -3090,7 +3090,7 @@

    parse

    FileModel but overwritten in - src/lib/models/document.coffee:181 + src/lib/models/document.coffee:180

    @@ -3162,7 +3162,7 @@

    performAction

    Defined in - src/lib/interfaces/console.coffee:310 + src/lib/interfaces/console.coffee:306

    @@ -3242,7 +3242,7 @@

    prompt

    Defined in - src/lib/interfaces/console.coffee:601 + src/lib/interfaces/console.coffee:597

    @@ -3316,7 +3316,7 @@

    referencesOthers

    Defined in - src/lib/models/document.coffee:163 + src/lib/models/document.coffee:162

    @@ -3374,7 +3374,7 @@

    removeUrl

    Inherited from FileModel: - src/lib/models/file.coffee:789 + src/lib/models/file.coffee:788

    @@ -3430,7 +3430,7 @@

    render

    Defined in - src/lib/models/document.coffee:673 + src/lib/models/document.coffee:672

    @@ -3509,7 +3509,7 @@

    render

    FileModel but overwritten in - src/lib/interfaces/console.coffee:804 + src/lib/interfaces/console.coffee:800

    @@ -3576,7 +3576,7 @@

    renderDocument

    Defined in - src/lib/models/document.coffee:593 + src/lib/models/document.coffee:592

    @@ -3647,7 +3647,7 @@

    renderExtensions

    Defined in - src/lib/models/document.coffee:502 + src/lib/models/document.coffee:501

    @@ -3726,7 +3726,7 @@

    renderLayouts

    Defined in - src/lib/models/document.coffee:624 + src/lib/models/document.coffee:623

    @@ -3794,7 +3794,7 @@

    run

    Defined in - src/lib/interfaces/console.coffee:872 + src/lib/interfaces/console.coffee:868

    @@ -3850,7 +3850,7 @@

    selectSkeletonCallback

    Defined in - src/lib/interfaces/console.coffee:409 + src/lib/interfaces/console.coffee:405

    @@ -3913,7 +3913,7 @@

    server

    Defined in - src/lib/interfaces/console.coffee:884 + src/lib/interfaces/console.coffee:880

    @@ -3969,7 +3969,7 @@

    set

    Inherited from FileModel: - src/lib/models/file.coffee:551 + src/lib/models/file.coffee:550

    @@ -4031,7 +4031,7 @@

    setBuffer

    Inherited from FileModel: - src/lib/models/file.coffee:447 + src/lib/models/file.coffee:446

    @@ -4090,7 +4090,7 @@

    setDefaults

    Inherited from FileModel: - src/lib/models/file.coffee:579 + src/lib/models/file.coffee:578

    @@ -4156,7 +4156,7 @@

    setMeta

    Inherited from FileModel: - src/lib/models/file.coffee:602 + src/lib/models/file.coffee:601

    @@ -4222,7 +4222,7 @@

    setMetaDefaults

    Inherited from FileModel: - src/lib/models/file.coffee:627 + src/lib/models/file.coffee:626

    @@ -4284,7 +4284,7 @@

    setOptions

    Inherited from FileModel: - src/lib/models/file.coffee:185 + src/lib/models/file.coffee:184

    @@ -4340,7 +4340,7 @@

    setStat

    Inherited from FileModel: - src/lib/models/file.coffee:479 + src/lib/models/file.coffee:478

    @@ -4392,7 +4392,7 @@

    setUrl

    Inherited from FileModel: - src/lib/models/file.coffee:751 + src/lib/models/file.coffee:750

    @@ -4444,7 +4444,7 @@

    start

    Defined in - src/lib/interfaces/console.coffee:235 + src/lib/interfaces/console.coffee:231

    @@ -4500,7 +4500,7 @@

    toJSON

    Inherited from FileModel: - src/lib/models/file.coffee:518 + src/lib/models/file.coffee:517

    @@ -4568,7 +4568,7 @@

    uninstall

    Defined in - src/lib/interfaces/console.coffee:788 + src/lib/interfaces/console.coffee:784

    @@ -4634,7 +4634,7 @@

    update

    Defined in - src/lib/interfaces/console.coffee:747 + src/lib/interfaces/console.coffee:743

    @@ -4700,7 +4700,7 @@

    upgrade

    Defined in - src/lib/interfaces/console.coffee:759 + src/lib/interfaces/console.coffee:755

    @@ -4763,7 +4763,7 @@

    watch

    Defined in - src/lib/interfaces/console.coffee:902 + src/lib/interfaces/console.coffee:898

    @@ -4819,7 +4819,7 @@

    welcomeCallback

    Defined in - src/lib/interfaces/console.coffee:450 + src/lib/interfaces/console.coffee:446

    @@ -4885,7 +4885,7 @@

    wrapAction

    Defined in - src/lib/interfaces/console.coffee:299 + src/lib/interfaces/console.coffee:295

    @@ -4951,7 +4951,7 @@

    write

    Inherited from FileModel: - src/lib/models/file.coffee:1249 + src/lib/models/file.coffee:1248

    @@ -5025,7 +5025,7 @@

    writeSource

    FileModel but overwritten in - src/lib/models/document.coffee:802 + src/lib/models/document.coffee:801

    @@ -5089,7 +5089,7 @@

    actionRunnerInstance

    Inherited from FileModel: - src/lib/models/file.coffee:828 + src/lib/models/file.coffee:827

    @@ -5113,7 +5113,7 @@

    buffer

    Inherited from FileModel: - src/lib/models/file.coffee:105 + src/lib/models/file.coffee:104

    @@ -5139,7 +5139,7 @@

    bufferTime

    Inherited from FileModel: - src/lib/models/file.coffee:113 + src/lib/models/file.coffee:112

    @@ -5163,7 +5163,7 @@

    detectEncoding

    Inherited from FileModel: - src/lib/models/file.coffee:90 + src/lib/models/file.coffee:89

    @@ -5191,7 +5191,7 @@

    FileModel but overwritten in - src/lib/models/document.coffee:93 + src/lib/models/document.coffee:92

    @@ -5220,7 +5220,7 @@

    klass

    FileModel but overwritten in - src/lib/models/document.coffee:74 + src/lib/models/document.coffee:73

    @@ -5246,7 +5246,7 @@

    locale

    Inherited from FileModel: - src/lib/models/file.coffee:127 + src/lib/models/file.coffee:126

    @@ -5271,7 +5271,7 @@

    meta

    Inherited from FileModel: - src/lib/models/file.coffee:119 + src/lib/models/file.coffee:118

    @@ -5296,7 +5296,7 @@

    rootOutDirPath

    Inherited from FileModel: - src/lib/models/file.coffee:84 + src/lib/models/file.coffee:83

    @@ -5320,7 +5320,7 @@

    stat

    Inherited from FileModel: - src/lib/models/file.coffee:96 + src/lib/models/file.coffee:95

    @@ -5348,7 +5348,7 @@

    TaskGroup

    Inherited from FileModel: - src/lib/models/file.coffee:77 + src/lib/models/file.coffee:76

    @@ -5376,7 +5376,7 @@

    type

    FileModel but overwritten in - src/lib/models/document.coffee:81 + src/lib/models/document.coffee:80

    diff --git a/docs/classes/FileModel.html b/docs/classes/FileModel.html index 4505693a..84e235d1 100644 --- a/docs/classes/FileModel.html +++ b/docs/classes/FileModel.html @@ -100,7 +100,7 @@

    FileModel Class

    @@ -148,7 +148,7 @@

    FileModel

    Defined in - src/lib/models/file.coffee:29 + src/lib/models/file.coffee:28

    @@ -434,7 +434,7 @@

    action

    Defined in - src/lib/models/file.coffee:840 + src/lib/models/file.coffee:839

    @@ -487,7 +487,7 @@

    addUrl

    Defined in - src/lib/models/file.coffee:761 + src/lib/models/file.coffee:760

    @@ -539,7 +539,7 @@

    clone

    Defined in - src/lib/models/file.coffee:237 + src/lib/models/file.coffee:236

    @@ -588,7 +588,7 @@

    contextualize

    Defined in - src/lib/models/file.coffee:1206 + src/lib/models/file.coffee:1205

    @@ -659,7 +659,7 @@

    delete

    Defined in - src/lib/models/file.coffee:1334 + src/lib/models/file.coffee:1333

    @@ -729,7 +729,7 @@

    deleteSource

    Defined in - src/lib/models/file.coffee:1380 + src/lib/models/file.coffee:1379

    @@ -800,7 +800,7 @@

    encode

    Defined in - src/lib/models/file.coffee:416 + src/lib/models/file.coffee:415

    @@ -867,7 +867,7 @@

    extractOptions

    Defined in - src/lib/models/file.coffee:165 + src/lib/models/file.coffee:164

    @@ -926,7 +926,7 @@

    getActionRunner

    Defined in - src/lib/models/file.coffee:834 + src/lib/models/file.coffee:833

    @@ -973,7 +973,7 @@

    getAttributes

    Defined in - src/lib/models/file.coffee:500 + src/lib/models/file.coffee:499

    @@ -1036,7 +1036,7 @@

    getBuffer

    Defined in - src/lib/models/file.coffee:461 + src/lib/models/file.coffee:460

    @@ -1080,7 +1080,7 @@

    getContent

    Defined in - src/lib/models/file.coffee:717 + src/lib/models/file.coffee:716

    @@ -1128,7 +1128,7 @@

    getExtensions

    Defined in - src/lib/models/file.coffee:698 + src/lib/models/file.coffee:697

    @@ -1198,7 +1198,7 @@

    getFilename

    Defined in - src/lib/models/file.coffee:650 + src/lib/models/file.coffee:649

    @@ -1268,7 +1268,7 @@

    getFilePath

    Defined in - src/lib/models/file.coffee:676 + src/lib/models/file.coffee:675

    @@ -1332,7 +1332,7 @@

    getLocale

    Defined in - src/lib/models/file.coffee:133 + src/lib/models/file.coffee:132

    @@ -1381,7 +1381,7 @@

    getMeta

    Defined in - src/lib/models/file.coffee:535 + src/lib/models/file.coffee:534

    @@ -1443,7 +1443,7 @@

    getOptions

    Defined in - src/lib/models/file.coffee:140 + src/lib/models/file.coffee:139

    @@ -1486,7 +1486,7 @@

    getOutContent

    Defined in - src/lib/models/file.coffee:726 + src/lib/models/file.coffee:725

    @@ -1536,7 +1536,7 @@

    getPath

    Defined in - src/lib/models/file.coffee:803 + src/lib/models/file.coffee:802

    @@ -1606,7 +1606,7 @@

    getStat

    Defined in - src/lib/models/file.coffee:492 + src/lib/models/file.coffee:491

    @@ -1655,7 +1655,7 @@

    initialize

    Defined in - src/lib/models/file.coffee:847 + src/lib/models/file.coffee:846

    @@ -1719,7 +1719,7 @@

    isBinary

    Defined in - src/lib/models/file.coffee:743 + src/lib/models/file.coffee:742

    @@ -1760,7 +1760,7 @@

    isBufferOutdated

    Defined in - src/lib/models/file.coffee:470 + src/lib/models/file.coffee:469

    @@ -1809,7 +1809,7 @@

    isOption

    Defined in - src/lib/models/file.coffee:152 + src/lib/models/file.coffee:151

    @@ -1867,7 +1867,7 @@

    isText

    Defined in - src/lib/models/file.coffee:734 + src/lib/models/file.coffee:733

    @@ -1915,7 +1915,7 @@

    load

    Defined in - src/lib/models/file.coffee:884 + src/lib/models/file.coffee:883

    @@ -1986,7 +1986,7 @@

    normalize

    Defined in - src/lib/models/file.coffee:1035 + src/lib/models/file.coffee:1034

    @@ -2057,7 +2057,7 @@

    parse

    Defined in - src/lib/models/file.coffee:960 + src/lib/models/file.coffee:959

    @@ -2123,7 +2123,7 @@

    removeUrl

    Defined in - src/lib/models/file.coffee:789 + src/lib/models/file.coffee:788

    @@ -2181,7 +2181,7 @@

    render

    Defined in - src/lib/models/file.coffee:1223 + src/lib/models/file.coffee:1222

    @@ -2253,7 +2253,7 @@

    set

    Defined in - src/lib/models/file.coffee:551 + src/lib/models/file.coffee:550

    @@ -2318,7 +2318,7 @@

    setBuffer

    Defined in - src/lib/models/file.coffee:447 + src/lib/models/file.coffee:446

    @@ -2378,7 +2378,7 @@

    setDefaults

    Defined in - src/lib/models/file.coffee:579 + src/lib/models/file.coffee:578

    @@ -2447,7 +2447,7 @@

    setMeta

    Defined in - src/lib/models/file.coffee:602 + src/lib/models/file.coffee:601

    @@ -2516,7 +2516,7 @@

    setMetaDefaults

    Defined in - src/lib/models/file.coffee:627 + src/lib/models/file.coffee:626

    @@ -2581,7 +2581,7 @@

    setOptions

    Defined in - src/lib/models/file.coffee:185 + src/lib/models/file.coffee:184

    @@ -2638,7 +2638,7 @@

    setStat

    Defined in - src/lib/models/file.coffee:479 + src/lib/models/file.coffee:478

    @@ -2691,7 +2691,7 @@

    setUrl

    Defined in - src/lib/models/file.coffee:751 + src/lib/models/file.coffee:750

    @@ -2747,7 +2747,7 @@

    toJSON

    Defined in - src/lib/models/file.coffee:518 + src/lib/models/file.coffee:517

    @@ -2816,7 +2816,7 @@

    write

    Defined in - src/lib/models/file.coffee:1249 + src/lib/models/file.coffee:1248

    @@ -2889,7 +2889,7 @@

    writeSource

    Defined in - src/lib/models/file.coffee:1309 + src/lib/models/file.coffee:1308

    @@ -2953,7 +2953,7 @@

    actionRunnerInstance

    Defined in - src/lib/models/file.coffee:828 + src/lib/models/file.coffee:827

    @@ -2978,7 +2978,7 @@

    buffer

    Defined in - src/lib/models/file.coffee:105 + src/lib/models/file.coffee:104

    @@ -3006,7 +3006,7 @@

    Defined in - src/lib/models/file.coffee:266 + src/lib/models/file.coffee:265

    @@ -3031,7 +3031,7 @@

    bufferTime

    Defined in - src/lib/models/file.coffee:113 + src/lib/models/file.coffee:112

    @@ -3056,7 +3056,7 @@

    detectEncoding

    Defined in - src/lib/models/file.coffee:90 + src/lib/models/file.coffee:89

    @@ -3082,7 +3082,7 @@

    klass

    Defined in - src/lib/models/file.coffee:60 + src/lib/models/file.coffee:59

    @@ -3109,7 +3109,7 @@

    locale

    Defined in - src/lib/models/file.coffee:127 + src/lib/models/file.coffee:126

    @@ -3135,7 +3135,7 @@

    meta

    Defined in - src/lib/models/file.coffee:119 + src/lib/models/file.coffee:118

    @@ -3161,7 +3161,7 @@

    rootOutDirPath

    Defined in - src/lib/models/file.coffee:84 + src/lib/models/file.coffee:83

    @@ -3186,7 +3186,7 @@

    stat

    Defined in - src/lib/models/file.coffee:96 + src/lib/models/file.coffee:95

    @@ -3215,7 +3215,7 @@

    TaskGroup

    Defined in - src/lib/models/file.coffee:77 + src/lib/models/file.coffee:76

    @@ -3241,7 +3241,7 @@

    type

    Defined in - src/lib/models/file.coffee:68 + src/lib/models/file.coffee:67

    diff --git a/docs/classes/docpadUtil.html b/docs/classes/docpadUtil.html index a830b3b8..d86e7cf0 100644 --- a/docs/classes/docpadUtil.html +++ b/docs/classes/docpadUtil.html @@ -97,7 +97,7 @@

    docpadUtil Class

    - Defined in: src/lib/util.coffee:16 + Defined in: src/lib/util.coffee:15
    @@ -128,7 +128,7 @@

    docpadUtil

    Defined in - src/lib/util.coffee:16 + src/lib/util.coffee:15

    @@ -289,7 +289,7 @@

    action

    Defined in - src/lib/util.coffee:280 + src/lib/util.coffee:279

    @@ -369,7 +369,7 @@

    getBasename

    Defined in - src/lib/util.coffee:187 + src/lib/util.coffee:186

    @@ -429,7 +429,7 @@

    getDefaultLogLevel

    Defined in - src/lib/util.coffee:56 + src/lib/util.coffee:55

    @@ -478,7 +478,7 @@

    getDirPath

    Defined in - src/lib/util.coffee:229 + src/lib/util.coffee:228

    @@ -542,7 +542,7 @@

    getExtension

    Defined in - src/lib/util.coffee:212 + src/lib/util.coffee:211

    @@ -607,7 +607,7 @@

    getExtensions

    Defined in - src/lib/util.coffee:201 + src/lib/util.coffee:200

    @@ -672,7 +672,7 @@

    getFilename

    Defined in - src/lib/util.coffee:239 + src/lib/util.coffee:238

    @@ -731,7 +731,7 @@

    getLocalDocPadExecutable

    Defined in - src/lib/util.coffee:138 + src/lib/util.coffee:137

    @@ -776,7 +776,7 @@

    getLocalDocPadExecutableExistance

    Defined in - src/lib/util.coffee:157 + src/lib/util.coffee:156

    @@ -826,7 +826,7 @@

    getOutFilename

    Defined in - src/lib/util.coffee:249 + src/lib/util.coffee:248

    @@ -899,7 +899,7 @@

    getSlug

    Defined in - src/lib/util.coffee:271 + src/lib/util.coffee:270

    @@ -964,7 +964,7 @@

    getUrl

    Defined in - src/lib/util.coffee:262 + src/lib/util.coffee:261

    @@ -1030,7 +1030,7 @@

    inspect

    Defined in - src/lib/util.coffee:105 + src/lib/util.coffee:104

    @@ -1098,7 +1098,7 @@

    isLocalDocPadExecutable

    Defined in - src/lib/util.coffee:148 + src/lib/util.coffee:147

    @@ -1140,7 +1140,7 @@

    isStandalone

    Defined in - src/lib/util.coffee:87 + src/lib/util.coffee:86

    @@ -1188,7 +1188,7 @@

    isStandardEncoding

    Defined in - src/lib/util.coffee:127 + src/lib/util.coffee:126

    @@ -1246,7 +1246,7 @@

    isTravis

    Defined in - src/lib/util.coffee:68 + src/lib/util.coffee:67

    @@ -1290,7 +1290,7 @@

    isTTY

    Defined in - src/lib/util.coffee:77 + src/lib/util.coffee:76

    @@ -1332,7 +1332,7 @@

    isUser

    Defined in - src/lib/util.coffee:96 + src/lib/util.coffee:95

    @@ -1380,7 +1380,7 @@

    startLocalDocPadExecutable

    Defined in - src/lib/util.coffee:166 + src/lib/util.coffee:165

    @@ -1446,7 +1446,7 @@

    wait

    Defined in - src/lib/util.coffee:46 + src/lib/util.coffee:45

    @@ -1510,7 +1510,7 @@

    writeError

    Defined in - src/lib/util.coffee:37 + src/lib/util.coffee:36

    @@ -1564,7 +1564,7 @@

    writeStderr

    Defined in - src/lib/util.coffee:25 + src/lib/util.coffee:24

    diff --git a/docs/data.json b/docs/data.json index cd757ad0..f91e6684 100644 --- a/docs/data.json +++ b/docs/data.json @@ -212,7 +212,7 @@ "plugin_for": [], "extension_for": [], "file": "src/lib/models/document.coffee", - "line": 26, + "line": 25, "description": "The DocumentModel class is DocPad's representation\nof a website or project's content files. This can be\nindividual web pages or blog posts etc. Generally, this\nis not other website files such as css files, images, or scripts -\nunless there is a requirement to have DocPad do transformation on\nthese files.\nExtends the DocPad FileModel class\nhttps://github.com/docpad/docpad/blob/master/src/lib/models/file.coffee\nDocumentModel primarily handles the rendering and parsing of document files.\nThis includes merging the document with layouts and managing the rendering\nfrom one file extension to another. The class inherits many of the file\nspecific operations and DocPad specific attributes from the FileModel class.\nHowever, it also overrides some parsing and file output operations contained\nin the FileModel class.\n\nTypically we do not need to create DocumentModels ourselves as DocPad handles\nall of that. Most of the time when we encounter DocumentModels is when\nquerying DocPad's document collections either in the docpad.coffee file or\nfrom within a template.\n\n\tindexDoc = @getCollection('documents').findOne({relativeOutPath: 'index.html'})\n\nA plugin, however, may need to create a DocumentModel depending on its requirements.\nIn such a case it is wise to use the built in DocPad methods to do so, in particular\ndocpad.createModel\n\n\t#check to see if the document alread exists ie its an update\n\tdocModel = @docpad.getCollection('posts').findOne({slug: 'some-slug'})\n\n\t#if so, load the existing document ready for regeneration\n\tif docModel\n\t\tdocModel.load()\n\telse\n\t\t#if document doesn't already exist, create it and add to database\n\t\tdocModel = @docpad.createModel({fullPath:'file/path/to/somewhere'})\n\t\tdocModel.load()", "docpad": ".getDatabase().add(docModel)", "is_constructor": 1, @@ -227,7 +227,7 @@ "plugin_for": [], "extension_for": [], "file": "src/lib/models/file.coffee", - "line": 29, + "line": 28, "description": "The FileModel class is DocPad's representation\nof a file in the file system.\nExtends the DocPad Model class\nhttps://github.com/docpad/docpad/blob/master/src/lib/base.coffee#L49.\nFileModel manages the loading\nof a file and parsing both the content and the metadata (if any).\nOnce loaded, the content, metadata and file stat (file info)\nproperties of the FileModel are populated, as well\nas a number of DocPad specific attributes and properties.\nTypically we do not need to create FileModels ourselves as\nDocPad handles all of that. But it is possible that a plugin\nmay need to manually create FileModels for some reason.\n\n\tattrs =\n\t\tfullPath: 'file/path/to/somewhere'\n\topts = {}\n\t#we only really need the path to the source file to create\n\t#a new file model\n\tmodel = new FileModel(attrs, opts)\n\nThe FileModel forms the base class for the DocPad DocumentModel class.", "is_constructor": 1, "extends": "Model" @@ -297,7 +297,7 @@ "plugin_for": [], "extension_for": [], "file": "src/lib/docpad.coffee", - "line": 118, + "line": 77, "description": "Contains methods for managing the DocPad application.\nThis includes managing a DocPad projects files and\ndocuments, watching directories, emitting events and\nmanaging the node.js/express.js web server.\nExtends https://github.com/bevry/event-emitter-grouped\n\nThe class is instantiated in the docpad-server.js file\nwhich is the entry point for a DocPad application.\n\n\tnew DocPad(docpadConfig, function(err, docpad) {\n\t\tif (err) {\n\t\t\treturn docpadUtil.writeError(err);\n\t\t}\n\t\treturn docpad.action(action, function(err) {\n\t\t\tif (err) {\n\t\t\t\treturn docpadUtil.writeError(err);\n\t\t\t}\n\t\t\treturn console.log('OK');\n\t\t});\n\t});", "is_constructor": 1, "extends": "EventEmitterGrouped" @@ -364,7 +364,7 @@ "plugin_for": [], "extension_for": [], "file": "src/lib/util.coffee", - "line": 16, + "line": 15, "description": "The DocPad Util Class.\nCollection of DocPad utility methods", "is_constructor": 1, "static": 1 @@ -559,7 +559,7 @@ }, { "file": "src/lib/interfaces/console.coffee", - "line": 235, + "line": 231, "description": "Start the CLI", "itemtype": "method", "name": "start", @@ -574,7 +574,7 @@ }, { "file": "src/lib/interfaces/console.coffee", - "line": 244, + "line": 240, "description": "Get the commander", "itemtype": "method", "name": "getCommander", @@ -585,7 +585,7 @@ }, { "file": "src/lib/interfaces/console.coffee", - "line": 252, + "line": 248, "description": "Destructor.", "itemtype": "method", "name": "destroy", @@ -600,7 +600,7 @@ }, { "file": "src/lib/interfaces/console.coffee", - "line": 299, + "line": 295, "description": "Wrap Action", "itemtype": "method", "name": "wrapAction", @@ -620,7 +620,7 @@ }, { "file": "src/lib/interfaces/console.coffee", - "line": 310, + "line": 306, "description": "Perform Action", "itemtype": "method", "name": "performAction", @@ -647,7 +647,7 @@ }, { "file": "src/lib/interfaces/console.coffee", - "line": 361, + "line": 357, "description": "Extract Configuration", "itemtype": "method", "name": "extractConfig", @@ -668,7 +668,7 @@ }, { "file": "src/lib/interfaces/console.coffee", - "line": 409, + "line": 405, "description": "Select a skeleton", "itemtype": "method", "name": "selectSkeletonCallback", @@ -688,7 +688,7 @@ }, { "file": "src/lib/interfaces/console.coffee", - "line": 450, + "line": 446, "description": "Welcome Callback", "itemtype": "method", "name": "welcomeCallback", @@ -708,7 +708,7 @@ }, { "file": "src/lib/interfaces/console.coffee", - "line": 601, + "line": 597, "description": "Prompt for input", "itemtype": "method", "name": "prompt", @@ -735,7 +735,7 @@ }, { "file": "src/lib/interfaces/console.coffee", - "line": 625, + "line": 621, "description": "Confirm an option", "itemtype": "method", "name": "confirm", @@ -762,7 +762,7 @@ }, { "file": "src/lib/interfaces/console.coffee", - "line": 652, + "line": 648, "description": "Choose something", "itemtype": "method", "name": "choose", @@ -794,7 +794,7 @@ }, { "file": "src/lib/interfaces/console.coffee", - "line": 694, + "line": 690, "description": "Do action", "itemtype": "method", "name": "action", @@ -814,7 +814,7 @@ }, { "file": "src/lib/interfaces/console.coffee", - "line": 706, + "line": 702, "description": "Action initialise", "itemtype": "method", "name": "init", @@ -829,7 +829,7 @@ }, { "file": "src/lib/interfaces/console.coffee", - "line": 715, + "line": 711, "description": "Generate action", "itemtype": "method", "name": "generate", @@ -844,7 +844,7 @@ }, { "file": "src/lib/interfaces/console.coffee", - "line": 724, + "line": 720, "description": "Help method", "itemtype": "method", "name": "help", @@ -859,7 +859,7 @@ }, { "file": "src/lib/interfaces/console.coffee", - "line": 735, + "line": 731, "description": "Info method", "itemtype": "method", "name": "info", @@ -874,7 +874,7 @@ }, { "file": "src/lib/interfaces/console.coffee", - "line": 747, + "line": 743, "description": "Update method", "itemtype": "method", "name": "update", @@ -894,7 +894,7 @@ }, { "file": "src/lib/interfaces/console.coffee", - "line": 759, + "line": 755, "description": "Upgrade method", "itemtype": "method", "name": "upgrade", @@ -914,7 +914,7 @@ }, { "file": "src/lib/interfaces/console.coffee", - "line": 772, + "line": 768, "description": "Install method", "itemtype": "method", "name": "install", @@ -934,7 +934,7 @@ }, { "file": "src/lib/interfaces/console.coffee", - "line": 788, + "line": 784, "description": "Uninstall method", "itemtype": "method", "name": "uninstall", @@ -954,7 +954,7 @@ }, { "file": "src/lib/interfaces/console.coffee", - "line": 804, + "line": 800, "description": "Render method", "itemtype": "method", "name": "render", @@ -974,7 +974,7 @@ }, { "file": "src/lib/interfaces/console.coffee", - "line": 872, + "line": 868, "description": "Run method", "itemtype": "method", "name": "run", @@ -989,7 +989,7 @@ }, { "file": "src/lib/interfaces/console.coffee", - "line": 884, + "line": 880, "description": "Server method", "itemtype": "method", "name": "server", @@ -1004,7 +1004,7 @@ }, { "file": "src/lib/interfaces/console.coffee", - "line": 893, + "line": 889, "description": "Clean method", "itemtype": "method", "name": "clean", @@ -1019,7 +1019,7 @@ }, { "file": "src/lib/interfaces/console.coffee", - "line": 902, + "line": 898, "description": "Watch method", "itemtype": "method", "name": "watch", @@ -1034,7 +1034,7 @@ }, { "file": "src/lib/models/document.coffee", - "line": 74, + "line": 73, "description": "The document model class.", "access": "private", "tagname": "", @@ -1045,7 +1045,7 @@ }, { "file": "src/lib/models/document.coffee", - "line": 81, + "line": 80, "description": "String name of the model type.\nIn this case, 'document'.", "access": "private", "tagname": "", @@ -1056,7 +1056,7 @@ }, { "file": "src/lib/models/document.coffee", - "line": 93, + "line": 92, "description": "The default attributes for any document model.", "access": "private", "tagname": "", @@ -1067,7 +1067,7 @@ }, { "file": "src/lib/models/document.coffee", - "line": 149, + "line": 148, "description": "Get the file content for output. This\nwill be the text content AFTER it has\nbeen through the rendering process. If\nthis has been called before the rendering\nprocess, then the raw text content will be returned,\nor, if early enough in the process, the file buffer object.", "itemtype": "method", "name": "getOutContent", @@ -1079,7 +1079,7 @@ }, { "file": "src/lib/models/document.coffee", - "line": 163, + "line": 162, "description": "Set flag to indicate if the document\ncontains references to other documents.\nUsed in the rendering process to decide\non whether to render this document when\nanother document is updated.", "itemtype": "method", "name": "referencesOthers", @@ -1096,7 +1096,7 @@ }, { "file": "src/lib/models/document.coffee", - "line": 181, + "line": 180, "description": "Parse our buffer and extract meaningful data from it.\nnext(err).", "itemtype": "method", "name": "parse", @@ -1118,7 +1118,7 @@ }, { "file": "src/lib/models/document.coffee", - "line": 345, + "line": 344, "description": "Normalize any parsing we have done, because if a value has\nupdates it may have consequences on another value.\nThis will ensure everything is okay.\nnext(err)", "itemtype": "method", "name": "normalize", @@ -1140,7 +1140,7 @@ }, { "file": "src/lib/models/document.coffee", - "line": 375, + "line": 374, "description": "Contextualize the data. In other words,\nput our data into the perspective of the bigger picture of the data.\nFor instance, generate the url for it's rendered equivalant.\nnext(err)", "itemtype": "method", "name": "contextualize", @@ -1162,7 +1162,7 @@ }, { "file": "src/lib/models/document.coffee", - "line": 419, + "line": 418, "description": "Checks if the file has a layout.", "itemtype": "method", "name": "hasLayout", @@ -1174,7 +1174,7 @@ }, { "file": "src/lib/models/document.coffee", - "line": 429, + "line": 428, "description": "Get the layout object that this file references (if any).\nWe update the layoutRelativePath as it is\nused for finding what documents are used by a\nlayout for when a layout changes.\nnext(err, layout)", "itemtype": "method", "name": "getLayout", @@ -1189,7 +1189,7 @@ }, { "file": "src/lib/models/document.coffee", - "line": 469, + "line": 468, "description": "Get the most ancestoral (root) layout we\nhave - ie, the very top one. Often this\nwill be the base or default layout for\na project. The layout where the head and other\nhtml on all pages is defined. In some projects,\nhowever, there may be more than one root layout\nso we can't assume there will always only be one.\nThis is used by the contextualize method to determine\nthe output extension of the document. In other words\nthe document's final output extension is determined by\nthe root layout.\nnext(err,layout)", "itemtype": "method", "name": "getEve", @@ -1204,7 +1204,7 @@ }, { "file": "src/lib/models/document.coffee", - "line": 502, + "line": 501, "description": "Renders one extension to another depending\non the document model's extensions property.\nTriggers the render event for each extension conversion.\nThis is the point where the various templating systems listen\nfor their extension and perform their conversions.\nCommon extension conversion is from md to html.\nSo the document source file maybe index.md.html.\nThis will be a markdown file to be converted to HTML.\nHowever, documents can be rendered through more than\none conversion. Index.html.md.eco will be rendered from\neco to md and then from md to html. Two conversions.\nnext(err,result)", "access": "private", "tagname": "", @@ -1226,7 +1226,7 @@ }, { "file": "src/lib/models/document.coffee", - "line": 593, + "line": 592, "description": "Triggers the renderDocument event after\nall extensions have been rendered. Listeners\ncan use this event to perform transformations\non the already rendered content.", "access": "private", "tagname": "", @@ -1248,7 +1248,7 @@ }, { "file": "src/lib/models/document.coffee", - "line": 624, + "line": 623, "description": "Render and merge layout content. Merge\nlayout metadata with document metadata.\nReturn the resulting merged content to\nthe callback result parameter.\nnext(err,result)", "access": "private", "tagname": "", @@ -1270,7 +1270,7 @@ }, { "file": "src/lib/models/document.coffee", - "line": 673, + "line": 672, "description": "Triggers the render process for this document.\nCalls the renderExtensions, renderDocument and\nrenderLayouts methods in sequence. This is the\nmethod you want to call if you want to trigger\nthe rendering of a document manually.\n\nThe rendered content is returned as the result\nparameter to the passed callback and the DocumentModel\ninstance is returned in the document parameter.\nnext(err,result,document)", "itemtype": "method", "name": "render", @@ -1292,7 +1292,7 @@ }, { "file": "src/lib/models/document.coffee", - "line": 802, + "line": 801, "description": "Write the source file. Optionally pass\nthe opts parameter to modify or set the file's\npath, content or type.\nnext(err)", "itemtype": "method", "name": "writeSource", @@ -1313,7 +1313,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 60, + "line": 59, "description": "The file model class. This should\nbe overridden in any descending classes.", "access": "private", "tagname": "", @@ -1324,7 +1324,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 68, + "line": 67, "description": "String name of the model type.\nIn this case, 'file'. This should\nbe overridden in any descending classes.", "access": "private", "tagname": "", @@ -1335,7 +1335,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 77, + "line": 76, "description": "Task Group Class", "access": "private", "tagname": "", @@ -1346,7 +1346,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 84, + "line": 83, "description": "The out directory path to put the relative path.", "itemtype": "property", "name": "rootOutDirPath", @@ -1355,7 +1355,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 90, + "line": 89, "description": "Whether or not we should detect encoding", "itemtype": "property", "name": "detectEncoding", @@ -1364,7 +1364,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 96, + "line": 95, "description": "Node.js file stat object.\nhttps://nodejs.org/api/fs.html#fs_class_fs_stats.\nBasically, information about a file, including file\ndates and size.", "itemtype": "property", "name": "stat", @@ -1373,7 +1373,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 105, + "line": 104, "description": "File buffer. Node.js Buffer object.\nhttps://nodejs.org/api/buffer.html#buffer_class_buffer.\nProvides methods for dealing with binary data directly.", "itemtype": "property", "name": "buffer", @@ -1382,7 +1382,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 113, + "line": 112, "description": "Buffer time.", "itemtype": "property", "name": "bufferTime", @@ -1391,7 +1391,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 119, + "line": 118, "description": "The parsed file meta data (header).\nIs a Model instance.", "access": "private", "tagname": "", @@ -1402,7 +1402,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 127, + "line": 126, "description": "Locale information for the file", "access": "private", "tagname": "", @@ -1413,7 +1413,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 133, + "line": 132, "description": "Get the file's locale information", "itemtype": "method", "name": "getLocale", @@ -1425,7 +1425,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 140, + "line": 139, "description": "Get Options. Returns an object containing\nthe properties detectEncoding, rootOutDirPath\nlocale, stat, buffer, meta and TaskGroup.", "access": "private", "tagname": "", @@ -1439,7 +1439,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 152, + "line": 151, "description": "Checks whether the passed key is one\nof the options.", "access": "private", "tagname": "", @@ -1460,7 +1460,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 165, + "line": 164, "description": "Extract Options.", "access": "private", "tagname": "", @@ -1481,7 +1481,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 185, + "line": 184, "description": "Set the options for the file model.\nValid properties for the attrs parameter:\nTaskGroup, detectEncoding, rootOutDirPath,\nlocale, stat, data, buffer, meta.", "itemtype": "method", "name": "setOptions", @@ -1498,7 +1498,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 237, + "line": 236, "description": "Clone the model and return the newly cloned model.", "itemtype": "method", "name": "clone", @@ -1510,7 +1510,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 266, + "line": 265, "description": "The default attributes for any file model.", "access": "private", "tagname": "", @@ -1521,7 +1521,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 416, + "line": 415, "description": "File encoding helper\nopts = {path, to, from, content}", "access": "private", "tagname": "", @@ -1542,7 +1542,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 447, + "line": 446, "description": "Set the file model's buffer.\nCreates a new node.js buffer\nobject if a buffer object is\nis not passed as the parameter", "itemtype": "method", "name": "setBuffer", @@ -1558,7 +1558,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 461, + "line": 460, "description": "Get the file model's buffer object.\nReturns a node.js buffer object.", "itemtype": "method", "name": "getBuffer", @@ -1570,7 +1570,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 470, + "line": 469, "description": "Is Buffer Outdated\nTrue if there is no buffer OR the buffer time is outdated", "itemtype": "method", "name": "isBufferOutdated", @@ -1582,7 +1582,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 479, + "line": 478, "description": "Set the node.js file stat.", "itemtype": "method", "name": "setStat", @@ -1597,7 +1597,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 492, + "line": 491, "description": "Get the node.js file stat.", "itemtype": "method", "name": "getStat", @@ -1609,7 +1609,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 500, + "line": 499, "description": "Get the file model attributes.\nBy default the attributes will be\ndereferenced from the file model.\nTo maintain a reference, pass false\nas the parameter. The returned object\nwill NOT contain the file model's ID attribute.", "itemtype": "method", "name": "getAttributes", @@ -1630,7 +1630,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 518, + "line": 517, "description": "Get the file model attributes.\nBy default the attributes will\nmaintain a reference to the file model.\nTo return a dereferenced object, pass true\nas the parameter. The returned object\nwill contain the file model's ID attribute.", "itemtype": "method", "name": "toJSON", @@ -1651,7 +1651,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 535, + "line": 534, "description": "Get the file model metadata object.\nOptionally pass a list of metadata property\nnames corresponding to those properties that\nyou want returned.", "itemtype": "method", "name": "getMeta", @@ -1671,7 +1671,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 551, + "line": 550, "description": "Assign attributes and options to the file model.", "itemtype": "method", "name": "set", @@ -1691,7 +1691,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 579, + "line": 578, "description": "Set defaults. Apply default attributes\nand options to the file model", "itemtype": "method", "name": "setDefaults", @@ -1711,7 +1711,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 602, + "line": 601, "description": "Set the file model meta data,\nattributes and options in one go.", "itemtype": "method", "name": "setMeta", @@ -1731,7 +1731,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 627, + "line": 626, "description": "Set the file model meta data defaults", "itemtype": "method", "name": "setMetaDefaults", @@ -1751,7 +1751,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 650, + "line": 649, "description": "Get the file name. Depending on the\nparameters passed this will either be\nthe file model's filename property or,\nthe filename determined from the fullPath\nor relativePath property. Valid values for\nthe opts parameter are: fullPath, relativePath\nor filename. Format: {filename}", "itemtype": "method", "name": "getFilename", @@ -1772,7 +1772,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 676, + "line": 675, "description": "Get the file path. Depending on the\nparameters passed this will either be\nthe file model's fullPath property, the\nrelativePath property or the filename property.\nValid values for the opts parameter are:\nfullPath, relativePath\nor filename. Format: {fullPath}", "itemtype": "method", "name": "getFilePath", @@ -1793,7 +1793,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 698, + "line": 697, "description": "Get file extensions. Depending on the\nparameters passed this will either be\nthe file model's extensions property or\nthe extensions extracted from the file model's\nfilename property. The opts parameter is passed\nin the format: {extensions,filename}.", "itemtype": "method", "name": "getExtensions", @@ -1812,7 +1812,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 717, + "line": 716, "description": "Get the file content. This will be\nthe text content if loaded or the file buffer object.", "itemtype": "method", "name": "getContent", @@ -1824,7 +1824,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 726, + "line": 725, "description": "Get the file content for output.", "itemtype": "method", "name": "getOutContent", @@ -1836,7 +1836,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 734, + "line": 733, "description": "Is this a text file? ie - not\na binary file.", "itemtype": "method", "name": "isText", @@ -1848,7 +1848,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 743, + "line": 742, "description": "Is this a binary file?", "itemtype": "method", "name": "isBinary", @@ -1860,7 +1860,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 751, + "line": 750, "description": "Set the url for the file", "itemtype": "method", "name": "setUrl", @@ -1875,7 +1875,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 761, + "line": 760, "description": "A file can have multiple urls.\nThis method adds either a single url\nor an array of urls to the file model.", "itemtype": "method", "name": "addUrl", @@ -1890,7 +1890,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 789, + "line": 788, "description": "Removes a url from the file\nmodel (files can have more than one url).", "itemtype": "method", "name": "removeUrl", @@ -1905,7 +1905,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 803, + "line": 802, "description": "Get a file path.\nIf the relativePath parameter starts with `.` then we get the\npath in relation to the document that is calling it.\nOtherwise we just return it as normal", "itemtype": "method", "name": "getPath", @@ -1929,7 +1929,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 828, + "line": 827, "description": "The action runner instance bound to DocPad", "access": "private", "tagname": "", @@ -1940,7 +1940,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 834, + "line": 833, "description": "Get the action runner instance bound to DocPad", "itemtype": "method", "name": "getActionRunner", @@ -1952,7 +1952,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 840, + "line": 839, "description": "Apply an action with the supplied arguments.", "itemtype": "method", "name": "action", @@ -1967,7 +1967,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 847, + "line": 846, "description": "Initialize the file model with the passed\nattributes and options. Emits the init event.", "itemtype": "method", "name": "initialize", @@ -1989,7 +1989,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 884, + "line": 883, "description": "Load the file from the file system.\nIf the fullPath exists, load the file.\nIf it doesn't, then parse and normalize the file.\nOptionally pass file options as a parameter.", "itemtype": "method", "name": "load", @@ -2011,7 +2011,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 960, + "line": 959, "description": "Parse our buffer and extract meaningful data from it.\nnext(err).", "itemtype": "method", "name": "parse", @@ -2033,7 +2033,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 1035, + "line": 1034, "description": "Normalize any parsing we have done, because if a value has\nupdates it may have consequences on another value.\nThis will ensure everything is okay.\nnext(err)", "itemtype": "method", "name": "normalize", @@ -2055,7 +2055,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 1206, + "line": 1205, "description": "Contextualize the data. In other words,\nput our data into the perspective of the bigger picture of the data.\nFor instance, generate the url for it's rendered equivalant.\nnext(err)", "itemtype": "method", "name": "contextualize", @@ -2077,7 +2077,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 1223, + "line": 1222, "description": "Render this file. The file model output content is\nreturned to the passed callback in the\nresult (2nd) parameter. The file model itself is returned\nin the callback's document (3rd) parameter.\nnext(err,result,document)", "itemtype": "method", "name": "render", @@ -2099,7 +2099,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 1249, + "line": 1248, "description": "Write the out file. The out file\nmay be different from the input file.\nOften the input file is transformed in some way\nand saved as another file format. A common example\nis transforming a markdown input file to a HTML\noutput file.\nnext(err)", "itemtype": "method", "name": "write", @@ -2119,7 +2119,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 1309, + "line": 1308, "description": "Write the source file. Optionally pass\nthe opts parameter to modify or set the file's\npath, content or type.\nnext(err)", "itemtype": "method", "name": "writeSource", @@ -2140,7 +2140,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 1334, + "line": 1333, "description": "Delete the out file, perhaps ahead of regeneration.\nOptionally pass the opts parameter to set the file path or type.\nnext(err)", "itemtype": "method", "name": "delete", @@ -2161,7 +2161,7 @@ }, { "file": "src/lib/models/file.coffee", - "line": 1380, + "line": 1379, "description": "Delete the source file.\nOptionally pass the opts parameter to set the file path or type.\nnext(err)", "itemtype": "method", "name": "deleteSource", @@ -2182,7 +2182,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 180, + "line": 139, "description": "Events class\nhttps://github.com/docpad/docpad/blob/master/src/lib/base.coffee", "itemtype": "property", "name": "Events", @@ -2191,7 +2191,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 186, + "line": 146, "description": "Model class\nExtension of the Backbone Model class\nhttp://backbonejs.org/#Model\nhttps://github.com/docpad/docpad/blob/master/src/lib/base.coffee", "itemtype": "property", "name": "Model", @@ -2200,7 +2200,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 195, + "line": 155, "description": "Collection class\nExtension of the Backbone Collection class\nhttps://github.com/docpad/docpad/blob/master/src/lib/base.coffee\nhttp://backbonejs.org/#Collection", "itemtype": "property", "name": "Collection", @@ -2209,7 +2209,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 204, + "line": 164, "description": "QueryCollection class\nExtension of the Query Engine QueryCollection class\nhttps://github.com/docpad/docpad/blob/master/src/lib/base.coffee\nhttps://github.com/bevry/query-engine/blob/master/src/documents/lib/query-engine.js.coffee", "itemtype": "property", "name": "QueryCollection", @@ -2218,7 +2218,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 216, + "line": 176, "description": "File Model class\nExtension of the Model class\nhttps://github.com/docpad/docpad/blob/master/src/lib/models/file.coffee", "itemtype": "property", "name": "FileModel", @@ -2227,7 +2227,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 224, + "line": 184, "description": "Document Model class\nExtension of the File Model class\nhttps://github.com/docpad/docpad/blob/master/src/lib/models/document.coffee", "itemtype": "property", "name": "DocumentModel", @@ -2236,7 +2236,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 235, + "line": 195, "description": "Collection of files in a DocPad project\nExtension of the QueryCollection class\nhttps://github.com/docpad/docpad/blob/master/src/lib/collections/files.coffee", "itemtype": "property", "name": "FilesCollection", @@ -2245,7 +2245,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 243, + "line": 203, "description": "Collection of elements in a DocPad project\nExtension of the Collection class\nhttps://github.com/docpad/docpad/blob/master/src/lib/collections/elements.coffee", "itemtype": "property", "name": "ElementsCollection", @@ -2254,7 +2254,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 251, + "line": 211, "description": "Collection of metadata in a DocPad project\nExtension of the ElementsCollection class\nhttps://github.com/docpad/docpad/blob/master/src/lib/collections/meta.coffee", "itemtype": "property", "name": "MetaCollection", @@ -2263,7 +2263,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 259, + "line": 219, "description": "Collection of JS script files in a DocPad project\nExtension of the ElementsCollection class\nhttps://github.com/docpad/docpad/blob/master/src/lib/collections/scripts.coffee", "itemtype": "property", "name": "ScriptsCollection", @@ -2272,7 +2272,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 267, + "line": 227, "description": "Collection of CSS style files in a DocPad project\nExtension of the ElementsCollection class\nhttps://github.com/docpad/docpad/blob/master/src/lib/collections/styles.coffee", "itemtype": "property", "name": "StylesCollection", @@ -2281,7 +2281,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 275, + "line": 235, "description": "Plugin Loader class\nhttps://github.com/docpad/docpad/blob/master/src/lib/plugin-loader.coffee\nLoads the DocPad plugins from the file system into\na DocPad project", "itemtype": "property", "name": "PluginLoader", @@ -2290,7 +2290,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 284, + "line": 244, "description": "Base class for all DocPad plugins\nhttps://github.com/docpad/docpad/blob/master/src/lib/plugin.coffee", "itemtype": "property", "name": "BasePlugin", @@ -2299,7 +2299,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 294, + "line": 254, "description": "DocPad's version number", "access": "private", "tagname": "", @@ -2310,7 +2310,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 301, + "line": 261, "description": "Get the DocPad version number", "itemtype": "method", "name": "getVersion", @@ -2322,7 +2322,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 310, + "line": 270, "description": "Get the DocPad version string", "itemtype": "method", "name": "getVersionString", @@ -2334,7 +2334,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 321, + "line": 281, "description": "The plugin version requirements", "itemtype": "property", "name": "pluginVersion", @@ -2343,7 +2343,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 328, + "line": 288, "description": "Get the process platform", "itemtype": "method", "name": "getProcessPlatform", @@ -2355,7 +2355,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 335, + "line": 295, "description": "Get the process version string", "itemtype": "method", "name": "getProcessVersion", @@ -2367,7 +2367,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 342, + "line": 302, "description": "The express.js server instance bound to DocPad.\nhttp://expressjs.com", "access": "private", "tagname": "", @@ -2378,7 +2378,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 350, + "line": 310, "description": "The Node.js http server instance bound to DocPad\nhttps://nodejs.org/api/http.html", "access": "private", "tagname": "", @@ -2389,7 +2389,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 358, + "line": 318, "description": "Get the DocPad express.js server instance and, optionally,\nthe node.js https server instance", "itemtype": "method", "name": "getServer", @@ -2410,7 +2410,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 372, + "line": 332, "description": "Set the express.js server and node.js http server\nto bind to DocPad", "itemtype": "method", "name": "setServer", @@ -2425,7 +2425,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 389, + "line": 349, "description": "Destructor. Close and destroy the node.js http server", "access": "private", "tagname": "", @@ -2435,7 +2435,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 400, + "line": 360, "description": "Internal property. The caterpillar logger instances bound to DocPad", "access": "private", "tagname": "", @@ -2446,7 +2446,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 407, + "line": 367, "description": "Get the caterpillar logger instance bound to DocPad", "itemtype": "method", "name": "getLogger", @@ -2458,7 +2458,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 414, + "line": 374, "description": "Get all the caterpillar logger instances bound to DocPad", "itemtype": "method", "name": "getLoggers", @@ -2470,7 +2470,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 421, + "line": 381, "description": "Sets the caterpillar logger instances bound to DocPad", "itemtype": "method", "name": "setLoggers", @@ -2489,7 +2489,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 436, + "line": 396, "description": "Destructor. Destroy the caterpillar logger instances bound to DocPad", "access": "private", "tagname": "", @@ -2500,7 +2500,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 447, + "line": 407, "description": "The action runner instance bound to docpad", "access": "private", "tagname": "", @@ -2511,7 +2511,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 454, + "line": 414, "description": "Get the action runner instance bound to docpad", "itemtype": "method", "name": "getActionRunner", @@ -2523,7 +2523,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 461, + "line": 421, "description": "Apply the passed DocPad action arguments", "itemtype": "method", "name": "action", @@ -2543,7 +2543,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 470, + "line": 430, "description": "The error runner instance bound to DocPad", "itemtype": "property", "name": "errorRunnerInstance", @@ -2552,7 +2552,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 476, + "line": 436, "description": "Get the error runner instance", "itemtype": "method", "name": "getErrorRunner", @@ -2565,7 +2565,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 483, + "line": 443, "description": "The track runner instance bound to DocPad", "access": "private", "tagname": "", @@ -2576,7 +2576,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 490, + "line": 450, "description": "Get the track runner instance", "itemtype": "method", "name": "getTrackRunner", @@ -2588,7 +2588,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 498, + "line": 458, "description": "Event Listing. String array of event names.\nWhenever an event is created, it must be applied here to be available to plugins and configuration files\nhttps://github.com/bevry/docpad/wiki/Events", "access": "private", "tagname": "", @@ -2599,7 +2599,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 533, + "line": 493, "description": "Get the list of available events", "itemtype": "method", "name": "getEvents", @@ -2611,7 +2611,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 547, + "line": 507, "description": "QueryEngine collection", "access": "private", "tagname": "", @@ -2622,7 +2622,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 554, + "line": 514, "description": "A FilesCollection of models updated\nfrom the DocPad database after each regeneration.", "access": "private", "tagname": "", @@ -2633,7 +2633,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 562, + "line": 522, "description": "Description for getDatabase", "itemtype": "method", "name": "getDatabase", @@ -2642,7 +2642,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 568, + "line": 528, "description": "Safe method for retrieving the database by\neither returning the database itself or the temporary\ndatabase cache", "itemtype": "method", "name": "getDatabaseSafe", @@ -2654,7 +2654,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 577, + "line": 537, "description": "Destructor. Destroy the DocPad database", "access": "private", "tagname": "", @@ -2664,7 +2664,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 591, + "line": 551, "description": "Files by url. Used to speed up fetching", "access": "private", "tagname": "", @@ -2675,7 +2675,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 598, + "line": 558, "description": "Files by Selector. Used to speed up fetching", "access": "private", "tagname": "", @@ -2686,7 +2686,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 605, + "line": 565, "description": "Files by Out Path. Used to speed up conflict detection. Do not use for anything else", "access": "private", "tagname": "", @@ -2697,7 +2697,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 612, + "line": 572, "description": "Blocks", "access": "private", "tagname": "", @@ -2708,7 +2708,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 629, + "line": 589, "description": "Get a block by block name. Optionally clone block.", "itemtype": "method", "name": "getBlock", @@ -2733,7 +2733,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 643, + "line": 603, "description": "Set a block by name and value", "itemtype": "method", "name": "setBlock", @@ -2753,7 +2753,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 660, + "line": 620, "description": "Get all blocks", "itemtype": "method", "name": "getBlocks", @@ -2765,7 +2765,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 667, + "line": 627, "description": "Set all blocks", "itemtype": "method", "name": "setBlocks", @@ -2780,7 +2780,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 677, + "line": 637, "description": "Apply the passed function to each block", "itemtype": "method", "name": "eachBlock", @@ -2795,7 +2795,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 686, + "line": 646, "description": "Destructor. Destroy all blocks", "access": "private", "tagname": "", @@ -2805,7 +2805,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 698, + "line": 658, "description": "The DocPad collections", "access": "private", "tagname": "", @@ -2816,7 +2816,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 705, + "line": 665, "description": "Get a collection by collection name or key.\nThis is often accessed within the docpad.coffee\nfile or a layout/page via @getCollection.\nBecause getCollection returns a docpad collection,\na call to this method is often chained with a\nQueryEngine style query.", "getcollection": "('documents').findAllLive({relativeOutDirPath: 'posts'},[{date:-1}])", "itemtype": "method", @@ -2836,7 +2836,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 737, + "line": 697, "description": "Destroy a collection by collection name or key", "itemtype": "method", "name": "destroyCollection", @@ -2855,7 +2855,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 763, + "line": 723, "description": "Add a collection", "itemtype": "method", "name": "addCollection", @@ -2870,7 +2870,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 773, + "line": 733, "description": "Set a name for a collection.\nA collection can have multiple names\n\nThe partials plugin (https://github.com/docpad/docpad-plugin-partials)\ncreates a live collection and passes this to setCollection with\nthe name 'partials'.\n\n\t# Add our partials collection\n\tdocpad.setCollection('partials', database.createLiveChildCollection()\n\t\t.setQuery('isPartial', {\n\t\t\t\t$or:\n\t\t\t\t\tisPartial: true\n\t\t\t\t\tfullPath: $startsWith: config.partialsPath\n\t\t})\n\t\t.on('add', (model) ->\n\t\t\tdocpad.log('debug', util.format(locale.addingPartial, model.getFilePath()))\n\t\t\tmodel.setDefaults(\n\t\t\t\tisPartial: true\n\t\t\t\trender: false\n\t\t\t\twrite: false\n\t\t\t)\n\t\t)\n\t)", "itemtype": "method", "name": "setCollection", @@ -2890,7 +2890,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 813, + "line": 773, "description": "Get the DocPad project's collections", "itemtype": "method", "name": "getCollections", @@ -2902,7 +2902,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 821, + "line": 781, "description": "Set the DocPad project's collections", "itemtype": "method", "name": "setCollections", @@ -2910,7 +2910,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 834, + "line": 794, "description": "Apply the passed function to each collection", "itemtype": "method", "name": "eachCollection", @@ -2925,7 +2925,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 845, + "line": 805, "description": "Destructor. Destroy the DocPad project's collections.", "access": "private", "tagname": "", @@ -2935,7 +2935,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 861, + "line": 821, "description": "Get all the files in the DocPad database (will use live collections)", "itemtype": "method", "name": "getFiles", @@ -2964,7 +2964,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 879, + "line": 839, "description": "Get a single file based on a query", "itemtype": "method", "name": "getFile", @@ -2993,7 +2993,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 891, + "line": 851, "description": "Get files at a path", "itemtype": "method", "name": "getFilesAtPath", @@ -3022,7 +3022,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 904, + "line": 864, "description": "Get a file at a relative or absolute path or url", "itemtype": "method", "name": "getFileAtPath", @@ -3051,7 +3051,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 918, + "line": 878, "description": "Get a file by its url", "itemtype": "method", "name": "getFileByUrl", @@ -3077,7 +3077,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 931, + "line": 891, "description": "Get a file by its id", "itemtype": "method", "name": "getFileById", @@ -3103,7 +3103,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 944, + "line": 904, "description": "Remove the query string from a url\nPathname convention taken from document.location.pathname", "itemtype": "method", "name": "getUrlPathname", @@ -3122,7 +3122,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 954, + "line": 914, "description": "Get a file by its route and return\nit to the supplied callback.", "itemtype": "method", "name": "getFileByRoute", @@ -3154,7 +3154,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 996, + "line": 956, "description": "Get a file by its selector", "itemtype": "method", "name": "getFileBySelector", @@ -3180,7 +3180,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1017, + "line": 977, "description": "Skeletons Collection", "access": "private", "tagname": "", @@ -3191,7 +3191,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1024, + "line": 984, "description": "Get Skeletons\nGet all the available skeletons with their details and\nreturn this collection to the supplied callback.", "itemtype": "method", "name": "getSkeletons", @@ -3222,7 +3222,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1079, + "line": 1039, "description": "Plugins that are loading really slow", "itemtype": "property", "name": "slowPlugins", @@ -3231,7 +3231,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1085, + "line": 1045, "description": "Loaded plugins indexed by name", "itemtype": "property", "name": "loadedPlugins", @@ -3240,7 +3240,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1091, + "line": 1051, "description": "A listing of all the available extensions for DocPad", "itemtype": "property", "name": "exchange", @@ -3249,7 +3249,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1100, + "line": 1060, "description": "The DocPad directory", "itemtype": "property", "name": "corePath", @@ -3258,7 +3258,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1106, + "line": 1066, "description": "The DocPad library directory", "access": "private", "tagname": "", @@ -3269,7 +3269,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1113, + "line": 1073, "description": "The main DocPad file", "itemtype": "property", "name": "mainPath", @@ -3278,7 +3278,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1119, + "line": 1079, "description": "The DocPad package.json path", "itemtype": "property", "name": "packagePath", @@ -3287,7 +3287,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1125, + "line": 1085, "description": "The DocPad locale path", "itemtype": "property", "name": "localePath", @@ -3296,7 +3296,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1131, + "line": 1091, "description": "The DocPad debug log path (docpad-debug.log)", "itemtype": "property", "name": "debugLogPath", @@ -3305,7 +3305,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1137, + "line": 1097, "description": "The User's configuration path (.docpad.cson)", "itemtype": "property", "name": "userConfigPath", @@ -3314,7 +3314,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1147, + "line": 1107, "description": "Description for initialTemplateData", "access": "private", "tagname": "", @@ -3325,7 +3325,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1154, + "line": 1114, "description": "Plugin's Extended Template Data", "access": "private", "tagname": "", @@ -3336,7 +3336,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1161, + "line": 1121, "description": "Get Complete Template Data", "itemtype": "method", "name": "getTemplateData", @@ -3355,7 +3355,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1278, + "line": 1238, "description": "Determined locale", "access": "private", "tagname": "", @@ -3366,7 +3366,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1286, + "line": 1246, "description": "Get the locale (language code and locale code)", "itemtype": "method", "name": "getLocale", @@ -3378,7 +3378,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1306, + "line": 1266, "description": "Load the locale", "itemtype": "method", "name": "loadLocale", @@ -3397,7 +3397,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1335, + "line": 1295, "description": "Get the DocPad environment, eg: development,\nproduction or static", "itemtype": "method", "name": "getEnvironment", @@ -3409,7 +3409,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1345, + "line": 1305, "description": "Get the environments", "itemtype": "method", "name": "getEnvironments", @@ -3421,7 +3421,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1359, + "line": 1319, "description": "Hash Key\nThe key that we use to hash some data before sending it to our statistic server", "access": "private", "tagname": "", @@ -3432,7 +3432,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1367, + "line": 1327, "description": "Website Package Configuration", "access": "private", "tagname": "", @@ -3443,7 +3443,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1374, + "line": 1334, "description": "Merged Configuration\nMerged in the order of:\n- initialConfig\n- userConfig\n- websiteConfig\n- instanceConfig\n- environmentConfig\nUse getConfig to retrieve this value", "access": "private", "tagname": "", @@ -3454,7 +3454,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1389, + "line": 1349, "description": "Instance Configuration", "access": "private", "tagname": "", @@ -3465,7 +3465,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1397, + "line": 1357, "description": "Website Configuration\nMerged into the config property", "access": "private", "tagname": "", @@ -3476,7 +3476,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1405, + "line": 1365, "description": "User Configuraiton\nMerged into the config property", "access": "private", "tagname": "", @@ -3487,7 +3487,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1434, + "line": 1394, "description": "Initial Configuration. The default docpadConfig\nsettings that can be overridden in a project's docpad.coffee file.\nMerged into the config property", "access": "private", "tagname": "", @@ -3498,7 +3498,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1728, + "line": 1683, "description": "Regenerate Timer\nWhen config.regenerateEvery is set to a value, we create a timer here", "access": "private", "tagname": "", @@ -3509,7 +3509,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1736, + "line": 1691, "description": "Get the DocPad configuration. Commonly\ncalled within the docpad.coffee file or within\nplugins to access application specific configurations.\n\tserverExtend: (opts) ->\nExtract the server from the options\n\t\t\t{server} = opts\n\t\t\tdocpad = @docpad\n\nAs we are now running in an event,\nensure we are using the latest copy of the docpad configuraiton\nand fetch our urls from it\n\t\t\tlatestConfig = docpad.getConfig()\n\t\t\toldUrls = latestConfig.templateData.site.oldUrls or []\n\t\t\tnewUrl = latestConfig.templateData.site.url\n\nRedirect any requests accessing one of our sites oldUrls to the new site url\n\t\t\tserver.use (req,res,next) ->\n\t\t\t\t...", "itemtype": "method", "name": "getConfig", @@ -3521,7 +3521,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1761, + "line": 1716, "description": "Get the port that DocPad is listening on (eg 9778)", "itemtype": "method", "name": "getPort", @@ -3533,7 +3533,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1769, + "line": 1724, "description": "Get the Hostname", "itemtype": "method", "name": "getHostname", @@ -3545,7 +3545,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1777, + "line": 1732, "description": "Get address", "itemtype": "method", "name": "getServerUrl", @@ -3566,7 +3566,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1792, + "line": 1747, "description": "Get simple server URL (changes 0.0.0.0, ::, and ::1 to 127.0.0.1)", "itemtype": "method", "name": "getSimpleServerUrl", @@ -3596,7 +3596,26 @@ }, { "file": "src/lib/docpad.coffee", - "line": 1807, + "line": 1762, + "description": "Create our own custom TaskGroup instance for DocPad.\nThat will listen to tasks as they execute and provide debugging information.", + "itemtype": "method", + "name": "createTaskGroup", + "params": [ + { + "name": "opts", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "TaskGroup" + }, + "class": "Docpad" + }, + { + "file": "src/lib/docpad.coffee", + "line": 1820, "description": "Constructor method. Sets up the DocPad instance.\nnext(err)", "itemtype": "method", "name": "constructor", @@ -3623,7 +3642,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 2053, + "line": 2011, "description": "Destructor. Destroy the DocPad instance\nThis is an action, and should be called as such\nE.g. docpad.action('destroy', next)", "itemtype": "method", "name": "destroy", @@ -3650,7 +3669,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 2111, + "line": 2069, "description": "Emit event, serial", "access": "private", "tagname": "", @@ -3684,7 +3703,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 2143, + "line": 2101, "description": "Emit event, parallel", "access": "private", "tagname": "", @@ -3718,7 +3737,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 2179, + "line": 2137, "description": "Get the ignore options for the DocPad project", "itemtype": "method", "name": "getIgnoreOpts", @@ -3730,7 +3749,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 2187, + "line": 2145, "description": "Is the supplied path ignored?", "itemtype": "method", "name": "isIgnoredPath", @@ -3756,7 +3775,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 2198, + "line": 2156, "description": "Scan directory", "itemtype": "method", "name": "scandir", @@ -3773,111 +3792,27 @@ }, { "file": "src/lib/docpad.coffee", - "line": 2210, - "description": "Watch Directory. Wrapper around the Bevry watchr\nmodule (https://github.com/bevry/watchr). Used\ninternally by DocPad to watch project documents\nand files and then activate the regeneration process\nwhen any of those items are updated.\n\nAlthough it is possible to pass a range of options to watchdir\nin practice these options are provided as part of\nthe DocPad config object with a number of default options\nspecified in the DocPad config.", + "line": 2168, + "description": "Watch Directory. Wrapper around the Bevry watchr\nmodule (https://github.com/bevry/watchr). Used\ninternally by DocPad to watch project documents\nand files and then activate the regeneration process\nwhen any of those items are updated.", + "access": "private", + "tagname": "", "itemtype": "method", "name": "watchdir", "params": [ { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}", - "props": [ - { - "name": "path", - "description": "a single path to watch.", - "type": "String", - "optional": true - }, - { - "name": "paths", - "description": "an array of paths to watch.", - "type": "Array", - "optional": true - }, - { - "name": "listener", - "description": "a single change listener to fire when a change occurs.", - "type": "Function", - "optional": true - }, - { - "name": "listeners", - "description": "an array of listeners.", - "type": "Array", - "optional": true - }, - { - "name": "next", - "description": "callback.", - "type": "Function", - "optional": true - }, - { - "name": "stat", - "description": "a file stat object to use for the path, instead of fetching a new one.", - "type": "Object", - "optional": true - }, - { - "name": "interval", - "description": "for systems that poll to detect file changes, how often should it poll in millseconds.", - "type": "Number", - "optional": true, - "optdefault": "5007" - }, - { - "name": "catupDelay", - "description": "handles system swap file deletions and renaming", - "type": "Number", - "optional": true, - "optdefault": "200" - }, - { - "name": "preferredMethods", - "description": "which order should we prefer our watching methods to be tried?.", - "type": "Array", - "optional": true, - "optdefault": "['watch','watchFile'" - }, - { - "name": "followLinks", - "description": "follow symlinks, i.e. use stat rather than lstat.", - "type": "Boolean", - "optional": true, - "optdefault": "true" - }, - { - "name": "ignorePaths", - "description": "an array of full paths to ignore.", - "type": "Boolean|Array", - "optional": true, - "optdefault": "false" - }, - { - "name": "ignoreHiddenFiles", - "description": "whether or not to ignored files which filename starts with a \".\".", - "type": "Boolean|Array", - "optional": true, - "optdefault": "false" - }, - { - "name": "ignoreCommonPatterns", - "description": "whether or not to ignore common undesirable file patterns (e.g. .svn, .git, .DS_Store, thumbs.db, etc).", - "type": "Boolean", - "optional": true, - "optdefault": "true" - }, - { - "name": "ignoreCustomPatterns", - "description": "any custom ignore patterns that you would also like to ignore along with the common patterns.", - "type": "Boolean|Array", - "optional": true, - "optdefault": "null" - } - ] + "name": "path", + "description": "- the path to watch", + "type": "String" + }, + { + "name": "listeners", + "description": "- listeners to attach to the watcher", + "type": "Object" + }, + { + "name": "next", + "description": "- completion callback accepting error", + "type": "Function" } ], "return": { @@ -3888,7 +3823,34 @@ }, { "file": "src/lib/docpad.coffee", - "line": 2247, + "line": 2190, + "description": "Watch Directories. Wrapper around watchdir.", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "watchdirs", + "params": [ + { + "name": "paths", + "description": "- the paths to watch", + "type": "Array" + }, + { + "name": "listeners", + "description": "- listeners to attach to the watcher", + "type": "Object" + }, + { + "name": "next", + "description": "- completion callback accepting error and watchers/stalkers", + "type": "Function" + } + ], + "class": "Docpad" + }, + { + "file": "src/lib/docpad.coffee", + "line": 2226, "description": "DocPad is ready. Peforms the tasks needed after DocPad construction\nand DocPad has loaded. Triggers the docpadReady event.\nnext(err,docpadInstance)", "access": "private", "tagname": "", @@ -3923,7 +3885,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 2312, + "line": 2291, "description": "Performs the merging of the passed configuration objects", "access": "private", "tagname": "", @@ -3945,7 +3907,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 2337, + "line": 2316, "description": "Set the instance configuration\nby merging the properties of the passed object\nwith the existing DocPad instanceConfig object", "access": "private", "tagname": "", @@ -3962,7 +3924,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 2354, + "line": 2333, "description": "Set the DocPad configuration object.\nPerforms a number of tasks, including\nmerging the pass instanceConfig with DocPad's\nother config objects.\nnext(err,config)", "access": "private", "tagname": "", @@ -3996,7 +3958,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 2455, + "line": 2434, "description": "Load the various configuration files from the\nfile system. Set the instanceConfig.\nnext(err,config)", "access": "private", "tagname": "", @@ -4030,7 +3992,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 2589, + "line": 2568, "description": "Update user configuration with the passed data", "itemtype": "method", "name": "updateUserConfig", @@ -4059,7 +4021,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 2621, + "line": 2600, "description": "Load a configuration url.", "itemtype": "method", "name": "loadConfigUrl", @@ -4091,7 +4053,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 2652, + "line": 2631, "description": "Load the configuration from a file path\npassed as one of the options (opts.configPath) or\nfrom DocPad's configPaths", "access": "private", "tagname": "", @@ -4125,7 +4087,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 2717, + "line": 2696, "description": "Get config paths and check that those\npaths exist", "access": "private", "tagname": "", @@ -4159,7 +4121,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 2760, + "line": 2739, "description": "Extend collecitons. Create DocPad's\nstandard (documents, files\nlayouts) and special (generate, referencesOthers,\nhasLayout, html, stylesheet) collections. Set blocks", "access": "private", "tagname": "", @@ -4183,7 +4145,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 2904, + "line": 2883, "description": "Reset collections. Perform a complete clean of our collections", "access": "private", "tagname": "", @@ -4212,7 +4174,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 2942, + "line": 2921, "description": "Initialise git repo", "access": "private", "tagname": "", @@ -4246,7 +4208,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 2967, + "line": 2946, "description": "Init node modules", "access": "private", "tagname": "", @@ -4280,7 +4242,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3000, + "line": 2979, "description": "Fix node package versions\nCombat to https://github.com/npm/npm/issues/4587#issuecomment-35370453", "access": "private", "tagname": "", @@ -4309,7 +4271,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3029, + "line": 3008, "description": "Install node module. Same as running\n'npm install' through the command line", "access": "private", "tagname": "", @@ -4348,7 +4310,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3092, + "line": 3071, "description": "Uninstall node module. Same as running\n'npm uninstall' through the command line", "access": "private", "tagname": "", @@ -4387,7 +4349,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3148, + "line": 3127, "description": "Set the log level", "access": "private", "tagname": "", @@ -4404,7 +4366,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3168, + "line": 3147, "description": "Get the log level", "itemtype": "method", "name": "getLogLevel", @@ -4416,7 +4378,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3176, + "line": 3155, "description": "Are we debugging?", "itemtype": "method", "name": "getDebugging", @@ -4428,7 +4390,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3185, + "line": 3164, "description": "Handle a fatal error", "access": "private", "tagname": "", @@ -4445,7 +4407,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3212, + "line": 3191, "description": "Inspect. Converts object to JSON string. Wrapper around nodes util.inspect method.\nCan't use the inspect namespace as for some silly reason it destroys everything", "itemtype": "method", "name": "inspector", @@ -4469,7 +4431,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3225, + "line": 3204, "description": "Log arguments", "itemtype": "property", "name": "log", @@ -4485,7 +4447,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3239, + "line": 3218, "description": "Create an error object", "itemtype": "method", "name": "createError", @@ -4509,7 +4471,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3273, + "line": 3252, "description": "Create an error (tracks it) and log it", "itemtype": "method", "name": "error", @@ -4531,7 +4493,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3298, + "line": 3277, "description": "Log an error", "itemtype": "method", "name": "logError", @@ -4546,7 +4508,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3329, + "line": 3308, "description": "Track an error in the background", "access": "private", "tagname": "", @@ -4563,7 +4525,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3353, + "line": 3332, "description": "Notify error", "access": "private", "tagname": "", @@ -4580,7 +4542,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3377, + "line": 3356, "description": "Log an error of level 'warn'", "itemtype": "method", "name": "warn", @@ -4604,7 +4566,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3403, + "line": 3382, "description": "Send a notify event to plugins (like growl)", "itemtype": "method", "name": "notify", @@ -4626,7 +4588,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3421, + "line": 3400, "description": "Check Request", "access": "private", "tagname": "", @@ -4655,7 +4617,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3444, + "line": 3423, "description": "Subscribe to the DocPad email list.", "access": "private", "tagname": "", @@ -4679,7 +4641,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3483, + "line": 3462, "description": "Track", "access": "private", "tagname": "", @@ -4715,7 +4677,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3540, + "line": 3519, "description": "Identify DocPad user", "access": "private", "tagname": "", @@ -4739,7 +4701,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3618, + "line": 3597, "description": "Create file model. Calls\n{{#crossLink \"DocPad/createModel:method\"}}{{/crossLink}}\nwith the 'file' modelType.", "itemtype": "method", "name": "createFile", @@ -4767,7 +4729,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3631, + "line": 3610, "description": "Create document model. Calls\n{{#crossLink \"DocPad/createModel:method\"}}{{/crossLink}}\nwith the 'document' modelType.", "itemtype": "method", "name": "createDocument", @@ -4795,7 +4757,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3645, + "line": 3624, "description": "Parse the files directory and\nreturn a files collection to\nthe passed callback", "itemtype": "method", "name": "parseFileDirectory", @@ -4829,7 +4791,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3660, + "line": 3639, "description": "Parse the documents directory and\nreturn a documents collection to\nthe passed callback.\n\nThe partials plugin (https://github.com/docpad/docpad-plugin-partials)\nuses this method to load a collection of\nfiles from the partials directory.\n\n\tdocpad.parseDocumentDirectory({path: config.partialsPath}, next)", "itemtype": "method", "name": "parseDocumentDirectory", @@ -4885,7 +4847,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3690, + "line": 3669, "description": "Attach events to a document model.", "access": "private", "tagname": "", @@ -4902,7 +4864,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3749, + "line": 3728, "description": "Add supplied model to the DocPad database. If the passed\nmodel definition is a plain object of properties, a new\nmodel will be created prior to adding to the database.\nCalls {{#crossLink \"DocPad/createModel:method\"}}{{/crossLink}}\nbefore adding the model to the database.\n\n\t# Override the stat's mtime to now\n\t# This is because renames will not update the mtime\n\tfileCurrentStat?.mtime = new Date()\n\n\t# Create the file object\n\tfile = docpad.addModel({fullPath:filePath, stat:fileCurrentStat})", "itemtype": "method", "name": "addModel", @@ -4926,7 +4888,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3774, + "line": 3753, "description": "Add the supplied collection of models to the DocPad database.\nCalls {{#crossLink \"DocPad/createModels:method\"}}{{/crossLink}}\nbefore adding the models to the database.\n\n\tdatabaseData = JSON.parse data.toString()\n\tmodels = docpad.addModels(databaseData.models)", "itemtype": "method", "name": "addModels", @@ -4950,7 +4912,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3792, + "line": 3771, "description": "Create a collection of models from the supplied collection\nensuring that the collection is suitable for adding to the\nDocPad database. The method calls {{#crossLink \"DocPad/createModel\"}}{{/crossLink}}\nfor each model in the models array.", "access": "private", "tagname": "", @@ -4976,7 +4938,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3808, + "line": 3787, "description": "Creates either a file or document model.\nThe model type to be created can be passed\nas an opts property, if not, the method will\nattempt to determing the model type by checking\nif the file is in one of the documents or\nlayout paths.\n\nEnsures a duplicate model is not created\nand all required attributes are present and\nevents attached.\n\nGenerally it is not necessary for an application\nto manually create a model via creatModel as DocPad\nwill handle this process when watching a project's\nfile and document directories. However, it is possible\nthat a plugin might have a requirement to do so.\n\n\tmodel = @docpad.createModel({fullPath:fullPath})\n model.load()", "docpad": ".getDatabase().add(model)", "itemtype": "method", @@ -5019,7 +4981,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3907, + "line": 3886, "description": "Parse a directory and return a\nfiles collection", "itemtype": "method", "name": "parseDirectory", @@ -5053,7 +5015,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3987, + "line": 3976, "description": "Get a plugin by it's name", "itemtype": "method", "name": "getPlugin", @@ -5072,7 +5034,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 3997, + "line": 3986, "description": "Check if we have any plugins", "itemtype": "method", "name": "hasPlugins", @@ -5084,7 +5046,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 4005, + "line": 3994, "description": "Destructor. Destroy plugins", "access": "private", "tagname": "", @@ -5094,7 +5056,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 4016, + "line": 4005, "description": "Load plugins from the file system\nnext(err)", "access": "private", "tagname": "", @@ -5118,7 +5080,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 4060, + "line": 4049, "description": "Checks if a plugin was loaded succesfully.", "itemtype": "method", "name": "loadedPlugin", @@ -5150,7 +5112,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 4079, + "line": 4068, "description": "Load a plugin from its full file path\n_next(err)", "access": "private", "tagname": "", @@ -5183,7 +5145,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 4176, + "line": 4165, "description": "Load plugins from a directory path", "access": "private", "tagname": "", @@ -5212,7 +5174,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 4231, + "line": 4224, "description": "Compare current DocPad version to the latest\nand print out the result to the console.\nUsed at startup.", "access": "private", "tagname": "", @@ -5222,7 +5184,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 4270, + "line": 4263, "description": "Get DocPad's exchange data\nRequires internet access\nnext(err,exchange)", "access": "private", "tagname": "", @@ -5251,7 +5213,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 4318, + "line": 4311, "description": "Contextualize files.\nContextualizing is the process of adding layouts and\nawareness of other documents to our document. The\ncontextualizeBefore and contextualizeAfter events\nare emitted here.", "access": "private", "tagname": "", @@ -5282,7 +5244,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 4399, + "line": 4392, "description": "Render the DocPad project's files.\nThe renderCollectionBefore, renderCollectionAfter,\nrenderBefore, renderAfter events are all emitted here.", "access": "private", "tagname": "", @@ -5313,7 +5275,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 4523, + "line": 4516, "description": "Write rendered files to the DocPad out directory.\nThe writeBefore and writeAfter events are emitted here.", "access": "private", "tagname": "", @@ -5344,7 +5306,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 4619, + "line": 4612, "description": "Has DocPad's generation process started?", "access": "private", "tagname": "", @@ -5355,7 +5317,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 4626, + "line": 4619, "description": "Has DocPad's generation process ended?", "access": "private", "tagname": "", @@ -5366,7 +5328,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 4633, + "line": 4626, "description": "Is DocPad currently generating?", "access": "private", "tagname": "", @@ -5377,7 +5339,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 4640, + "line": 4633, "description": "Has DocPad done at least one generation?\nTrue once the first generation has occured.", "access": "private", "tagname": "", @@ -5388,7 +5350,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 4648, + "line": 4641, "description": "Create the console progress bar.\nProgress only shown if the DocPad config 'progress'\noption is true, the DocPad config 'prompts' option is true\nand the log level is 6 (default)", "access": "private", "tagname": "", @@ -5402,7 +5364,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 4677, + "line": 4670, "description": "Destructor. Destroy the progress object", "access": "private", "tagname": "", @@ -5423,7 +5385,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 4693, + "line": 4686, "description": "Destructor. Destroy the regeneration timer.", "access": "private", "tagname": "", @@ -5433,7 +5395,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 4710, + "line": 4703, "description": "Create the regeneration timer", "access": "private", "tagname": "", @@ -5443,7 +5405,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 4733, + "line": 4726, "description": "Set off DocPad's generation process.\nThe generated, populateCollectionsBefore, populateCollections, populateCollections\ngenerateBefore and generateAfter events are emitted here", "itemtype": "method", "name": "generate", @@ -5470,7 +5432,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 5117, + "line": 5110, "description": "Load a document", "access": "private", "tagname": "", @@ -5509,7 +5471,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 5138, + "line": 5131, "description": "Load and render a document", "itemtype": "method", "name": "loadAndRenderDocument", @@ -5546,7 +5508,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 5162, + "line": 5155, "description": "Render a document", "itemtype": "method", "name": "renderDocument", @@ -5588,7 +5550,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 5184, + "line": 5177, "description": "Render a document at a file path\nnext(err,result)", "itemtype": "method", "name": "renderPath", @@ -5625,7 +5587,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 5208, + "line": 5201, "description": "Render the passed content data as a\ndocument. Required option, filename\n(opts.filename)\nnext(err,result)", "itemtype": "method", "name": "renderData", @@ -5662,7 +5624,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 5239, + "line": 5232, "description": "Render the passed text data as a\ndocument. Required option, filename\n(opts.filename)\nnext(err,result)", "access": "private", "tagname": "", @@ -5706,7 +5668,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 5275, + "line": 5268, "description": "Render action\nnext(err,document,result)", "itemtype": "method", "name": "render", @@ -5733,7 +5695,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 5311, + "line": 5304, "description": "Array of file watchers", "access": "private", "tagname": "", @@ -5744,7 +5706,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 5318, + "line": 5311, "description": "Destructor. Destroy the watchers used\nby DocPad", "access": "private", "tagname": "", @@ -5754,7 +5716,7 @@ }, { "file": "src/lib/docpad.coffee", - "line": 5340, + "line": 5333, "description": "Start up file watchers used by DocPad", "access": "private", "tagname": "", @@ -6934,7 +6896,7 @@ }, { "file": "src/lib/util.coffee", - "line": 25, + "line": 24, "description": "Write to stderr", "access": "private", "tagname": "", @@ -6951,7 +6913,7 @@ }, { "file": "src/lib/util.coffee", - "line": 37, + "line": 36, "description": "Write an error", "access": "private", "tagname": "", @@ -6968,7 +6930,7 @@ }, { "file": "src/lib/util.coffee", - "line": 46, + "line": 45, "description": "Wait. Wrapper for setTimeout", "access": "private", "tagname": "", @@ -6990,7 +6952,7 @@ }, { "file": "src/lib/util.coffee", - "line": 56, + "line": 55, "description": "Get Default Log Level", "access": "private", "tagname": "", @@ -7004,7 +6966,7 @@ }, { "file": "src/lib/util.coffee", - "line": 68, + "line": 67, "description": "Are we executing on Travis", "access": "private", "tagname": "", @@ -7018,7 +6980,7 @@ }, { "file": "src/lib/util.coffee", - "line": 77, + "line": 76, "description": "Is this TTY", "access": "private", "tagname": "", @@ -7032,7 +6994,7 @@ }, { "file": "src/lib/util.coffee", - "line": 87, + "line": 86, "description": "Is Standadlone", "access": "private", "tagname": "", @@ -7046,7 +7008,7 @@ }, { "file": "src/lib/util.coffee", - "line": 96, + "line": 95, "description": "Is user", "access": "private", "tagname": "", @@ -7060,7 +7022,7 @@ }, { "file": "src/lib/util.coffee", - "line": 105, + "line": 104, "description": "Wrapper for the node.js method util.inspect", "itemtype": "method", "name": "inspect", @@ -7084,7 +7046,7 @@ }, { "file": "src/lib/util.coffee", - "line": 127, + "line": 126, "description": "Are we using standard encoding?", "access": "private", "tagname": "", @@ -7105,7 +7067,7 @@ }, { "file": "src/lib/util.coffee", - "line": 138, + "line": 137, "description": "Get Local DocPad Installation Executable - ie\nnot the global installation", "access": "private", "tagname": "", @@ -7119,7 +7081,7 @@ }, { "file": "src/lib/util.coffee", - "line": 148, + "line": 147, "description": "Is Local DocPad Installation", "access": "private", "tagname": "", @@ -7133,7 +7095,7 @@ }, { "file": "src/lib/util.coffee", - "line": 157, + "line": 156, "description": "Does the local DocPad Installation Exist?", "access": "private", "tagname": "", @@ -7147,7 +7109,7 @@ }, { "file": "src/lib/util.coffee", - "line": 166, + "line": 165, "description": "Spawn Local DocPad Executable", "access": "private", "tagname": "", @@ -7168,7 +7130,7 @@ }, { "file": "src/lib/util.coffee", - "line": 187, + "line": 186, "description": "get a filename without the extension", "itemtype": "method", "name": "getBasename", @@ -7187,7 +7149,7 @@ }, { "file": "src/lib/util.coffee", - "line": 201, + "line": 200, "description": "Get the extensions of a filename", "itemtype": "method", "name": "getExtensions", @@ -7206,7 +7168,7 @@ }, { "file": "src/lib/util.coffee", - "line": 212, + "line": 211, "description": "Get the extension from a bunch of extensions", "itemtype": "method", "name": "getExtension", @@ -7225,7 +7187,7 @@ }, { "file": "src/lib/util.coffee", - "line": 229, + "line": 228, "description": "Get the directory path.\nWrapper around the node.js path.dirname method", "itemtype": "method", "name": "getDirPath", @@ -7244,7 +7206,7 @@ }, { "file": "src/lib/util.coffee", - "line": 239, + "line": 238, "description": "Get the file name.\nWrapper around the node.js path.basename method", "itemtype": "method", "name": "getFilename", @@ -7263,7 +7225,7 @@ }, { "file": "src/lib/util.coffee", - "line": 249, + "line": 248, "description": "Get the DocPad out file name", "itemtype": "method", "name": "getOutFilename", @@ -7287,7 +7249,7 @@ }, { "file": "src/lib/util.coffee", - "line": 262, + "line": 261, "description": "Get the URL", "itemtype": "method", "name": "getUrl", @@ -7306,7 +7268,7 @@ }, { "file": "src/lib/util.coffee", - "line": 271, + "line": 270, "description": "Get the post slug from the URL", "itemtype": "method", "name": "getSlug", @@ -7325,7 +7287,7 @@ }, { "file": "src/lib/util.coffee", - "line": 280, + "line": 279, "description": "Perform an action\nnext(err,...), ... = any special arguments from the action\nthis should be it's own npm module\nas we also use the concept of actions in a few other packages.\nImportant concept in DocPad.", "itemtype": "method", "name": "action", @@ -7356,15 +7318,15 @@ }, { "message": "unknown tag: docpad", - "line": " src/lib/models/document.coffee:26" + "line": " src/lib/models/document.coffee:25" }, { "message": "unknown tag: getcollection", - "line": " src/lib/docpad.coffee:705" + "line": " src/lib/docpad.coffee:665" }, { "message": "unknown tag: docpad", - "line": " src/lib/docpad.coffee:3808" + "line": " src/lib/docpad.coffee:3787" }, { "message": "Missing item type\nConsole Interface", diff --git a/docs/files/src_lib_docpad.coffee.html b/docs/files/src_lib_docpad.coffee.html index 601e271e..e2012d3e 100644 --- a/docs/files/src_lib_docpad.coffee.html +++ b/docs/files/src_lib_docpad.coffee.html @@ -104,55 +104,14 @@

    File: src/lib/docpad.coffee

    # ===================================== # This block *must* come first +# Node 0.10 compat +require('babel-polyfill') + # Important pathUtil = require('path') lazyRequire = require('lazy-require') corePath = pathUtil.resolve(__dirname, '..', '..') -# Profile -if ('--profile' in process.argv) - # Debug - debugger - - # Nodetime - if process.env.DOCPAD_PROFILER.indexOf('nodetime') isnt -1 - throw new Error('NODETIME_KEY environment variable is undefined') unless process.env.NODETIME_KEY - console.log 'Loading profiling tool: nodetime' - require('lazy-require').sync 'nodetime', {cwd:corePath}, (err,nodetime) -> - if err - console.log 'Failed to load profiling tool: nodetime' - console.log err.stack or err - else - nodetime.profile({ - accountKey: process.env.NODETIME_KEY - appName: 'DocPad' - }) - console.log 'Profiling with nodetime with account key:', process.env.NODETIME_KEY - - # Webkit Devtools - if process.env.DOCPAD_PROFILER.indexOf('webkit-devtools-agent') isnt -1 - console.log 'Loading profiling tool: webkit-devtools-agent' - require('lazy-require').sync 'webkit-devtools-agent', {cwd:corePath}, (err, agent) -> - if err - console.log 'Failed to load profiling tool: webkit-devtools-agent' - console.log err.stack or err - else - agent.start() - console.log "Profiling with webkit-devtools-agent on pid #{process.pid} at http://127.0.0.1:9999/" - - # V8 Profiler - if process.env.DOCPAD_PROFILER.indexOf('v8-profiler') isnt -1 - console.log 'Loading profiling tool: v8-profiler' - require('lazy-require').sync 'v8-profiler-helper', {cwd:corePath}, (err, profiler) -> - if err - console.log 'Failed to load profiling tool: v8-profiler' - console.log err.stack or err - else - profiler.startProfile('docpad-profile') - console.log "Profiling with v8-profiler" - process.on 'exit', -> - profiler.stopProfile('docpad-profile') - # ===================================== # Requires @@ -281,6 +240,7 @@

    File: src/lib/docpad.coffee

    # @property {Object} Events ### Events: Events + ###* # Model class # Extension of the Backbone Model class @@ -1396,7 +1356,7 @@

    File: src/lib/docpad.coffee

    safeps.getLocaleCode config.localeCode safeps.getLocaleCode safeps.getLocaleCode() ] - locales = (@loadLocale(code) for code in codes) + locales = (@loadLocale(code) for code in codes).filter((l) -> l) @locale = extendr.extend(locales...) return @locale @@ -1771,11 +1731,6 @@

    File: src/lib/docpad.coffee

    # Helper's source-code can be found at: https://github.com/docpad/helper helperUrl: if true then 'http://helper.docpad.org/' else 'http://localhost:8000/' - # Safe Mode - # If enabled, we will try our best to sandbox our template rendering so that they cannot modify things outside of them - # Not yet implemented - safeMode: false - # Template Data # What data would you like to expose to your templates templateData: {} @@ -1902,6 +1857,64 @@

    File: src/lib/docpad.coffee

    # ================================= # Initialization Functions + ###* + # Create our own custom TaskGroup instance for DocPad. + # That will listen to tasks as they execute and provide debugging information. + # @method createTaskGroup + # @param {Object} opts + # @return {TaskGroup} + ### + createTaskGroup: (opts...) => + docpad = @ + tasks = TaskGroup.create(opts...) + + # Listen to executing tasks and output their progress + tasks.on 'running', -> + config = tasks.getConfig() + name = tasks.getNames() + progress = config.progress + if progress + totals = tasks.getItemTotals() + progress.step(name).total(totals.total).setTick(totals.completed) + else + docpad.log('debug', name+' > running') + + # Listen to executing tasks and output their progress + tasks.on 'item.add', (item) -> + config = tasks.getConfig() + name = item.getNames() + progress = config.progress + if progress + totals = tasks.getItemTotals() + progress.step(name).total(totals.total).setTick(totals.completed) + else + docpad.log('debug', name+' > added') + + # Listen to executing tasks and output their progress + item.on 'started', (item) -> + config = tasks.getConfig() + name = item.getNames() + progress = config.progress + if progress + totals = tasks.getItemTotals() + progress.step(name).total(totals.total).setTick(totals.completed) + else + docpad.log('debug', name+' > started') + + # Listen to executing tasks and output their progress + item.done (err) -> + config = tasks.getConfig() + name = item.getNames() + progress = config.progress + if progress + totals = tasks.getItemTotals() + progress.step(name).total(totals.total).setTick(totals.completed) + else + docpad.log('debug', name+' > done') + + # Return + return tasks + ###* # Constructor method. Sets up the DocPad instance. # next(err) @@ -1915,61 +1928,6 @@

    File: src/lib/docpad.coffee

    [instanceConfig,next] = extractOptsAndCallback(instanceConfig, next) docpad = @ - # Create our own custom TaskGroup class for DocPad - # That will listen to tasks as they execute and provide debugging information - @TaskGroup = class extends TaskGroup - constructor: -> - # Prepare - super - tasks = @ - - # Listen to executing tasks and output their progress - tasks.on 'started', -> - config = tasks.getConfig() - name = tasks.getNames() - progress = config.progress - if progress - totals = tasks.getItemTotals() - progress.step(name).total(totals.total).setTick(totals.completed) - else - docpad.log('debug', name+' > started') - - # Listen to executing tasks and output their progress - tasks.on 'item.add', (item) -> - config = tasks.getConfig() - name = item.getNames() - progress = config.progress - if progress - totals = tasks.getItemTotals() - progress.step(name).total(totals.total).setTick(totals.completed) - else - docpad.log('debug', name+' > added') - - # Listen to executing tasks and output their progress - tasks.on 'item.started', (item) -> - config = tasks.getConfig() - name = item.getNames() - progress = config.progress - if progress - totals = tasks.getItemTotals() - progress.step(name).total(totals.total).setTick(totals.completed) - else - docpad.log('debug', name+' > started') - - # Listen to executing tasks and output their progress - tasks.on 'item.done', (item, err) -> - config = tasks.getConfig() - name = item.getNames() - progress = config.progress - if progress - totals = tasks.getItemTotals() - progress.step(name).total(totals.total).setTick(totals.completed) - else - docpad.log('debug', name+' > done') - - # Chain - @ - # Binders # Using this over coffescript's => on class methods, ensures that the method length is kept for methodName in """ @@ -1998,11 +1956,11 @@

    File: src/lib/docpad.coffee

    next() # Create our action runner - @actionRunnerInstance = @TaskGroup.create('action runner').whenDone (err) -> + @actionRunnerInstance = @createTaskGroup('action runner', {abortOnError: false, destroyOnceDone: false}).whenDone (err) -> docpad.error(err) if err # Create our track runner - @trackRunnerInstance = @TaskGroup.create('track runner').whenDone (err) -> + @trackRunnerInstance = @createTaskGroup('track runner', {abortOnError: false, destroyOnceDone: false}).whenDone (err) -> if err and docpad.getDebugging() locale = docpad.getLocale() docpad.warn(locale.trackError, err) @@ -2012,15 +1970,15 @@

    File: src/lib/docpad.coffee

    delete instanceConfig.loggers else # Create - logger = new (require('caterpillar').Logger)(lineOffset: 2) + logger = require('caterpillar').create(lineOffset: 2) # console loggerConsole = logger .pipe( - new (require('caterpillar-filter').Filter) + require('caterpillar-filter').create() ) .pipe( - new (require('caterpillar-human').Human) + require('caterpillar-human').create() ) # Apply @@ -2126,8 +2084,8 @@

    File: src/lib/docpad.coffee

    # Return safely return true ) - @userConfig = extendr.dereference(@userConfig) - @initialConfig = extendr.dereference(@initialConfig) + @userConfig = extendr.dereferenceJSON(@userConfig) + @initialConfig = extendr.dereferenceJSON(@initialConfig) # Extract action if instanceConfig.action? @@ -2311,32 +2269,53 @@

    File: src/lib/docpad.coffee

    # internally by DocPad to watch project documents # and files and then activate the regeneration process # when any of those items are updated. - # - # Although it is possible to pass a range of options to watchdir - # in practice these options are provided as part of - # the DocPad config object with a number of default options - # specified in the DocPad config. + # @private # @method watchdir - # @param {Object} [opts={}] - # @param {String} [opts.path] a single path to watch. - # @param {Array} [opts.paths] an array of paths to watch. - # @param {Function} [opts.listener] a single change listener to fire when a change occurs. - # @param {Array} [opts.listeners] an array of listeners. - # @param {Function} [opts.next] callback. - # @param {Object} [opts.stat] a file stat object to use for the path, instead of fetching a new one. - # @param {Number} [opts.interval=5007] for systems that poll to detect file changes, how often should it poll in millseconds. - # @param {Number} [opts.catupDelay=200] handles system swap file deletions and renaming - # @param {Array} [opts.preferredMethods=['watch','watchFile'] which order should we prefer our watching methods to be tried?. - # @param {Boolean} [opts.followLinks=true] follow symlinks, i.e. use stat rather than lstat. - # @param {Boolean|Array} [opts.ignorePaths=false] an array of full paths to ignore. - # @param {Boolean|Array} [opts.ignoreHiddenFiles=false] whether or not to ignored files which filename starts with a ".". - # @param {Boolean} [opts.ignoreCommonPatterns=true] whether or not to ignore common undesirable file patterns (e.g. .svn, .git, .DS_Store, thumbs.db, etc). - # @param {Boolean|Array} [opts.ignoreCustomPatterns=null] any custom ignore patterns that you would also like to ignore along with the common patterns. + # @param {String} path - the path to watch + # @param {Object} listeners - listeners to attach to the watcher + # @param {Function} next - completion callback accepting error # @return {Object} the watcher ### - watchdir: (opts={}) -> - opts = extendr.extend(@getIgnoreOpts(), opts, @config.watchOptions) - return require('watchr').watch(opts) + watchdir: (path, listeners, next) -> + opts = extendr.extend(@getIgnoreOpts(), @config.watchOptions or {}) + stalker = require('watchr').create(path) + for own key, value of listeners + stalker.on(key, value) + stalker.setConfig(opts) + stalker.watch(next) + return stalker + + ###* + # Watch Directories. Wrapper around watchdir. + # @private + # @method watchdirs + # @param {Array} paths - the paths to watch + # @param {Object} listeners - listeners to attach to the watcher + # @param {Function} next - completion callback accepting error and watchers/stalkers + ### + watchdirs: (paths, listeners, next) -> + docpad = @ + stalkers = [] + + tasks = new TaskGroup('watching directories').setConfig(concurrency:0).done (err) -> + if err + for stalker in stalkers + stalker.close() + next(err) + else + next(err, stalkers) + + paths.forEach (path) -> + tasks.addTask "watching #{path}", (done) -> + # check if the dir exists first as reloadPaths may not apparently + safefs.exists path, (exists) -> + return done() unless exists + stalkers.push docpad.watchdir(path, listeners, done) + + tasks.run() + + # Chain + @ # ================================= @@ -2380,7 +2359,7 @@

    File: src/lib/docpad.coffee

    docpad.log 'info', util.format(locale.welcomeEnvironment, @getEnvironment()) # Prepare - tasks = new @TaskGroup 'ready tasks', next:(err) -> + tasks = @createTaskGroup 'ready tasks', next:(err) -> # Error? return docpad.error(err) if err @@ -2427,7 +2406,7 @@

    File: src/lib/docpad.coffee

    configsToMerge.push(envConfig) if envConfig # Merge - extendr.safeDeepExtendPlainObjects(configsToMerge...) + extendr.deep(configsToMerge...) # Chain @ @@ -2444,8 +2423,8 @@

    File: src/lib/docpad.coffee

    # Merge in the instance configurations if instanceConfig logLevel = @getLogLevel() - extendr.safeDeepExtendPlainObjects(@instanceConfig, instanceConfig) - extendr.safeDeepExtendPlainObjects(@config, instanceConfig) if @config # @TODO document why there is the if + extendr.deepDefaults(@instanceConfig, instanceConfig) + extendr.deepDefaults(@config, instanceConfig) if @config # @TODO document why there is the if @setLogLevel(instanceConfig.logLevel) if instanceConfig.logLevel and instanceConfig.logLevel isnt logLevel @ @@ -2484,10 +2463,10 @@

    File: src/lib/docpad.coffee

    docpad.mergeConfigurations(configPackages, configsToMerge) # Extract and apply the server - @setServer extendr.safeShallowExtendPlainObjects({ + @setServer extendr.defaults({ serverHttp: @config.serverHttp serverExpress: @config.serverExpress - }, @config.server) + }, @config.server or {}) # Extract and apply the logger @setLogLevel(@config.logLevel) @@ -2520,7 +2499,7 @@

    File: src/lib/docpad.coffee

    @on('error', @error) # Prepare the Post Tasks - postTasks = new @TaskGroup 'setConfig post tasks', next:(err) -> + postTasks = @createTaskGroup 'setConfig post tasks', next:(err) -> return next(err, docpad.config) ### @@ -2577,7 +2556,7 @@

    File: src/lib/docpad.coffee

    @setInstanceConfig(instanceConfig) # Prepare the Load Tasks - preTasks = new @TaskGroup 'load tasks', next:(err) => + preTasks = @createTaskGroup 'load tasks', next:(err) => return next(err) if err return @setConfig(next) @@ -2833,7 +2812,7 @@

    File: src/lib/docpad.coffee

    opts.configPaths ?= config.configPaths opts.configPaths = [opts.configPaths] unless typeChecker.isArray(opts.configPaths) - tasks = new @TaskGroup 'getConfigPath tasks', next:(err) -> + tasks = @createTaskGroup 'getConfigPath tasks', next:(err) -> return next(err, result) # Determine our configuration path @@ -2956,7 +2935,7 @@

    File: src/lib/docpad.coffee

    }) # Custom Collections Group - tasks = new @TaskGroup "extendCollections tasks", concurrency:0, next:(err) -> + tasks = @createTaskGroup "extendCollections tasks", concurrency:0, next:(err) -> docpad.error(err) if err docpad.emitSerial('extendCollections', next) @@ -3256,7 +3235,7 @@

    File: src/lib/docpad.coffee

    if loggers.debug? is false loggers.debug = loggers.logger .pipe( - new (require('caterpillar-human').Human)(color:false) + require('caterpillar-human').create(color:false) ) .pipe( require('fs').createWriteStream(@debugLogPath) @@ -3983,7 +3962,7 @@

    File: src/lib/docpad.coffee

    detectEncoding: config.detectEncoding rootOutDirPath: config.outPath locale: @getLocale() - TaskGroup: @TaskGroup + TaskGroup: @createTaskGroup # @TODO this a bit dodgy, but works well enough }, opts) if opts.modelType is 'file' @@ -4035,13 +4014,24 @@

    File: src/lib/docpad.coffee

    # Log docpad.log 'debug', util.format(locale.renderDirectoryParsing, path) + # Tasks + tasks = new TaskGroup('parse directory').setConfig(concurrency:0).done (err) -> + # Check + return next(err) if err + + # Log + docpad.log 'debug', util.format(locale.renderDirectoryParsed, path) + + # Forward + return next(null, files) + # Files docpad.scandir( # Path path: path # File Action - fileAction: (fileFullPath,fileRelativePath,nextFile,fileStat) -> + fileAction: (fileFullPath, fileRelativePath, filename, fileStat) -> # Prepare data = fullPath: fileFullPath @@ -4051,28 +4041,27 @@

    File: src/lib/docpad.coffee

    # Create file file = createFunction.call(docpad, data, opts) - # Update the file's stat - # To ensure changes files are handled correctly in generation - file.action 'load', (err) -> - # Error? - return nextFile(err) if err + # Create a task to load the file + tasks.addTask "load the file #{fileRelativePath}", (complete) -> + # Update the file's stat + # To ensure changes files are handled correctly in generation + file.action 'load', (err) -> + # Error? + return complete(err) if err + + # Add the file to the collection + files.add(file) - # Add the file to the collection - files.add(file) + # Next + complete() - # Next - nextFile() + # Return + return # Next next: (err) -> - # Check return next(err) if err - - # Log - docpad.log 'debug', util.format(locale.renderDirectoryParsed, path) - - # Forward - return next(null, files) + tasks.run() ) # Chain @@ -4130,7 +4119,7 @@

    File: src/lib/docpad.coffee

    docpad.log 'notice', util.format(locale.pluginsSlow, Object.keys(docpad.slowPlugins).join(', ')) # Async - tasks = new @TaskGroup "loadPlugins tasks", concurrency:0, next:(err) -> + tasks = @createTaskGroup "loadPlugins tasks", concurrency:0, next:(err) -> docpad.slowPlugins = {} snore.clear() return next(err) @@ -4284,9 +4273,14 @@

    File: src/lib/docpad.coffee

    docpad = @ locale = @getLocale() + # Tasks + tasks = new TaskGroup('load plugins').setConfig(concurrency:0).done (err) -> + docpad.log 'debug', util.format(locale.pluginsLoadedFor, pluginsPath) + return next(err) + # Load Plugins docpad.log 'debug', util.format(locale.pluginsLoadingFor, pluginsPath) - @scandir( + docpad.scandir( # Path path: pluginsPath @@ -4294,26 +4288,25 @@

    File: src/lib/docpad.coffee

    fileAction: false # Handle directories - dirAction: (fileFullPath,fileRelativePath,nextFile) -> + dirAction: (fileFullPath, fileRelativePath, pluginName) -> # Prepare pluginName = pathUtil.basename(fileFullPath) - # Delve deeper into the directory if it is a direcotry of plugins - return nextFile(null, false) if fileFullPath is pluginsPath - - # Otherwise, it is a plugin directory, so load the plugin - docpad.loadPlugin fileFullPath, (err) -> - # Warn about the plugin load error if there is one - if err - docpad.warn util.format(locale.pluginFailedToLoad, pluginName, fileFullPath), err + # Add the task to load the oplugin to the queue + tasks.addTask "load the plugin #{pluginName}", (complete) -> + # Otherwise, it is a plugin directory, so load the plugin + docpad.loadPlugin fileFullPath, (err) -> + # Warn about the plugin load error if there is one + if err + docpad.warn util.format(locale.pluginFailedToLoad, pluginName, fileFullPath), err - # All done and don't recurse into this directory - return nextFile(null, true) + # All done and don't recurse into this directory + return complete() # Next next: (err) -> - docpad.log 'debug', util.format(locale.pluginsLoadedFor, pluginsPath) - return next(err) + return next(err) if err + tasks.run() ) # Chain @@ -4447,7 +4440,7 @@

    File: src/lib/docpad.coffee

    return next(err) if err # Completion callback - tasks = new docpad.TaskGroup "contextualizeFiles tasks", concurrency:0, next:(err) -> + tasks = docpad.createTaskGroup "contextualizeFiles tasks", concurrency:0, next:(err) -> # Kill the timer clearInterval(slowFilesTimer) slowFilesTimer = null @@ -4540,7 +4533,7 @@

    File: src/lib/docpad.coffee

    # Prepare return next(err) if err - subTasks = new docpad.TaskGroup "renderCollection: #{collectionToRender.options.name}", concurrency:0, next:(err) -> + subTasks = docpad.createTaskGroup "renderCollection: #{collectionToRender.options.name}", concurrency:0, next:(err) -> # Prepare return next(err) if err @@ -4568,7 +4561,7 @@

    File: src/lib/docpad.coffee

    return next(err) if err # Async - tasks = new docpad.TaskGroup "renderCollection: renderBefore tasks", next:(err) -> + tasks = docpad.createTaskGroup "renderCollection: renderBefore tasks", next:(err) -> # Kill the timer clearInterval(slowFilesTimer) slowFilesTimer = null @@ -4649,7 +4642,7 @@

    File: src/lib/docpad.coffee

    return next(err) if err # Completion callback - tasks = new docpad.TaskGroup "writeFiles tasks", concurrency:0, next:(err) -> + tasks = docpad.createTaskGroup "writeFiles tasks", concurrency:0, next:(err) -> # Kill the timer clearInterval(slowFilesTimer) slowFilesTimer = null @@ -4677,7 +4670,7 @@

    File: src/lib/docpad.coffee

    slowFilesObject[file.id] = file.get('relativePath') # Create sub tasks - fileTasks = new docpad.TaskGroup "tasks for file write: #{filePath}", concurrency:0, next:(err) -> + fileTasks = docpad.createTaskGroup "tasks for file write: #{filePath}", concurrency:0, next:(err) -> delete slowFilesObject[file.id] opts.progress?.tick() return complete(err) @@ -4881,7 +4874,7 @@

    File: src/lib/docpad.coffee

    docpad.notify (new Date()).toLocaleTimeString(), {title: locale.renderGeneratingNotification} # Tasks - tasks = new @TaskGroup("generate tasks", {progress: opts.progress}).done (err) -> + tasks = @createTaskGroup("generate tasks", {progress: opts.progress}).done (err) -> # Update generating flag docpad.generating = false docpad.generateEnded = new Date() @@ -5294,7 +5287,7 @@

    File: src/lib/docpad.coffee

    [opts,next] = extractOptsAndCallback(opts,next) attributes = extendr.extend({ fullPath: path - },opts.attributes) + }, opts.attributes or {}) # Handle document = @createDocument(attributes) @@ -5321,7 +5314,7 @@

    File: src/lib/docpad.coffee

    attributes = extendr.extend({ filename: opts.filename data: content - }, opts.attributes) + }, opts.attributes or {}) # Handle document = @createDocument(attributes) @@ -5357,7 +5350,7 @@

    File: src/lib/docpad.coffee

    data: text body: text content: text - }, opts.attributes) + }, opts.attributes or {}) # Handle document = @createDocument(attributes) @@ -5458,61 +5451,68 @@

    File: src/lib/docpad.coffee

    docpad.destroyWatchers() # Start a group - tasks = new docpad.TaskGroup("watch tasks", {concurrency:0, next}) + tasks = docpad.createTaskGroup("watch tasks", {concurrency:0, next}) # Watch reload paths reloadPaths = union(config.reloadPaths, config.configPaths) - tasks.addTask "watch reload paths", (complete) -> docpad.watchdir( - paths: reloadPaths - listeners: - 'log': docpad.log - 'error': docpad.error - 'change': -> - docpad.log 'info', util.format(locale.watchReloadChange, new Date().toLocaleTimeString()) - docpad.action 'load', (err) -> - return docpad.fatal(err) if err - performGenerate(reset:true) - next: (err,_watchers) -> - if err - docpad.warn("Watching the reload paths has failed:\n"+docpad.inspector(reloadPaths), err) + tasks.addTask "watch reload paths", (complete) -> + docpad.watchdirs( + reloadPaths, + { + 'log': docpad.log + 'error': docpad.error + 'change': -> + docpad.log 'info', util.format(locale.watchReloadChange, new Date().toLocaleTimeString()) + docpad.action 'load', (err) -> + return docpad.fatal(err) if err + performGenerate(reset:true) + }, + (err,_watchers) -> + if err + docpad.warn("Watching the reload paths has failed:\n"+docpad.inspector(reloadPaths), err) + return complete() + for watcher in _watchers + docpad.watchers.push(watcher) return complete() - for watcher in _watchers - docpad.watchers.push(watcher) - return complete() - ) + ) # Watch regenerate paths regeneratePaths = config.regeneratePaths - tasks.addTask "watch regenerate paths", (complete) -> docpad.watchdir( - paths: regeneratePaths - listeners: - 'log': docpad.log - 'error': docpad.error - 'change': -> performGenerate(reset:true) - next: (err,_watchers) -> - if err - docpad.warn("Watching the regenerate paths has failed:\n"+docpad.inspector(regeneratePaths), err) + tasks.addTask "watch regenerate paths", (complete) -> + docpad.watchdirs( + regeneratePaths, + { + 'log': docpad.log + 'error': docpad.error + 'change': -> performGenerate(reset:true) + }, + (err,_watchers) -> + if err + docpad.warn("Watching the regenerate paths has failed:\n"+docpad.inspector(regeneratePaths), err) + return complete() + for watcher in _watchers + docpad.watchers.push(watcher) return complete() - for watcher in _watchers - docpad.watchers.push(watcher) - return complete() - ) + ) # Watch the source srcPath = config.srcPath - tasks.addTask "watch the source path", (complete) -> docpad.watchdir( - path: srcPath - listeners: - 'log': docpad.log - 'error': docpad.error - 'change': changeHandler - next: (err,watcher) -> - if err - docpad.warn("Watching the src path has failed: "+srcPath, err) + tasks.addTask "watch the source path", (complete) -> + docpad.watchdirs( + [srcPath], + { + 'log': docpad.log + 'error': docpad.error + 'change': changeHandler + }, + (err,_watchers) -> + if err + docpad.warn("Watching the src path has failed: "+srcPath, err) + return complete() + for watcher in _watchers + docpad.watchers.push(watcher) return complete() - docpad.watchers.push(watcher) - return complete() - ) + ) # Run tasks.run() @@ -5693,7 +5693,7 @@

    File: src/lib/docpad.coffee

    config = @getConfig() # Tasks - tasks = new @TaskGroup("initInstall tasks", {concurrency:0, next}) + tasks = @createTaskGroup("initInstall tasks", {concurrency:0, next}) tasks.addTask "node modules", (complete) -> path = pathUtil.join(config.rootPath, 'node_modules') @@ -5740,7 +5740,7 @@

    File: src/lib/docpad.coffee

    config = @getConfig() # Tasks - tasks = new @TaskGroup("uninstall tasks", {next}) + tasks = @createTaskGroup("uninstall tasks", {next}) # Uninstall a plugin if opts.plugin @@ -5779,7 +5779,7 @@

    File: src/lib/docpad.coffee

    config = @getConfig() # Tasks - tasks = new @TaskGroup("install tasks", {next}) + tasks = @createTaskGroup("install tasks", {next}) tasks.addTask "init the installation", (complete) -> docpad.initInstall(opts, complete) @@ -5850,7 +5850,7 @@

    File: src/lib/docpad.coffee

    config = @getConfig() # Tasks - tasks = new @TaskGroup("update tasks", {next}) + tasks = @createTaskGroup("update tasks", {next}) tasks.addTask "init the install", (complete) -> docpad.initInstall(opts, complete) @@ -5918,7 +5918,7 @@

    File: src/lib/docpad.coffee

    docpad.log('info', locale.renderCleaning) # Tasks - tasks = new @TaskGroup "clean tasks", {concurrency:0}, next:(err) -> + tasks = @createTaskGroup "clean tasks", {concurrency:0}, next:(err) -> # Error? return next(err) if err @@ -5971,7 +5971,7 @@

    File: src/lib/docpad.coffee

    opts.destinationPath ?= config.rootPath # Tasks - tasks = new @TaskGroup("initSkeleton tasks", {next}) + tasks = @createTaskGroup("initSkeleton tasks", {next}) tasks.addTask "ensure the path we are writing to exists", (complete) -> safefs.ensurePath(opts.destinationPath, complete) @@ -6481,7 +6481,7 @@

    File: src/lib/docpad.coffee

    # @TODO: Why do we do opts here instead of config??? # Tasks - tasks = new @TaskGroup("server tasks", {next}) + tasks = @createTaskGroup("server tasks", {next}) # Before Plugin Event tasks.addTask "emit serverBefore", (complete) -> diff --git a/docs/files/src_lib_interfaces_console.coffee.html b/docs/files/src_lib_interfaces_console.coffee.html index 462611d3..7e8ffce8 100644 --- a/docs/files/src_lib_interfaces_console.coffee.html +++ b/docs/files/src_lib_interfaces_console.coffee.html @@ -191,10 +191,6 @@

    File: src/lib/interfaces/console.coffee

    '--skeleton <skeleton>' locale.consoleOptionSkeleton ) - .option( - '--profile' - locale.consoleOptionProfile - ) .option( '--offline' locale.consoleOptionOffline @@ -427,7 +423,7 @@

    File: src/lib/interfaces/console.coffee

    opts = {} opts.commander = args[-1...][0] opts.args = args[...-1] - opts.instanceConfig = extendr.safeDeepExtendPlainObjects({}, @extractConfig(opts.commander), config) + opts.instanceConfig = extendr.deepDefaults({}, @extractConfig(opts.commander), config) # Complete Action completeAction = (err) -> diff --git a/docs/files/src_lib_models_document.coffee.html b/docs/files/src_lib_models_document.coffee.html index dcd22604..bf6d2872 100644 --- a/docs/files/src_lib_models_document.coffee.html +++ b/docs/files/src_lib_models_document.coffee.html @@ -108,7 +108,6 @@

    File: src/lib/models/document.coffee

    CSON = require('cson') extendr = require('extendr') eachr = require('eachr') -{TaskGroup} = require('taskgroup') extractOptsAndCallback = require('extract-opts') # Local diff --git a/docs/files/src_lib_models_file.coffee.html b/docs/files/src_lib_models_file.coffee.html index 63857a78..08559d4f 100644 --- a/docs/files/src_lib_models_file.coffee.html +++ b/docs/files/src_lib_models_file.coffee.html @@ -106,7 +106,6 @@

    File: src/lib/models/file.coffee

    # External isTextOrBinary = require('istextorbinary') typeChecker = require('typechecker') -{TaskGroup} = require('taskgroup') safefs = require('safefs') mime = require('mime') extendr = require('extendr') @@ -627,7 +626,7 @@

    File: src/lib/models/file.coffee

    toJSON: (dereference=false) -> data = super data.meta = @getMeta().toJSON() - data = extendr.dereference(data) if dereference is true + data = extendr.dereferenceJSON(data) if dereference is true return data ###* @@ -970,7 +969,7 @@

    File: src/lib/models/file.coffee

    throw new Error("Use docpad.createModel to create the file or document model") # Create our action runner - @actionRunnerInstance = new @TaskGroup("file action runner").whenDone (err) -> + @actionRunnerInstance = new @TaskGroup("file action runner", {abortOnError: false, destroyOnceDone: false}).whenDone (err) -> file.emit('error', err) if err # Apply diff --git a/docs/files/src_lib_plugin.coffee.html b/docs/files/src_lib_plugin.coffee.html index 84118305..0b4e088f 100644 --- a/docs/files/src_lib_plugin.coffee.html +++ b/docs/files/src_lib_plugin.coffee.html @@ -148,7 +148,7 @@

    File: src/lib/plugin.coffee

    # @property {Object} ### config: {} - + ###* # The instance config. # @property {Object} @@ -177,8 +177,8 @@

    File: src/lib/plugin.coffee

    @bindListeners() # Swap out our configuration - @config = extendr.deepClone(@config) - @instanceConfig = extendr.deepClone(@instanceConfig) + @config = extendr.clone(@config) + @instanceConfig = extendr.clone(@instanceConfig) @initialConfig = @config @setConfig(config) @@ -200,8 +200,8 @@

    File: src/lib/plugin.coffee

    setInstanceConfig: (instanceConfig) -> # Merge in the instance configurations if instanceConfig - extendr.safeDeepExtendPlainObjects(@instanceConfig, instanceConfig) - extendr.safeDeepExtendPlainObjects(@config, instanceConfig) if @config + extendr.deepDefaults(@instanceConfig, instanceConfig) + extendr.deepDefaults(@config, instanceConfig) if @config @ ###* diff --git a/docs/files/src_lib_util.coffee.html b/docs/files/src_lib_util.coffee.html index 02ab87ae..edf8af36 100644 --- a/docs/files/src_lib_util.coffee.html +++ b/docs/files/src_lib_util.coffee.html @@ -106,7 +106,6 @@

    File: src/lib/util.coffee

    # External {uniq, compact} = require('underscore') extractOptsAndCallback = require('extract-opts') -{TaskGroup} = require('taskgroup') # ===================================== @@ -410,7 +409,7 @@

    File: src/lib/util.coffee

    # We have multiple actions if actions.length > 1 - actionTaskOrGroup = runner.createGroup 'actions bundle: '+actions.join(' ') + actionTaskOrGroup = runner.createTaskGroup 'actions bundle: '+actions.join(' ') for action in actions # Fetch diff --git a/package.json b/package.json index d2c6e161..4d8de680 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,8 @@ { "title": "DocPad. Streamlined web development.", "name": "docpad", - "version": "6.78.5", + "version": "6.79.0", + "tag": "beta", "description": "DocPad is a dynamic static site generator. Write your content as files, or import your content from other external sources. Render the content with plugins. And deploy your static or dynamic website to your favourite hosting provider.", "homepage": "http://docpad.org", "installUrl": "http://docpad.org/install", @@ -122,7 +123,7 @@ "Todd Anglin (kendoui.com)", "Tatu Tamminen (http://www.triplet.fi)", "Nick Matantsev (http://unframework.com)", - "Vladislav Botvin (https://github.com/darrrk)", + "Vladislav Botvin (https://github.com/darky)", "vsopvsop (https://github.com/vsopvsop)", "Zearin (https://github.com/Zearin)", "Firede (http://firede.us)", @@ -132,7 +133,10 @@ "Ke Zhu (http://blog.shawnzhu.com)", "Morgan Larosa (https://github.com/chaos95)", "Paul Armstrong (https://github.com/paularmstrong)", - "Prayag Verma (http://www.prayagverma.com/)" + "Prayag Verma (http://www.prayagverma.com/)", + "Steve Mc (http://www.stevemcarthur.co.uk)", + "Todd Anglin (nativescript.org)", + "Prayag Verma (http://www.StylifyYourBlog.com/)" ], "bugs": { "url": "https://github.com/docpad/docpad/issues" @@ -149,13 +153,13 @@ "ambi": "^2.5.0", "babel-polyfill": "^6.9.1", "backbone": "1.2.3", - "bal-util": "~2.5.1", + "bal-util": "~2.6.0", "caterpillar": "^3.0.0", "caterpillar-filter": "^3.0.0", "caterpillar-human": "^3.0.0", "commander": "^2.9.0", "csextends": "^1.0.3", - "cson": "^3.0.2", + "cson": "^4.0.0", "eachr": "^3.2.0", "encoding": "~0.1.12", "envfile": "^2.1.1", @@ -177,13 +181,13 @@ "rimraf": "^2.5.2", "safefs": "^4.1.0", "safeps": "^6.3.0", - "scandirectory": "^2.5.0", + "scandirectory": "^3.0.1", "semver": "^5.1.0", "superagent": "^2.0.0", "taskgroup": "^5.0.1", "typechecker": "^4.3.0", "underscore": "^1.8.3", - "watchr": "^2.4.13", + "watchr": "^3.0.0", "yamljs": "~0.2.7" }, "optionalDependencies": {}, @@ -203,7 +207,7 @@ "editions": [ { "description": "Source + CoffeeScript + Require", - "entry": "src/lib/docpad.coffee", + "entry": "lib/docpad.coffee", "directory": "src", "syntaxes": [ "coffeescript", @@ -212,7 +216,7 @@ }, { "description": "CoffeeScript Compiled JavaScript + ES5 + Require", - "entry": "out/lib/docpad.js", + "entry": "lib/docpad.js", "directory": "out", "syntaxes": [ "javascript", @@ -223,11 +227,11 @@ ], "main": "out/lib/docpad.js", "bin": { - "docpad": "./bin/docpad", - "docpad-compile": "./bin/docpad-compile", - "docpad-debug": "./bin/docpad-debug", - "docpad-server": "./bin/docpad-server", - "docpad-trace": "./bin/docpad-trace" + "docpad": "bin/docpad", + "docpad-compile": "bin/docpad-compile", + "docpad-debug": "bin/docpad-debug", + "docpad-server": "bin/docpad-server", + "docpad-trace": "bin/docpad-trace" }, "scripts": { "setup": "npm install", @@ -239,7 +243,7 @@ "meta:projectz": "projectz compile", "prepare": "npm run compile && npm run test && npm run meta", "release": "npm run prepare && npm run release:publish && npm run release:tag && npm run release:push", - "release:publish": "npm publish", + "release:publish": "npm publish --tag $npm_package_tag", "release:tag": "git tag v$npm_package_version -a", "release:push": "git push origin master && git push origin --tags", "pretest": "npm run test:coffeelint", diff --git a/src/lib/docpad.coffee b/src/lib/docpad.coffee index 527005ab..0343293e 100755 --- a/src/lib/docpad.coffee +++ b/src/lib/docpad.coffee @@ -1633,11 +1633,6 @@ class DocPad extends EventEmitterGrouped # Helper's source-code can be found at: https://github.com/docpad/helper helperUrl: if true then 'http://helper.docpad.org/' else 'http://localhost:8000/' - # Safe Mode - # If enabled, we will try our best to sandbox our template rendering so that they cannot modify things outside of them - # Not yet implemented - safeMode: false - # Template Data # What data would you like to expose to your templates templateData: {} @@ -2176,32 +2171,53 @@ class DocPad extends EventEmitterGrouped # internally by DocPad to watch project documents # and files and then activate the regeneration process # when any of those items are updated. - # - # Although it is possible to pass a range of options to watchdir - # in practice these options are provided as part of - # the DocPad config object with a number of default options - # specified in the DocPad config. + # @private # @method watchdir - # @param {Object} [opts={}] - # @param {String} [opts.path] a single path to watch. - # @param {Array} [opts.paths] an array of paths to watch. - # @param {Function} [opts.listener] a single change listener to fire when a change occurs. - # @param {Array} [opts.listeners] an array of listeners. - # @param {Function} [opts.next] callback. - # @param {Object} [opts.stat] a file stat object to use for the path, instead of fetching a new one. - # @param {Number} [opts.interval=5007] for systems that poll to detect file changes, how often should it poll in millseconds. - # @param {Number} [opts.catupDelay=200] handles system swap file deletions and renaming - # @param {Array} [opts.preferredMethods=['watch','watchFile'] which order should we prefer our watching methods to be tried?. - # @param {Boolean} [opts.followLinks=true] follow symlinks, i.e. use stat rather than lstat. - # @param {Boolean|Array} [opts.ignorePaths=false] an array of full paths to ignore. - # @param {Boolean|Array} [opts.ignoreHiddenFiles=false] whether or not to ignored files which filename starts with a ".". - # @param {Boolean} [opts.ignoreCommonPatterns=true] whether or not to ignore common undesirable file patterns (e.g. .svn, .git, .DS_Store, thumbs.db, etc). - # @param {Boolean|Array} [opts.ignoreCustomPatterns=null] any custom ignore patterns that you would also like to ignore along with the common patterns. + # @param {String} path - the path to watch + # @param {Object} listeners - listeners to attach to the watcher + # @param {Function} next - completion callback accepting error # @return {Object} the watcher ### - watchdir: (opts={}) -> - opts = extendr.extend(@getIgnoreOpts(), opts, @config.watchOptions) - return require('watchr').watch(opts) + watchdir: (path, listeners, next) -> + opts = extendr.extend(@getIgnoreOpts(), @config.watchOptions or {}) + stalker = require('watchr').create(path) + for own key, value of listeners + stalker.on(key, value) + stalker.setConfig(opts) + stalker.watch(next) + return stalker + + ###* + # Watch Directories. Wrapper around watchdir. + # @private + # @method watchdirs + # @param {Array} paths - the paths to watch + # @param {Object} listeners - listeners to attach to the watcher + # @param {Function} next - completion callback accepting error and watchers/stalkers + ### + watchdirs: (paths, listeners, next) -> + docpad = @ + stalkers = [] + + tasks = new TaskGroup('watching directories').setConfig(concurrency:0).done (err) -> + if err + for stalker in stalkers + stalker.close() + next(err) + else + next(err, stalkers) + + paths.forEach (path) -> + tasks.addTask "watching #{path}", (done) -> + # check if the dir exists first as reloadPaths may not apparently + safefs.exists path, (exists) -> + return done() unless exists + stalkers.push docpad.watchdir(path, listeners, done) + + tasks.run() + + # Chain + @ # ================================= @@ -2292,7 +2308,7 @@ class DocPad extends EventEmitterGrouped configsToMerge.push(envConfig) if envConfig # Merge - extendr.deepDefaults(configsToMerge...) + extendr.deep(configsToMerge...) # Chain @ @@ -3121,7 +3137,7 @@ class DocPad extends EventEmitterGrouped if loggers.debug? is false loggers.debug = loggers.logger .pipe( - new (require('caterpillar-human').Human)(color:false) + require('caterpillar-human').create(color:false) ) .pipe( require('fs').createWriteStream(@debugLogPath) @@ -3900,13 +3916,24 @@ class DocPad extends EventEmitterGrouped # Log docpad.log 'debug', util.format(locale.renderDirectoryParsing, path) + # Tasks + tasks = new TaskGroup('parse directory').setConfig(concurrency:0).done (err) -> + # Check + return next(err) if err + + # Log + docpad.log 'debug', util.format(locale.renderDirectoryParsed, path) + + # Forward + return next(null, files) + # Files docpad.scandir( # Path path: path # File Action - fileAction: (fileFullPath,fileRelativePath,nextFile,fileStat) -> + fileAction: (fileFullPath, fileRelativePath, filename, fileStat) -> # Prepare data = fullPath: fileFullPath @@ -3916,28 +3943,27 @@ class DocPad extends EventEmitterGrouped # Create file file = createFunction.call(docpad, data, opts) - # Update the file's stat - # To ensure changes files are handled correctly in generation - file.action 'load', (err) -> - # Error? - return nextFile(err) if err + # Create a task to load the file + tasks.addTask "load the file #{fileRelativePath}", (complete) -> + # Update the file's stat + # To ensure changes files are handled correctly in generation + file.action 'load', (err) -> + # Error? + return complete(err) if err + + # Add the file to the collection + files.add(file) - # Add the file to the collection - files.add(file) + # Next + complete() - # Next - nextFile() + # Return + return # Next next: (err) -> - # Check return next(err) if err - - # Log - docpad.log 'debug', util.format(locale.renderDirectoryParsed, path) - - # Forward - return next(null, files) + tasks.run() ) # Chain @@ -4149,9 +4175,14 @@ class DocPad extends EventEmitterGrouped docpad = @ locale = @getLocale() + # Tasks + tasks = new TaskGroup('load plugins').setConfig(concurrency:0).done (err) -> + docpad.log 'debug', util.format(locale.pluginsLoadedFor, pluginsPath) + return next(err) + # Load Plugins docpad.log 'debug', util.format(locale.pluginsLoadingFor, pluginsPath) - @scandir( + docpad.scandir( # Path path: pluginsPath @@ -4159,26 +4190,25 @@ class DocPad extends EventEmitterGrouped fileAction: false # Handle directories - dirAction: (fileFullPath,fileRelativePath,nextFile) -> + dirAction: (fileFullPath, fileRelativePath, pluginName) -> # Prepare pluginName = pathUtil.basename(fileFullPath) - # Delve deeper into the directory if it is a direcotry of plugins - return nextFile(null, false) if fileFullPath is pluginsPath + # Add the task to load the oplugin to the queue + tasks.addTask "load the plugin #{pluginName}", (complete) -> + # Otherwise, it is a plugin directory, so load the plugin + docpad.loadPlugin fileFullPath, (err) -> + # Warn about the plugin load error if there is one + if err + docpad.warn util.format(locale.pluginFailedToLoad, pluginName, fileFullPath), err - # Otherwise, it is a plugin directory, so load the plugin - docpad.loadPlugin fileFullPath, (err) -> - # Warn about the plugin load error if there is one - if err - docpad.warn util.format(locale.pluginFailedToLoad, pluginName, fileFullPath), err - - # All done and don't recurse into this directory - return nextFile(null, true) + # All done and don't recurse into this directory + return complete() # Next next: (err) -> - docpad.log 'debug', util.format(locale.pluginsLoadedFor, pluginsPath) - return next(err) + return next(err) if err + tasks.run() ) # Chain @@ -4312,7 +4342,7 @@ class DocPad extends EventEmitterGrouped return next(err) if err # Completion callback - tasks = new docpad.TaskGroup "contextualizeFiles tasks", concurrency:0, next:(err) -> + tasks = docpad.createTaskGroup "contextualizeFiles tasks", concurrency:0, next:(err) -> # Kill the timer clearInterval(slowFilesTimer) slowFilesTimer = null @@ -4405,7 +4435,7 @@ class DocPad extends EventEmitterGrouped # Prepare return next(err) if err - subTasks = new docpad.TaskGroup "renderCollection: #{collectionToRender.options.name}", concurrency:0, next:(err) -> + subTasks = docpad.createTaskGroup "renderCollection: #{collectionToRender.options.name}", concurrency:0, next:(err) -> # Prepare return next(err) if err @@ -4433,7 +4463,7 @@ class DocPad extends EventEmitterGrouped return next(err) if err # Async - tasks = new docpad.TaskGroup "renderCollection: renderBefore tasks", next:(err) -> + tasks = docpad.createTaskGroup "renderCollection: renderBefore tasks", next:(err) -> # Kill the timer clearInterval(slowFilesTimer) slowFilesTimer = null @@ -4514,7 +4544,7 @@ class DocPad extends EventEmitterGrouped return next(err) if err # Completion callback - tasks = new docpad.TaskGroup "writeFiles tasks", concurrency:0, next:(err) -> + tasks = docpad.createTaskGroup "writeFiles tasks", concurrency:0, next:(err) -> # Kill the timer clearInterval(slowFilesTimer) slowFilesTimer = null @@ -4542,7 +4572,7 @@ class DocPad extends EventEmitterGrouped slowFilesObject[file.id] = file.get('relativePath') # Create sub tasks - fileTasks = new docpad.TaskGroup "tasks for file write: #{filePath}", concurrency:0, next:(err) -> + fileTasks = docpad.createTaskGroup "tasks for file write: #{filePath}", concurrency:0, next:(err) -> delete slowFilesObject[file.id] opts.progress?.tick() return complete(err) @@ -5159,7 +5189,7 @@ class DocPad extends EventEmitterGrouped [opts,next] = extractOptsAndCallback(opts,next) attributes = extendr.extend({ fullPath: path - },opts.attributes) + }, opts.attributes or {}) # Handle document = @createDocument(attributes) @@ -5222,7 +5252,7 @@ class DocPad extends EventEmitterGrouped data: text body: text content: text - }, opts.attributes) + }, opts.attributes or {}) # Handle document = @createDocument(attributes) @@ -5323,61 +5353,68 @@ class DocPad extends EventEmitterGrouped docpad.destroyWatchers() # Start a group - tasks = new docpad.TaskGroup("watch tasks", {concurrency:0, next}) + tasks = docpad.createTaskGroup("watch tasks", {concurrency:0, next}) # Watch reload paths reloadPaths = union(config.reloadPaths, config.configPaths) - tasks.addTask "watch reload paths", (complete) -> docpad.watchdir( - paths: reloadPaths - listeners: - 'log': docpad.log - 'error': docpad.error - 'change': -> - docpad.log 'info', util.format(locale.watchReloadChange, new Date().toLocaleTimeString()) - docpad.action 'load', (err) -> - return docpad.fatal(err) if err - performGenerate(reset:true) - next: (err,_watchers) -> - if err - docpad.warn("Watching the reload paths has failed:\n"+docpad.inspector(reloadPaths), err) + tasks.addTask "watch reload paths", (complete) -> + docpad.watchdirs( + reloadPaths, + { + 'log': docpad.log + 'error': docpad.error + 'change': -> + docpad.log 'info', util.format(locale.watchReloadChange, new Date().toLocaleTimeString()) + docpad.action 'load', (err) -> + return docpad.fatal(err) if err + performGenerate(reset:true) + }, + (err,_watchers) -> + if err + docpad.warn("Watching the reload paths has failed:\n"+docpad.inspector(reloadPaths), err) + return complete() + for watcher in _watchers + docpad.watchers.push(watcher) return complete() - for watcher in _watchers - docpad.watchers.push(watcher) - return complete() - ) + ) # Watch regenerate paths regeneratePaths = config.regeneratePaths - tasks.addTask "watch regenerate paths", (complete) -> docpad.watchdir( - paths: regeneratePaths - listeners: - 'log': docpad.log - 'error': docpad.error - 'change': -> performGenerate(reset:true) - next: (err,_watchers) -> - if err - docpad.warn("Watching the regenerate paths has failed:\n"+docpad.inspector(regeneratePaths), err) + tasks.addTask "watch regenerate paths", (complete) -> + docpad.watchdirs( + regeneratePaths, + { + 'log': docpad.log + 'error': docpad.error + 'change': -> performGenerate(reset:true) + }, + (err,_watchers) -> + if err + docpad.warn("Watching the regenerate paths has failed:\n"+docpad.inspector(regeneratePaths), err) + return complete() + for watcher in _watchers + docpad.watchers.push(watcher) return complete() - for watcher in _watchers - docpad.watchers.push(watcher) - return complete() - ) + ) # Watch the source srcPath = config.srcPath - tasks.addTask "watch the source path", (complete) -> docpad.watchdir( - path: srcPath - listeners: - 'log': docpad.log - 'error': docpad.error - 'change': changeHandler - next: (err,watcher) -> - if err - docpad.warn("Watching the src path has failed: "+srcPath, err) + tasks.addTask "watch the source path", (complete) -> + docpad.watchdirs( + [srcPath], + { + 'log': docpad.log + 'error': docpad.error + 'change': changeHandler + }, + (err,_watchers) -> + if err + docpad.warn("Watching the src path has failed: "+srcPath, err) + return complete() + for watcher in _watchers + docpad.watchers.push(watcher) return complete() - docpad.watchers.push(watcher) - return complete() - ) + ) # Run tasks.run() diff --git a/src/lib/interfaces/console.coffee b/src/lib/interfaces/console.coffee index eae3f645..e6babe29 100755 --- a/src/lib/interfaces/console.coffee +++ b/src/lib/interfaces/console.coffee @@ -325,7 +325,7 @@ class ConsoleInterface opts = {} opts.commander = args[-1...][0] opts.args = args[...-1] - opts.instanceConfig = extendr.safeDeepExtendPlainObjects({}, @extractConfig(opts.commander), config) + opts.instanceConfig = extendr.deepDefaults({}, @extractConfig(opts.commander), config) # Complete Action completeAction = (err) -> diff --git a/src/test/actions-test.coffee b/src/test/actions-test.coffee index 837a6040..d32271b1 100755 --- a/src/test/actions-test.coffee +++ b/src/test/actions-test.coffee @@ -43,13 +43,18 @@ docpadConfig = logLevel: docpadUtil.getDefaultLogLevel() skipUnsupportedPlugins: false catchExceptions: false + b: 'instanceConfig' # overwrite + c: 'instanceConfig' # insert + templateData: + b: 'instanceConfig templateData' # overwrite + c: 'instanceConfig templateData' # insert environments: development: - a: 'instanceConfig' - b: 'instanceConfig' + b: 'instanceConfig development' # overwrite + c: 'instanceConfig development' # insert templateData: - a: 'instanceConfig' - b: 'instanceConfig' + b: 'instanceConfig templateData development' # overwrite + c: 'instanceConfig templateData development' # insert # Fail on an uncaught error process.on 'uncaughtException', (err) -> @@ -68,24 +73,26 @@ joe.suite 'docpad-actions', (suite,test) -> docpad = DocPad.createInstance docpadConfig, (err) -> done(err) - test 'config', (done) -> - expected = {a:'instanceConfig', b:'instanceConfig', c:'websiteConfig'} + test 'config', -> + expected = {a:'websiteConfig development', b:'instanceConfig development', c:'instanceConfig development'} config = docpad.getConfig() {a,b,c} = config deepEqual( {a,b,c} - expected + expected, + "config matched" ) + test 'config templateData', -> + expected = {a:'websiteConfig templateData development', b:'instanceConfig templateData development', c:'instanceConfig templateData development'} templateData = docpad.getTemplateData() {a,b,c} = templateData deepEqual( {a,b,c} - expected + expected, + "template data matched" ) - done() - test 'clean', (done) -> docpad.action 'clean', (err) -> done(err) diff --git a/test/docpad.coffee b/test/docpad.coffee index 8a8b5f9e..2deaf955 100644 --- a/test/docpad.coffee +++ b/test/docpad.coffee @@ -11,17 +11,19 @@ module.exports = # then we tell our test docpad site to use docpad's node modules directory for plugins pluginsPaths: ['../node_modules'] + a: 'websiteConfig' + b: 'websiteConfig' environments: development: - a: 'websiteConfig' - b: 'websiteConfig' - c: 'websiteConfig' + a: 'websiteConfig development' + b: 'websiteConfig development' templateData: - a: 'websiteConfig' - b: 'websiteConfig' - c: 'websiteConfig' + a: 'websiteConfig templateData development' + b: 'websiteConfig templateData development' templateData: + a: 'websiteConfig templateData' + b: 'websiteConfig templateData' require: require site: