diff --git a/.editorconfig b/.editorconfig index 4423e0fd..29d11ece 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,4 +1,4 @@ -# 2016 March 8 +# 2017 March 3 # https://github.com/bevry/base root = true @@ -6,7 +6,7 @@ root = true [*] end_of_line = lf charset = utf-8 -trim_trailing_whitespace = false +trim_trailing_whitespace = true insert_final_newline = false indent_style = tab diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000..84ec1ee1 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,931 @@ +// 2017 February 22 +// https://github.com/bevry/base +// http://eslint.org +// This code must be able to run on Node 0.10 +/* eslint no-warning-comments: 0 */ +'use strict' + +const IGNORE = 0, WARN = 1, ERROR = 2, MAX_PARAMS = 4 + +const config = { + extends: ['eslint:recommended'], + plugins: [], + parserOptions: {ecmaFeatures: {}}, + env: {}, + rules: { + // ---------------------------- + // Problems with these rules + // If we can figure out how to enable the following, that would be great + + // Two spaces after one line if or else: + // if ( blah ) return + // Insead of one space: + // if ( blah ) return + + // No spaces on embedded function: + // .forEach(function(key, value){ + // instead of: + // .forEach(function (key, value) { + + // Else and catch statements on the same line as closing brace: + // } else { + // } catch (e) { + // instead of: + // } + // else { + + + // -------------------------------------- + // Possible Errors + // The following rules point out areas where you might have made mistakes. + + // Don't allow assignments in conditional statements (if, while, etc.) + 'no-cond-assign': [ERROR, 'always'], + + // Warn but don't error about console statements + 'no-console': WARN, + + // Sometimes useful for debugging + // Allow while(true) loops + 'no-constant-condition': WARN, + + // Seems like a good idea to error about this + 'no-control-regex': ERROR, + + // Warn but don't error about console statements + 'no-debugger': WARN, + + // Don't allow duplicate arguments in a function, they can cause errors + 'no-dupe-args': ERROR, + + // Disallow duplicate keys in an object, they can cause errors + 'no-dupe-keys': ERROR, + + // Disallow duplicate case statements in a switch + 'no-duplicate-case': ERROR, + + // Allow empty block statements, they are useful for clarity + 'no-empty': IGNORE, + + // Disallow empty [] in regular expressions as they cause unexpected behaviour + 'no-empty-character-class': ERROR, + + // Overwriting the exception argument in a catch statement can cause memory leaks in some browsers + 'no-ex-assign': ERROR, + + // Disallow superflous boolean casts, they offer no value + 'no-extra-boolean-cast': ERROR, + + // Allow superflous parenthesis as they offer clarity in some cases + 'no-extra-parens': IGNORE, + + // Disallow superflous semicolons, they offer no value + 'no-extra-semi': ERROR, + + // Seems like a good idea to error about this + 'no-func-assign': ERROR, + + // Seems like a good idea to error about this + 'no-inner-declarations': ERROR, + + // Seems like a good idea to error about this + 'no-invalid-regexp': ERROR, + + // Seems like a good idea to error about this + 'no-irregular-whitespace': ERROR, + + // Seems like a good idea to error about this + 'no-obj-calls': ERROR, + + // Not enough justification to change our existing use + 'no-prototype-builtins': IGNORE, + + // Seems like a good idea to error about this + // Instead of / / used / {ERROR}/ instead + 'no-regex-spaces': ERROR, + + // Seems like a good idea to error about this + 'no-sparse-arrays': ERROR, + + // Probably an error on our part, so warn + 'no-template-curly-in-string': WARN, + + // Seems like a good idea to error about this + 'no-unexpected-multiline': ERROR, + + // Seems like a good idea to error about this + 'no-unreachable': ERROR, + + // Seems like a good idea to error about this + 'no-unsafe-finally': ERROR, + + // Seems like a good idea to error about this + 'no-unsafe-negation': ERROR, + + // Seems like a good idea to error about this + 'use-isnan': ERROR, + + // We use JSDoc again + 'valid-jsdoc': [ERROR, { + requireParamDescription: false, + requireReturnDescription: false + }], + + // Seems like a good idea to error about this + 'valid-typeof': ERROR, + + + // -------------------------------------- + // Best Practices + // These are rules designed to prevent you from making mistakes. They either prescribe a better way of doing something or help you avoid footguns. + + // Often we only need one, setting both doesn't make sense + // Enforces getter/setter pairs in objects + 'accessor-pairs': IGNORE, + + // Seems sensible + // Enforces return statements in callbacks of array's methods + 'array-callback-return': ERROR, + + // This rule seems buggy + 'block-scoped-var': IGNORE, + + // Seems interesting, lets give it a go + 'class-methods-use-this': WARN, + + // Disable complexity checks, they are annoying and not that useful in detecting actual complexity + 'complexity': IGNORE, + + // We use blank returns for break statements and for returning void + 'consistent-return': IGNORE, + + // Always require curly braces unless the statement is all on a single line + 'curly': [ERROR, 'multi-line'], + + // If we don't have a default cause, it probably means we should throw an error + 'default-case': ERROR, + + // Dots should be on the newlines + // chainableThingy + // .doSomething() + // .doSomethingElse() + 'dot-location': [ERROR, 'property'], + + // Use dot notation where possible + 'dot-notation': ERROR, + + // Unless you are doing == null, then force === to avoid truthy/falsey mistakes + 'eqeqeq': [ERROR, 'allow-null'], + + // Always use hasOwnProperty when doing for in + 'guard-for-in': ERROR, + + // Warn about alert statements in our code + // Use one of the suggested alternatives instead + // Reasoning is they could be mistaken for left over debugging statements + 'no-alert': WARN, + + // They are very slow + 'no-caller': ERROR, + + // Wow... + 'no-case-declarations': ERROR, + + // Seems like a good idea to error about this + 'no-div-regex': ERROR, + + // Returns in else statements offer code clarity, so disable this rule + 'no-else-return': IGNORE, + + // Up to developer sensibility + // disallow use of empty functions + 'no-empty-function': IGNORE, + + // Seems sensible + 'no-empty-pattern': ERROR, + + // We know that == null is a null and undefined check + 'no-eq-null': IGNORE, + + // Eval is slow and unsafe, use vm's instead + 'no-eval': ERROR, + + // There is never a good reason for this + 'no-extend-native': ERROR, + + // Don't allow useless binds + 'no-extra-bind': ERROR, + + // Seems sensible + 'no-extra-label': ERROR, + + // Don't allow switch case statements to follow through, use continue keyword instead + 'no-fallthrough': ERROR, + + // Use zero when doing decimals, otherwise it is confusing + 'no-floating-decimal': ERROR, + + // Seems sensible + 'no-global-assign': ERROR, + + // Cleverness is unclear + 'no-implicit-coercion': ERROR, + + // Seems sensible providing detection works correctly + 'no-implicit-globals': ERROR, + + // A sneaky way to do evals + 'no-implied-eval': ERROR, + + // This throws for a lot of senseless things, like chainy functions + 'no-invalid-this': IGNORE, + + // Use proper iterators instead + 'no-iterator': ERROR, + + // We never use this, it seems silly to allow this + 'no-labels': ERROR, + + // We never use this, it seems silly to allow this + 'no-lone-blocks': ERROR, + + // Loop functions always cause problems, as the scope isn't clear through iterations + 'no-loop-func': ERROR, + + // Far too annoying + 'no-magic-numbers': IGNORE, + + // We like multi spaces for clarity + // E.g. We like + // if ( blah ) return foo + // Instead of: + // if ( blah ) return foo + // @TODO would be great to enforce the above + 'no-multi-spaces': IGNORE, + + // Use ES6 template strings instead + 'no-multi-str': ERROR, + + // We never use this, it seems silly to allow this + 'no-new-func': ERROR, + + // We never use this, it seems silly to allow this + 'no-new-wrappers': ERROR, + + // We never use this, it seems silly to allow this + 'no-new': ERROR, + + // We never use this, it seems silly to allow this + 'no-octal-escape': ERROR, + + // We never use this, it seems silly to allow this + 'no-octal': ERROR, + + // We got to be pretty silly if we don't realise we are doing this + // As such, take any usage as intentional and aware + 'no-param-reassign': IGNORE, + + // We never use this, it seems silly to allow this + 'no-proto': ERROR, + + // We never use this, it seems silly to allow this + 'no-redeclare': ERROR, + + // No defaults for this that are useful + 'no-restricted-properties': IGNORE, + + // We never use this, it seems silly to allow this + 'no-return-assign': ERROR, + + // We never use this, it seems silly to allow this + 'no-script-url': ERROR, + + // Seems sensible + 'no-self-assign': ERROR, + + // We never use this, it seems silly to allow this + 'no-self-compare': ERROR, + + // We never use this, it seems silly to allow this + 'no-sequences': ERROR, + + // We always want proper error objects as they have stack traces and respond to instanceof Error checks + 'no-throw-literal': ERROR, + + // Could be a getter, so warn + 'no-unmodified-loop-condition': WARN, + + // We never use this, it seems silly to allow this + 'no-unused-expressions': ERROR, + + // Seems sensible + 'no-unused-labels': ERROR, + + // Seems sensible + 'no-useless-call': ERROR, + + // Seems sensible + 'no-useless-concat': ERROR, + + // Seems sensible + 'no-useless-escape': ERROR, + + // We never use this, it seems silly to allow this + 'no-void': ERROR, + + // Warn about todos + 'no-warning-comments': [WARN, { terms: ['todo', 'fixme'], location: 'anywhere' }], + + // We never use this, it seems silly to allow this + 'no-with': ERROR, + + // Always specify a radix to avoid errors + 'radix': ERROR, + + // We appreciate the clarity late defines offer + 'vars-on-top': IGNORE, + + // Wrap instant called functions in parenthesis for clearer intent + 'wrap-iife': ERROR, + + // Because we force === and never allow assignments in conditions + // we have no need for yoda statements, so disable them + 'yoda': [ERROR, 'never'], + + + // -------------------------------------- + // Strict Mode + // These rules relate to using strict mode. + + // Ensure that use strict is specified to prevent the runtime erorr: + // SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode + 'strict': [ERROR, 'global'], + + + // -------------------------------------- + // Variables + // These rules have to do with variable declarations. + + // We don't care + 'init-declarations': IGNORE, + + // Don't allow the catch method to shadow objects as browsers handle this differently + // Update: We don't care for IE8 + 'no-catch-shadow': IGNORE, + + // Don't use delete, it disables optimisations + 'no-delete-var': ERROR, + + // We never use this, it seems silly to allow this + 'no-label-var': ERROR, + + // No useful defaults + 'no-restricted-globals': IGNORE, + + // We never use this, it seems silly to allow this + 'no-shadow-restricted-names': ERROR, + + // We use shadowing + 'no-shadow': IGNORE, + + // Makes sense + 'no-undef-init': ERROR, + + // Error when an undefined variable is used + 'no-undef': ERROR, + + // typeof blah === 'undefined' should always be used + 'no-undefined': ERROR, + + // Warn us when we don't use something + 'no-unused-vars': WARN, + + // Error when we try and use something before it is defined + 'no-use-before-define': ERROR, + + + // -------------------------------------- + // Node.js and CommonJS + // These rules are specific to JavaScript running on Node.js or using CommonJS in the browser. + + // Seems to difficult to enforce + 'callback-return': IGNORE, + + // We use require where it is appropriate to use it + 'global-require': IGNORE, + + // Force handling of callback errors + 'handle-callback-err': ERROR, + + // @TODO decide if this is good or not + 'no-mixed-requires': ERROR, + + // Disallow error prone syntax + 'no-new-require': ERROR, + + // Always use path.join for windows support + 'no-path-concat': ERROR, + + // We use process.env wisely + 'no-process-env': IGNORE, + + // We know what we are doing + 'no-process-exit': IGNORE, + + // No need to disallow any modules + 'no-restricted-modules': IGNORE, + + // Sometimes sync methods are useful, so warn but don't error + 'no-sync': WARN, + + + // -------------------------------------- + // Stylistic + // These rules are purely matters of style and are quite subjective. + + // We don't use spaces with brackets + 'array-bracket-spacing': [ERROR, 'never'], + + // Disallow or enforce spaces inside of single line blocks + 'block-spacing': [ERROR, 'always'], + + // Opening brace on same line, closing brace on its own line, except when statement is a single line + 'brace-style': [ERROR, 'stroustrup', { allowSingleLine: true }], + + // Use camel case + 'camelcase': ERROR, + + // ES6 supports dangling commas + 'comma-dangle': [ERROR, 'never'], + + // Require a comma after always + 'comma-spacing': [ERROR, { before: false, after: true }], + + // Commas go last, we have tooling to detect if we forget a comma + 'comma-style': [ERROR, 'last'], + + // Require or disallow padding inside computed properties + 'computed-property-spacing': [ERROR, 'never'], + + // Enabling this was incredibly annoying when doing layers of nesting + 'consistent-this': IGNORE, + + // Enable to make UNIX people's lives easier + 'eol-last': ERROR, + + // We never use this, it seems silly to allow this + 'func-call-spacing': [ERROR, 'never'], + + // This rule is not currently useful + 'func-name-matching': IGNORE, + + // We like anonymous functions + 'func-names': IGNORE, + + // Prefer to define functions via variables + 'func-style': [WARN, 'declaration'], + + // Nothing we want to blacklist + // blacklist certain identifiers to prevent them being used + 'id-blacklist': IGNORE, + + // Sometimes short names are appropriate + 'id-length': IGNORE, + + // Camel case handles this for us + 'id-match': IGNORE, + + // Use tabs and indent case blocks + 'indent': [ERROR, 'tab', { + SwitchCase: 1, + VariableDeclarator: 0, + outerIIFEBody: 1, + MemberExpression: 1, + FunctionDeclaration: { + body: 1, + parameters: 0 + }, + FunctionExpression: { + body: 1, + parameters: 0 + } + }], + // ^ broken before, let us try again + + // Prefer double qoutes for JSX properties: , + 'jsx-quotes': [ERROR, 'prefer-double'], + + // Space after the colon + 'key-spacing': [ERROR, { + beforeColon: false, + afterColon: true + }], + + // Always force a space before and after a keyword + 'keyword-spacing': [ERROR], + + // we use both + 'line-comment-position': IGNORE, + + // Enforce unix line breaks + 'linebreak-style': [ERROR, 'unix'], + + // Enforce new lines before block comments + 'lines-around-comment': [ERROR, { + beforeBlockComment: true, + allowBlockStart: true + }], + + // Enforce directives with no line above but a line below + 'lines-around-directive': [ERROR, { + before: 'never', + after: 'always' + }], + + // Disabled to ensure consistency with complexity option + 'max-depth': IGNORE, + + // We use soft wrap + 'max-len': IGNORE, + + // Perhaps in the future we can set this to 300 or so + // but for now it is not useful for the things we write and maintain + 'max-lines': IGNORE, + + // We are smart enough to know if this is bad or not + 'max-nested-callbacks': IGNORE, + + // Sometimes we have no control over this for compat reasons, so just warn + 'max-params': [WARN, MAX_PARAMS], + + // Let's give this a go and see what is appropriate for our usage + 'max-statements-per-line': [WARN, {max: 1}], + + // We should be able to use whatever feels right + 'max-statements': IGNORE, + + // Current options are not useful + 'multiline-ternary': IGNORE, + + // Constructors should be CamelCase + 'new-cap': ERROR, + + // Always use parens when instantiating a class + 'new-parens': ERROR, + + // Too difficult to enforce correctly as too many edge-cases + // require or disallow an empty newline after variable declarations + 'newline-after-var': IGNORE, + + // Let the author decide + // enforce newline after each call when chaining the calls + 'newline-per-chained-call': IGNORE, + + // Don't use the array constructor when it is not needed + 'no-array-constructor': ERROR, + + // We never use bitwise, they are too clever + 'no-bitwise': ERROR, + + // We use continue + 'no-continue': IGNORE, + + // We like inline comments + 'no-inline-comments': IGNORE, + + // The code could be optimised if this error occurs + 'no-lonely-if': ERROR, + + // Seems sensible, let's see how we go with this + 'no-mixed-operators': ERROR, + + // Don't mix spaces and tabs + // Maybe [ERROR, 'smart-tabs'] will be better, we will see + 'no-mixed-spaces-and-tabs': ERROR, + + // We use multiple empty lines for styling + 'no-multiple-empty-lines': IGNORE, + + // Sometimes it is more understandable with a negated condition + 'no-negated-condition': IGNORE, + + // Sometimes these are useful + 'no-nested-ternary': IGNORE, + + // Use {} instead of new Object() + 'no-new-object': ERROR, + + // We use plus plus + 'no-plusplus': IGNORE, + + // Handled by other rules + 'no-restricted-syntax': IGNORE, + + // We use tabs + 'no-tabs': IGNORE, + + // Sometimes ternaries are useful + 'no-ternary': IGNORE, + + // Disallow trailing spaces + 'no-trailing-spaces': ERROR, + + // Sometimes this is useful when avoiding shadowing + 'no-underscore-dangle': IGNORE, + + // Sensible + 'no-unneeded-ternary': ERROR, + + // Seems sensible + 'no-whitespace-before-property': ERROR, + + // Object indentation should be consistent within the object + // Ignore until https://github.com/eslint/eslint/issues/7434 is done + 'object-curly-newline': [IGNORE, {multiline: true}], + + // Desirable, but too many edge cases it turns out where it is actually preferred + 'object-curly-spacing': IGNORE, + + // We like multiple var statements + 'one-var': IGNORE, + 'one-var-declaration-per-line': IGNORE, + + // Force use of shorthands when available + 'operator-assignment': [ERROR, 'always'], + + // Should be before, but not with =, *=, /=, += lines + // @TODO figure out how to enforce + 'operator-linebreak': IGNORE, + + // This rule doesn't appear to work correclty + 'padded-blocks': IGNORE, + + // Seems like a good idea to error about this + // was broken before, but lets give a go again + 'quote-props': [ERROR, 'consistent-as-needed'], + + // Use single quotes where escaping isn't needed + 'quotes': [ERROR, 'single', 'avoid-escape'], + + // We use YUIdoc + 'require-jsdoc': IGNORE, + + // If semi's are used, then add spacing after + 'semi-spacing': [ERROR, { before: false, after: true }], + + // Never use semicolons + 'semi': [ERROR, 'never'], + + // Importance makes more sense than alphabetical + 'sort-keys': IGNORE, + + // Importance makes more sense than alphabetical + 'sort-vars': IGNORE, + + // Always force a space before a { + 'space-before-blocks': [ERROR, 'always'], + + // function () {, get blah () { + 'space-before-function-paren': [ERROR, 'always'], + + // This is for spacing between (), so doSomething( WARN, ERROR, 3 ) or if ( WARN === 3 ) + // which we want for ifs, but don't want for calls + 'space-in-parens': IGNORE, + + // We use this + 'space-infix-ops': ERROR, + + // We use this + 'space-unary-ops': ERROR, + + // We use this + // 'spaced-line-comment': ERROR, + 'spaced-comment': ERROR, + + // When would we ever do this? Makes no sense + 'unicode-bom': [ERROR, 'never'], + + // We do this, seems to work well + 'wrap-regex': ERROR, + + + // -------------------------------------- + // ECMAScript 6 / ES6 + + // Sensible to create more informed and clear code + 'arrow-body-style': [ERROR, 'as-needed'], + + // We do this, no reason why, just what we do + 'arrow-parens': [ERROR, 'always'], + + // Require consistent spacing for arrow functions + 'arrow-spacing': ERROR, + + // Makes sense as otherwise runtime error will occur + 'constructor-super': ERROR, + + // Seems the most consistent location for it + 'generator-star-spacing': [ERROR, 'before'], + + // Makes sense + 'no-class-assign': ERROR, + + // Makes sense + 'no-confusing-arrow': ERROR, + + // Of course + 'no-const-assign': ERROR, + + // Of course + 'no-dupe-class-members': ERROR, + + // Seems sensible, may be times when we want this + 'no-duplicate-imports': WARN, + + // Seems sensible + 'no-new-symbol': ERROR, + + // No need to disallow any imports + 'no-restricted-imports': IGNORE, + + // Makes sense as otherwise runtime error will occur + 'no-this-before-super': ERROR, + + // Seems sensible + 'no-useless-computed-key': ERROR, + + // Seems sensible + 'no-useless-constructor': ERROR, + + // Seems sensible + 'no-useless-rename': ERROR, + + // Of course + // However, would be good to have this adjusted per environment + 'no-var': WARN, + + // Enforce ES6 object shorthand + 'object-shorthand': ERROR, + + // Better performance when running native + // but horrible performance if not running native as could fallback to bind + // https://travis-ci.org/bevry/es6-benchmarks + 'prefer-arrow-callback': IGNORE, + + // Of course + 'prefer-const': ERROR, + + // Makes sense + 'prefer-numeric-literals': ERROR, + + // Controversial change, but makes sense to move towards to reduce the risk of bad people overwriting apply and call + // https://github.com/eslint/eslint/issues/ERROR939 + // Ignoring because node does not yet support it, so we don't want to get the performance hit of using the compiled ES5 version + 'prefer-reflect': IGNORE, + + // Makes sense to enforce, exceptions should be opted out of on case by case + 'prefer-rest-params': ERROR, + + // Sure, why not + 'prefer-spread': ERROR, + + // Too annoying to enforce + 'prefer-template': IGNORE, + + // Makes sense + 'require-yield': ERROR, + + // Makes sense + 'rest-spread-spacing': [ERROR, 'never'], + + // Importance makes more sense than alphabetical + 'sort-imports': IGNORE, + + // Makes sense + 'symbol-description': ERROR, + + // Makes sense + 'template-curly-spacing': [ERROR, 'never'], + + // Our preference + 'yield-star-spacing': [ERROR, 'both'], + + + // -------------------------------------- + // Plugins + + // Not sure why, but okay + 'babel/no-await-in-loop': WARN, + 'flow-vars/define-flow-type': WARN, + 'flow-vars/use-flow-type': WARN + } +} + +// ------------------------------------ +// Enhancements + +// Load data.json file if it exists +const rules = Object.keys(config.rules) +let data = {}, devDeps = [] +try { + data = require('./package.json') || {} + devDeps = Object.keys(data.devDependencies || {}) +} +catch ( err ) {} + +// Set the parser options depending on our editions +if ( data.editions ) { + const sourceEdition = data.editions[0] + for ( let syntaxIndex = 0; syntaxIndex < sourceEdition.syntaxes.length; ++syntaxIndex ) { + const syntax = sourceEdition.syntaxes[syntaxIndex] + if ( syntax === 'esnext' ) { + config.parserOptions.ecmaVersion = 8 + break + } + else if ( syntax.indexOf('es') === 0 ) { + config.parserOptions.ecmaVersion = Number(syntax.substr(2)) + break + } + } + config.parserOptions.ecmaFeatures.sourceType = sourceEdition.syntaxes.indexOf('import') !== -1 ? 'module' : 'script' + config.parserOptions.ecmaFeatures.jsx = sourceEdition.syntaxes.indexOf('jsx') !== -1 +} +else { + // node version + const node = data.engines && data.engines.node && data.engines.node.replace('>=', '').replace(/ /g, '').replace(/\..+$/, '') + config.parserOptions.ecmaVersion = node >= 6 ? 6 : 5 +} + +// Set the environments depending on whether we need them or not +config.env.es6 = Boolean(config.parserOptions.ecmaVersion && config.parserOptions.ecmaVersion >= 6) +config.env.node = Boolean(data.engines && data.engines.node) +config.env.browser = Boolean(data.browser) +if ( config.env.browser ) { + config.env.commonjs = true + if ( config.env.node ) { + config.env['shared-node-browser'] = true + } +} + +// If not on legacy javascript, disable esnext rules +if ( config.parserOptions.ecmaVersion && config.parserOptions.ecmaVersion <= 5 ) { + config.rules['no-var'] = IGNORE + config.rules['object-shorthand'] = [ERROR, 'never'] +} + +// Add babel parsing if installed +if ( devDeps.indexOf('babel-eslint') !== -1 ) { + config.parser = 'babel-eslint' +} + +// Add react linting if installed +if ( devDeps.indexOf('eslint-plugin-react') !== -1 ) { + config.extends.push('plugin:react/recommended') + config.plugins.push('react') +} + +if ( devDeps.indexOf('eslint-plugin-babel') !== -1 ) { + // Remove rules that babel rules replace + config.plugins.push('babel') + const replacements = [ + 'array-bracket-spacing', + 'new-cap', + 'object-curly-spacing', + 'arrow-parens', + 'generator-star-spacing', + 'object-shorthand' + ] + replacements.forEach(function (key) { + if ( rules.indexOf(key) !== -1 ) { + config.rules['babel/' + key] = config.rules[key] + config.rules[key] = IGNORE + } + }) +} +else { + // Remove babel rules if not using babel + rules.forEach(function (key) { + if ( key.indexOf('babel/') === 0 ) { + delete config.rules[key] + } + }) +} + +if ( devDeps.indexOf('eslint-plugin-flow-vars') !== -1 ) { + // Add flow plugin if installed + config.plugins.push('flow-vars') +} +else { + // Remove flow rules if plugin not installed + rules.forEach(function (key) { + if ( key.indexOf('flow-vars/') === 0 ) { + delete config.rules[key] + } + }) +} + + +// ------------------------------------ +// Export + +module.exports = config diff --git a/.gitignore b/.gitignore index 3afd533b..ca68e21a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -# 2016 October 17 +# 2017 January 27 # https://github.com/bevry/base # Temp Files @@ -21,6 +21,7 @@ coffee/ es5/ es2015/ esnext/ +docs/ # Editor Caches .c9/ diff --git a/.travis.yml b/.travis.yml index 7aee9b45..97b853fc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,32 +1,140 @@ -# 2016 April 27 +# 2017 March 22 # https://github.com/bevry/base # Use the latest travis infrastructure sudo: false -# We use node +# Complete Node.js Version Matrix +# https://github.com/balupton/awesome-travis#complete-nodejs-version-matrix language: node_js node_js: - - "0.12" - - "4" - - "5" - - "6" + - "0.8" # end of life + - "0.10" # end of life + - "0.12" # maintenance + - "4" # lts + - "6" # lts + - "7" # stable +matrix: + fast_finish: true + allow_failures: + - node_js: "0.8" + - node_js: "0.10" cache: directories: - - node_modules + - $HOME/.npm # npm's cache -# Prepare our tests -# Ensure the project is setup correctly and compiled -install: "npm run-script setup" -before_script: "npm run-script compile" +install: | + # Ensure NPM is latest + # https://github.com/balupton/awesome-travis#ensure-npm-is-latest + export CURRENT_NPM_VERSION="$(npm --version)" || exit -1 + export LATEST_NPM_VERSION="$(npm view npm version)" || exit -1 + if test "$CURRENT_NPM_VERSION" != "$LATEST_NPM_VERSION"; then + echo "running an old npm version $CURRENT_NPM_VERSION, upgrading npm to $LATEST_NPM_VERSION..." + npm install npm --global --cache-min=Infinity || exit -1 + echo "...npm upgrade complete" + fi + # Ensure dependencies install with a LTS node version + # https://github.com/balupton/awesome-travis#use-lts-node-version-for-preparation + export CURRENT_NODE_VERSION="$(node --version)" || exit -1 + export LTS_NODE_VERSIONS="$(nvm ls-remote --lts)" || exit -1 + if echo "$LTS_NODE_VERSIONS" | grep "$CURRENT_NODE_VERSION"; then + echo "running on a LTS node version, completing setup..." + npm run our:setup || exit -1 + echo "...setup complete with current LTS version" + else + echo "running on a non-LTS node version, completing setup on a LTS node version..." + nvm install --lts + export LTS_NODE_INSTALLED_VERSION="$(node --version)" || exit -1 + npm run our:setup || exit -1 + nvm use "$TRAVIS_NODE_VERSION" || exit -1 + echo "...setup complete with LTS" + fi +before_script: | + # Ensure compilation and linting occur on a LTS node version + # https://github.com/balupton/awesome-travis#use-lts-node-version-for-preparation + if test "$LTS_NODE_INSTALLED_VERSION"; then + echo "running on a non-LTS node version, compiling with LTS, skipping linting..." + nvm use "$LTS_NODE_INSTALLED_VERSION" || exit -1 + npm run our:compile || exit -1 + nvm use "$TRAVIS_NODE_VERSION" || exit -1 + echo "...compiled" + else + echo "running on a LTS node version, compiling and linting..." + npm run our:compile && npm run our:verify || exit -1 + echo "...compiled and linted" + fi +after_success: | + # Release to Surge + # https://github.com/balupton/awesome-travis#release-to-surge + export CURRENT_NODE_VERSION="$(node --version)" || exit -1 + export LTS_NODE_LATEST_VERSION="$(nvm version-remote --lts)" || exit -1 + if test "$CURRENT_NODE_VERSION" = "$LTS_NODE_LATEST_VERSION"; then + echo "running on latest LTS node version, performing release to surge..." + echo "preparing release" + npm run our:meta || exit -1 + echo "installing surge" + npm install surge || exit -1 + echo "performing deploy" + export SURGE_SLUG="$(echo $TRAVIS_REPO_SLUG | sed 's/^\(.*\)\/\(.*\)/\2.\1/')" || exit -1 + if test "$TRAVIS_BRANCH"; then + echo "deploying branch..." + surge --project $SURGE_PROJECT --domain "$TRAVIS_BRANCH.$SURGE_SLUG.surge.sh" || exit -1 + fi + if test "$TRAVIS_TAG"; then + echo "deploying tag..." + surge --project $SURGE_PROJECT --domain "$TRAVIS_TAG.$SURGE_SLUG.surge.sh" || exit -1 + fi + if test "$TRAVIS_COMMIT"; then + echo "deploying commit..." + surge --project $SURGE_PROJECT --domain "$TRAVIS_COMMIT.$SURGE_SLUG.surge.sh" || exit -1 + fi + echo "...released to surge" + else + echo "running on non-latest LTS node version, skipping release to surge" + fi + # Release to NPM + # https://github.com/balupton/awesome-travis#release-to-npm + export CURRENT_NODE_VERSION="$(node --version)" || exit -1 + export LTS_NODE_LATEST_VERSION="$(nvm version-remote --lts)" || exit -1 + if test "$CURRENT_NODE_VERSION" = "$LTS_NODE_LATEST_VERSION"; then + if test "$TRAVIS_TAG"; then + echo "logging in..." + echo -e "$NPM_USERNAME\n$NPM_PASSWORD\n$NPM_EMAIL" | npm login || exit -1 + echo "publishing..." + npm publish || exit -1 + echo "...released to npm" + else + echo "non-tag, no need for release" + fi + else + echo "running on non-latest LTS node version, skipping release to npm" + fi -# Run our tests -script: "npm test" +# ======================================== +# Custom Configuration +# https://github.com/bevry/base#configuration -# Custom notifications +env: + global: + # Release to NPM + # https://github.com/balupton/awesome-travis#release-to-npm + - secure: WeIfuQhk2MgqXySloBoW1Th6dh7GTp7FbE/KHP/v7WKh/wFwxN6dIp7+zl3oMi/uVIWkiZ18EX82v6CUJq+u01vzd/Rk4Sj4p3L1lNi4wwElniXSblCnTakKivZfP/VaFO2ka2nwiIN7lSFBLoHojAecH2g5vxU8Q6mEW6mOVP4= + - secure: gcR6X6qf1XC2zu/oN8/fIiCMpEg7dFlzWPPkZ+8wqH7Dan77FsPIhisDw1W1seneMvms3Ku3gV07QU/kSrpbNTNfRrIusCl/Bh/imUPMElfQxxEcykQcUaHSzmWHa/SaLwRJWPp6ii5hu6Z1F3pwgyl1TpheRQrMcjmRr5I/SkU= + - secure: B5IlZLjgldcR5+ypZ0oiurUsybmpu0ZDD2mIu22fcP6eBzrGcVUPeUBBT2qC8DUFkYYJqi8gbQfJ/pJBngWktXxbyj5jJkV9bBdMzf7eupz8vcjcq1kr9piLTF+66qB7+djS+1Gm9uxVP1cM5BjOO44eWoKGfxl8oNVlPaRqmQE= + # Release to Surge + # https://github.com/balupton/awesome-travis#release-to-surge + - SURGE_PROJECT='.' # ths is the path that you want to deploy to surge + - secure: fHn9nZBNewevxuVLmzHrWGniwWBs8pz7ejy8QHLFvv1910w8fT7ZowzstyfQPWaidP5+/z76rAKvSp05qF0WMM2XBcpKJzbMHyrp1zxnboah9cDNz87Tx8tULhB2eo6/Cb1BUD9jlOyEwkbS3PzhiLNgy9gnF9+rijnA2tf0QYE= + - secure: OMTu9+wWFGKD5CCIadP8WZXFxY2DRx/21qKes5WUpjipnho2GyxcjfDK0MFloThLzSayDWIbjxNH3WmMUb3c4uLsqhEm9wj5vWllUsJ+ELgyeK/9Q1M6vkIAS2vrkjnc4peltCd6t85SQF0SE/DwToj8sGajNwRzsikLEULSCMQ= + # Custom Configuration for this repository + +# https://github.com/balupton/awesome-travis#slack +# https://github.com/balupton/awesome-travis#email +env: + global: notifications: slack: - secure: hYTEHwzc03LIgAC08QvXU5yvhMwDM00rUtk7r0j5Qr1aD04PaKFVTRlBcvvy8YkNoMrtUWizPqmSZ4RamliXt+kioI6A/Phf6r6V3/tupEVBcvVzTi8LamzUomj3vYXOwJNN4IVWjdoCf0kZTB8Sz7xwXsvGnEkAlhRJD7ZEG2s= + secure: TV6bx7xKGz4dVbcmnp1Oy8zXhyvkOeg3xOga7PxIlE+Grof2+a7oNJk8kk8ti0Wmnx3KznmJnKw7qHauijfMFOvJJaMvDLx499L07jjA/x9D93U0tUvpcy8hCIGwWHaoyr3UFjopFKt7RdUBVW2MtXWtvLwVuQmnwoFKwHbN970= email: recipients: - secure: jvtlCYaUCPzvE985LlJpEGIIgVzhkEUi/ImAa4fLxyGKAmTG1JsykDznwquggN5UbTFlOYS+i+rFmPLm4hLJf9bGUtl/yk90KN0NlHZfZ+x7EE/nTIpr6iaK8TqdrmaMNnwuj87/6zBdl9iKjzU/1lrBnz1hanUABU96kbWFFJE= + secure: lCRwaxvOAOnv6FHwATCeufywriNoksNnexTMYX3lIGTcTfVJN1n3EZoicaZ5KiwG0cHdFX7Na2lBjCELpOtL9ZOOYf1zg+9/ily8Kc2InQvnv9dsySa7HAXPto12pprwajFqlbULCWVP8HJiMv8U5QRGnc39+K83Ev35YEHZLkk= diff --git a/README.md b/README.md index 828dd33d..18e74510 100755 --- a/README.md +++ b/README.md @@ -15,13 +15,15 @@ Dependency Status Dev Dependency Status
-Slack community badge -Patreon donate button +Patreon donate button +Open Collective donate button Gratipay donate button -Flattr donate button -PayPal donate button +Flattr donate button +PayPal donate button Bitcoin donate button Wishlist browse button +
+Slack community badge @@ -145,10 +147,11 @@ These amazing people have contributed finances to this project: Become a sponsor! -Patreon donate button +Patreon donate button +Open Collective donate button Gratipay donate button -Flattr donate button -PayPal donate button +Flattr donate button +PayPal donate button Bitcoin donate button Wishlist browse button @@ -171,7 +174,7 @@ These amazing people have contributed code to this project:
  • Chase Colmanview contributions
  • Lukasz Gornickiview contributions
  • eldiosview contributions
  • -
  • Shih-Yung Leeview contributions
  • +
  • syleeview contributions
  • Eduardo Lavaqueview contributions
  • Homme Zwaagstraview contributions
  • JT Turner
  • @@ -202,7 +205,7 @@ These amazing people have contributed code to this project:
  • vsopvsopview contributions
  • Zearinview contributions
  • Firedeview contributions
  • -
  • JT Turnerview contributions
  • +
  • JT Turnerview contributions
  • Anton Wilhelmview contributions
  • Bahtiar Gadimovview contributions
  • Ke Zhuview contributions
  • diff --git a/docs/api.js b/docs/api.js deleted file mode 100644 index 49ce4e9b..00000000 --- a/docs/api.js +++ /dev/null @@ -1,26 +0,0 @@ -YUI.add("yuidoc-meta", function(Y) { - Y.YUIDoc = { meta: { - "classes": [ - "BasePlugin", - "Collection", - "Docpad", - "DocumentModel", - "ElementsCollection", - "Events", - "FileModel", - "FilesCollection", - "MetaCollection", - "Model", - "PluginLoader", - "PluginTester", - "QueryCollection", - "ScriptCollection", - "ServerTester", - "StylesCollection", - "docpadUtil" - ], - "modules": [], - "allModules": [], - "elements": [] -} }; -}); \ No newline at end of file diff --git a/docs/assets/css/external-small.png b/docs/assets/css/external-small.png deleted file mode 100755 index 759a1cdc..00000000 Binary files a/docs/assets/css/external-small.png and /dev/null differ diff --git a/docs/assets/css/logo.png b/docs/assets/css/logo.png deleted file mode 100755 index c82444af..00000000 Binary files a/docs/assets/css/logo.png and /dev/null differ diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css deleted file mode 100755 index cdfe209e..00000000 --- a/docs/assets/css/main.css +++ /dev/null @@ -1,783 +0,0 @@ -/* -Font sizes for all selectors other than the body are given in percentages, -with 100% equal to 13px. To calculate a font size percentage, multiply the -desired size in pixels by 7.6923076923. - -Here's a quick lookup table: - -10px - 76.923% -11px - 84.615% -12px - 92.308% -13px - 100% -14px - 107.692% -15px - 115.385% -16px - 123.077% -17px - 130.769% -18px - 138.462% -19px - 146.154% -20px - 153.846% -*/ - -html { - background: #fff; - color: #333; - overflow-y: scroll; -} - -body { - /*font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif;*/ - font: 13px/1.4 'Helvetica', 'Arial', sans-serif; - margin: 0; - padding: 0; -} - -/* -- Links ----------------------------------------------------------------- */ -a { - color: #356de4; - text-decoration: none; -} - -.hidden { - display: none; -} - -a:hover { text-decoration: underline; } - -/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from - sight until it's focused. */ -.jump { - position: absolute; - padding: 3px 6px; - left: -99999px; - top: 0; -} - -.jump:focus { left: 40%; } - -/* -- Paragraphs ------------------------------------------------------------ */ -p { margin: 1.3em 0; } -dd p, td p { margin-bottom: 0; } -dd p:first-child, td p:first-child { margin-top: 0; } - -/* -- Headings -------------------------------------------------------------- */ -h1, h2, h3, h4, h5, h6 { - color: #D98527;/*was #f80*/ - font-family: 'Trebuchet MS', sans-serif; - font-weight: bold; - line-height: 1.1; - margin: 1.1em 0 0.5em; -} - -h1 { - font-size: 184.6%; - color: #30418C; - margin: 0.75em 0 0.5em; -} - -h2 { - font-size: 153.846%; - color: #E48A2B; -} - -h3 { font-size: 138.462%; } - -h4 { - border-bottom: 1px solid #DBDFEA; - color: #E48A2B; - font-size: 115.385%; - font-weight: normal; - padding-bottom: 2px; -} - -h5, h6 { font-size: 107.692%; } - -/* -- Code and examples ----------------------------------------------------- */ -code, kbd, pre, samp { - font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; - font-size: 92.308%; - line-height: 1.35; -} - -p code, p kbd, p samp, li code { - background: #FCFBFA; - border: 1px solid #EFEEED; - padding: 0 3px; -} - -a code, a kbd, a samp, -pre code, pre kbd, pre samp, -table code, table kbd, table samp, -.intro code, .intro kbd, .intro samp, -.toc code, .toc kbd, .toc samp { - background: none; - border: none; - padding: 0; -} - -pre.code, pre.terminal, pre.cmd { - overflow-x: auto; - *overflow-x: scroll; - padding: 0.3em 0.6em; -} - -pre.code { - background: #FCFBFA; - border: 1px solid #EFEEED; - border-left-width: 5px; -} - -pre.terminal, pre.cmd { - background: #F0EFFC; - border: 1px solid #D0CBFB; - border-left: 5px solid #D0CBFB; -} - -/* Don't reduce the font size of // elements inside
    -   blocks. */
    -pre code, pre kbd, pre samp { font-size: 100%; }
    -
    -/* Used to denote text that shouldn't be selectable, such as line numbers or
    -   shell prompts. Guess which browser this doesn't work in. */
    -.noselect {
    -    -moz-user-select: -moz-none;
    -    -khtml-user-select: none;
    -    -webkit-user-select: none;
    -    -o-user-select: none;
    -    user-select: none;
    -}
    -
    -/* -- Lists ----------------------------------------------------------------- */
    -dd { margin: 0.2em 0 0.7em 1em; }
    -dl { margin: 1em 0; }
    -dt { font-weight: bold; }
    -
    -/* -- Tables ---------------------------------------------------------------- */
    -caption, th { text-align: left; }
    -
    -table {
    -    border-collapse: collapse;
    -    width: 100%;
    -}
    -
    -td, th {
    -    border: 1px solid #fff;
    -    padding: 5px 12px;
    -    vertical-align: top;
    -}
    -
    -td { background: #E6E9F5; }
    -td dl { margin: 0; }
    -td dl dl { margin: 1em 0; }
    -td pre:first-child { margin-top: 0; }
    -
    -th {
    -    background: #D2D7E6;/*#97A0BF*/
    -    border-bottom: none;
    -    border-top: none;
    -    color: #000;/*#FFF1D5*/
    -    font-family: 'Trebuchet MS', sans-serif;
    -    font-weight: bold;
    -    line-height: 1.3;
    -    white-space: nowrap;
    -}
    -
    -
    -/* -- Layout and Content ---------------------------------------------------- */
    -#doc {
    -    margin: auto;
    -    min-width: 1024px;
    -}
    -
    -.content { padding: 0 20px 0 25px; }
    -
    -.sidebar {
    -    padding: 0 15px 0 10px;
    -}
    -#bd {
    -    padding: 7px 0 130px;
    -    position: relative;
    -    width: 99%;
    -}
    -
    -/* -- Table of Contents ----------------------------------------------------- */
    -
    -/* The #toc id refers to the single global table of contents, while the .toc
    -   class refers to generic TOC lists that could be used throughout the page. */
    -
    -.toc code, .toc kbd, .toc samp { font-size: 100%; }
    -.toc li { font-weight: bold; }
    -.toc li li { font-weight: normal; }
    -
    -/* -- Intro and Example Boxes ----------------------------------------------- */
    -/*
    -.intro, .example { margin-bottom: 2em; }
    -.example {
    -    -moz-border-radius: 4px;
    -    -webkit-border-radius: 4px;
    -    border-radius: 4px;
    -    -moz-box-shadow: 0 0 5px #bfbfbf;
    -    -webkit-box-shadow: 0 0 5px #bfbfbf;
    -    box-shadow: 0 0 5px #bfbfbf;
    -    padding: 1em;
    -}
    -.intro {
    -    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    -}
    -*/
    -
    -/* -- Other Styles ---------------------------------------------------------- */
    -
    -/* These are probably YUI-specific, and should be moved out of Selleck's default
    -   theme. */
    -
    -.button {
    -    border: 1px solid #dadada;
    -    -moz-border-radius: 3px;
    -    -webkit-border-radius: 3px;
    -    border-radius: 3px;
    -    color: #444;
    -    display: inline-block;
    -    font-family: Helvetica, Arial, sans-serif;
    -    font-size: 92.308%;
    -    font-weight: bold;
    -    padding: 4px 13px 3px;
    -    -moz-text-shadow: 1px 1px 0 #fff;
    -    -webkit-text-shadow: 1px 1px 0 #fff;
    -    text-shadow: 1px 1px 0 #fff;
    -    white-space: nowrap;
    -
    -    background: #EFEFEF; /* old browsers */
    -    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    -    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    -    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    -}
    -
    -.button:hover {
    -    border-color: #466899;
    -    color: #fff;
    -    text-decoration: none;
    -    -moz-text-shadow: 1px 1px 0 #222;
    -    -webkit-text-shadow: 1px 1px 0 #222;
    -    text-shadow: 1px 1px 0 #222;
    -
    -    background: #6396D8; /* old browsers */
    -    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    -    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    -    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    -}
    -
    -.newwindow { text-align: center; }
    -
    -.header .version em {
    -    display: block;
    -    text-align: right;
    -}
    -
    -
    -#classdocs .item {
    -    border-bottom: 1px solid #466899;
    -    margin: 1em 0;
    -    padding: 1.5em;
    -}
    -
    -#classdocs .item .params p,
    -    #classdocs .item .returns p,{
    -    display: inline;
    -}
    -
    -#classdocs .item em code, #classdocs .item em.comment {
    -    color: green;
    -}
    -
    -#classdocs .item em.comment a {
    -    color: green;
    -    text-decoration: underline;
    -}
    -
    -#classdocs .foundat {
    -    font-size: 11px;
    -    font-style: normal;
    -}
    -
    -.attrs .emits {
    -    margin-left: 2em;
    -    padding: .5em;
    -    border-left: 1px dashed #ccc;
    -}
    -
    -abbr {
    -    border-bottom: 1px dashed #ccc;
    -    font-size: 80%;
    -    cursor: help;
    -}
    -
    -.prettyprint li.L0, 
    -.prettyprint li.L1, 
    -.prettyprint li.L2, 
    -.prettyprint li.L3, 
    -.prettyprint li.L5, 
    -.prettyprint li.L6, 
    -.prettyprint li.L7, 
    -.prettyprint li.L8 {
    -    list-style: decimal;
    -}
    -
    -ul li p {
    -    margin-top: 0;
    -}
    -
    -.method .name {
    -    font-size: 110%;
    -}
    -
    -.apidocs .methods .extends .method,
    -.apidocs .properties .extends .property,
    -.apidocs .attrs .extends .attr,
    -.apidocs .events .extends .event {
    -    font-weight: bold;
    -}
    -
    -.apidocs .methods .extends .inherited,
    -.apidocs .properties .extends .inherited,
    -.apidocs .attrs .extends .inherited,
    -.apidocs .events .extends .inherited {
    -    font-weight: normal;
    -}
    -
    -#hd {
    -    background: whiteSmoke;
    -    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    -    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    -    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    -    border-bottom: 1px solid #DFDFDF;
    -    padding: 0 15px 1px 20px;
    -    margin-bottom: 15px;
    -}
    -
    -#hd img {
    -    margin-right: 10px;
    -    vertical-align: middle;
    -}
    -
    -
    -/* -- API Docs CSS ---------------------------------------------------------- */
    -
    -/*
    -This file is organized so that more generic styles are nearer the top, and more
    -specific styles are nearer the bottom of the file. This allows us to take full
    -advantage of the cascade to avoid redundant style rules. Please respect this
    -convention when making changes.
    -*/
    -
    -/* -- Generic TabView styles ------------------------------------------------ */
    -
    -/*
    -These styles apply to all API doc tabviews. To change styles only for a
    -specific tabview, see the other sections below.
    -*/
    -
    -.yui3-js-enabled .apidocs .tabview {
    -    visibility: hidden; /* Hide until the TabView finishes rendering. */
    -    _visibility: visible;
    -}
    -
    -.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    -.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    -
    -/* -- Generic Content Styles ------------------------------------------------ */
    -
    -/* Headings */
    -h2, h3, h4, h5, h6 {
    -    border: none;
    -    color: #30418C;
    -    font-weight: bold;
    -    text-decoration: none;
    -}
    -
    -.link-docs {
    -    float: right;
    -    font-size: 15px;
    -    margin: 4px 4px 6px;
    -    padding: 6px 30px 5px;
    -}
    -
    -.apidocs { zoom: 1; }
    -
    -/* Generic box styles. */
    -.apidocs .box {
    -    border: 1px solid;
    -    border-radius: 3px;
    -    margin: 1em 0;
    -    padding: 0 1em;
    -}
    -
    -/* A flag is a compact, capsule-like indicator of some kind. It's used to
    -   indicate private and protected items, item return types, etc. in an
    -   attractive and unobtrusive way. */
    -.apidocs .flag {
    -    background: #bababa;
    -    border-radius: 3px;
    -    color: #fff;
    -    font-size: 11px;
    -    margin: 0 0.5em;
    -    padding: 2px 4px 1px;
    -}
    -
    -/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    -.apidocs .meta {
    -    background: #f9f9f9;
    -    border-color: #efefef;
    -    color: #555;
    -    font-size: 11px;
    -    padding: 3px 6px;
    -}
    -
    -.apidocs .meta p { margin: 0; }
    -
    -/* Deprecation warning. */
    -.apidocs .box.deprecated,
    -.apidocs .flag.deprecated {
    -    background: #fdac9f;
    -    border: 1px solid #fd7775;
    -}
    -
    -.apidocs .box.deprecated p { margin: 0.5em 0; }
    -.apidocs .flag.deprecated { color: #333; }
    -
    -/* Module/Class intro description. */
    -.apidocs .intro {
    -    background: #f0f1f8;
    -    border-color: #d4d8eb;
    -}
    -
    -/* Loading spinners. */
    -#bd.loading .apidocs,
    -#api-list.loading .yui3-tabview-panel {
    -    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    -    min-height: 150px;
    -}
    -
    -#bd.loading .apidocs .content,
    -#api-list.loading .yui3-tabview-panel .apis {
    -    display: none;
    -}
    -
    -.apidocs .no-visible-items { color: #666; }
    -
    -/* Generic inline list. */
    -.apidocs ul.inline {
    -    display: inline;
    -    list-style: none;
    -    margin: 0;
    -    padding: 0;
    -}
    -
    -.apidocs ul.inline li { display: inline; }
    -
    -/* Comma-separated list. */
    -.apidocs ul.commas li:after { content: ','; }
    -.apidocs ul.commas li:last-child:after { content: ''; }
    -
    -/* Keyboard shortcuts. */
    -kbd .cmd { font-family: Monaco, Helvetica; }
    -
    -/* -- Generic Access Level styles ------------------------------------------- */
    -.apidocs .item.protected,
    -.apidocs .item.private,
    -.apidocs .index-item.protected,
    -.apidocs .index-item.deprecated,
    -.apidocs .index-item.private {
    -    display: none;
    -}
    -
    -.show-deprecated .item.deprecated,
    -.show-deprecated .index-item.deprecated,
    -.show-protected .item.protected,
    -.show-protected .index-item.protected,
    -.show-private .item.private,
    -.show-private .index-item.private {
    -    display: block;
    -}
    -
    -.hide-inherited .item.inherited,
    -.hide-inherited .index-item.inherited {
    -    display: none;
    -}
    -
    -/* -- Generic Item Index styles --------------------------------------------- */
    -.apidocs .index { margin: 1.5em 0 3em; }
    -
    -.apidocs .index h3 {
    -    border-bottom: 1px solid #efefef;
    -    color: #333;
    -    font-size: 13px;
    -    margin: 2em 0 0.6em;
    -    padding-bottom: 2px;
    -}
    -
    -.apidocs .index .no-visible-items { margin-top: 2em; }
    -
    -.apidocs .index-list {
    -    border-color: #efefef;
    -    font-size: 12px;
    -    list-style: none;
    -    margin: 0;
    -    padding: 0;
    -    -moz-column-count: 4;
    -    -moz-column-gap: 10px;
    -    -moz-column-width: 170px;
    -    -ms-column-count: 4;
    -    -ms-column-gap: 10px;
    -    -ms-column-width: 170px;
    -    -o-column-count: 4;
    -    -o-column-gap: 10px;
    -    -o-column-width: 170px;
    -    -webkit-column-count: 4;
    -    -webkit-column-gap: 10px;
    -    -webkit-column-width: 170px;
    -    column-count: 4;
    -    column-gap: 10px;
    -    column-width: 170px;
    -}
    -
    -.apidocs .no-columns .index-list {
    -    -moz-column-count: 1;
    -    -ms-column-count: 1;
    -    -o-column-count: 1;
    -    -webkit-column-count: 1;
    -    column-count: 1;
    -}
    -
    -.apidocs .index-item { white-space: nowrap; }
    -
    -.apidocs .index-item .flag {
    -    background: none;
    -    border: none;
    -    color: #afafaf;
    -    display: inline;
    -    margin: 0 0 0 0.2em;
    -    padding: 0;
    -}
    -
    -/* -- Generic API item styles ----------------------------------------------- */
    -.apidocs .args {
    -    display: inline;
    -    margin: 0 0.5em;
    -}
    -
    -.apidocs .flag.chainable { background: #46ca3b; }
    -.apidocs .flag.protected { background: #9b86fc; }
    -.apidocs .flag.private { background: #fd6b1b; }
    -.apidocs .flag.async { background: #356de4; }
    -.apidocs .flag.required { background: #e60923; }
    -
    -.apidocs .item {
    -    border-bottom: 1px solid #efefef;
    -    margin: 1.5em 0 2em;
    -    padding-bottom: 2em;
    -}
    -
    -.apidocs .item h4,
    -.apidocs .item h5,
    -.apidocs .item h6 {
    -    color: #333;
    -    font-family: inherit;
    -    font-size: 100%;
    -}
    -
    -.apidocs .item .description p,
    -.apidocs .item pre.code {
    -    margin: 1em 0 0;
    -}
    -
    -.apidocs .item .meta {
    -    background: none;
    -    border: none;
    -    padding: 0;
    -}
    -
    -.apidocs .item .name {
    -    display: inline;
    -    font-size: 14px;
    -}
    -
    -.apidocs .item .type,
    -.apidocs .item .type a,
    -.apidocs .returns-inline {
    -    color: #555;
    -}
    -
    -.apidocs .item .type,
    -.apidocs .returns-inline {
    -    font-size: 11px;
    -    margin: 0 0 0 0;
    -}
    -
    -.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    -.apidocs .item .type a:hover { border: none; }
    -
    -/* -- Item Parameter List --------------------------------------------------- */
    -.apidocs .params-list {
    -    list-style: square;
    -    margin: 1em 0 0 2em;
    -    padding: 0;
    -}
    -
    -.apidocs .param { margin-bottom: 1em; }
    -
    -.apidocs .param .type,
    -.apidocs .param .type a {
    -    color: #666;
    -}
    -
    -.apidocs .param .type {
    -    margin: 0 0 0 0.5em;
    -    *margin-left: 0.5em;
    -}
    -
    -.apidocs .param-name { font-weight: bold; }
    -
    -/* -- Item "Emits" block ---------------------------------------------------- */
    -.apidocs .item .emits {
    -    background: #f9f9f9;
    -    border-color: #eaeaea;
    -}
    -
    -/* -- Item "Returns" block -------------------------------------------------- */
    -.apidocs .item .returns .type,
    -.apidocs .item .returns .type a {
    -    font-size: 100%;
    -    margin: 0;
    -}
    -
    -/* -- Class Constructor block ----------------------------------------------- */
    -.apidocs .constructor .item {
    -    border: none;
    -    padding-bottom: 0;
    -}
    -
    -/* -- File Source View ------------------------------------------------------ */
    -.apidocs .file pre.code,
    -#doc .apidocs .file pre.prettyprint {
    -    background: inherit;
    -    border: none;
    -    overflow: visible;
    -    padding: 0;
    -}
    -
    -.apidocs .L0,
    -.apidocs .L1,
    -.apidocs .L2,
    -.apidocs .L3,
    -.apidocs .L4,
    -.apidocs .L5,
    -.apidocs .L6,
    -.apidocs .L7,
    -.apidocs .L8,
    -.apidocs .L9 {
    -    background: inherit;
    -}
    -
    -/* -- Submodule List -------------------------------------------------------- */
    -.apidocs .module-submodule-description {
    -    font-size: 12px;
    -    margin: 0.3em 0 1em;
    -}
    -
    -.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    -
    -/* -- Sidebar TabView ------------------------------------------------------- */
    -#api-tabview { margin-top: 0.6em; }
    -
    -#api-tabview-filter,
    -#api-tabview-panel {
    -    border: 1px solid #dfdfdf;
    -}
    -
    -#api-tabview-filter {
    -    border-bottom: none;
    -    border-top: none;
    -    padding: 0.6em 10px 0 10px;
    -}
    -
    -#api-tabview-panel { border-top: none; }
    -#api-filter { width: 97%; }
    -
    -/* -- Content TabView ------------------------------------------------------- */
    -#classdocs .yui3-tabview-panel { border: none; }
    -
    -/* -- Source File Contents -------------------------------------------------- */
    -.prettyprint li.L0,
    -.prettyprint li.L1,
    -.prettyprint li.L2,
    -.prettyprint li.L3,
    -.prettyprint li.L5,
    -.prettyprint li.L6,
    -.prettyprint li.L7,
    -.prettyprint li.L8 {
    -    list-style: decimal;
    -}
    -
    -/* -- API options ----------------------------------------------------------- */
    -#api-options {
    -    font-size: 11px;
    -    margin-top: 2.2em;
    -    position: absolute;
    -    right: 1.5em;
    -}
    -
    -/*#api-options label { margin-right: 0.6em; }*/
    -
    -/* -- API list -------------------------------------------------------------- */
    -#api-list {
    -    margin-top: 1.5em;
    -    *zoom: 1;
    -}
    -
    -.apis {
    -    font-size: 12px;
    -    line-height: 1.4;
    -    list-style: none;
    -    margin: 0;
    -    padding: 0.5em 0 0.5em 0.4em;
    -}
    -
    -.apis a {
    -    border: 1px solid transparent;
    -    display: block;
    -    margin: 0 0 0 -4px;
    -    padding: 1px 4px 0;
    -    text-decoration: none;
    -    _border: none;
    -    _display: inline;
    -}
    -
    -.apis a:hover,
    -.apis a:focus {
    -    background: #E8EDFC;
    -    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    -    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    -    border-color: #AAC0FA;
    -    border-radius: 3px;
    -    color: #333;
    -    outline: none;
    -}
    -
    -.api-list-item a:hover,
    -.api-list-item a:focus {
    -    font-weight: bold;
    -    text-shadow: 1px 1px 1px #fff;
    -}
    -
    -.apis .message { color: #888; }
    -.apis .result a { padding: 3px 5px 2px; }
    -
    -.apis .result .type {
    -    right: 4px;
    -    top: 7px;
    -}
    -
    -.api-list-item .yui3-highlight {
    -    font-weight: bold;
    -}
    -
    diff --git a/docs/assets/favicon.ico b/docs/assets/favicon.ico
    deleted file mode 100755
    index 414ac4fb..00000000
    Binary files a/docs/assets/favicon.ico and /dev/null differ
    diff --git a/docs/assets/img/spinner.gif b/docs/assets/img/spinner.gif
    deleted file mode 100755
    index 44f96ba6..00000000
    Binary files a/docs/assets/img/spinner.gif and /dev/null differ
    diff --git a/docs/assets/index.html b/docs/assets/index.html
    deleted file mode 100755
    index 487fe15b..00000000
    --- a/docs/assets/index.html
    +++ /dev/null
    @@ -1,10 +0,0 @@
    -
    -
    -    
    -        Redirector
    -        
    -    
    -    
    -        Click here to redirect
    -    
    -
    diff --git a/docs/assets/js/api-filter.js b/docs/assets/js/api-filter.js
    deleted file mode 100755
    index d442e543..00000000
    --- a/docs/assets/js/api-filter.js
    +++ /dev/null
    @@ -1,56 +0,0 @@
    -YUI.add('api-filter', function (Y) {
    -
    -Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    -    // -- Initializer ----------------------------------------------------------
    -    initializer: function () {
    -        this._bindUIACBase();
    -        this._syncUIACBase();
    -    },
    -    getDisplayName: function(name) {
    -
    -        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    -            if (i.name === name && i.displayName) {
    -                name = i.displayName;
    -            }
    -        });
    -
    -        if (this.get('queryType') === 'elements') {
    -            name = '<' + name + '>';
    -        }
    -
    -        return name;
    -    }
    -
    -}, {
    -    // -- Attributes -----------------------------------------------------------
    -    ATTRS: {
    -        resultHighlighter: {
    -            value: 'phraseMatch'
    -        },
    -
    -        // May be set to "classes", "elements" or "modules".
    -        queryType: {
    -            value: 'classes'
    -        },
    -
    -        source: {
    -            valueFn: function() {
    -                var self = this;
    -                return function(q) {
    -                    var data = Y.YUIDoc.meta[self.get('queryType')],
    -                        out = [];
    -                    Y.each(data, function(v) {
    -                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    -                            out.push(v);
    -                        }
    -                    });
    -                    return out;
    -                };
    -            }
    -        }
    -    }
    -});
    -
    -}, '3.4.0', {requires: [
    -    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    -]});
    diff --git a/docs/assets/js/api-list.js b/docs/assets/js/api-list.js
    deleted file mode 100755
    index e8f650d5..00000000
    --- a/docs/assets/js/api-list.js
    +++ /dev/null
    @@ -1,255 +0,0 @@
    -YUI.add('api-list', function (Y) {
    -
    -var Lang   = Y.Lang,
    -    YArray = Y.Array,
    -
    -    APIList = Y.namespace('APIList'),
    -
    -    classesNode    = Y.one('#api-classes'),
    -    elementsNode   = Y.one('#api-elements'),
    -    inputNode      = Y.one('#api-filter'),
    -    modulesNode    = Y.one('#api-modules'),
    -    tabviewNode    = Y.one('#api-tabview'),
    -
    -    tabs = APIList.tabs = {},
    -
    -    filter = APIList.filter = new Y.APIFilter({
    -        inputNode : inputNode,
    -        maxResults: 1000,
    -
    -        on: {
    -            results: onFilterResults
    -        }
    -    }),
    -
    -    search = APIList.search = new Y.APISearch({
    -        inputNode : inputNode,
    -        maxResults: 100,
    -
    -        on: {
    -            clear  : onSearchClear,
    -            results: onSearchResults
    -        }
    -    }),
    -
    -    tabview = APIList.tabview = new Y.TabView({
    -        srcNode  : tabviewNode,
    -        panelNode: '#api-tabview-panel',
    -        render   : true,
    -
    -        on: {
    -            selectionChange: onTabSelectionChange
    -        }
    -    }),
    -
    -    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    -        circular   : true,
    -        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    -        keys       : {next: 'down:40', previous: 'down:38'}
    -    }).focusManager,
    -
    -    LIST_ITEM_TEMPLATE =
    -        '
  • ' + - '{displayName}' + - '
  • '; - -// -- Init --------------------------------------------------------------------- - -// Duckpunch FocusManager's key event handling to prevent it from handling key -// events when a modifier is pressed. -Y.before(function (e, activeDescendant) { - if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { - return new Y.Do.Prevent(); - } -}, focusManager, '_focusPrevious', focusManager); - -Y.before(function (e, activeDescendant) { - if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { - return new Y.Do.Prevent(); - } -}, focusManager, '_focusNext', focusManager); - -// Create a mapping of tabs in the tabview so we can refer to them easily later. -tabview.each(function (tab, index) { - var name = tab.get('label').toLowerCase(); - - tabs[name] = { - index: index, - name : name, - tab : tab - }; -}); - -// Switch tabs on Ctrl/Cmd-Left/Right arrows. -tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); - -// Focus the filter input when the `/` key is pressed. -Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); - -// Keep the Focus Manager up to date. -inputNode.on('focus', function () { - focusManager.set('activeDescendant', inputNode); -}); - -// Update all tabview links to resolved URLs. -tabview.get('panelNode').all('a').each(function (link) { - link.setAttribute('href', link.get('href')); -}); - -// -- Private Functions -------------------------------------------------------- -function getFilterResultNode() { - var queryType = filter.get('queryType'); - return queryType === 'classes' ? classesNode - : queryType === 'elements' ? elementsNode : modulesNode; -} - -// -- Event Handlers ----------------------------------------------------------- -function onFilterResults(e) { - var frag = Y.one(Y.config.doc.createDocumentFragment()), - resultNode = getFilterResultNode(), - typePlural = filter.get('queryType'), - typeSingular = typePlural === 'classes' ? 'class' : typePlural === 'elements' ? 'element' : 'module'; - - if (e.results.length) { - YArray.each(e.results, function (result) { - frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { - rootPath : APIList.rootPath, - displayName : filter.getDisplayName(result.highlighted), - name : result.text, - typePlural : typePlural, - typeSingular: typeSingular - })); - }); - } else { - frag.append( - '
  • ' + - 'No ' + typePlural + ' found.' + - '
  • ' - ); - } - - resultNode.empty(true); - resultNode.append(frag); - - focusManager.refresh(); -} - -function onSearchClear(e) { - - focusManager.refresh(); -} - -function onSearchKey(e) { - var target = e.target; - - if (target.test('input,select,textarea') - || target.get('isContentEditable')) { - return; - } - - e.preventDefault(); - - inputNode.focus(); - focusManager.refresh(); -} - -function onSearchResults(e) { - var frag = Y.one(Y.config.doc.createDocumentFragment()); - - if (e.results.length) { - YArray.each(e.results, function (result) { - frag.append(result.display); - }); - } else { - frag.append( - '
  • ' + - 'No results found. Maybe you\'ll have better luck with a ' + - 'different query?' + - '
  • ' - ); - } - - - focusManager.refresh(); -} - -function onTabSelectionChange(e) { - var tab = e.newVal, - name = tab.get('label').toLowerCase(); - - tabs.selected = { - index: tab.get('index'), - name : name, - tab : tab - }; - - switch (name) { - case 'elements':// fallthru - case 'classes': // fallthru - case 'modules': - filter.setAttrs({ - minQueryLength: 0, - queryType : name - }); - - search.set('minQueryLength', -1); - - // Only send a request if this isn't the initially-selected tab. - if (e.prevVal) { - filter.sendRequest(filter.get('value')); - } - break; - - case 'everything': - filter.set('minQueryLength', -1); - search.set('minQueryLength', 1); - - if (search.get('value')) { - search.sendRequest(search.get('value')); - } else { - inputNode.focus(); - } - break; - - default: - // WTF? We shouldn't be here! - filter.set('minQueryLength', -1); - search.set('minQueryLength', -1); - } - - if (focusManager) { - setTimeout(function () { - focusManager.refresh(); - }, 1); - } -} - -function onTabSwitchKey(e) { - var currentTabIndex = tabs.selected.index; - - if (!(e.ctrlKey || e.metaKey)) { - return; - } - - e.preventDefault(); - - switch (e.keyCode) { - case 37: // left arrow - if (currentTabIndex > 0) { - tabview.selectChild(currentTabIndex - 1); - inputNode.focus(); - } - break; - - case 39: // right arrow - if (currentTabIndex < (Y.Object.size(tabs) - 2)) { - tabview.selectChild(currentTabIndex + 1); - inputNode.focus(); - } - break; - } -} - -}, '3.4.0', {requires: [ - 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' -]}); diff --git a/docs/assets/js/api-search.js b/docs/assets/js/api-search.js deleted file mode 100755 index 175f6a61..00000000 --- a/docs/assets/js/api-search.js +++ /dev/null @@ -1,98 +0,0 @@ -YUI.add('api-search', function (Y) { - -var Lang = Y.Lang, - Node = Y.Node, - YArray = Y.Array; - -Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { - // -- Public Properties ---------------------------------------------------- - RESULT_TEMPLATE: - '
  • ' + - '' + - '

    {name}

    ' + - '{resultType}' + - '
    {description}
    ' + - '{class}' + - '
    ' + - '
  • ', - - // -- Initializer ---------------------------------------------------------- - initializer: function () { - this._bindUIACBase(); - this._syncUIACBase(); - }, - - // -- Protected Methods ---------------------------------------------------- - _apiResultFilter: function (query, results) { - // Filter components out of the results. - return YArray.filter(results, function (result) { - return result.raw.resultType === 'component' ? false : result; - }); - }, - - _apiResultFormatter: function (query, results) { - return YArray.map(results, function (result) { - var raw = Y.merge(result.raw), // create a copy - desc = raw.description || ''; - - // Convert description to text and truncate it if necessary. - desc = Node.create('
    ' + desc + '
    ').get('text'); - - if (desc.length > 65) { - desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; - } else { - desc = Y.Escape.html(desc); - } - - raw['class'] || (raw['class'] = ''); - raw.description = desc; - - // Use the highlighted result name. - raw.name = result.highlighted; - - return Lang.sub(this.RESULT_TEMPLATE, raw); - }, this); - }, - - _apiTextLocator: function (result) { - return result.displayName || result.name; - } -}, { - // -- Attributes ----------------------------------------------------------- - ATTRS: { - resultFormatter: { - valueFn: function () { - return this._apiResultFormatter; - } - }, - - resultFilters: { - valueFn: function () { - return this._apiResultFilter; - } - }, - - resultHighlighter: { - value: 'phraseMatch' - }, - - resultListLocator: { - value: 'data.results' - }, - - resultTextLocator: { - valueFn: function () { - return this._apiTextLocator; - } - }, - - source: { - value: '/api/v1/search?q={query}&count={maxResults}' - } - } -}); - -}, '3.4.0', {requires: [ - 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', - 'escape' -]}); diff --git a/docs/assets/js/apidocs.js b/docs/assets/js/apidocs.js deleted file mode 100755 index af9ac322..00000000 --- a/docs/assets/js/apidocs.js +++ /dev/null @@ -1,376 +0,0 @@ -YUI().use( - 'yuidoc-meta', - 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', -function (Y) { - -var win = Y.config.win, - localStorage = win.localStorage, - - bdNode = Y.one('#bd'), - - pjax, - defaultRoute, - - classTabView, - selectedTab; - -// Kill pjax functionality unless serving over HTTP. -if (!Y.getLocation().protocol.match(/^https?\:/)) { - Y.Router.html5 = false; -} - -// Create the default route with middleware which enables syntax highlighting -// on the loaded content. -defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { - prettyPrint(); - bdNode.removeClass('loading'); - - next(); -}); - -pjax = new Y.Pjax({ - container : '#docs-main', - contentSelector: '#docs-main > .content', - linkSelector : '#bd a', - titleSelector : '#xhr-title', - - navigateOnHash: true, - root : '/', - routes : [ - // -- / ---------------------------------------------------------------- - { - path : '/(index.html)?', - callbacks: defaultRoute - }, - - // -- /elements/* ------------------------------------------------------- - { - path : '/elements/:element.html*', - callbacks: defaultRoute - }, - - // -- /classes/* ------------------------------------------------------- - { - path : '/classes/:class.html*', - callbacks: [defaultRoute, 'handleClasses'] - }, - - // -- /files/* --------------------------------------------------------- - { - path : '/files/*file', - callbacks: [defaultRoute, 'handleFiles'] - }, - - // -- /modules/* ------------------------------------------------------- - { - path : '/modules/:module.html*', - callbacks: defaultRoute - } - ] -}); - -// -- Utility Functions -------------------------------------------------------- - -pjax.checkVisibility = function (tab) { - tab || (tab = selectedTab); - - if (!tab) { return; } - - var panelNode = tab.get('panelNode'), - visibleItems; - - // If no items are visible in the tab panel due to the current visibility - // settings, display a message to that effect. - visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { - if (itemNode.getComputedStyle('display') !== 'none') { - return true; - } - }); - - panelNode.all('.no-visible-items').remove(); - - if (!visibleItems) { - if (Y.one('#index .index-item')) { - panelNode.append( - '
    ' + - '

    ' + - 'Some items are not shown due to the current visibility ' + - 'settings. Use the checkboxes at the upper right of this ' + - 'page to change the visibility settings.' + - '

    ' + - '
    ' - ); - } else { - panelNode.append( - '
    ' + - '

    ' + - 'This class doesn\'t provide any methods, properties, ' + - 'attributes, or events.' + - '

    ' + - '
    ' - ); - } - } - - // Hide index sections without any visible items. - Y.all('.index-section').each(function (section) { - var items = 0, - visibleItems = 0; - - section.all('.index-item').each(function (itemNode) { - items += 1; - - if (itemNode.getComputedStyle('display') !== 'none') { - visibleItems += 1; - } - }); - - section.toggleClass('hidden', !visibleItems); - section.toggleClass('no-columns', visibleItems < 4); - }); -}; - -pjax.initClassTabView = function () { - if (!Y.all('#classdocs .api-class-tab').size()) { - return; - } - - if (classTabView) { - classTabView.destroy(); - selectedTab = null; - } - - classTabView = new Y.TabView({ - srcNode: '#classdocs', - - on: { - selectionChange: pjax.onTabSelectionChange - } - }); - - pjax.updateTabState(); - classTabView.render(); -}; - -pjax.initLineNumbers = function () { - var hash = win.location.hash.substring(1), - container = pjax.get('container'), - hasLines, node; - - // Add ids for each line number in the file source view. - container.all('.linenums>li').each(function (lineNode, index) { - lineNode.set('id', 'l' + (index + 1)); - lineNode.addClass('file-line'); - hasLines = true; - }); - - // Scroll to the desired line. - if (hasLines && /^l\d+$/.test(hash)) { - if ((node = container.getById(hash))) { - win.scroll(0, node.getY()); - } - } -}; - -pjax.initRoot = function () { - var terminators = /^(?:classes|files|elements|modules)$/, - parts = pjax._getPathRoot().split('/'), - root = [], - i, len, part; - - for (i = 0, len = parts.length; i < len; i += 1) { - part = parts[i]; - - if (part.match(terminators)) { - // Makes sure the path will end with a "/". - root.push(''); - break; - } - - root.push(part); - } - - pjax.set('root', root.join('/')); -}; - -pjax.updateTabState = function (src) { - var hash = win.location.hash.substring(1), - defaultTab, node, tab, tabPanel; - - function scrollToNode() { - if (node.hasClass('protected')) { - Y.one('#api-show-protected').set('checked', true); - pjax.updateVisibility(); - } - - if (node.hasClass('private')) { - Y.one('#api-show-private').set('checked', true); - pjax.updateVisibility(); - } - - setTimeout(function () { - // For some reason, unless we re-get the node instance here, - // getY() always returns 0. - var node = Y.one('#classdocs').getById(hash); - win.scrollTo(0, node.getY() - 70); - }, 1); - } - - if (!classTabView) { - return; - } - - if (src === 'hashchange' && !hash) { - defaultTab = 'index'; - } else { - if (localStorage) { - defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || - 'index'; - } else { - defaultTab = 'index'; - } - } - - if (hash && (node = Y.one('#classdocs').getById(hash))) { - if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { - if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { - if (classTabView.get('rendered')) { - Y.Widget.getByNode(tab).set('selected', 1); - } else { - tab.addClass('yui3-tab-selected'); - } - } - } - - // Scroll to the desired element if this is a hash URL. - if (node) { - if (classTabView.get('rendered')) { - scrollToNode(); - } else { - classTabView.once('renderedChange', scrollToNode); - } - } - } else { - tab = Y.one('#classdocs .api-class-tab.' + defaultTab); - - // When the `defaultTab` node isn't found, `localStorage` is stale. - if (!tab && defaultTab !== 'index') { - tab = Y.one('#classdocs .api-class-tab.index'); - } - - if (classTabView.get('rendered')) { - Y.Widget.getByNode(tab).set('selected', 1); - } else { - tab.addClass('yui3-tab-selected'); - } - } -}; - -pjax.updateVisibility = function () { - var container = pjax.get('container'); - - container.toggleClass('hide-inherited', - !Y.one('#api-show-inherited').get('checked')); - - container.toggleClass('show-deprecated', - Y.one('#api-show-deprecated').get('checked')); - - container.toggleClass('show-protected', - Y.one('#api-show-protected').get('checked')); - - container.toggleClass('show-private', - Y.one('#api-show-private').get('checked')); - - pjax.checkVisibility(); -}; - -// -- Route Handlers ----------------------------------------------------------- - -pjax.handleClasses = function (req, res, next) { - var status = res.ioResponse.status; - - // Handles success and local filesystem XHRs. - if (res.ioResponse.readyState === 4 && (!status || (status >= 200 && status < 300))) { - pjax.initClassTabView(); - } - - next(); -}; - -pjax.handleFiles = function (req, res, next) { - var status = res.ioResponse.status; - - // Handles success and local filesystem XHRs. - if (res.ioResponse.readyState === 4 && (!status || (status >= 200 && status < 300))) { - pjax.initLineNumbers(); - } - - next(); -}; - -// -- Event Handlers ----------------------------------------------------------- - -pjax.onNavigate = function (e) { - var hash = e.hash, - originTarget = e.originEvent && e.originEvent.target, - tab; - - if (hash) { - tab = originTarget && originTarget.ancestor('.yui3-tab', true); - - if (hash === win.location.hash) { - pjax.updateTabState('hashchange'); - } else if (!tab) { - win.location.hash = hash; - } - - e.preventDefault(); - return; - } - - // Only scroll to the top of the page when the URL doesn't have a hash. - this.set('scrollToTop', !e.url.match(/#.+$/)); - - bdNode.addClass('loading'); -}; - -pjax.onOptionClick = function (e) { - pjax.updateVisibility(); -}; - -pjax.onTabSelectionChange = function (e) { - var tab = e.newVal, - tabId = tab.get('contentBox').getAttribute('href').substring(1); - - selectedTab = tab; - - // If switching from a previous tab (i.e., this is not the default tab), - // replace the history entry with a hash URL that will cause this tab to - // be selected if the user navigates away and then returns using the back - // or forward buttons. - if (e.prevVal && localStorage) { - localStorage.setItem('tab_' + pjax.getPath(), tabId); - } - - pjax.checkVisibility(tab); -}; - -// -- Init --------------------------------------------------------------------- - -pjax.on('navigate', pjax.onNavigate); - -pjax.initRoot(); -pjax.upgrade(); -pjax.initClassTabView(); -pjax.initLineNumbers(); -pjax.updateVisibility(); - -Y.APIList.rootPath = pjax.get('root'); - -Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); - -Y.on('hashchange', function (e) { - pjax.updateTabState('hashchange'); -}, win); - -}); diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js deleted file mode 100755 index 18de8649..00000000 --- a/docs/assets/js/yui-prettify.js +++ /dev/null @@ -1,17 +0,0 @@ -YUI().use('node', function(Y) { - var code = Y.all('.prettyprint.linenums'); - if (code.size()) { - code.each(function(c) { - var lis = c.all('ol li'), - l = 1; - lis.each(function(n) { - n.prepend(''); - l++; - }); - }); - var h = location.hash; - location.hash = ''; - h = h.replace('LINE_', 'LINENUM_'); - location.hash = h; - } -}); diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html deleted file mode 100755 index b50b8414..00000000 --- a/docs/assets/vendor/prettify/CHANGES.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - Change Log - - - README - -

    Known Issues

    - - -

    Change Log

    -

    29 March 2007

    - -

    4 Jul 2008

    - -

    5 Jul 2008

    -
    -

    14 Jul 2008

    - -

    6 Jan 2009

    - -

    21 May 2009

    - -

    14 August 2009

    - -

    3 October 2009

    - -

    19 July 2010

    - - - diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING deleted file mode 100755 index d6456956..00000000 --- a/docs/assets/vendor/prettify/COPYING +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html deleted file mode 100755 index c6fe1a32..00000000 --- a/docs/assets/vendor/prettify/README.html +++ /dev/null @@ -1,203 +0,0 @@ - - - - - Javascript code prettifier - - - - - - - - - - Languages : CH -

    Javascript code prettifier

    - -

    Setup

    -
      -
    1. Download a distribution -
    2. Include the script and stylesheets in your document - (you will need to make sure the css and js file are on your server, and - adjust the paths in the script and link tag) -
      -<link href="prettify.css" type="text/css" rel="stylesheet" />
      -<script type="text/javascript" src="prettify.js"></script>
      -
    3. Add onload="prettyPrint()" to your - document's body tag. -
    4. Modify the stylesheet to get the coloring you prefer
    5. -
    - -

    Usage

    -

    Put code snippets in - <pre class="prettyprint">...</pre> - or <code class="prettyprint">...</code> - and it will automatically be pretty printed. - - - - -
    The original - Prettier -
    class Voila {
    -public:
    -  // Voila
    -  static const string VOILA = "Voila";
    -
    -  // will not interfere with embedded tags.
    -}
    - -
    class Voila {
    -public:
    -  // Voila
    -  static const string VOILA = "Voila";
    -
    -  // will not interfere with embedded tags.
    -}
    -
    - -

    FAQ

    -

    Which languages does it work for?

    -

    The comments in prettify.js are authoritative but the lexer - should work on a number of languages including C and friends, - Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. - It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl - and Ruby, but, because of commenting conventions, doesn't work on - Smalltalk, or CAML-like languages.

    - -

    LISPy languages are supported via an extension: - lang-lisp.js.

    -

    And similarly for - CSS, - Haskell, - Lua, - OCAML, SML, F#, - Visual Basic, - SQL, - Protocol Buffers, and - WikiText.. - -

    If you'd like to add an extension for your favorite language, please - look at src/lang-lisp.js and file an - issue including your language extension, and a testcase.

    - -

    How do I specify which language my code is in?

    -

    You don't need to specify the language since prettyprint() - will guess. You can specify a language by specifying the language extension - along with the prettyprint class like so:

    -
    <pre class="prettyprint lang-html">
    -  The lang-* class specifies the language file extensions.
    -  File extensions supported by default include
    -    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    -    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    -    "xhtml", "xml", "xsl".
    -</pre>
    - -

    It doesn't work on <obfuscated code sample>?

    -

    Yes. Prettifying obfuscated code is like putting lipstick on a pig - — i.e. outside the scope of this tool.

    - -

    Which browsers does it work with?

    -

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. - Look at the test page to see if it - works in your browser.

    - -

    What's changed?

    -

    See the change log

    - -

    Why doesn't Prettyprinting of strings work on WordPress?

    -

    Apparently wordpress does "smart quoting" which changes close quotes. - This causes end quotes to not match up with open quotes. -

    This breaks prettifying as well as copying and pasting of code samples. - See - WordPress's help center for info on how to stop smart quoting of code - snippets.

    - -

    How do I put line numbers in my code?

    -

    You can use the linenums class to turn on line - numbering. If your code doesn't start at line number 1, you can - add a colon and a line number to the end of that class as in - linenums:52. - -

    For example -

    <pre class="prettyprint linenums:4"
    ->// This is line 4.
    -foo();
    -bar();
    -baz();
    -boo();
    -far();
    -faz();
    -<pre>
    - produces -
    // This is line 4.
    -foo();
    -bar();
    -baz();
    -boo();
    -far();
    -faz();
    -
    - -

    How do I prevent a portion of markup from being marked as code?

    -

    You can use the nocode class to identify a span of markup - that is not code. -

    <pre class=prettyprint>
    -int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    -  Continuation of comment */
    -int y = bar();
    -</pre>
    -produces -
    -int x = foo();  /* This is a comment  This is not code
    -  Continuation of comment */
    -int y = bar();
    -
    - -

    For a more complete example see the issue22 - testcase.

    - -

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    -

    If you are calling prettyPrint via an event handler, wrap it in a function. - Instead of doing -

    - addEventListener('load', prettyPrint, false); -
    - wrap it in a closure like -
    - addEventListener('load', function (event) { prettyPrint() }, false); -
    - so that the browser does not pass an event object to prettyPrint which - will confuse it. - -


    - - - - diff --git a/docs/assets/vendor/prettify/prettify-min.css b/docs/assets/vendor/prettify/prettify-min.css deleted file mode 100755 index d44b3a22..00000000 --- a/docs/assets/vendor/prettify/prettify-min.css +++ /dev/null @@ -1 +0,0 @@ -.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/docs/assets/vendor/prettify/prettify-min.js b/docs/assets/vendor/prettify/prettify-min.js deleted file mode 100755 index 4845d05d..00000000 --- a/docs/assets/vendor/prettify/prettify-min.js +++ /dev/null @@ -1 +0,0 @@ -window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/docs/classes/BasePlugin.html b/docs/classes/BasePlugin.html deleted file mode 100644 index 50664967..00000000 --- a/docs/classes/BasePlugin.html +++ /dev/null @@ -1,815 +0,0 @@ - - - - - BasePlugin - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    BasePlugin Class

    -
    - - -
    - Defined in: src/lib/plugin.coffee:15 -
    - - -
    - - -
    -

    The base class for all DocPad plugins

    - -
    - -
    -

    Constructor

    -
    -

    BasePlugin

    - - () - - - - - - - - -
    -

    - Defined in - src/lib/plugin.coffee:15 -

    - - - -
    - -
    - -
    - - - - -
    -
    - -
    - - -
    -
    -

    Item Index

    - -
    -

    Methods

    - - -
    - -
    -

    Properties

    - -
      -
    • - @extend - -
    • -
    • - docpad - -
    • -
    • - - -
    • -
    • - - -
    • -
    • - - -
    • -
    • - - -
    • -
    -
    - - -
    - -
    -

    Methods

    - -
    -

    constructor

    - -
    - (
      -
    • - opts -
    • -
    ) -
    - - - - - - - - -
    -

    - Defined in - src/lib/plugin.coffee:67 -

    - - - -
    - -
    -

    Constructor method for the plugin

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    setConfig

    - -
    - (
      -
    • - [instanceConfig=null] -
    • -
    ) -
    - - - - private - - - - - -
    -

    - Defined in - src/lib/plugin.coffee:109 -

    - - - -
    - -
    -

    Set Configuration

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [instanceConfig=null] - Object - optional - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    setInstanceConfig

    - -
    - (
      -
    • - instanceConfig -
    • -
    ) -
    - - - - private - - - - - -
    -

    - Defined in - src/lib/plugin.coffee:96 -

    - - - -
    - -
    -

    Set Instance Configuration

    - -
    - -
    -

    Parameters:

    - -
      -
    • - instanceConfig - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    - - () - - - - private - - - - - -
    -

    - Defined in - src/lib/plugin.coffee:135 -

    - - - -
    - -
    -

    Get the Configuration

    - -
    - - - - -
    -
    -

    addListeners

    - - () - - - - private - - - - - -
    -

    - Defined in - src/lib/plugin.coffee:176 -

    - - - -
    - -
    -

    Add Listeners

    - -
    - - - - -
    -
    -

    bindEvents

    - - () - - - - private - - - - - -
    -

    - Defined in - src/lib/plugin.coffee:143 -

    - - - -
    - -
    -

    Alias for b/c

    - -
    - - - - -
    -
    -

    bindListeners

    - - () - - - - private - - - - - -
    -

    - Defined in - src/lib/plugin.coffee:151 -

    - - - -
    - -
    -

    Bind Listeners

    - -
    - - - - -
    -
    -

    destroy

    - - () - - - - private - - - - - -
    -

    - Defined in - src/lib/plugin.coffee:233 -

    - - - -
    - -
    -

    Destructor. Calls removeListeners

    - -
    - - - - -
    -
    -

    isEnabled

    - - () - - - Boolean - - - - - - - - -
    -

    - Defined in - src/lib/plugin.coffee:243 -

    - - - -
    - -
    -

    Is Enabled?

    - -
    - - -
    -

    Returns:

    - -
    - Boolean: -
    -
    - - -
    -
    -

    removeListeners

    - - () - - - - private - - - - - -
    -

    - Defined in - src/lib/plugin.coffee:209 -

    - - - -
    - -
    -

    Remove Listeners

    - -
    - - - - -
    -
    - -
    -

    Properties

    - -
    -

    @extend

    - Object - - - private - - - -
    -

    - Defined in - src/lib/plugin.coffee:22 -

    - - -
    - -
    -

    Add support for BasePlugin.extend(proto)

    - -
    - - - -
    -
    -

    docpad

    - Object - - - private - - - -
    -

    - Defined in - src/lib/plugin.coffee:32 -

    - - -
    - -
    -

    The DocPad Instance

    - -
    - - - -
    -
    -

    - String - - - - - -
    -

    - Defined in - src/lib/plugin.coffee:42 -

    - - -
    - -
    -

    The plugin name

    - -
    - - - -
    -
    -

    - Object - - - - - -
    -

    - Defined in - src/lib/plugin.coffee:48 -

    - - -
    - -
    -

    The plugin config

    - -
    - - - -
    -
    -

    - Object - - - - - -
    -

    - Defined in - src/lib/plugin.coffee:54 -

    - - -
    - -
    -

    The instance config.

    - -
    - - - -
    -
    -

    - Number - - - private - - - -
    -

    - Defined in - src/lib/plugin.coffee:60 -

    - - -
    - -
    -

    Plugin priority

    - -
    - - - -
    -
    - - -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/classes/Collection.html b/docs/classes/Collection.html deleted file mode 100644 index 0ba22b28..00000000 --- a/docs/classes/Collection.html +++ /dev/null @@ -1,186 +0,0 @@ - - - - - Collection - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    Collection Class

    -
    - -
    - Extends queryEngine.Backbone.Collection -
    - -
    - Defined in: src/lib/base.coffee:64 -
    - - -
    - - -
    -

    Base class for the DocPad collection object -Extends the backbone.js collection object -http://backbonejs.org/#Collection

    - -
    - -
    -

    Constructor

    -
    -

    Collection

    - - () - - - - - - - - -
    -

    - Defined in - src/lib/base.coffee:64 -

    - - - -
    - -
    - -
    - - - - -
    -
    - -
    - - -
    -
    -

    Item Index

    - - - - -
    - - - - -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/classes/Docpad.html b/docs/classes/Docpad.html deleted file mode 100644 index 63a90c06..00000000 --- a/docs/classes/Docpad.html +++ /dev/null @@ -1,13147 +0,0 @@ - - - - - Docpad - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    Docpad Class

    -
    - -
    - Extends EventEmitterGrouped -
    - -
    - Defined in: src/lib/docpad.coffee:77 -
    - - -
    - - -
    -

    Contains methods for managing the DocPad application. -This includes managing a DocPad projects files and -documents, watching directories, emitting events and -managing the node.js/express.js web server. -Extends https://github.com/bevry/event-emitter-grouped

    -

    The class is instantiated in the docpad-server.js file -which is the entry point for a DocPad application.

    -
    new DocPad(docpadConfig, function(err, docpad) {
    -    if (err) {
    -        return docpadUtil.writeError(err);
    -    }
    -    return docpad.action(action, function(err) {
    -        if (err) {
    -            return docpadUtil.writeError(err);
    -        }
    -        return console.log('OK');
    -    });
    -});
    - -
    - -
    -

    Constructor

    -
    -

    Docpad

    - - () - - - - - - - - -
    -

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

    - - - -
    - -
    - -
    - - - - -
    -
    - -
    - - -
    -
    -

    Item Index

    - -
    -

    Methods

    - - -
    - -
    -

    Properties

    - - -
    - - -
    - -
    -

    Methods

    - -
    -

    action

    - -
    - (
      -
    • - args -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Apply the passed DocPad action arguments

    - -
    - -
    -

    Parameters:

    - -
      -
    • - args - Object - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -
    -
    - - -
    -
    -

    addCollection

    - -
    - (
      -
    • - collection -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Add a collection

    - -
    - -
    -

    Parameters:

    - -
      -
    • - collection - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    addModel

    - -
    - (
      -
    • - model -
    • -
    • - opts -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Add supplied model to the DocPad database. If the passed -model definition is a plain object of properties, a new -model will be created prior to adding to the database. -Calls DocPad/createModel:method -before adding the model to the database.

    -
    # Override the stat's mtime to now
    -# This is because renames will not update the mtime
    -fileCurrentStat?.mtime = new Date()
    -
    -# Create the file object
    -file = docpad.addModel({fullPath:filePath, stat:fileCurrentStat})
    - -
    - -
    -

    Parameters:

    - -
      -
    • - model - Object - - -
      -

      either a plain object defining the required properties, in particular -the file path or an actual model object

      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    the model

    - -
    -
    - - -
    -
    -

    addModels

    - -
    - (
      -
    • - models -
    • -
    • - opts -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Add the supplied collection of models to the DocPad database. -Calls DocPad/createModels:method -before adding the models to the database.

    -
    databaseData = JSON.parse data.toString()
    -models = docpad.addModels(databaseData.models)
    - -
    - -
    -

    Parameters:

    - -
      -
    • - models - Object - - -
      -

      DocPad collection of models

      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    the models

    - -
    -
    - - -
    -
    -

    attachModelEvents

    - -
    - (
      -
    • - model -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Attach events to a document model.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - model - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    checkRequest

    - -
    - (
      -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Check Request

    - -
    - -
    -

    Parameters:

    - -
      -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      • - res - Object - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    clean

    - -
    - (
      -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - Object - - - - private - - - - - -
    -

    - Defined in - src/lib/docpad.coffee:5803 -

    - - - -
    - -
    -

    DocPad cleanup tasks.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Object - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    description

    - -
    -
    - - -
    -
    -

    compareVersion

    - - () - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Compare current DocPad version to the latest -and print out the result to the console. -Used at startup.

    - -
    - - - - -
    -
    -

    constructor

    - -
    - (
      -
    • - instanceConfig -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Constructor method. Sets up the DocPad instance. -next(err)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - instanceConfig - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      -

      callback

      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    contextualizeFiles

    - -
    - (
      -
    • - [opts={}] -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Contextualize files. -Contextualizing is the process of adding layouts and -awareness of other documents to our document. The -contextualizeBefore and contextualizeAfter events -are emitted here.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    createDocument

    - -
    - (
      -
    • - [attrs={}] -
    • -
    • - [opts={}] -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Create document model. Calls -DocPad/createModel:method -with the 'document' modelType.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [attrs={}] - Object - optional - - -
      - -
      - -
    • -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    DocumentModel

    - -
    -
    - - -
    -
    -

    createError

    - -
    - (
      -
    • - err -
    • -
    • - opts -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Create an error object

    - -
    - -
    -

    Parameters:

    - -
      -
    • - err - Object - - -
      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    the error

    - -
    -
    - - -
    -
    -

    createFile

    - -
    - (
      -
    • - [attrs={}] -
    • -
    • - [opts={}] -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Create file model. Calls -DocPad/createModel:method -with the 'file' modelType.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [attrs={}] - Object - optional - - -
      - -
      - -
    • -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    FileModel

    - -
    -
    - - -
    -
    -

    createModel

    - -
    - (
      -
    • - [attrs={}] -
    • -
    • - [opts={}] -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Creates either a file or document model. -The model type to be created can be passed -as an opts property, if not, the method will -attempt to determing the model type by checking -if the file is in one of the documents or -layout paths.

    -

    Ensures a duplicate model is not created -and all required attributes are present and -events attached.

    -

    Generally it is not necessary for an application -to manually create a model via creatModel as DocPad -will handle this process when watching a project's -file and document directories. However, it is possible -that a plugin might have a requirement to do so.

    -
    model = @docpad.createModel({fullPath:fullPath})
    -
    -

    model.load()

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [attrs={}] - Object - optional - - -
      - -
      - -
        -
      • - fullPath - String - -
        -

        the full path to the file

        - -
        - -
      • -
      -
    • -
    • - [opts={}] - Object - optional - - -
      - -
      - -
        -
      • - modelType - String - -
        -

        either 'file' or 'document'

        - -
        - -
      • -
      -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    the file or document model

    - -
    -
    - - -
    -
    -

    createModels

    - -
    - (
      -
    • - models -
    • -
    • - opts -
    • -
    ) -
    - - - Object - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Create a collection of models from the supplied collection -ensuring that the collection is suitable for adding to the -DocPad database. The method calls DocPad/createModel -for each model in the models array.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - models - Object - - -
      -

      DocPad collection of models

      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    the models

    - -
    -
    - - -
    -
    -

    createProgress

    - - () - - - Object - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Create the console progress bar. -Progress only shown if the DocPad config 'progress' -option is true, the DocPad config 'prompts' option is true -and the log level is 6 (default)

    - -
    - - -
    -

    Returns:

    - -
    - Object: -

    the progress object

    - -
    -
    - - -
    -
    -

    createRegenerateTimer

    - - () - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Create the regeneration timer

    - -
    - - - - -
    -
    -

    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

    - -
    - (
      -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Destructor. Destroy the DocPad instance -This is an action, and should be called as such -E.g. docpad.action('destroy', next)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    destroyBlocks

    - - () - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Destructor. Destroy all blocks

    - -
    - - - - -
    -
    -

    destroyCollection

    - -
    - (
      -
    • - value -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Destroy a collection by collection name or key

    - -
    - -
    -

    Parameters:

    - -
      -
    • - value - String - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    description

    - -
    -
    - - -
    -
    -

    destroyCollections

    - - () - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Destructor. Destroy the DocPad project's collections.

    - -
    - - - - -
    -
    -

    destroyDatabase

    - - () - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Destructor. Destroy the DocPad database

    - -
    - - - - -
    -
    -

    destroyLoggers

    - - () - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Destructor. Destroy the caterpillar logger instances bound to DocPad

    - -
    - - - - -
    -
    -

    destroyPlugins

    - - () - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Destructor. Destroy plugins

    - -
    - - - - -
    -
    -

    destroyProgress

    - -
    - (
      -
    • - progress -
    • -
    ) -
    - - - Object - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Destructor. Destroy the progress object

    - -
    - -
    -

    Parameters:

    - -
      -
    • - progress - Object - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    the progress object

    - -
    -
    - - -
    -
    -

    destroyRegenerateTimer

    - - () - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Destructor. Destroy the regeneration timer.

    - -
    - - - - -
    -
    -

    destroyServer

    - - () - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Destructor. Close and destroy the node.js http server

    - -
    - - - - -
    -
    -

    destroyWatchers

    - - () - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Destructor. Destroy the watchers used -by DocPad

    - -
    - - - - -
    -
    -

    eachBlock

    - -
    - (
      -
    • - fn -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Apply the passed function to each block

    - -
    - -
    -

    Parameters:

    - -
      -
    • - fn - Function - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    eachCollection

    - -
    - (
      -
    • - fn -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Apply the passed function to each collection

    - -
    - -
    -

    Parameters:

    - -
      -
    • - fn - Function - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    emitParallel

    - -
    - (
      -
    • - eventName -
    • -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Emit event, parallel

    - -
    - -
    -

    Parameters:

    - -
      -
    • - eventName - String - - -
      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    emitSerial

    - -
    - (
      -
    • - eventName -
    • -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Emit event, serial

    - -
    - -
    -

    Parameters:

    - -
      -
    • - eventName - String - - -
      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    error

    - -
    - (
      -
    • - err -
    • -
    • - [level='err'] -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Create an error (tracks it) and log it

    - -
    - -
    -

    Parameters:

    - -
      -
    • - err - Object - - -
      - -
      - -
    • -
    • - [level='err'] - Object - optional - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    extendCollections

    - -
    - (
      -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Extend collecitons. Create DocPad's -standard (documents, files -layouts) and special (generate, referencesOthers, -hasLayout, html, stylesheet) collections. Set blocks

    - -
    - -
    -

    Parameters:

    - -
      -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    fatal

    - -
    - (
      -
    • - err -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Handle a fatal error

    - -
    - -
    -

    Parameters:

    - -
      -
    • - err - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    fixNodePackageVersions

    - -
    - (
      -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Fix node package versions -Combat to https://github.com/npm/npm/issues/4587#issuecomment-35370453

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    generate

    - -
    - (
      -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Set off DocPad's generation process. -The generated, populateCollectionsBefore, populateCollections, populateCollections -generateBefore and generateAfter events are emitted here

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    getActionRunner

    - - () - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the action runner instance bound to docpad

    - -
    - - -
    -

    Returns:

    - -
    - Object: -

    the action runner instance

    - -
    -
    - - -
    -
    -

    getBlock

    - -
    - (
      -
    • - name -
    • -
    • - [clone] -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get a block by block name. Optionally clone block.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - name - String - - -
      - -
      - -
    • -
    • - [clone] - Object - optional - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    block

    - -
    -
    - - -
    -
    -

    getBlocks

    - - () - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get all blocks

    - -
    - - -
    -

    Returns:

    - -
    - Object: -

    collection of blocks

    - -
    -
    - - -
    -
    -

    getCollection

    - -
    - (
      -
    • - value -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get a collection by collection name or key. -This is often accessed within the docpad.coffee -file or a layout/page via @getCollection. -Because getCollection returns a docpad collection, -a call to this method is often chained with a -QueryEngine style query.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - value - String - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    collection

    - -
    -
    - - -
    -
    -

    getCollections

    - - () - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the DocPad project's collections

    - -
    - - -
    -

    Returns:

    - -
    - Object: -

    the collections

    - -
    -
    - - -
    -
    -

    getConfig

    - - () - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the DocPad configuration. Commonly -called within the docpad.coffee file or within -plugins to access application specific configurations. -serverExtend: (opts) -> -Extract the server from the options -{server} = opts -docpad = @docpad

    -

    As we are now running in an event, -ensure we are using the latest copy of the docpad configuraiton -and fetch our urls from it -latestConfig = docpad.getConfig() -oldUrls = latestConfig.templateData.site.oldUrls or [] -newUrl = latestConfig.templateData.site.url

    -

    Redirect any requests accessing one of our sites oldUrls to the new site url -server.use (req,res,next) -> -...

    - -
    - - -
    -

    Returns:

    - -
    - Object: -

    the DocPad configuration object

    - -
    -
    - - -
    -
    -

    getConfigPath

    - -
    - (
      -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Get config paths and check that those -paths exist

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Object - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      • - path - String - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    getDatabase

    - - () - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Description for getDatabase

    - -
    - - - - -
    -
    -

    getDatabaseSafe

    - - () - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Safe method for retrieving the database by -either returning the database itself or the temporary -database cache

    - -
    - - -
    -

    Returns:

    - -
    - Object: -
    -
    - - -
    -
    -

    getDebugging

    - - () - - - Boolean - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Are we debugging?

    - -
    - - -
    -

    Returns:

    - -
    - Boolean: -
    -
    - - -
    -
    -

    getEnvironment

    - - () - - - String - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the DocPad environment, eg: development, -production or static

    - -
    - - -
    -

    Returns:

    - -
    - String: -

    the environment

    - -
    -
    - - -
    -
    -

    getEnvironments

    - - () - - - Array - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the environments

    - -
    - - -
    -

    Returns:

    - -
    - Array: -

    array of environment strings

    - -
    -
    - - -
    -
    -

    getErrorRunner

    - - () - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the error runner instance

    - -
    - - -
    -

    Returns:

    - -
    - Object: -

    the error runner instance

    - -
    -
    - - -
    -
    -

    getEvents

    - - () - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the list of available events

    - -
    - - -
    -

    Returns:

    - -
    - Object: -

    string array of event names

    - -
    -
    - - -
    -
    -

    getExchange

    - -
    - (
      -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Get DocPad's exchange data -Requires internet access -next(err,exchange)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      • - exchange - Object - -
        -

        docpad.exchange

        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    getFile

    - -
    - (
      -
    • - query -
    • -
    • - sorting -
    • -
    • - paging -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get a single file based on a query

    - -
    - -
    -

    Parameters:

    - -
      -
    • - query - Object - - -
      - -
      - -
    • -
    • - sorting - Object - - -
      - -
      - -
    • -
    • - paging - Object - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    a file

    - -
    -
    - - -
    -
    -

    getFileAtPath

    - -
    - (
      -
    • - path -
    • -
    • - sorting -
    • -
    • - paging -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get a file at a relative or absolute path or url

    - -
    - -
    -

    Parameters:

    - -
      -
    • - path - String - - -
      - -
      - -
    • -
    • - sorting - Object - - -
      - -
      - -
    • -
    • - paging - Object - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    a file

    - -
    -
    - - -
    -
    -

    getFileById

    - -
    - (
      -
    • - id -
    • -
    • - [opts={}] -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get a file by its id

    - -
    - -
    -

    Parameters:

    - -
      -
    • - id - String - - -
      - -
      - -
    • -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    a file

    - -
    -
    - - -
    -
    -

    getFileByRoute

    - -
    - (
      -
    • - url -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get a file by its route and return -it to the supplied callback.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - url - String - - -
      - -
      - -
    • -
    • - next - Object - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      • - file - String - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    getFileBySelector

    - -
    - (
      -
    • - selector -
    • -
    • - [opts={}] -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get a file by its selector

    - -
    - -
    -

    Parameters:

    - -
      -
    • - selector - Object - - -
      - -
      - -
    • -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    a file

    - -
    -
    - - -
    -
    -

    getFileByUrl

    - -
    - (
      -
    • - url -
    • -
    • - [opts={}] -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get a file by its url

    - -
    - -
    -

    Parameters:

    - -
      -
    • - url - String - - -
      - -
      - -
    • -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    a file

    - -
    -
    - - -
    -
    -

    getFiles

    - -
    - (
      -
    • - query -
    • -
    • - sorting -
    • -
    • - paging -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get all the files in the DocPad database (will use live collections)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - query - Object - - -
      - -
      - -
    • -
    • - sorting - Object - - -
      - -
      - -
    • -
    • - paging - Object - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    collection

    - -
    -
    - - -
    -
    -

    getFilesAtPath

    - -
    - (
      -
    • - path -
    • -
    • - sorting -
    • -
    • - paging -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get files at a path

    - -
    - -
    -

    Parameters:

    - -
      -
    • - path - String - - -
      - -
      - -
    • -
    • - sorting - Object - - -
      - -
      - -
    • -
    • - paging - Object - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    files

    - -
    -
    - - -
    -
    -

    getHostname

    - - () - - - String - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the Hostname

    - -
    - - -
    -

    Returns:

    - -
    - String: -
    -
    - - -
    -
    -

    getIgnoreOpts

    - - () - - - Array - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the ignore options for the DocPad project

    - -
    - - -
    -

    Returns:

    - -
    - Array: -

    string array of ignore options

    - -
    -
    - - -
    -
    -

    getLocale

    - - () - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the locale (language code and locale code)

    - -
    - - -
    -

    Returns:

    - -
    - Object: -

    locale

    - -
    -
    - - -
    -
    -

    getLogger

    - - () - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the caterpillar logger instance bound to DocPad

    - -
    - - -
    -

    Returns:

    - -
    - Object: -

    caterpillar logger

    - -
    -
    - - -
    -
    -

    getLoggers

    - - () - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get all the caterpillar logger instances bound to DocPad

    - -
    - - -
    -

    Returns:

    - -
    - Object: -

    collection of caterpillar loggers

    - -
    -
    - - -
    -
    -

    getLogLevel

    - - () - - - Number - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the log level

    - -
    - - -
    -

    Returns:

    - -
    - Number: -

    the log level

    - -
    -
    - - -
    -
    -

    getPlugin

    - -
    - (
      -
    • - pluginName -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get a plugin by it's name

    - -
    - -
    -

    Parameters:

    - -
      -
    • - pluginName - Object - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    a DocPad plugin

    - -
    -
    - - -
    -
    -

    getPort

    - - () - - - Number - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the port that DocPad is listening on (eg 9778)

    - -
    - - -
    -

    Returns:

    - -
    - Number: -

    the port number

    - -
    -
    - - -
    -
    -

    getProcessPlatform

    - - () - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the process platform

    - -
    - - -
    -

    Returns:

    - -
    - Object: -
    -
    - - -
    -
    -

    getProcessVersion

    - - () - - - String - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the process version string

    - -
    - - -
    -

    Returns:

    - -
    - String: -
    -
    - - -
    -
    -

    getServer

    - -
    - (
      -
    • - [both=false] -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the DocPad express.js server instance and, optionally, -the node.js https server instance

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [both=false] - Boolean - optional - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -
    -
    - - -
    -
    -

    getServerUrl

    - -
    - (
      -
    • - [opts={}] -
    • -
    ) -
    - - - String - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get address

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - String: -
    -
    - - -
    -
    -

    getSimpleServerUrl

    - -
    - (
      -
    • - [opts={}] -
    • -
    ) -
    - - - String - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get simple server URL (changes 0.0.0.0, ::, and ::1 to 127.0.0.1)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [opts={}] - Object - optional - - -
      - -
      - -
        -
      • - [simple=true] - Boolean - optional - -
        - -
        - -
      • -
      -
    • -
    -
    - -
    -

    Returns:

    - -
    - String: -
    -
    - - -
    -
    -

    getSkeletons

    - -
    - (
      -
    • - next -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get Skeletons -Get all the available skeletons with their details and -return this collection to the supplied callback.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      • - skeletonsCollection - Object - -
        -

        DocPad collection of skeletons

        - -
        - -
      • -
      -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    DocPad skeleton collection

    - -
    -
    - - -
    -
    -

    getTemplateData

    - -
    - (
      -
    • - userTemplateData -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get Complete Template Data

    - -
    - -
    -

    Parameters:

    - -
      -
    • - userTemplateData - Object - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    templateData

    - -
    -
    - - -
    -
    -

    getTrackRunner

    - - () - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the track runner instance

    - -
    - - -
    -

    Returns:

    - -
    - Object: -

    the track runner instance

    - -
    -
    - - -
    -
    -

    getUrlPathname

    - -
    - (
      -
    • - url -
    • -
    ) -
    - - - String - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Remove the query string from a url -Pathname convention taken from document.location.pathname

    - -
    - -
    -

    Parameters:

    - -
      -
    • - url - String - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - String: -
    -
    - - -
    -
    -

    getVersion

    - - () - - - Number - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the DocPad version number

    - -
    - - -
    -

    Returns:

    - -
    - Number: -
    -
    - - -
    -
    -

    getVersionString

    - - () - - - String - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the DocPad version string

    - -
    - - -
    -

    Returns:

    - -
    - String: -
    -
    - - -
    -
    -

    hasPlugins

    - - () - - - Boolean - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Check if we have any plugins

    - -
    - - -
    -

    Returns:

    - -
    - Boolean: -
    -
    - - -
    -
    -

    identify

    - -
    - (
      -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Identify DocPad user

    - -
    - -
    -

    Parameters:

    - -
      -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    init

    - -
    - (
      -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - Object - - - - private - - - - - -
    -

    - Defined in - src/lib/docpad.coffee:6117 -

    - - - -
    - -
    -

    Initialize the project directory -with the basic skeleton.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Object - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    description

    - -
    -
    - - -
    -
    -

    initGitRepo

    - -
    - (
      -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Initialise git repo

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      • - results - Object - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    initInstall

    - -
    - (
      -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

    - Defined in - src/lib/docpad.coffee:5583 -

    - - - -
    - -
    -

    Initialize the skeleton install process.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    initNodeModules

    - -
    - (
      -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Init node modules

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      • - results - Object - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    initSkeleton

    - -
    - (
      -
    • - skeletonModel -
    • -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

    - Defined in - src/lib/docpad.coffee:5857 -

    - - - -
    - -
    -

    Initialize a Skeleton into to a Directory

    - -
    - -
    -

    Parameters:

    - -
      -
    • - skeletonModel - Object - - -
      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    inspector

    - -
    - (
      -
    • - obj -
    • -
    • - opts -
    • -
    ) -
    - - - String - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Inspect. Converts object to JSON string. Wrapper around nodes util.inspect method. -Can't use the inspect namespace as for some silly reason it destroys everything

    - -
    - -
    -

    Parameters:

    - -
      -
    • - obj - Object - - -
      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - String: -

    JSON string of passed object

    - -
    -
    - - -
    -
    -

    install

    - -
    - (
      -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

    - Defined in - src/lib/docpad.coffee:5669 -

    - - - -
    - -
    -

    Install a plugin

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    installNodeModule

    - -
    - (
      -
    • - names -
    • -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Install node module. Same as running -'npm install' through the command line

    - -
    - -
    -

    Parameters:

    - -
      -
    • - names - Array - - -
      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      • - result - Object - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    installSkeleton

    - -
    - (
      -
    • - skeletonModel -
    • -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

    - Defined in - src/lib/docpad.coffee:5957 -

    - - - -
    - -
    -

    Install a Skeleton into a Directory

    - -
    - -
    -

    Parameters:

    - -
      -
    • - skeletonModel - Object - - -
      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    isIgnoredPath

    - -
    - (
      -
    • - path -
    • -
    • - [opts={}] -
    • -
    ) -
    - - - Boolean - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Is the supplied path ignored?

    - -
    - -
    -

    Parameters:

    - -
      -
    • - path - String - - -
      - -
      - -
    • -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Boolean: -
    -
    - - -
    -
    -

    load

    - -
    - (
      -
    • - instanceConfig -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Load the various configuration files from the -file system. Set the instanceConfig. -next(err,config)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - instanceConfig - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      • - config - Object - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    loadAndRenderDocument

    - -
    - (
      -
    • - document -
    • -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Load and render a document

    - -
    - -
    -

    Parameters:

    - -
      -
    • - document - Object - - -
      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      • - document - Object - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    loadConfigPath

    - -
    - (
      -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Load the configuration from a file path -passed as one of the options (opts.configPath) or -from DocPad's configPaths

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      • - parsedData - Object - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    loadConfigUrl

    - -
    - (
      -
    • - configUrl -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Load a configuration url.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - configUrl - String - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      • - parsedData - Object - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    loadDocument

    - -
    - (
      -
    • - document -
    • -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Load a document

    - -
    - -
    -

    Parameters:

    - -
      -
    • - document - Object - - -
      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      • - document - Object - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    loadedPlugin

    - -
    - (
      -
    • - pluginName -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Checks if a plugin was loaded succesfully.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - pluginName - String - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      • - loaded - Boolean - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    loadLocale

    - -
    - (
      -
    • - code -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Load the locale

    - -
    - -
    -

    Parameters:

    - -
      -
    • - code - String - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    locale

    - -
    -
    - - -
    -
    -

    loadPlugin

    - -
    - (
      -
    • - fileFullPath -
    • -
    • - _next -
    • -
    ) -
    - - - Object - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Load a plugin from its full file path -_next(err)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - fileFullPath - String - - -
      - -
      - -
    • -
    • - _next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    description

    - -
    -
    - - -
    -
    -

    loadPlugins

    - -
    - (
      -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Load plugins from the file system -next(err)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    loadPluginsIn

    - -
    - (
      -
    • - pluginsPath -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Load plugins from a directory path

    - -
    - -
    -

    Parameters:

    - -
      -
    • - pluginsPath - String - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    logError

    - -
    - (
      -
    • - err -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Log an error

    - -
    - -
    -

    Parameters:

    - -
      -
    • - err - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    mergeConfigurations

    - -
    - (
      -
    • - configPackages -
    • -
    • - configsToMerge -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Performs the merging of the passed configuration objects

    - -
    - -
    -

    Parameters:

    - -
      -
    • - configPackages - Object - - -
      - -
      - -
    • -
    • - configsToMerge - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    notify

    - -
    - (
      -
    • - message -
    • -
    • - [opts={}] -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Send a notify event to plugins (like growl)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - message - String - - -
      - -
      - -
    • -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    notifyError

    - -
    - (
      -
    • - err -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Notify error

    - -
    - -
    -

    Parameters:

    - -
      -
    • - err - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    parseDirectory

    - -
    - (
      -
    • - [opts={}] -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Parse a directory and return a -files collection

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    • - next - Object - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      • - files - Object - -
        -

        files collection

        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    parseDocumentDirectory

    - -
    - (
      -
    • - [opts={}] -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Parse the documents directory and -return a documents collection to -the passed callback.

    -

    The partials plugin (https://github.com/docpad/docpad-plugin-partials) -uses this method to load a collection of -files from the partials directory.

    -
    docpad.parseDocumentDirectory({path: config.partialsPath}, next)
    - -
    - -
    -

    Parameters:

    - -
      -
    • - [opts={}] - Object - optional - - -
      - -
      - -
        -
      • - [modelType='document'] - String - optional - -
        - -
        - -
      • -
      • - [collection=docpad.database] - Object - optional - -
        - -
        - -
      • -
      • - [path] - Object - optional - -
        - -
        - -
      • -
      -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      • - files - Object - -
        -

        files collection of documents

        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    parseFileDirectory

    - -
    - (
      -
    • - [opts={}] -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Parse the files directory and -return a files collection to -the passed callback

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    • - next - Function - - -
      -

      callback

      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      • - files - Object - -
        -

        files collection

        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    ready

    - -
    - (
      -
    • - [opts] -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    DocPad is ready. Peforms the tasks needed after DocPad construction -and DocPad has loaded. Triggers the docpadReady event. -next(err,docpadInstance)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [opts] - Object - optional - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      • - docpadInstance - Object - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    render

    - -
    - (
      -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Render action -next(err,document,result)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    renderData

    - -
    - (
      -
    • - content -
    • -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Render the passed content data as a -document. Required option, filename -(opts.filename) -next(err,result)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - content - String - - -
      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      • - result - Object - -
        -

        the rendered document

        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    renderDocument

    - -
    - (
      -
    • - document -
    • -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Render a document

    - -
    - -
    -

    Parameters:

    - -
      -
    • - document - Object - - -
      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Object - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      • - result - Object - -
        - -
        - -
      • -
      • - document - Object - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    renderFiles

    - -
    - (
      -
    • - [opts={}] -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Render the DocPad project's files. -The renderCollectionBefore, renderCollectionAfter, -renderBefore, renderAfter events are all emitted here.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    renderPath

    - -
    - (
      -
    • - path -
    • -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Render a document at a file path -next(err,result)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - path - String - - -
      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      • - result - Object - -
        -

        the rendered document

        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    renderText

    - -
    - (
      -
    • - text -
    • -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Render the passed text data as a -document. Required option, filename -(opts.filename) -next(err,result)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - text - String - - -
      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      • - result - Object - -
        -

        the rendered content

        - -
        - -
      • -
      • - document - Object - -
        -

        the rendered document model

        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    resetCollections

    - -
    - (
      -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Reset collections. Perform a complete clean of our collections

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    run

    - -
    - (
      -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

    - Defined in - src/lib/docpad.coffee:5518 -

    - - - -
    - -
    -

    Run an action

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    scandir

    - -
    - (
      -
    • - [opts={}] -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Scan directory

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    selectSkeleton

    - -
    - (
      -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

    - Defined in - src/lib/docpad.coffee:6029 -

    - - - -
    - -
    -

    Select a Skeleton

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      • - skeletonModel - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    serveDocument

    - -
    - (
      -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

    - Defined in - src/lib/docpad.coffee:6147 -

    - - - -
    - -
    -

    Serve a document

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    server

    - -
    - (
      -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

    - Defined in - src/lib/docpad.coffee:6350 -

    - - - -
    - -
    -

    Configure and start up the DocPad web server. -Http and express server is created, extended with -middleware, started up and begins listening. -The events serverBefore, serverExtend and -serverAfter emitted here.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    serverMiddleware404

    - -
    - (
      -
    • - req -
    • -
    • - res -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

    - Defined in - src/lib/docpad.coffee:6299 -

    - - - -
    - -
    -

    Server Middleware: 404

    - -
    - -
    -

    Parameters:

    - -
      -
    • - req - Object - - -
      - -
      - -
    • -
    • - res - Object - - -
      - -
      - -
    • -
    • - next - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    serverMiddleware500

    - -
    - (
      -
    • - err -
    • -
    • - req -
    • -
    • - res -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

    - Defined in - src/lib/docpad.coffee:6326 -

    - - - -
    - -
    -

    Server Middleware: 500

    - -
    - -
    -

    Parameters:

    - -
      -
    • - err - Object - - -
      - -
      - -
    • -
    • - req - Object - - -
      - -
      - -
    • -
    • - res - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    serverMiddlewareHeader

    - -
    - (
      -
    • - req -
    • -
    • - res -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

    - Defined in - src/lib/docpad.coffee:6240 -

    - - - -
    - -
    -

    Server Middleware: Header

    - -
    - -
    -

    Parameters:

    - -
      -
    • - req - Object - - -
      - -
      - -
    • -
    • - res - Object - - -
      - -
      - -
    • -
    • - next - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    serverMiddlewareRouter

    - -
    - (
      -
    • - req -
    • -
    • - res -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

    - Defined in - src/lib/docpad.coffee:6267 -

    - - - -
    - -
    -

    Server Middleware: Router

    - -
    - -
    -

    Parameters:

    - -
      -
    • - req - Object - - -
      - -
      - -
    • -
    • - res - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    setBlock

    - -
    - (
      -
    • - name -
    • -
    • - value -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Set a block by name and value

    - -
    - -
    -

    Parameters:

    - -
      -
    • - name - String - - -
      - -
      - -
    • -
    • - value - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    setBlocks

    - -
    - (
      -
    • - blocks -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Set all blocks

    - -
    - -
    -

    Parameters:

    - -
      -
    • - blocks - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    setCollection

    - -
    - (
      -
    • - name -
    • -
    • - collection -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Set a name for a collection. -A collection can have multiple names

    -

    The partials plugin (https://github.com/docpad/docpad-plugin-partials) -creates a live collection and passes this to setCollection with -the name 'partials'.

    -
    # Add our partials collection
    -docpad.setCollection('partials', database.createLiveChildCollection()
    -    .setQuery('isPartial', {
    -            $or:
    -                isPartial: true
    -                fullPath: $startsWith: config.partialsPath
    -    })
    -    .on('add', (model) ->
    -        docpad.log('debug', util.format(locale.addingPartial, model.getFilePath()))
    -        model.setDefaults(
    -            isPartial: true
    -            render: false
    -            write: false
    -        )
    -    )
    -)
    - -
    - -
    -

    Parameters:

    - -
      -
    • - name - String - - -
      -

      the name to give to the collection

      - -
      - -
    • -
    • - collection - Object - - -
      -

      a DocPad collection

      - -
      - -
    • -
    -
    - - - -
    -
    -

    setCollections

    - - () - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Set the DocPad project's collections

    - -
    - - - - -
    -
    -

    setConfig

    - -
    - (
      -
    • - instanceConfig -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Set the DocPad configuration object. -Performs a number of tasks, including -merging the pass instanceConfig with DocPad's -other config objects. -next(err,config)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - instanceConfig - Object - - -
      - -
      - -
    • -
    • - next - Object - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      • - config - Object - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    setInstanceConfig

    - -
    - (
      -
    • - instanceConfig -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Set the instance configuration -by merging the properties of the passed object -with the existing DocPad instanceConfig object

    - -
    - -
    -

    Parameters:

    - -
      -
    • - instanceConfig - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    setLoggers

    - -
    - (
      -
    • - loggers -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Sets the caterpillar logger instances bound to DocPad

    - -
    - -
    -

    Parameters:

    - -
      -
    • - loggers - Object - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    logger instances bound to DocPad

    - -
    -
    - - -
    -
    -

    setLogLevel

    - -
    - (
      -
    • - level -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Set the log level

    - -
    - -
    -

    Parameters:

    - -
      -
    • - level - Number - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    setServer

    - -
    - (
      -
    • - servers -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Set the express.js server and node.js http server -to bind to DocPad

    - -
    - -
    -

    Parameters:

    - -
      -
    • - servers - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    skeleton

    - -
    - (
      -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

    - Defined in - src/lib/docpad.coffee:6086 -

    - - - -
    - -
    -

    Initialize the project directory -with the basic skeleton.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    skeletonEmpty

    - -
    - (
      -
    • - path -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

    - Defined in - src/lib/docpad.coffee:6058 -

    - - - -
    - -
    -

    Skeleton Empty?

    - -
    - -
    -

    Parameters:

    - -
      -
    • - path - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    subscribe

    - -
    - (
      -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Subscribe to the DocPad email list.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    track

    - -
    - (
      -
    • - name -
    • -
    • - [things={}] -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Track

    - -
    - -
    -

    Parameters:

    - -
      -
    • - name - String - - -
      - -
      - -
    • -
    • - [things={}] - Object - optional - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    trackError

    - -
    - (
      -
    • - err -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Track an error in the background

    - -
    - -
    -

    Parameters:

    - -
      -
    • - err - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    uninstall

    - -
    - (
      -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

    - Defined in - src/lib/docpad.coffee:5630 -

    - - - -
    - -
    -

    Uninstall a plugin.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    uninstallNodeModule

    - -
    - (
      -
    • - names -
    • -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Uninstall node module. Same as running -'npm uninstall' through the command line

    - -
    - -
    -

    Parameters:

    - -
      -
    • - names - Array - - -
      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      • - result - Object - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    update

    - -
    - (
      -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

    - Defined in - src/lib/docpad.coffee:5740 -

    - - - -
    - -
    -

    Update the local DocPad and plugin dependencies

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Object - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    updateUserConfig

    - -
    - (
      -
    • - [data={}] -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Update user configuration with the passed data

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [data={}] - Object - optional - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    upgrade

    - -
    - (
      -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - Object - - - - private - - - - - -
    -

    - Defined in - src/lib/docpad.coffee:5720 -

    - - - -
    - -
    -

    Update global NPM and DocPad

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Object - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    description

    - -
    -
    - - -
    -
    -

    useSkeleton

    - -
    - (
      -
    • - skeletonModel -
    • -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - Object - - - - private - - - - - -
    -

    - Defined in - src/lib/docpad.coffee:5985 -

    - - - -
    - -
    -

    Use a Skeleton

    - -
    - -
    -

    Parameters:

    - -
      -
    • - skeletonModel - Object - - -
      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Object - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    description

    - -
    -
    - - -
    -
    -

    warn

    - -
    - (
      -
    • - message -
    • -
    • - err -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Log an error of level 'warn'

    - -
    - -
    -

    Parameters:

    - -
      -
    • - message - String - - -
      - -
      - -
    • -
    • - err - Object - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    description

    - -
    -
    - - -
    -
    -

    watch

    - -
    - (
      -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Start up file watchers used by DocPad

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    watchdir

    - -
    - (
      -
    • - path -
    • -
    • - listeners -
    • -
    • - next -
    • -
    ) -
    - - - Object - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Watch Directory. Wrapper around the Bevry watchr -module (https://github.com/bevry/watchr). Used -internally by DocPad to watch project documents -and files and then activate the regeneration process -when any of those items are updated.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - path - String - - -
      -
        -
      • the path to watch
      • -
      - -
      - -
    • -
    • - listeners - Object - - -
      -
        -
      • listeners to attach to the watcher
      • -
      - -
      - -
    • -
    • - next - Function - - -
      -
        -
      • completion callback accepting error
      • -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    the watcher

    - -
    -
    - - -
    -
    -

    watchdirs

    - -
    - (
      -
    • - paths -
    • -
    • - listeners -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Watch Directories. Wrapper around watchdir.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - paths - Array - - -
      -
        -
      • the paths to watch
      • -
      - -
      - -
    • -
    • - listeners - Object - - -
      -
        -
      • listeners to attach to the watcher
      • -
      - -
      - -
    • -
    • - next - Function - - -
      -
        -
      • completion callback accepting error and watchers/stalkers
      • -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    writeFiles

    - -
    - (
      -
    • - [opts={}] -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Write rendered files to the DocPad out directory. -The writeBefore and writeAfter events are emitted here.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
        -
      • - err - Error - -
        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    - -
    -

    Properties

    - -
    -

    actionRunnerInstance

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    The action runner instance bound to docpad

    - -
    - - - -
    -
    -

    BasePlugin

    - Object - - - - - -
    -

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

    - - -
    - - - - - -
    -
    -

    blocks

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    Blocks

    - -
    - - - -
    -
    -

    Collection

    - Object - - - - - -
    -

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

    - - -
    - -
    -

    Collection class -Extension of the Backbone Collection class -https://github.com/docpad/docpad/blob/master/src/lib/base.coffee -http://backbonejs.org/#Collection

    - -
    - - - -
    -
    -

    collections

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    The DocPad collections

    - -
    - - - -
    -
    -

    config

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    Merged Configuration -Merged in the order of:

    -
      -
    • initialConfig
    • -
    • userConfig
    • -
    • websiteConfig
    • -
    • instanceConfig
    • -
    • environmentConfig -Use getConfig to retrieve this value
    • -
    - -
    - - - -
    -
    -

    corePath

    - String - - - - - -
    -

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

    - - -
    - -
    -

    The DocPad directory

    - -
    - - - -
    -
    -

    database

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    QueryEngine collection

    - -
    - - - -
    -
    -

    databaseTempCache FileCollection of models

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    A FilesCollection of models updated -from the DocPad database after each regeneration.

    - -
    - - - -
    -
    -

    debugLogPath

    - String - - - - - -
    -

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

    - - -
    - -
    -

    The DocPad debug log path (docpad-debug.log)

    - -
    - - - -
    -
    -

    DocumentModel

    - Object - - - - - -
    -

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

    - - -
    - -
    -

    Document Model class -Extension of the File Model class -https://github.com/docpad/docpad/blob/master/src/lib/models/document.coffee

    - -
    - - - -
    -
    -

    ElementsCollection

    - Object - - - - - -
    -

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

    - - -
    - -
    -

    Collection of elements in a DocPad project -Extension of the Collection class -https://github.com/docpad/docpad/blob/master/src/lib/collections/elements.coffee

    - -
    - - - -
    -
    -

    errorRunnerInstance

    - Object - - - - - -
    -

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

    - - -
    - -
    -

    The error runner instance bound to DocPad

    - -
    - - - -
    -
    -

    Events

    - Object - - - - - -
    -

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

    - - -
    - - - - - -
    -
    -

    exchange

    - Object - - - - - -
    -

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

    - - -
    - -
    -

    A listing of all the available extensions for DocPad

    - -
    - - - -
    -
    -

    FileModel

    - Object - - - - - -
    -

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

    - - -
    - -
    -

    File Model class -Extension of the Model class -https://github.com/docpad/docpad/blob/master/src/lib/models/file.coffee

    - -
    - - - -
    -
    -

    filesByOutPath

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    Files by Out Path. Used to speed up conflict detection. Do not use for anything else

    - -
    - - - -
    -
    -

    filesBySelector

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    Files by Selector. Used to speed up fetching

    - -
    - - - -
    -
    -

    filesByUrl

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    Files by url. Used to speed up fetching

    - -
    - - - -
    -
    -

    FilesCollection

    - Object - - - - - -
    -

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

    - - -
    - -
    -

    Collection of files in a DocPad project -Extension of the QueryCollection class -https://github.com/docpad/docpad/blob/master/src/lib/collections/files.coffee

    - -
    - - - -
    -
    -

    generated

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    Has DocPad done at least one generation? -True once the first generation has occured.

    - -
    - - - -
    -
    -

    generateEnded

    - Boolean - - - private - - - -
    -

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

    - - -
    - -
    -

    Has DocPad's generation process ended?

    - -
    - - - -
    -
    -

    generateStarted

    - Boolean - - - private - - - -
    -

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

    - - -
    - -
    -

    Has DocPad's generation process started?

    - -
    - - - -
    -
    -

    generating

    - Boolean - - - private - - - -
    -

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

    - - -
    - -
    -

    Is DocPad currently generating?

    - -
    - - - -
    -
    -

    initialConfig

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    Initial Configuration. The default docpadConfig -settings that can be overridden in a project's docpad.coffee file. -Merged into the config property

    - -
    - - - -
    -
    -

    initialTemplateData

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    Description for initialTemplateData

    - -
    - - - -
    -
    -

    instanceConfig

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    Instance Configuration

    - -
    - - - -
    -
    -

    libPath

    - String - - - private - - - -
    -

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

    - - -
    - -
    -

    The DocPad library directory

    - -
    - - - -
    -
    -

    loadedPlugins

    - Object - - - - - -
    -

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

    - - -
    - -
    -

    Loaded plugins indexed by name

    - -
    - - - -
    -
    -

    locale

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    Determined locale

    - -
    - - - -
    -
    -

    localePath

    - String - - - - - -
    -

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

    - - -
    - -
    -

    The DocPad locale path

    - -
    - - - -
    -
    -

    log

    - Object - - - - - -
    -

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

    - - -
    - -
    -

    Log arguments

    - -
    - - - -

    Sub-properties:

    - -
      -
    • - args... - Mixed - -
      - -
      - -
    • -
    -
    -
    -

    loggerInstances

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    Internal property. The caterpillar logger instances bound to DocPad

    - -
    - - - -
    -
    -

    mainPath

    - String - - - - - -
    -

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

    - - -
    - -
    -

    The main DocPad file

    - -
    - - - -
    -
    -

    MetaCollection

    - Object - - - - - -
    -

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

    - - -
    - -
    -

    Collection of metadata in a DocPad project -Extension of the ElementsCollection class -https://github.com/docpad/docpad/blob/master/src/lib/collections/meta.coffee

    - -
    - - - -
    -
    -

    Model

    - Object - - - - - -
    -

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

    - - -
    - -
    -

    Model class -Extension of the Backbone Model class -http://backbonejs.org/#Model -https://github.com/docpad/docpad/blob/master/src/lib/base.coffee

    - -
    - - - -
    -
    -

    packagePath

    - String - - - - - -
    -

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

    - - -
    - -
    -

    The DocPad package.json path

    - -
    - - - -
    -
    -

    PluginLoader

    - Object - - - - - -
    -

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

    - - -
    - -
    -

    Plugin Loader class -https://github.com/docpad/docpad/blob/master/src/lib/plugin-loader.coffee -Loads the DocPad plugins from the file system into -a DocPad project

    - -
    - - - -
    -
    -

    pluginsTemplateData

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    Plugin's Extended Template Data

    - -
    - - - -
    -
    -

    pluginVersion

    - String - - - - - -
    -

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

    - - -
    - -
    -

    The plugin version requirements

    - -
    - - - -
    -
    -

    QueryCollection

    - Object - - - - - -
    -

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

    - - -
    - - - - - -
    -
    -

    regenerateTimer

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    Regenerate Timer -When config.regenerateEvery is set to a value, we create a timer here

    - -
    - - - -
    -
    -

    ScriptsCollection

    - Object - - - - - -
    -

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

    - - -
    - -
    -

    Collection of JS script files in a DocPad project -Extension of the ElementsCollection class -https://github.com/docpad/docpad/blob/master/src/lib/collections/scripts.coffee

    - -
    - - - -
    -
    -

    serverExpress

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    The express.js server instance bound to DocPad. -http://expressjs.com

    - -
    - - - -
    -
    -

    serverHttp

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    The Node.js http server instance bound to DocPad -https://nodejs.org/api/http.html

    - -
    - - - -
    -
    -

    skeletonsCollection

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    Skeletons Collection

    - -
    - - - -
    -
    -

    slowPlugins

    - Object - - - - - -
    -

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

    - - -
    - -
    -

    Plugins that are loading really slow

    - -
    - - - -
    -
    -

    string array of event names

    - Array - - - private - - - -
    -

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

    - - -
    - -
    -

    Event Listing. String array of event names. -Whenever an event is created, it must be applied here to be available to plugins and configuration files -https://github.com/bevry/docpad/wiki/Events

    - -
    - - - -
    -
    -

    string constant

    - String - - - private - - - -
    -

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

    - - -
    - -
    -

    Hash Key -The key that we use to hash some data before sending it to our statistic server

    - -
    - - - -
    -
    -

    StylesCollection

    - Object - - - - - -
    -

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

    - - -
    - -
    -

    Collection of CSS style files in a DocPad project -Extension of the ElementsCollection class -https://github.com/docpad/docpad/blob/master/src/lib/collections/styles.coffee

    - -
    - - - -
    -
    -

    trackRunnerInstance

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    The track runner instance bound to DocPad

    - -
    - - - -
    -
    -

    userConfig

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    User Configuraiton -Merged into the config property

    - -
    - - - -
    -
    -

    userConfigPath

    - String - - - - - -
    -

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

    - - -
    - -
    -

    The User's configuration path (.docpad.cson)

    - -
    - - - -
    -
    -

    version

    - Number - - - private - - - -
    -

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

    - - -
    - -
    -

    DocPad's version number

    - -
    - - - -
    -
    -

    watchers

    - Array - - - private - - - -
    -

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

    - - -
    - -
    -

    Array of file watchers

    - -
    - - - -
    -
    -

    websiteConfig

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    Website Configuration -Merged into the config property

    - -
    - - - -
    -
    -

    websitePackageConfig

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    Website Package Configuration

    - -
    - - - -
    -
    - - -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/classes/DocumentModel.html b/docs/classes/DocumentModel.html deleted file mode 100644 index ca025599..00000000 --- a/docs/classes/DocumentModel.html +++ /dev/null @@ -1,5414 +0,0 @@ - - - - - DocumentModel - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    DocumentModel Class

    -
    - -
    - Extends FileModel -
    - - - - -
    - - -
    -

    The DocumentModel class is DocPad's representation -of a website or project's content files. This can be -individual web pages or blog posts etc. Generally, this -is not other website files such as css files, images, or scripts - -unless there is a requirement to have DocPad do transformation on -these files. -Extends the DocPad FileModel class -https://github.com/docpad/docpad/blob/master/src/lib/models/file.coffee -DocumentModel primarily handles the rendering and parsing of document files. -This includes merging the document with layouts and managing the rendering -from one file extension to another. The class inherits many of the file -specific operations and DocPad specific attributes from the FileModel class. -However, it also overrides some parsing and file output operations contained -in the FileModel class.

    -

    Typically we do not need to create DocumentModels ourselves as DocPad handles -all of that. Most of the time when we encounter DocumentModels is when -querying DocPad's document collections either in the docpad.coffee file or -from within a template.

    -
    indexDoc = @getCollection('documents').findOne({relativeOutPath: 'index.html'})
    -
    -

    A plugin, however, may need to create a DocumentModel depending on its requirements. -In such a case it is wise to use the built in DocPad methods to do so, in particular -docpad.createModel

    -
    #check to see if the document alread exists ie its an update
    -docModel = @docpad.getCollection('posts').findOne({slug: 'some-slug'})
    -
    -#if so, load the existing document ready for regeneration
    -if docModel
    -    docModel.load()
    -else
    -    #if document doesn't already exist, create it and add to database
    -    docModel = @docpad.createModel({fullPath:'file/path/to/somewhere'})
    -    docModel.load()
    - -
    - -
    -

    Constructor

    -
    -

    DocumentModel

    - - () - - - - - - - - -
    -

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

    - - - -
    - -
    - -
    - - - - -
    -
    - -
    - - -
    -
    -

    Item Index

    - -
    -

    Methods

    - - -
    - -
    -

    Properties

    - - -
    - - -
    - -
    -

    Methods

    - -
    -

    action

    - -
    - (
      -
    • - next -
    • -
    • - opts -
    • -
    ) -
    - - - - - - - - -
    -

    Inherited from - - FileModel - - but overwritten in - src/lib/interfaces/console.coffee:690 -

    - - - -
    - -
    -

    Do action

    - -
    - -
    -

    Parameters:

    - -
      -
    • - next - Function - - -
      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    addUrl

    - -
    - (
      -
    • - url -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    - A file can have multiple urls. -This method adds either a single url -or an array of urls to the file model. -
    - -
    -

    Parameters:

    - -
      -
    • - url - String or Array - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    choose

    - -
    - (
      -
    • - message -
    • -
    • - choices -
    • -
    • - [opts={}] -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Choose something

    - -
    - -
    -

    Parameters:

    - -
      -
    • - message - String - - -
      - -
      - -
    • -
    • - choices - Object - - -
      - -
      - -
    • -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    clean

    - -
    - (
      -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Clean method

    - -
    - -
    -

    Parameters:

    - -
      -
    • - next - Function - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    clone

    - - () - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    - Clone the model and return the newly cloned model. -
    - - -
    -

    Returns:

    - -
    - Object: - cloned file model -
    -
    - - -
    -
    -

    confirm

    - -
    - (
      -
    • - message -
    • -
    • - [opts={}] -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Confirm an option

    - -
    - -
    -

    Parameters:

    - -
      -
    • - message - String - - -
      - -
      - -
    • -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    constructor

    - -
    - (
      -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

    - Defined in - src/lib/interfaces/console.coffee:28 -

    - - - -
    - -
    -

    Constructor method. Setup the CLI

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    contextualize

    - -
    - (
      -
    • - [opts={}] -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

    Inherited from - - FileModel - - but overwritten in - src/lib/models/document.coffee:374 -

    - - - -
    - -
    -

    Contextualize the data. In other words, -put our data into the perspective of the bigger picture of the data. -For instance, generate the url for it's rendered equivalant. -next(err)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    • - next - Object - - -
      -

      callback

      - -
      - -
    • -
    -
    - - - -
    -
    -

    delete

    - -
    - (
      -
    • - [opts] -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    - Delete the out file, perhaps ahead of regeneration. -Optionally pass the opts parameter to set the file path or type. -next(err) -
    - -
    -

    Parameters:

    - -
      -
    • - [opts] - Object - optional - - -
      - -
      - -
    • -
    • - next - Object - - -
      - callback -
      - -
    • -
    -
    - - - -
    -
    -

    deleteSource

    - -
    - (
      -
    • - [opts] -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    - Delete the source file. -Optionally pass the opts parameter to set the file path or type. -next(err) -
    - -
    -

    Parameters:

    - -
      -
    • - [opts] - Object - optional - - -
      - -
      - -
    • -
    • - next - Object - - -
      - callback -
      - -
    • -
    -
    - - - -
    -
    -

    destroy

    - -
    - (
      -
    • - err -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Destructor.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - err - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    encode

    - -
    - (
      -
    • - opts -
    • -
    ) -
    - - - Object - - - - private - - - - - -
    -

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

    - - - -
    - -
    - File encoding helper -opts = {path, to, from, content} -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: - encoded result -
    -
    - - -
    -
    -

    extractConfig

    - -
    - (
      -
    • - [customConfig={}] -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Extract Configuration

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [customConfig={}] - Object - optional - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    the DocPad config

    - -
    -
    - - -
    -
    -

    extractOptions

    - -
    - (
      -
    • - attrs -
    • -
    ) -
    - - - Object - - - - private - - - - - -
    -

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

    - - - -
    - -
    - Extract Options. -
    - -
    -

    Parameters:

    - -
      -
    • - attrs - Object - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: - the options object -
    -
    - - -
    -
    -

    generate

    - -
    - (
      -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Generate action

    - -
    - -
    -

    Parameters:

    - -
      -
    • - next - Function - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    getActionRunner

    - - () - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    - Get the action runner instance bound to DocPad -
    - - -
    -

    Returns:

    - -
    - Object: -
    -
    - - -
    -
    -

    getAttributes

    - -
    - (
      -
    • - [dereference=true] -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    - Get the file model attributes. -By default the attributes will be -dereferenced from the file model. -To maintain a reference, pass false -as the parameter. The returned object -will NOT contain the file model's ID attribute. -
    - -
    -

    Parameters:

    - -
      -
    • - [dereference=true] - Object - optional - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -
    -
    - - -
    -
    -

    getBuffer

    - - () - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    - Get the file model's buffer object. -Returns a node.js buffer object. -
    - - -
    -

    Returns:

    - -
    - Object: - node.js buffer object -
    -
    - - -
    -
    -

    getCommander

    - - () - - - - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the commander

    - -
    - - -
    -

    Returns:

    - -
    -

    the commander instance

    - -
    -
    - - -
    -
    -

    getContent

    - - () - - - String or Object - - - - - - - - -
    -

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

    - - - -
    - -
    - Get the file content. This will be -the text content if loaded or the file buffer object. -
    - - -
    -

    Returns:

    - -
    - String or Object: -
    -
    - - -
    -
    -

    getEve

    - -
    - (
      -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the most ancestoral (root) layout we -have - ie, the very top one. Often this -will be the base or default layout for -a project. The layout where the head and other -html on all pages is defined. In some projects, -however, there may be more than one root layout -so we can't assume there will always only be one. -This is used by the contextualize method to determine -the output extension of the document. In other words -the document's final output extension is determined by -the root layout. -next(err,layout)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - next - Function - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    getExtensions

    - -
    - (
      -
    • - opts -
    • -
    ) -
    - - - Array - - - - - - - - -
    -

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

    - - - -
    - -
    - Get file extensions. Depending on the -parameters passed this will either be -the file model's extensions property or -the extensions extracted from the file model's -filename property. The opts parameter is passed -in the format: {extensions,filename}. -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Array: - array of extension names -
    -
    - - -
    -
    -

    getFilename

    - -
    - (
      -
    • - [opts={}] -
    • -
    ) -
    - - - String - - - - - - - - -
    -

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

    - - - -
    - -
    - Get the file name. Depending on the -parameters passed this will either be -the file model's filename property or, -the filename determined from the fullPath -or relativePath property. Valid values for -the opts parameter are: fullPath, relativePath -or filename. Format: {filename} -
    - -
    -

    Parameters:

    - -
      -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - String: -
    -
    - - -
    -
    -

    getFilePath

    - -
    - (
      -
    • - [opts={}] -
    • -
    ) -
    - - - String - - - - - - - - -
    -

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

    - - - -
    - -
    - Get the file path. Depending on the -parameters passed this will either be -the file model's fullPath property, the -relativePath property or the filename property. -Valid values for the opts parameter are: -fullPath, relativePath -or filename. Format: {fullPath} -
    - -
    -

    Parameters:

    - -
      -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - String: -
    -
    - - -
    -
    -

    getLayout

    - -
    - (
      -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the layout object that this file references (if any). -We update the layoutRelativePath as it is -used for finding what documents are used by a -layout for when a layout changes. -next(err, layout)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - next - Function - - -
      -

      callback

      - -
      - -
    • -
    -
    - - - -
    -
    -

    getLocale

    - - () - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    - Get the file's locale information -
    - - -
    -

    Returns:

    - -
    - Object: - the locale -
    -
    - - -
    -
    -

    getMeta

    - -
    - (
      -
    • - [args...] -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    - Get the file model metadata object. -Optionally pass a list of metadata property -names corresponding to those properties that -you want returned. -
    - -
    -

    Parameters:

    - -
      -
    • - [args...] - Object - optional - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -
    -
    - - -
    -
    -

    getOptions

    - - () - - - Object - - - - private - - - - - -
    -

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

    - - - -
    - -
    - Get Options. Returns an object containing -the properties detectEncoding, rootOutDirPath -locale, stat, buffer, meta and TaskGroup. -
    - - -
    -

    Returns:

    - -
    - Object: -
    -
    - - -
    -
    -

    getOutContent

    - - () - - - String or Object - - - - - - - - -
    -

    Inherited from - - FileModel - - but overwritten in - src/lib/models/document.coffee:148 -

    - - - -
    - -
    -

    Get the file content for output. This -will be the text content AFTER it has -been through the rendering process. If -this has been called before the rendering -process, then the raw text content will be returned, -or, if early enough in the process, the file buffer object.

    - -
    - - -
    -

    Returns:

    - -
    - String or Object: -
    -
    - - -
    -
    -

    getPath

    - -
    - (
      -
    • - relativePath -
    • -
    • - parentPath -
    • -
    ) -
    - - - String - - - - - - - - -
    -

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

    - - - -
    - -
    - Get a file path. -If the relativePath parameter starts with . then we get the -path in relation to the document that is calling it. -Otherwise we just return it as normal -
    - -
    -

    Parameters:

    - -
      -
    • - relativePath - String - - -
      - -
      - -
    • -
    • - parentPath - String - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - String: -
    -
    - - -
    -
    -

    getStat

    - - () - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    - Get the node.js file stat. -
    - - -
    -

    Returns:

    - -
    - Object: - the file stat -
    -
    - - -
    -
    -

    hasLayout

    - - () - - - Boolean - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Checks if the file has a layout.

    - -
    - - -
    -

    Returns:

    - -
    - Boolean: -
    -
    - - -
    -
    -

    help

    - -
    - (
      -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Help method

    - -
    - -
    -

    Parameters:

    - -
      -
    • - next - Function - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    info

    - -
    - (
      -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Info method

    - -
    - -
    -

    Parameters:

    - -
      -
    • - next - Function - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    init

    - -
    - (
      -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Action initialise

    - -
    - -
    -

    Parameters:

    - -
      -
    • - next - Function - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    initialize

    - -
    - (
      -
    • - attrs -
    • -
    • - [opts={}] -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    - Initialize the file model with the passed -attributes and options. Emits the init event. -
    - -
    -

    Parameters:

    - -
      -
    • - attrs - Object - - -
      - the file model attributes -
      - -
    • -
    • - [opts={}] - Object - optional - - -
      - the file model options -
      - -
    • -
    -
    - - - -
    -
    -

    install

    - -
    - (
      -
    • - next -
    • -
    • - opts -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Install method

    - -
    - -
    -

    Parameters:

    - -
      -
    • - next - Function - - -
      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    isBinary

    - - () - - - Boolean - - - - - - - - -
    -

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

    - - - -
    - -
    - Is this a binary file? -
    - - -
    -

    Returns:

    - -
    - Boolean: -
    -
    - - -
    -
    -

    isBufferOutdated

    - - () - - - Boolean - - - - - - - - -
    -

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

    - - - -
    - -
    - Is Buffer Outdated -True if there is no buffer OR the buffer time is outdated -
    - - -
    -

    Returns:

    - -
    - Boolean: -
    -
    - - -
    -
    -

    isOption

    - -
    - (
      -
    • - key -
    • -
    ) -
    - - - Boolean - - - - private - - - - - -
    -

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

    - - - -
    - -
    - Checks whether the passed key is one -of the options. -
    - -
    -

    Parameters:

    - -
      -
    • - key - String - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Boolean: -
    -
    - - -
    -
    -

    isText

    - - () - - - Boolean - - - - - - - - -
    -

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

    - - - -
    - -
    - Is this a text file? ie - not -a binary file. -
    - - -
    -

    Returns:

    - -
    - Boolean: -
    -
    - - -
    -
    -

    load

    - -
    - (
      -
    • - [opts={}] -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    - Load the file from the file system. -If the fullPath exists, load the file. -If it doesn't, then parse and normalize the file. -Optionally pass file options as a parameter. -
    - -
    -

    Parameters:

    - -
      -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    • - next - Function - - -
      - callback -
      - -
    • -
    -
    - - - -
    -
    -

    normalize

    - -
    - (
      -
    • - [opts={}] -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

    Inherited from - - FileModel - - but overwritten in - src/lib/models/document.coffee:344 -

    - - - -
    - -
    -

    Normalize any parsing we have done, because if a value has -updates it may have consequences on another value. -This will ensure everything is okay. -next(err)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    • - next - Object - - -
      -

      callback

      - -
      - -
    • -
    -
    - - - -
    -
    -

    parse

    - -
    - (
      -
    • - [opts={}] -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

    Inherited from - - FileModel - - but overwritten in - src/lib/models/document.coffee:180 -

    - - - -
    - -
    -

    Parse our buffer and extract meaningful data from it. -next(err).

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    • - next - Object - - -
      -

      callback

      - -
      - -
    • -
    -
    - - - -
    -
    -

    performAction

    - -
    - (
      -
    • - action -
    • -
    • - args -
    • -
    • - [config={}] -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Perform Action

    - -
    - -
    -

    Parameters:

    - -
      -
    • - action - Object - - -
      - -
      - -
    • -
    • - args - Object - - -
      - -
      - -
    • -
    • - [config={}] - Object - optional - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    prompt

    - -
    - (
      -
    • - message -
    • -
    • - [opts={}] -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Prompt for input

    - -
    - -
    -

    Parameters:

    - -
      -
    • - message - String - - -
      - -
      - -
    • -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    referencesOthers

    - -
    - (
      -
    • - [flag=true] -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Set flag to indicate if the document -contains references to other documents. -Used in the rendering process to decide -on whether to render this document when -another document is updated.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [flag=true] - Boolean - optional - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    removeUrl

    - -
    - (
      -
    • - userUrl -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    - Removes a url from the file -model (files can have more than one url). -
    - -
    -

    Parameters:

    - -
      -
    • - userUrl - Object - - -
      - the url to be removed -
      - -
    • -
    -
    - - - -
    -
    -

    render

    - -
    - (
      -
    • - [opts={}] -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Triggers the render process for this document. -Calls the renderExtensions, renderDocument and -renderLayouts methods in sequence. This is the -method you want to call if you want to trigger -the rendering of a document manually.

    -

    The rendered content is returned as the result -parameter to the passed callback and the DocumentModel -instance is returned in the document parameter. -next(err,result,document)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    • - next - Function - - -
      -

      callback

      - -
      - -
    • -
    -
    - - - -
    -
    -

    render

    - -
    - (
      -
    • - next -
    • -
    • - opts -
    • -
    ) -
    - - - - - - - - -
    -

    Inherited from - - FileModel - - but overwritten in - src/lib/interfaces/console.coffee:800 -

    - - - -
    - -
    -

    Render method

    - -
    - -
    -

    Parameters:

    - -
      -
    • - next - Function - - -
      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    renderDocument

    - -
    - (
      -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Triggers the renderDocument event after -all extensions have been rendered. Listeners -can use this event to perform transformations -on the already rendered content.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      -

      callback

      - -
      - -
    • -
    -
    - - - -
    -
    -

    renderExtensions

    - -
    - (
      -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Renders one extension to another depending -on the document model's extensions property. -Triggers the render event for each extension conversion. -This is the point where the various templating systems listen -for their extension and perform their conversions. -Common extension conversion is from md to html. -So the document source file maybe index.md.html. -This will be a markdown file to be converted to HTML. -However, documents can be rendered through more than -one conversion. Index.html.md.eco will be rendered from -eco to md and then from md to html. Two conversions. -next(err,result)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      -

      callback

      - -
      - -
    • -
    -
    - - - -
    -
    -

    renderLayouts

    - -
    - (
      -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Render and merge layout content. Merge -layout metadata with document metadata. -Return the resulting merged content to -the callback result parameter. -next(err,result)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      -

      callback

      - -
      - -
    • -
    -
    - - - -
    -
    -

    run

    - -
    - (
      -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Run method

    - -
    - -
    -

    Parameters:

    - -
      -
    • - next - Function - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    selectSkeletonCallback

    - -
    - (
      -
    • - skeletonsCollection -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Select a skeleton

    - -
    - -
    -

    Parameters:

    - -
      -
    • - skeletonsCollection - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    server

    - -
    - (
      -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Server method

    - -
    - -
    -

    Parameters:

    - -
      -
    • - next - Function - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    set

    - -
    - (
      -
    • - attrs -
    • -
    • - opts -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    - Assign attributes and options to the file model. -
    - -
    -

    Parameters:

    - -
      -
    • - attrs - Array - - -
      - the attributes to be applied -
      - -
    • -
    • - opts - Object - - -
      - the options to be applied -
      - -
    • -
    -
    - - - -
    -
    -

    setBuffer

    - -
    - (
      -
    • - [buffer] -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    - Set the file model's buffer. -Creates a new node.js buffer -object if a buffer object is -is not passed as the parameter -
    - -
    -

    Parameters:

    - -
      -
    • - [buffer] - Object - optional - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    setDefaults

    - -
    - (
      -
    • - attrs -
    • -
    • - opts -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    - Set defaults. Apply default attributes -and options to the file model -
    - -
    -

    Parameters:

    - -
      -
    • - attrs - Object - - -
      - the attributes to be applied -
      - -
    • -
    • - opts - Object - - -
      - the options to be applied -
      - -
    • -
    -
    - - - -
    -
    -

    setMeta

    - -
    - (
      -
    • - attrs -
    • -
    • - opts -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    - Set the file model meta data, -attributes and options in one go. -
    - -
    -

    Parameters:

    - -
      -
    • - attrs - Object - - -
      - the attributes to be applied -
      - -
    • -
    • - opts - Object - - -
      - the options to be applied -
      - -
    • -
    -
    - - - -
    -
    -

    setMetaDefaults

    - -
    - (
      -
    • - attrs -
    • -
    • - opts -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    - Set the file model meta data defaults -
    - -
    -

    Parameters:

    - -
      -
    • - attrs - Object - - -
      - the attributes to be applied -
      - -
    • -
    • - opts - Object - - -
      - the options to be applied -
      - -
    • -
    -
    - - - -
    -
    -

    setOptions

    - -
    - (
      -
    • - [attrs={}] -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    - Set the options for the file model. -Valid properties for the attrs parameter: -TaskGroup, detectEncoding, rootOutDirPath, -locale, stat, data, buffer, meta. -
    - -
    -

    Parameters:

    - -
      -
    • - [attrs={}] - Object - optional - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    setStat

    - -
    - (
      -
    • - stat -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    - Set the node.js file stat. -
    - -
    -

    Parameters:

    - -
      -
    • - stat - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    setUrl

    - -
    - (
      -
    • - url -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    - Set the url for the file -
    - -
    -

    Parameters:

    - -
      -
    • - url - String - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    start

    - -
    - (
      -
    • - argv -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Start the CLI

    - -
    - -
    -

    Parameters:

    - -
      -
    • - argv - Array - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    toJSON

    - -
    - (
      -
    • - [dereference=false] -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    - Get the file model attributes. -By default the attributes will -maintain a reference to the file model. -To return a dereferenced object, pass true -as the parameter. The returned object -will contain the file model's ID attribute. -
    - -
    -

    Parameters:

    - -
      -
    • - [dereference=false] - Object - optional - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -
    -
    - - -
    -
    -

    uninstall

    - -
    - (
      -
    • - next -
    • -
    • - opts -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Uninstall method

    - -
    - -
    -

    Parameters:

    - -
      -
    • - next - Function - - -
      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    update

    - -
    - (
      -
    • - next -
    • -
    • - opts -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Update method

    - -
    - -
    -

    Parameters:

    - -
      -
    • - next - Function - - -
      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    upgrade

    - -
    - (
      -
    • - next -
    • -
    • - opts -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Upgrade method

    - -
    - -
    -

    Parameters:

    - -
      -
    • - next - Function - - -
      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    watch

    - -
    - (
      -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Watch method

    - -
    - -
    -

    Parameters:

    - -
      -
    • - next - Function - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    welcomeCallback

    - -
    - (
      -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Welcome Callback

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    wrapAction

    - -
    - (
      -
    • - action -
    • -
    • - config -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Wrap Action

    - -
    - -
    -

    Parameters:

    - -
      -
    • - action - Object - - -
      - -
      - -
    • -
    • - config - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    write

    - -
    - (
      -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    - Write the out file. The out file -may be different from the input file. -Often the input file is transformed in some way -and saved as another file format. A common example -is transforming a markdown input file to a HTML -output file. -next(err) -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - callback -
      - -
    • -
    -
    - - - -
    -
    -

    writeSource

    - -
    - (
      -
    • - [opts] -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

    Inherited from - - FileModel - - but overwritten in - src/lib/models/document.coffee:801 -

    - - - -
    - -
    -

    Write the source file. Optionally pass -the opts parameter to modify or set the file's -path, content or type. -next(err)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [opts] - Object - optional - - -
      - -
      - -
    • -
    • - next - Object - - -
      -

      callback

      - -
      - -
    • -
    -
    - - - -
    -
    - -
    -

    Properties

    - -
    -

    actionRunnerInstance

    - Object - - - private - - - -
    -

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

    - - -
    - -
    - The action runner instance bound to DocPad -
    - - - -
    -
    -

    buffer

    - Object - - - - - -
    -

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

    - - -
    - -
    - File buffer. Node.js Buffer object. -https://nodejs.org/api/buffer.html#buffer_class_buffer. -Provides methods for dealing with binary data directly. -
    - - - -
    -
    -

    bufferTime

    - Object - - - - - -
    -

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

    - - -
    - -
    - Buffer time. -
    - - - -
    -
    -

    detectEncoding

    - Boolean - - - - - -
    -

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

    - - -
    - -
    - Whether or not we should detect encoding -
    - - - -
    -
    -

    - Object - - - private - - - -
    -

    Inherited from - - FileModel - - but overwritten in - src/lib/models/document.coffee:92 -

    - - -
    - -
    -

    The default attributes for any document model.

    - -
    - - - -
    -
    -

    klass

    - Object - - - private - - - -
    -

    Inherited from - - FileModel - - but overwritten in - src/lib/models/document.coffee:73 -

    - - -
    - -
    -

    The document model class.

    - -
    - - - -
    -
    -

    locale

    - Object - - - private - - - -
    -

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

    - - -
    - -
    - Locale information for the file -
    - - - -
    -
    -

    meta

    - Object - - - private - - - -
    -

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

    - - -
    - -
    - The parsed file meta data (header). -Is a Model instance. -
    - - - -
    -
    -

    rootOutDirPath

    - String - - - - - -
    -

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

    - - -
    - -
    - The out directory path to put the relative path. -
    - - - -
    -
    -

    stat

    - Object - - - - - -
    -

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

    - - -
    - -
    - Node.js file stat object. -https://nodejs.org/api/fs.html#fs_class_fs_stats. -Basically, information about a file, including file -dates and size. -
    - - - -
    -
    -

    TaskGroup

    - Object - - - private - - - -
    -

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

    - - -
    - -
    - Task Group Class -
    - - - -
    -
    -

    type

    - String - - - private - - - -
    -

    Inherited from - - FileModel - - but overwritten in - src/lib/models/document.coffee:80 -

    - - -
    - -
    -

    String name of the model type. -In this case, 'document'.

    - -
    - - - -
    -
    - - -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/classes/ElementsCollection.html b/docs/classes/ElementsCollection.html deleted file mode 100644 index 291690ed..00000000 --- a/docs/classes/ElementsCollection.html +++ /dev/null @@ -1,356 +0,0 @@ - - - - - ElementsCollection - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    ElementsCollection Class

    -
    - -
    - Extends Collection -
    - - - - -
    - - -
    -

    Base class for the DocPad Elements Collection object -Extends the DocPad collection class -https://github.com/docpad/docpad/blob/master/src/lib/base.coffee#L72 -Used as the base collection class for specific collection of file types. -In particular metadata, scripts and styles.

    - -
    - -
    -

    Constructor

    -
    -

    ElementsCollection

    - - () - - - - - - - - -
    -

    - Defined in - src/lib/collections/elements.coffee:14 -

    - - - -
    - -
    - -
    - - - - -
    -
    - -
    - - -
    -
    -

    Item Index

    - -
    -

    Methods

    - - -
    - -
    -

    Properties

    - - -
    - - -
    - -
    -

    Methods

    - -
    -

    add

    - -
    - (
      -
    • - values -
    • -
    • - opts -
    • -
    ) -
    - - - - - - - - -
    -

    - Defined in - src/lib/collections/elements.coffee:32 -

    - - - -
    - -
    -

    Add an element to the collection. -Right now we just support strings.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - values - Array - - -
      -

      string array of values

      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    toHTML

    - - () - - - String - - - - - - - - -
    -

    - Defined in - src/lib/collections/elements.coffee:64 -

    - - - -
    - -
    -

    Create a way to output our elements to HTML

    - -
    - - -
    -

    Returns:

    - -
    - String: -
    -
    - - -
    -
    - -
    -

    Properties

    - -
    -

    model

    - Object - - - - - -
    -

    - Defined in - src/lib/collections/elements.coffee:26 -

    - - -
    - -
    -

    Base Model for all items in this collection

    - -
    - - - -
    -
    - - -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/classes/Events.html b/docs/classes/Events.html deleted file mode 100644 index a25df458..00000000 --- a/docs/classes/Events.html +++ /dev/null @@ -1,186 +0,0 @@ - - - - - Events - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    Events Class

    -
    - -
    - Extends queryEngine.Backbone.Events -
    - -
    - Defined in: src/lib/base.coffee:28 -
    - - -
    - - -
    -

    Base class for the DocPad Events object -Extends the backbone.js events object -http://backbonejs.org/#Events

    - -
    - -
    -

    Constructor

    -
    -

    Events

    - - () - - - - - - - - -
    -

    - Defined in - src/lib/base.coffee:28 -

    - - - -
    - -
    - -
    - - - - -
    -
    - -
    - - -
    -
    -

    Item Index

    - - - - -
    - - - - -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/classes/FileModel.html b/docs/classes/FileModel.html deleted file mode 100644 index 84e235d1..00000000 --- a/docs/classes/FileModel.html +++ /dev/null @@ -1,3280 +0,0 @@ - - - - - FileModel - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    FileModel Class

    -
    - -
    - Extends Model -
    - - - - -
    - - -
    -

    The FileModel class is DocPad's representation -of a file in the file system. -Extends the DocPad Model class -https://github.com/docpad/docpad/blob/master/src/lib/base.coffee#L49. -FileModel manages the loading -of a file and parsing both the content and the metadata (if any). -Once loaded, the content, metadata and file stat (file info) -properties of the FileModel are populated, as well -as a number of DocPad specific attributes and properties. -Typically we do not need to create FileModels ourselves as -DocPad handles all of that. But it is possible that a plugin -may need to manually create FileModels for some reason.

    -
    attrs =
    -    fullPath: 'file/path/to/somewhere'
    -opts = {}
    -#we only really need the path to the source file to create
    -#a new file model
    -model = new FileModel(attrs, opts)
    -
    -

    The FileModel forms the base class for the DocPad DocumentModel class.

    - -
    - -
    -

    Constructor

    -
    -

    FileModel

    - - () - - - - - - - - -
    -

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

    - - - -
    - -
    - -
    - - - - -
    -
    - -
    - - -
    -
    -

    Item Index

    - -
    -

    Methods

    - - -
    - -
    -

    Properties

    - - -
    - - -
    - -
    -

    Methods

    - -
    -

    action

    - -
    - (
      -
    • - args... -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Apply an action with the supplied arguments.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - args... - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    addUrl

    - -
    - (
      -
    • - url -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    A file can have multiple urls. -This method adds either a single url -or an array of urls to the file model.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - url - String or Array - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    clone

    - - () - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Clone the model and return the newly cloned model.

    - -
    - - -
    -

    Returns:

    - -
    - Object: -

    cloned file model

    - -
    -
    - - -
    -
    -

    contextualize

    - -
    - (
      -
    • - [opts={}] -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Contextualize the data. In other words, -put our data into the perspective of the bigger picture of the data. -For instance, generate the url for it's rendered equivalant. -next(err)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    • - next - Object - - -
      -

      callback

      - -
      - -
    • -
    -
    - - - -
    -
    -

    delete

    - -
    - (
      -
    • - [opts] -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Delete the out file, perhaps ahead of regeneration. -Optionally pass the opts parameter to set the file path or type. -next(err)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [opts] - Object - optional - - -
      - -
      - -
    • -
    • - next - Object - - -
      -

      callback

      - -
      - -
    • -
    -
    - - - -
    -
    -

    deleteSource

    - -
    - (
      -
    • - [opts] -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Delete the source file. -Optionally pass the opts parameter to set the file path or type. -next(err)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [opts] - Object - optional - - -
      - -
      - -
    • -
    • - next - Object - - -
      -

      callback

      - -
      - -
    • -
    -
    - - - -
    -
    -

    encode

    - -
    - (
      -
    • - opts -
    • -
    ) -
    - - - Object - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    File encoding helper -opts = {path, to, from, content}

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    encoded result

    - -
    -
    - - -
    -
    -

    extractOptions

    - -
    - (
      -
    • - attrs -
    • -
    ) -
    - - - Object - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Extract Options.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - attrs - Object - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    the options object

    - -
    -
    - - -
    -
    -

    getActionRunner

    - - () - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the action runner instance bound to DocPad

    - -
    - - -
    -

    Returns:

    - -
    - Object: -
    -
    - - -
    -
    -

    getAttributes

    - -
    - (
      -
    • - [dereference=true] -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the file model attributes. -By default the attributes will be -dereferenced from the file model. -To maintain a reference, pass false -as the parameter. The returned object -will NOT contain the file model's ID attribute.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [dereference=true] - Object - optional - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -
    -
    - - -
    -
    -

    getBuffer

    - - () - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the file model's buffer object. -Returns a node.js buffer object.

    - -
    - - -
    -

    Returns:

    - -
    - Object: -

    node.js buffer object

    - -
    -
    - - -
    -
    -

    getContent

    - - () - - - String or Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the file content. This will be -the text content if loaded or the file buffer object.

    - -
    - - -
    -

    Returns:

    - -
    - String or Object: -
    -
    - - -
    -
    -

    getExtensions

    - -
    - (
      -
    • - opts -
    • -
    ) -
    - - - Array - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get file extensions. Depending on the -parameters passed this will either be -the file model's extensions property or -the extensions extracted from the file model's -filename property. The opts parameter is passed -in the format: {extensions,filename}.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Array: -

    array of extension names

    - -
    -
    - - -
    -
    -

    getFilename

    - -
    - (
      -
    • - [opts={}] -
    • -
    ) -
    - - - String - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the file name. Depending on the -parameters passed this will either be -the file model's filename property or, -the filename determined from the fullPath -or relativePath property. Valid values for -the opts parameter are: fullPath, relativePath -or filename. Format: {filename}

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - String: -
    -
    - - -
    -
    -

    getFilePath

    - -
    - (
      -
    • - [opts={}] -
    • -
    ) -
    - - - String - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the file path. Depending on the -parameters passed this will either be -the file model's fullPath property, the -relativePath property or the filename property. -Valid values for the opts parameter are: -fullPath, relativePath -or filename. Format: {fullPath}

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - String: -
    -
    - - -
    -
    -

    getLocale

    - - () - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the file's locale information

    - -
    - - -
    -

    Returns:

    - -
    - Object: -

    the locale

    - -
    -
    - - -
    -
    -

    getMeta

    - -
    - (
      -
    • - [args...] -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the file model metadata object. -Optionally pass a list of metadata property -names corresponding to those properties that -you want returned.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [args...] - Object - optional - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -
    -
    - - -
    -
    -

    getOptions

    - - () - - - Object - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Get Options. Returns an object containing -the properties detectEncoding, rootOutDirPath -locale, stat, buffer, meta and TaskGroup.

    - -
    - - -
    -

    Returns:

    - -
    - Object: -
    -
    - - -
    -
    -

    getOutContent

    - - () - - - String or Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the file content for output.

    - -
    - - -
    -

    Returns:

    - -
    - String or Object: -
    -
    - - -
    -
    -

    getPath

    - -
    - (
      -
    • - relativePath -
    • -
    • - parentPath -
    • -
    ) -
    - - - String - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get a file path. -If the relativePath parameter starts with . then we get the -path in relation to the document that is calling it. -Otherwise we just return it as normal

    - -
    - -
    -

    Parameters:

    - -
      -
    • - relativePath - String - - -
      - -
      - -
    • -
    • - parentPath - String - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - String: -
    -
    - - -
    -
    -

    getStat

    - - () - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the node.js file stat.

    - -
    - - -
    -

    Returns:

    - -
    - Object: -

    the file stat

    - -
    -
    - - -
    -
    -

    initialize

    - -
    - (
      -
    • - attrs -
    • -
    • - [opts={}] -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Initialize the file model with the passed -attributes and options. Emits the init event.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - attrs - Object - - -
      -

      the file model attributes

      - -
      - -
    • -
    • - [opts={}] - Object - optional - - -
      -

      the file model options

      - -
      - -
    • -
    -
    - - - -
    -
    -

    isBinary

    - - () - - - Boolean - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Is this a binary file?

    - -
    - - -
    -

    Returns:

    - -
    - Boolean: -
    -
    - - -
    -
    -

    isBufferOutdated

    - - () - - - Boolean - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Is Buffer Outdated -True if there is no buffer OR the buffer time is outdated

    - -
    - - -
    -

    Returns:

    - -
    - Boolean: -
    -
    - - -
    -
    -

    isOption

    - -
    - (
      -
    • - key -
    • -
    ) -
    - - - Boolean - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Checks whether the passed key is one -of the options.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - key - String - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Boolean: -
    -
    - - -
    -
    -

    isText

    - - () - - - Boolean - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Is this a text file? ie - not -a binary file.

    - -
    - - -
    -

    Returns:

    - -
    - Boolean: -
    -
    - - -
    -
    -

    load

    - -
    - (
      -
    • - [opts={}] -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Load the file from the file system. -If the fullPath exists, load the file. -If it doesn't, then parse and normalize the file. -Optionally pass file options as a parameter.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    • - next - Function - - -
      -

      callback

      - -
      - -
    • -
    -
    - - - -
    -
    -

    normalize

    - -
    - (
      -
    • - [opts={}] -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Normalize any parsing we have done, because if a value has -updates it may have consequences on another value. -This will ensure everything is okay. -next(err)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    • - next - Object - - -
      -

      callback

      - -
      - -
    • -
    -
    - - - -
    -
    -

    parse

    - -
    - (
      -
    • - [opts={}] -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Parse our buffer and extract meaningful data from it. -next(err).

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    • - next - Object - - -
      -

      callback

      - -
      - -
    • -
    -
    - - - -
    -
    -

    removeUrl

    - -
    - (
      -
    • - userUrl -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Removes a url from the file -model (files can have more than one url).

    - -
    - -
    -

    Parameters:

    - -
      -
    • - userUrl - Object - - -
      -

      the url to be removed

      - -
      - -
    • -
    -
    - - - -
    -
    -

    render

    - -
    - (
      -
    • - [opts={}] -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Render this file. The file model output content is -returned to the passed callback in the -result (2nd) parameter. The file model itself is returned -in the callback's document (3rd) parameter. -next(err,result,document)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    • - next - Object - - -
      -

      callback

      - -
      - -
    • -
    -
    - - - -
    -
    -

    set

    - -
    - (
      -
    • - attrs -
    • -
    • - opts -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Assign attributes and options to the file model.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - attrs - Array - - -
      -

      the attributes to be applied

      - -
      - -
    • -
    • - opts - Object - - -
      -

      the options to be applied

      - -
      - -
    • -
    -
    - - - -
    -
    -

    setBuffer

    - -
    - (
      -
    • - [buffer] -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Set the file model's buffer. -Creates a new node.js buffer -object if a buffer object is -is not passed as the parameter

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [buffer] - Object - optional - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    setDefaults

    - -
    - (
      -
    • - attrs -
    • -
    • - opts -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Set defaults. Apply default attributes -and options to the file model

    - -
    - -
    -

    Parameters:

    - -
      -
    • - attrs - Object - - -
      -

      the attributes to be applied

      - -
      - -
    • -
    • - opts - Object - - -
      -

      the options to be applied

      - -
      - -
    • -
    -
    - - - -
    -
    -

    setMeta

    - -
    - (
      -
    • - attrs -
    • -
    • - opts -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Set the file model meta data, -attributes and options in one go.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - attrs - Object - - -
      -

      the attributes to be applied

      - -
      - -
    • -
    • - opts - Object - - -
      -

      the options to be applied

      - -
      - -
    • -
    -
    - - - -
    -
    -

    setMetaDefaults

    - -
    - (
      -
    • - attrs -
    • -
    • - opts -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Set the file model meta data defaults

    - -
    - -
    -

    Parameters:

    - -
      -
    • - attrs - Object - - -
      -

      the attributes to be applied

      - -
      - -
    • -
    • - opts - Object - - -
      -

      the options to be applied

      - -
      - -
    • -
    -
    - - - -
    -
    -

    setOptions

    - -
    - (
      -
    • - [attrs={}] -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Set the options for the file model. -Valid properties for the attrs parameter: -TaskGroup, detectEncoding, rootOutDirPath, -locale, stat, data, buffer, meta.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [attrs={}] - Object - optional - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    setStat

    - -
    - (
      -
    • - stat -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Set the node.js file stat.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - stat - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    setUrl

    - -
    - (
      -
    • - url -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Set the url for the file

    - -
    - -
    -

    Parameters:

    - -
      -
    • - url - String - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    toJSON

    - -
    - (
      -
    • - [dereference=false] -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the file model attributes. -By default the attributes will -maintain a reference to the file model. -To return a dereferenced object, pass true -as the parameter. The returned object -will contain the file model's ID attribute.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [dereference=false] - Object - optional - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -
    -
    - - -
    -
    -

    write

    - -
    - (
      -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Write the out file. The out file -may be different from the input file. -Often the input file is transformed in some way -and saved as another file format. A common example -is transforming a markdown input file to a HTML -output file. -next(err)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      -

      callback

      - -
      - -
    • -
    -
    - - - -
    -
    -

    writeSource

    - -
    - (
      -
    • - [opts] -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Write the source file. Optionally pass -the opts parameter to modify or set the file's -path, content or type. -next(err)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [opts] - Object - optional - - -
      - -
      - -
    • -
    • - next - Object - - -
      -

      callback

      - -
      - -
    • -
    -
    - - - -
    -
    - -
    -

    Properties

    - -
    -

    actionRunnerInstance

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    The action runner instance bound to DocPad

    - -
    - - - -
    -
    -

    buffer

    - Object - - - - - -
    -

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

    - - -
    - -
    -

    File buffer. Node.js Buffer object. -https://nodejs.org/api/buffer.html#buffer_class_buffer. -Provides methods for dealing with binary data directly.

    - -
    - - - -
    -
    -

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    The default attributes for any file model.

    - -
    - - - -
    -
    -

    bufferTime

    - Object - - - - - -
    -

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

    - - -
    - -
    -

    Buffer time.

    - -
    - - - -
    -
    -

    detectEncoding

    - Boolean - - - - - -
    -

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

    - - -
    - -
    -

    Whether or not we should detect encoding

    - -
    - - - -
    -
    -

    klass

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    The file model class. This should -be overridden in any descending classes.

    - -
    - - - -
    -
    -

    locale

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    Locale information for the file

    - -
    - - - -
    -
    -

    meta

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    The parsed file meta data (header). -Is a Model instance.

    - -
    - - - -
    -
    -

    rootOutDirPath

    - String - - - - - -
    -

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

    - - -
    - -
    -

    The out directory path to put the relative path.

    - -
    - - - -
    -
    -

    stat

    - Object - - - - - -
    -

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

    - - -
    - -
    -

    Node.js file stat object. -https://nodejs.org/api/fs.html#fs_class_fs_stats. -Basically, information about a file, including file -dates and size.

    - -
    - - - -
    -
    -

    TaskGroup

    - Object - - - private - - - -
    -

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

    - - -
    - -
    -

    Task Group Class

    - -
    - - - -
    -
    -

    type

    - String - - - private - - - -
    -

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

    - - -
    - -
    -

    String name of the model type. -In this case, 'file'. This should -be overridden in any descending classes.

    - -
    - - - -
    -
    - - -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/classes/FilesCollection.html b/docs/classes/FilesCollection.html deleted file mode 100644 index 84b6a6fd..00000000 --- a/docs/classes/FilesCollection.html +++ /dev/null @@ -1,444 +0,0 @@ - - - - - FilesCollection - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    FilesCollection Class

    -
    - -
    - Extends QueryCollection -
    - - - - -
    - - -
    -

    The DocPad files and documents query collection class -Extends the DocPad QueryCollection class -https://github.com/docpad/docpad/blob/master/src/lib/base.coffee#L91 -Used as the query collection class for DocPad files and documents. -This differs from standard collections in that it provides backbone.js, -noSQL style methods for querying the file system. In DocPad this -is the various files that make up a web project. Typically this is the documents, -css, script and image files.

    -

    Most often a developer will use this class to find (and possibly sort) documents, -such as blog posts, by some criteria. -posts: ->

    - -
    - -
    -

    Constructor

    -
    -

    FilesCollection

    - - () - - - - - - - - -
    -

    - Defined in - src/lib/collections/files.coffee:15 -

    - - - -
    - -
    - -
    - - - - -
    -
    - -
    - - -
    -
    -

    Item Index

    - -
    -

    Methods

    - - -
    - -
    -

    Properties

    - - -
    - - -
    - -
    -

    Methods

    - -
    -

    fuzzyFindOne

    - -
    - (
      -
    • - data -
    • -
    • - sorting -
    • -
    • - paging -
    • -
    ) -
    - - - Object - - - - - - - - -
    -

    - Defined in - src/lib/collections/files.coffee:61 -

    - - - -
    - -
    -

    Fuzzy find one -Useful for layout searching

    - -
    - -
    -

    Parameters:

    - -
      -
    • - data - Object - - -
      - -
      - -
    • -
    • - sorting - Object - - -
      - -
      - -
    • -
    • - paging - Object - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    the file, if found

    - -
    -
    - - -
    -
    -

    initialize

    - -
    - (
      -
    • - attrs -
    • -
    • - [opts={}] -
    • -
    ) -
    - - - - private - - - - - -
    -

    - Defined in - src/lib/collections/files.coffee:49 -

    - - - -
    - -
    -

    Initialize the collection

    - -
    - -
    -

    Parameters:

    - -
      -
    • - attrs - Object - - -
      - -
      - -
    • -
    • - [opts={}] - Object - optional - - -
      - -
      - -
    • -
    -
    - - - -
    -
    - -
    -

    Properties

    - -
    -

    collection

    - Object - - - private - - - -
    -

    - Defined in - src/lib/collections/files.coffee:42 -

    - - -
    - -
    -

    Base Collection for all child collections

    - -
    - - - -
    -
    -

    model

    - Object - - - private - - - -
    -

    - Defined in - src/lib/collections/files.coffee:35 -

    - - -
    - -
    -

    Base Model for all items in this collection

    - -
    - - - -
    -
    - - -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/classes/MetaCollection.html b/docs/classes/MetaCollection.html deleted file mode 100644 index af77d07c..00000000 --- a/docs/classes/MetaCollection.html +++ /dev/null @@ -1,353 +0,0 @@ - - - - - MetaCollection - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    MetaCollection Class

    -
    - -
    - Extends ElementsCollection -
    - - - - -
    - - -
    -

    Meta collection class. Collection of -document meta data strings

    - -
    - -
    -

    Constructor

    -
    -

    MetaCollection

    - - () - - - - - - - - -
    -

    - Defined in - src/lib/collections/meta.coffee:11 -

    - - - -
    - -
    - -
    - - - - -
    -
    - -
    - - -
    -
    -

    Item Index

    - -
    -

    Methods

    - - -
    - -
    -

    Properties

    - - -
    - - -
    - -
    -

    Methods

    - -
    -

    add

    - -
    - (
      -
    • - values -
    • -
    • - opts -
    • -
    ) -
    - - - - - - - - - - -
    -

    Add an element to the collection. -Right now we just support strings.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - values - Array - - -
      -

      string array of values

      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    toHTML

    - - () - - - String - - - - - - - - - - -
    -

    Create a way to output our elements to HTML

    - -
    - - -
    -

    Returns:

    - -
    - String: -
    -
    - - -
    -
    - -
    -

    Properties

    - -
    -

    model

    - Object - - - - - - - -
    -

    Base Model for all items in this collection

    - -
    - - - -
    -
    - - -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/classes/Model.html b/docs/classes/Model.html deleted file mode 100644 index 861f3ad0..00000000 --- a/docs/classes/Model.html +++ /dev/null @@ -1,186 +0,0 @@ - - - - - Model - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    Model Class

    -
    - -
    - Extends queryEngine.Backbone.Model -
    - -
    - Defined in: src/lib/base.coffee:41 -
    - - -
    - - -
    -

    Base class for the DocPad file and document model -Extends the backbone.js model -http://backbonejs.org/#Model

    - -
    - -
    -

    Constructor

    -
    -

    Model

    - - () - - - - - - - - -
    -

    - Defined in - src/lib/base.coffee:41 -

    - - - -
    - -
    - -
    - - - - -
    -
    - -
    - - -
    -
    -

    Item Index

    - - - - -
    - - - - -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/classes/PluginLoader.html b/docs/classes/PluginLoader.html deleted file mode 100644 index e32b0bfc..00000000 --- a/docs/classes/PluginLoader.html +++ /dev/null @@ -1,903 +0,0 @@ - - - - - PluginLoader - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    PluginLoader Class

    -
    - - - - - -
    - - -
    -

    The Plugin Loader class

    - -
    - -
    -

    Constructor

    -
    -

    PluginLoader

    - - () - - - - - - - - -
    -

    - Defined in - src/lib/plugin-loader.coffee:18 -

    - - - -
    - -
    - -
    - - - - -
    -
    - -
    - - -
    -
    -

    Item Index

    - -
    -

    Methods

    - - -
    - -
    -

    Properties

    - -
      -
    • - docpad - -
    • -
    • - - -
    • -
    • - - -
    • -
    • - - -
    • -
    • - - -
    • -
    • - - -
    • -
    • - - -
    • -
    • - - -
    • -
    • - - -
    • -
    • - - -
    • -
    -
    - - -
    - -
    -

    Methods

    - -
    -

    constructor

    - -
    - (
      -
    • - opts -
    • -
    ) -
    - - - - - - - - -
    -

    - Defined in - src/lib/plugin-loader.coffee:109 -

    - - - -
    - -
    -

    Constructor method

    - -
    - -
    -

    Parameters:

    - -
      -
    • - opts - Object - - -
      - -
      - -
        -
      • - docpad - Object - -
        -

        The docpad instance that we are loading plugins for

        - -
        - -
      • -
      • - dirPath - String - -
        -

        The directory path of the plugin

        - -
        - -
      • -
      • - BasePlugin - Object - -
        -

        The base plugin class

        - -
        - -
      • -
      -
    • -
    -
    - - - -
    -
    -

    create

    - -
    - (
      -
    • - config -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

    - Defined in - src/lib/plugin-loader.coffee:322 -

    - - - -
    - -
    -

    Create an instance of a plugin -defined by the passed config. -The plugin instance is returned in -the passed callback. -next(err,pluginInstance)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - config - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    exists

    - -
    - (
      -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

    - Defined in - src/lib/plugin-loader.coffee:128 -

    - - - -
    - -
    -

    Loads the package.json file and extracts the main path -next(err,exists)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - next - Function - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    install

    - -
    - (
      -
    • - next -
    • -
    ) -
    - - - - private - - - - - -
    -

    - Defined in - src/lib/plugin-loader.coffee:232 -

    - - - -
    - -
    -

    Installs the plugins node modules. -next(err)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - next - Function - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    load

    - -
    - (
      -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

    - Defined in - src/lib/plugin-loader.coffee:259 -

    - - - -
    - -
    -

    Load in the pluginClass from the plugin file. -The plugin class that has been loaded is returned -in the passed callback -next(err,pluginClass)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - next - Function - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    unsupported

    - -
    - (
      -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

    - Defined in - src/lib/plugin-loader.coffee:177 -

    - - - -
    - -
    -

    Check if this plugin is unsupported -Boolean value returned as a parameter -in the passed callback -next(err,supported)

    - -
    - -
    -

    Parameters:

    - -
      -
    • - next - Function - - -
      - -
      - -
    • -
    -
    - - - -
    -
    - -
    -

    Properties

    - -
    -

    docpad

    - Object - - - private - - - -
    -

    - Defined in - src/lib/plugin-loader.coffee:28 -

    - - -
    - -
    -

    The DocPad Instance

    - -
    - - - -
    -
    -

    - Object - - - private - - - -
    -

    - Defined in - src/lib/plugin-loader.coffee:36 -

    - - -
    - -
    -

    The BasePlugin Class

    - -
    - - - -
    -
    -

    - String - - - private - - - -
    -

    - Defined in - src/lib/plugin-loader.coffee:44 -

    - - -
    - -
    -

    The full path of the plugin's directory

    - -
    - - - -
    -
    -

    - String - - - private - - - -
    -

    - Defined in - src/lib/plugin-loader.coffee:55 -

    - - -
    - -
    -

    The full path of the plugin's package.json file

    - -
    - - - -
    -
    -

    - Object - - - private - - - -
    -

    - Defined in - src/lib/plugin-loader.coffee:62 -

    - - -
    - -
    -

    The parsed contents of the plugin's package.json file

    - -
    - - - -
    -
    -

    - String - - - private - - - -
    -

    - Defined in - src/lib/plugin-loader.coffee:69 -

    - - -
    - -
    -

    The full path of the plugin's main file

    - -
    - - - -
    -
    -

    - Object - - - private - - - -
    -

    - Defined in - src/lib/plugin-loader.coffee:77 -

    - - -
    - -
    -

    The parsed content of the plugin's main file

    - -
    - - - -
    -
    -

    - String - - - private - - - -
    -

    - Defined in - src/lib/plugin-loader.coffee:84 -

    - - -
    - -
    -

    The plugin name

    - -
    - - - -
    -
    -

    - String - - - private - - - -
    -

    - Defined in - src/lib/plugin-loader.coffee:91 -

    - - -
    - -
    -

    The plugin version

    - -
    - - - -
    -
    -

    - String - - - private - - - -
    -

    - Defined in - src/lib/plugin-loader.coffee:98 -

    - - -
    - -
    -

    Node modules path

    - -
    - - - -
    -
    - - -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/classes/PluginTester.html b/docs/classes/PluginTester.html deleted file mode 100644 index 099cff98..00000000 --- a/docs/classes/PluginTester.html +++ /dev/null @@ -1,643 +0,0 @@ - - - - - PluginTester - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    PluginTester Class

    -
    - - -
    - Defined in: src/lib/testers.coffee:37 -
    - - -
    - - -
    -

    The Plugin Tester class

    - -
    - -
    -

    Constructor

    -
    -

    PluginTester

    - - () - - - - - - - - -
    -

    - Defined in - src/lib/testers.coffee:37 -

    - - - -
    - -
    - -
    - - - - -
    -
    - -
    - - -
    -
    -

    Item Index

    - -
    -

    Methods

    - - -
    - -
    -

    Properties

    - -
      -
    • - - -
    • -
    • - - -
    • -
    • - - -
    • -
    -
    - - -
    - -
    -

    Methods

    - -
    -

    constructor

    - -
    - (
      -
    • - [config={}] -
    • -
    • - [docpadConfig={}] -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

    - Defined in - src/lib/testers.coffee:88 -

    - - - -
    - -
    -

    Constructor method

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [config={}] - Object - optional - - -
      - -
      - -
    • -
    • - [docpadConfig={}] - Object - optional - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    getConfig

    - - () - - - Object - - - - - - - - -
    -

    - Defined in - src/lib/testers.coffee:128 -

    - - - -
    - -
    -

    Get tester Configuration

    - -
    - - -
    -

    Returns:

    - -
    - Object: -
    -
    - - -
    -
    -

    getPlugin

    - - () - - - Object - - - - - - - - -
    -

    - Defined in - src/lib/testers.coffee:136 -

    - - - -
    - -
    -

    Get the plugin instance

    - -
    - - -
    -

    Returns:

    - -
    - Object: -

    the plugin

    - -
    -
    - - -
    -
    -

    testCreate

    - - () - - - - - - - - -
    -

    - Defined in - src/lib/testers.coffee:145 -

    - - - -
    - -
    -

    Create the DocPad instance

    - -
    - - - - -
    -
    -

    - - () - - - - - - - - -
    -

    - Defined in - src/lib/testers.coffee:175 -

    - - - -
    - -
    -

    Test Loaded

    - -
    - - - - -
    -
    -

    - - () - - - - - - - - -
    -

    - Defined in - src/lib/testers.coffee:206 -

    - - - -
    - -
    -

    Test generate

    - -
    - - - - -
    -
    -

    - - () - - - - - - - - -
    -

    - Defined in - src/lib/testers.coffee:222 -

    - - - -
    - -
    -

    Test everything

    - -
    - - - - -
    -
    -

    finish

    - - () - - - - - - - - -
    -

    - Defined in - src/lib/testers.coffee:243 -

    - - - -
    - -
    -

    Finish

    - -
    - - - - -
    -
    - -
    -

    Properties

    - -
    -

    - Object - - - - - -
    -

    - Defined in - src/lib/testers.coffee:48 -

    - - -
    - -
    -

    Default plugin config

    - -
    - - - -
    -
    -

    - Object - - - - - -
    -

    - Defined in - src/lib/testers.coffee:62 -

    - - -
    - -
    -

    Default DocPad config

    - -
    - - - -
    -
    -

    - Object - - - private - - - -
    -

    - Defined in - src/lib/testers.coffee:81 -

    - - -
    - -
    -

    The DocPad instance

    - -
    - - - -
    -
    - - -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/classes/QueryCollection.html b/docs/classes/QueryCollection.html deleted file mode 100644 index 0925fdfd..00000000 --- a/docs/classes/QueryCollection.html +++ /dev/null @@ -1,186 +0,0 @@ - - - - - QueryCollection - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    QueryCollection Class

    -
    - -
    - Extends queryEngine.QueryCollection -
    - -
    - Defined in: src/lib/base.coffee:83 -
    - - -
    - - -
    -

    Base class for the DocPad query collection object -Extends the bevry QueryEngine object -http://github.com/bevry/query-engine

    - -
    - -
    -

    Constructor

    -
    -

    QueryCollection

    - - () - - - - - - - - -
    -

    - Defined in - src/lib/base.coffee:83 -

    - - - -
    - -
    - -
    - - - - -
    -
    - -
    - - -
    -
    -

    Item Index

    - - - - -
    - - - - -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/classes/ScriptCollection.html b/docs/classes/ScriptCollection.html deleted file mode 100644 index 4d77e60f..00000000 --- a/docs/classes/ScriptCollection.html +++ /dev/null @@ -1,356 +0,0 @@ - - - - - ScriptCollection - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    ScriptCollection Class

    -
    - -
    - Extends ElementsCollection -
    - - - - -
    - - -
    -

    Scripts collection class. A DocPad -project's script file paths

    - -
    - -
    -

    Constructor

    -
    -

    ScriptCollection

    - - () - - - - - - - - -
    -

    - Defined in - src/lib/collections/scripts.coffee:14 -

    - - - -
    - -
    - -
    - - - - -
    -
    - -
    - - -
    -
    -

    Item Index

    - -
    -

    Methods

    - - -
    - -
    -

    Properties

    - - -
    - - -
    - -
    -

    Methods

    - -
    -

    add

    - -
    - (
      -
    • - values -
    • -
    • - opts -
    • -
    ) -
    - - - - - - - - -
    -

    Inherited from - - ElementsCollection - - but overwritten in - src/lib/collections/scripts.coffee:23 -

    - - - -
    - -
    -

    Add an element to the collection -Right now we just support strings

    - -
    - -
    -

    Parameters:

    - -
      -
    • - values - Array - - -
      -

      string array of file paths

      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    toHTML

    - - () - - - String - - - - - - - - - - -
    -

    Create a way to output our elements to HTML

    - -
    - - -
    -

    Returns:

    - -
    - String: -
    -
    - - -
    -
    - -
    -

    Properties

    - -
    -

    model

    - Object - - - - - - - -
    -

    Base Model for all items in this collection

    - -
    - - - -
    -
    - - -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/classes/ServerTester.html b/docs/classes/ServerTester.html deleted file mode 100644 index cc54738c..00000000 --- a/docs/classes/ServerTester.html +++ /dev/null @@ -1,553 +0,0 @@ - - - - - ServerTester - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    ServerTester Class

    -
    - -
    - Extends PluginTester -
    - -
    - Defined in: src/lib/testers.coffee:269 -
    - - -
    - - -
    -

    Rednderer tester

    - -
    - -
    -

    Constructor

    -
    -

    ServerTester

    - - () - - - - - - - - -
    -

    - Defined in - src/lib/testers.coffee:269 -

    - - - -
    - -
    - -
    - - - - -
    -
    - -
    - - -
    -
    -

    Item Index

    - -
    -

    Methods

    - - -
    - -
    -

    Properties

    - -
      -
    • - test - -
    • -
    • - - -
    • -
    -
    - - -
    - -
    -

    Methods

    - -
    -

    constructor

    - -
    - (
      -
    • - [config={}] -
    • -
    • - [docpadConfig={}] -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

    Inherited from - PluginTester: - src/lib/testers.coffee:88 -

    - - - -
    - -
    -

    Constructor method

    - -
    - -
    -

    Parameters:

    - -
      -
    • - [config={}] - Object - optional - - -
      - -
      - -
    • -
    • - [docpadConfig={}] - Object - optional - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    getConfig

    - - () - - - Object - - - - - - - - -
    -

    Inherited from - PluginTester: - src/lib/testers.coffee:128 -

    - - - -
    - -
    -

    Get tester Configuration

    - -
    - - -
    -

    Returns:

    - -
    - Object: -
    -
    - - -
    -
    -

    getPlugin

    - - () - - - Object - - - - - - - - -
    -

    Inherited from - PluginTester: - src/lib/testers.coffee:136 -

    - - - -
    - -
    -

    Get the plugin instance

    - -
    - - -
    -

    Returns:

    - -
    - Object: -

    the plugin

    - -
    -
    - - -
    -
    -

    testCreate

    - - () - - - - - - - - -
    -

    Inherited from - PluginTester: - src/lib/testers.coffee:145 -

    - - - -
    - -
    -

    Create the DocPad instance

    - -
    - - - - -
    -
    -

    - - () - - - - - - - - -
    -

    Inherited from - - PluginTester - - but overwritten in - src/lib/testers.coffee:175 -

    - - - -
    - -
    -

    Test Loaded

    - -
    - - - - -
    -
    -

    finish

    - - () - - - - - - - - -
    -

    Inherited from - PluginTester: - src/lib/testers.coffee:243 -

    - - - -
    - -
    -

    Finish

    - -
    - - - - -
    -
    - -
    -

    Properties

    - -
    -

    test

    - Unknown - - - - - -
    -

    - Defined in - src/lib/testers.coffee:335 -

    - - -
    - -
    -

    Test a plugin -test({pluginPath: String})

    - -
    - - - -
    -
    -

    - Object - - - - - -
    -

    Inherited from - - PluginTester - - but overwritten in - src/lib/testers.coffee:48 -

    - - -
    - -
    -

    Default plugin config

    - -
    - - - -
    -
    - - -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/classes/StylesCollection.html b/docs/classes/StylesCollection.html deleted file mode 100644 index 3b30c5f3..00000000 --- a/docs/classes/StylesCollection.html +++ /dev/null @@ -1,356 +0,0 @@ - - - - - StylesCollection - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    StylesCollection Class

    -
    - -
    - Extends ElementsCollection -
    - - - - -
    - - -
    -

    Styles collection class. A DocPad -project's style (css) file paths

    - -
    - -
    -

    Constructor

    -
    -

    StylesCollection

    - - () - - - - - - - - -
    -

    - Defined in - src/lib/collections/styles.coffee:14 -

    - - - -
    - -
    - -
    - - - - -
    -
    - -
    - - -
    -
    -

    Item Index

    - -
    -

    Methods

    - - -
    - -
    -

    Properties

    - - -
    - - -
    - -
    -

    Methods

    - -
    -

    add

    - -
    - (
      -
    • - values -
    • -
    • - opts -
    • -
    ) -
    - - - - - - - - -
    -

    Inherited from - - ElementsCollection - - but overwritten in - src/lib/collections/styles.coffee:23 -

    - - - -
    - -
    -

    Add an element to the collection -Right now we just support strings

    - -
    - -
    -

    Parameters:

    - -
      -
    • - values - Array - - -
      -

      string array of file paths

      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    toHTML

    - - () - - - String - - - - - - - - - - -
    -

    Create a way to output our elements to HTML

    - -
    - - -
    -

    Returns:

    - -
    - String: -
    -
    - - -
    -
    - -
    -

    Properties

    - -
    -

    model

    - Object - - - - - - - -
    -

    Base Model for all items in this collection

    - -
    - - - -
    -
    - - -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/classes/docpadUtil.html b/docs/classes/docpadUtil.html deleted file mode 100644 index d86e7cf0..00000000 --- a/docs/classes/docpadUtil.html +++ /dev/null @@ -1,1620 +0,0 @@ - - - - - docpadUtil - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    docpadUtil Class

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

    The DocPad Util Class. -Collection of DocPad utility methods

    - -
    - -
    -

    Constructor

    -
    -

    docpadUtil

    - - () - - - - - - static - - - -
    -

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

    - - - -
    - -
    - -
    - - - - -
    -
    - -
    - - -
    -
    -

    Item Index

    - -
    -

    Methods

    - - -
    - - - -
    - -
    -

    Methods

    - -
    -

    action

    - -
    - (
      -
    • - action -
    • -
    • - opts -
    • -
    • - next -
    • -
    ) -
    - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Perform an action -next(err,...), ... = any special arguments from the action -this should be it's own npm module -as we also use the concept of actions in a few other packages. -Important concept in DocPad.

    - -
    - -
    -

    Parameters:

    - -
      -
    • - action - Object - - -
      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    • - next - Function - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    getBasename

    - -
    - (
      -
    • - filename -
    • -
    ) -
    - - - String - - - - - - - - -
    -

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

    - - - -
    - -
    -

    get a filename without the extension

    - -
    - -
    -

    Parameters:

    - -
      -
    • - filename - String - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - String: -

    base name

    - -
    -
    - - -
    -
    -

    getDefaultLogLevel

    - - () - - - Number - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Get Default Log Level

    - -
    - - -
    -

    Returns:

    - -
    - Number: -

    default log level

    - -
    -
    - - -
    -
    -

    getDirPath

    - -
    - (
      -
    • - path -
    • -
    ) -
    - - - String - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the directory path. -Wrapper around the node.js path.dirname method

    - -
    - -
    -

    Parameters:

    - -
      -
    • - path - String - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - String: -
    -
    - - -
    -
    -

    getExtension

    - -
    - (
      -
    • - extensions -
    • -
    ) -
    - - - String - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the extension from a bunch of extensions

    - -
    - -
    -

    Parameters:

    - -
      -
    • - extensions - Array - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - String: -

    the extension

    - -
    -
    - - -
    -
    -

    getExtensions

    - -
    - (
      -
    • - filename -
    • -
    ) -
    - - - Array - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the extensions of a filename

    - -
    - -
    -

    Parameters:

    - -
      -
    • - filename - String - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Array: -

    array of string

    - -
    -
    - - -
    -
    -

    getFilename

    - -
    - (
      -
    • - path -
    • -
    ) -
    - - - String - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the file name. -Wrapper around the node.js path.basename method

    - -
    - -
    -

    Parameters:

    - -
      -
    • - path - String - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - String: -
    -
    - - -
    -
    -

    getLocalDocPadExecutable

    - - () - - - String - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Get Local DocPad Installation Executable - ie -not the global installation

    - -
    - - -
    -

    Returns:

    - -
    - String: -

    the path to the local DocPad executable

    - -
    -
    - - -
    -
    -

    getLocalDocPadExecutableExistance

    - - () - - - Boolean - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Does the local DocPad Installation Exist?

    - -
    - - -
    -

    Returns:

    - -
    - Boolean: -
    -
    - - -
    -
    -

    getOutFilename

    - -
    - (
      -
    • - basename -
    • -
    • - extension -
    • -
    ) -
    - - - String - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the DocPad out file name

    - -
    - -
    -

    Parameters:

    - -
      -
    • - basename - String - - -
      - -
      - -
    • -
    • - extension - String - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - String: -
    -
    - - -
    -
    -

    getSlug

    - -
    - (
      -
    • - relativeBase -
    • -
    ) -
    - - - String - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the post slug from the URL

    - -
    - -
    -

    Parameters:

    - -
      -
    • - relativeBase - String - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - String: -

    the slug

    - -
    -
    - - -
    -
    -

    getUrl

    - -
    - (
      -
    • - relativePath -
    • -
    ) -
    - - - String - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Get the URL

    - -
    - -
    -

    Parameters:

    - -
      -
    • - relativePath - String - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - String: -
    -
    - - -
    -
    -

    inspect

    - -
    - (
      -
    • - obj -
    • -
    • - opts -
    • -
    ) -
    - - - String - - - - - - - - -
    -

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

    - - - -
    - -
    -

    Wrapper for the node.js method util.inspect

    - -
    - -
    -

    Parameters:

    - -
      -
    • - obj - Object - - -
      - -
      - -
    • -
    • - opts - Object - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - String: -
    -
    - - -
    -
    -

    isLocalDocPadExecutable

    - - () - - - Boolean - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Is Local DocPad Installation

    - -
    - - -
    -

    Returns:

    - -
    - Boolean: -
    -
    - - -
    -
    -

    isStandalone

    - - () - - - Object - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Is Standadlone

    - -
    - - -
    -

    Returns:

    - -
    - Object: -
    -
    - - -
    -
    -

    isStandardEncoding

    - -
    - (
      -
    • - encoding -
    • -
    ) -
    - - - Boolean - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Are we using standard encoding?

    - -
    - -
    -

    Parameters:

    - -
      -
    • - encoding - String - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Boolean: -
    -
    - - -
    -
    -

    isTravis

    - - () - - - String - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Are we executing on Travis

    - -
    - - -
    -

    Returns:

    - -
    - String: -

    The travis node version

    - -
    -
    - - -
    -
    -

    isTTY

    - - () - - - Boolean - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Is this TTY

    - -
    - - -
    -

    Returns:

    - -
    - Boolean: -
    -
    - - -
    -
    -

    isUser

    - - () - - - Boolean - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Is user

    - -
    - - -
    -

    Returns:

    - -
    - Boolean: -
    -
    - - -
    -
    -

    startLocalDocPadExecutable

    - -
    - (
      -
    • - next -
    • -
    ) -
    - - - Object - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Spawn Local DocPad Executable

    - -
    - -
    -

    Parameters:

    - -
      -
    • - next - Function - - -
      - -
      - -
    • -
    -
    - -
    -

    Returns:

    - -
    - Object: -

    don't know what

    - -
    -
    - - -
    -
    -

    wait

    - -
    - (
      -
    • - time -
    • -
    • - fn -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Wait. Wrapper for setTimeout

    - -
    - -
    -

    Parameters:

    - -
      -
    • - time - Number - - -
      - -
      - -
    • -
    • - fn - Function - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    writeError

    - -
    - (
      -
    • - err -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Write an error

    - -
    - -
    -

    Parameters:

    - -
      -
    • - err - Object - - -
      - -
      - -
    • -
    -
    - - - -
    -
    -

    writeStderr

    - -
    - (
      -
    • - data -
    • -
    ) -
    - - - - private - - - - - -
    -

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

    - - - -
    - -
    -

    Write to stderr

    - -
    - -
    -

    Parameters:

    - -
      -
    • - data - String - - -
      - -
      - -
    • -
    -
    - - - -
    -
    - - - -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/classes/index.html b/docs/classes/index.html deleted file mode 100644 index 487fe15b..00000000 --- a/docs/classes/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Redirector - - - - Click here to redirect - - diff --git a/docs/data.json b/docs/data.json deleted file mode 100644 index f91e6684..00000000 --- a/docs/data.json +++ /dev/null @@ -1,7336 +0,0 @@ -{ - "project": {}, - "files": { - "src/lib/collections/elements.coffee": { - "name": "src/lib/collections/elements.coffee", - "modules": {}, - "classes": { - "ElementsCollection": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/lib/collections/files.coffee": { - "name": "src/lib/collections/files.coffee", - "modules": {}, - "classes": { - "FilesCollection": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/lib/collections/meta.coffee": { - "name": "src/lib/collections/meta.coffee", - "modules": {}, - "classes": { - "MetaCollection": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/lib/collections/scripts.coffee": { - "name": "src/lib/collections/scripts.coffee", - "modules": {}, - "classes": { - "ScriptCollection": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/lib/collections/styles.coffee": { - "name": "src/lib/collections/styles.coffee", - "modules": {}, - "classes": { - "StylesCollection": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/lib/interfaces/console.coffee": { - "name": "src/lib/interfaces/console.coffee", - "modules": {}, - "classes": {}, - "fors": {}, - "namespaces": {} - }, - "src/lib/models/document.coffee": { - "name": "src/lib/models/document.coffee", - "modules": {}, - "classes": { - "DocumentModel": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/lib/models/file.coffee": { - "name": "src/lib/models/file.coffee", - "modules": {}, - "classes": { - "FileModel": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/lib/base.coffee": { - "name": "src/lib/base.coffee", - "modules": {}, - "classes": { - "Events": 1, - "Model": 1, - "Collection": 1, - "QueryCollection": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/lib/docpad.coffee": { - "name": "src/lib/docpad.coffee", - "modules": {}, - "classes": { - "Docpad": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/lib/plugin-loader.coffee": { - "name": "src/lib/plugin-loader.coffee", - "modules": {}, - "classes": { - "PluginLoader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/lib/plugin.coffee": { - "name": "src/lib/plugin.coffee", - "modules": {}, - "classes": { - "BasePlugin": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/lib/testers.coffee": { - "name": "src/lib/testers.coffee", - "modules": {}, - "classes": { - "PluginTester": 1, - "ServerTester": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/lib/util.coffee": { - "name": "src/lib/util.coffee", - "modules": {}, - "classes": { - "docpadUtil": 1 - }, - "fors": {}, - "namespaces": {} - } - }, - "modules": {}, - "classes": { - "ElementsCollection": { - "name": "ElementsCollection", - "shortname": "ElementsCollection", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "file": "src/lib/collections/elements.coffee", - "line": 14, - "description": "Base class for the DocPad Elements Collection object\nExtends the DocPad collection class\nhttps://github.com/docpad/docpad/blob/master/src/lib/base.coffee#L72\nUsed as the base collection class for specific collection of file types.\nIn particular metadata, scripts and styles.", - "is_constructor": 1, - "extends": "Collection" - }, - "FilesCollection": { - "name": "FilesCollection", - "shortname": "FilesCollection", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "file": "src/lib/collections/files.coffee", - "line": 15, - "description": "The DocPad files and documents query collection class\nExtends the DocPad QueryCollection class\nhttps://github.com/docpad/docpad/blob/master/src/lib/base.coffee#L91\nUsed as the query collection class for DocPad files and documents.\nThis differs from standard collections in that it provides backbone.js,\nnoSQL style methods for querying the file system. In DocPad this\nis the various files that make up a web project. Typically this is the documents,\ncss, script and image files.\n\nMost often a developer will use this class to find (and possibly sort) documents,\nsuch as blog posts, by some criteria.\n\tposts: ->", - "getcollection": "('documents').findAllLive({relativeOutDirPath: 'posts'},[{date:-1}])", - "is_constructor": 1, - "extends": "QueryCollection" - }, - "MetaCollection": { - "name": "MetaCollection", - "shortname": "MetaCollection", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "file": "src/lib/collections/meta.coffee", - "line": 11, - "description": "Meta collection class. Collection of\ndocument meta data strings", - "is_constructor": 1, - "extends": "ElementsCollection" - }, - "ScriptCollection": { - "name": "ScriptCollection", - "shortname": "ScriptCollection", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "file": "src/lib/collections/scripts.coffee", - "line": 14, - "description": "Scripts collection class. A DocPad\nproject's script file paths", - "is_constructor": 1, - "extends": "ElementsCollection" - }, - "StylesCollection": { - "name": "StylesCollection", - "shortname": "StylesCollection", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "file": "src/lib/collections/styles.coffee", - "line": 14, - "description": "Styles collection class. A DocPad\nproject's style (css) file paths", - "is_constructor": 1, - "extends": "ElementsCollection" - }, - "DocumentModel": { - "name": "DocumentModel", - "shortname": "DocumentModel", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "file": "src/lib/models/document.coffee", - "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, - "extends": "FileModel" - }, - "FileModel": { - "name": "FileModel", - "shortname": "FileModel", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "file": "src/lib/models/file.coffee", - "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" - }, - "Events": { - "name": "Events", - "shortname": "Events", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "file": "src/lib/base.coffee", - "line": 28, - "description": "Base class for the DocPad Events object\nExtends the backbone.js events object\nhttp://backbonejs.org/#Events", - "is_constructor": 1, - "extends": "queryEngine.Backbone.Events" - }, - "Model": { - "name": "Model", - "shortname": "Model", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "file": "src/lib/base.coffee", - "line": 41, - "description": "Base class for the DocPad file and document model\nExtends the backbone.js model\nhttp://backbonejs.org/#Model", - "is_constructor": 1, - "extends": "queryEngine.Backbone.Model" - }, - "Collection": { - "name": "Collection", - "shortname": "Collection", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "file": "src/lib/base.coffee", - "line": 64, - "description": "Base class for the DocPad collection object\nExtends the backbone.js collection object\nhttp://backbonejs.org/#Collection", - "is_constructor": 1, - "extends": "queryEngine.Backbone.Collection" - }, - "QueryCollection": { - "name": "QueryCollection", - "shortname": "QueryCollection", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "file": "src/lib/base.coffee", - "line": 83, - "description": "Base class for the DocPad query collection object\nExtends the bevry QueryEngine object\nhttp://github.com/bevry/query-engine", - "is_constructor": 1, - "extends": "queryEngine.QueryCollection" - }, - "Docpad": { - "name": "Docpad", - "shortname": "Docpad", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "file": "src/lib/docpad.coffee", - "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" - }, - "PluginLoader": { - "name": "PluginLoader", - "shortname": "PluginLoader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "file": "src/lib/plugin-loader.coffee", - "line": 18, - "description": "The Plugin Loader class", - "is_constructor": 1 - }, - "BasePlugin": { - "name": "BasePlugin", - "shortname": "BasePlugin", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "file": "src/lib/plugin.coffee", - "line": 15, - "description": "The base class for all DocPad plugins", - "is_constructor": 1 - }, - "PluginTester": { - "name": "PluginTester", - "shortname": "PluginTester", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "file": "src/lib/testers.coffee", - "line": 37, - "description": "The Plugin Tester class", - "is_constructor": 1 - }, - "ServerTester": { - "name": "ServerTester", - "shortname": "ServerTester", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "file": "src/lib/testers.coffee", - "line": 269, - "description": "Rednderer tester", - "extends": "PluginTester", - "is_constructor": 1 - }, - "docpadUtil": { - "name": "docpadUtil", - "shortname": "docpadUtil", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "file": "src/lib/util.coffee", - "line": 15, - "description": "The DocPad Util Class.\nCollection of DocPad utility methods", - "is_constructor": 1, - "static": 1 - } - }, - "elements": {}, - "classitems": [ - { - "file": "src/lib/collections/elements.coffee", - "line": 26, - "description": "Base Model for all items in this collection", - "itemtype": "property", - "name": "model", - "type": "Object", - "class": "ElementsCollection" - }, - { - "file": "src/lib/collections/elements.coffee", - "line": 32, - "description": "Add an element to the collection.\nRight now we just support strings.", - "itemtype": "method", - "name": "add", - "params": [ - { - "name": "values", - "description": "string array of values", - "type": "Array" - }, - { - "name": "opts", - "description": "", - "type": "Object" - } - ], - "class": "ElementsCollection" - }, - { - "file": "src/lib/collections/elements.coffee", - "line": 64, - "description": "Create a way to output our elements to HTML", - "itemtype": "method", - "name": "toHTML", - "return": { - "description": "", - "type": "String" - }, - "class": "ElementsCollection" - }, - { - "file": "src/lib/collections/files.coffee", - "line": 35, - "description": "Base Model for all items in this collection", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "model", - "type": "Object", - "class": "FilesCollection" - }, - { - "file": "src/lib/collections/files.coffee", - "line": 42, - "description": "Base Collection for all child collections", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "collection", - "type": "Object", - "class": "FilesCollection" - }, - { - "file": "src/lib/collections/files.coffee", - "line": 49, - "description": "Initialize the collection", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "initialize", - "params": [ - { - "name": "attrs", - "description": "", - "type": "Object" - }, - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - } - ], - "class": "FilesCollection" - }, - { - "file": "src/lib/collections/files.coffee", - "line": 61, - "description": "Fuzzy find one\nUseful for layout searching", - "itemtype": "method", - "name": "fuzzyFindOne", - "params": [ - { - "name": "data", - "description": "", - "type": "Object" - }, - { - "name": "sorting", - "description": "", - "type": "Object" - }, - { - "name": "paging", - "description": "", - "type": "Object" - } - ], - "return": { - "description": "the file, if found", - "type": "Object" - }, - "class": "FilesCollection" - }, - { - "file": "src/lib/collections/scripts.coffee", - "line": 23, - "description": "Add an element to the collection\nRight now we just support strings", - "itemtype": "method", - "name": "add", - "params": [ - { - "name": "values", - "description": "string array of file paths", - "type": "Array" - }, - { - "name": "opts", - "description": "", - "type": "Object" - } - ], - "class": "ScriptCollection" - }, - { - "file": "src/lib/collections/styles.coffee", - "line": 23, - "description": "Add an element to the collection\nRight now we just support strings", - "itemtype": "method", - "name": "add", - "params": [ - { - "name": "values", - "description": "string array of file paths", - "type": "Array" - }, - { - "name": "opts", - "description": "", - "type": "Object" - } - ], - "class": "StylesCollection" - }, - { - "file": "src/lib/interfaces/console.coffee", - "line": 21, - "description": "Console Interface", - "is_constructor": 1, - "class": "DocumentModel" - }, - { - "file": "src/lib/interfaces/console.coffee", - "line": 28, - "description": "Constructor method. Setup the CLI", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "constructor", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/interfaces/console.coffee", - "line": 231, - "description": "Start the CLI", - "itemtype": "method", - "name": "start", - "params": [ - { - "name": "argv", - "description": "", - "type": "Array" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/interfaces/console.coffee", - "line": 240, - "description": "Get the commander", - "itemtype": "method", - "name": "getCommander", - "return": { - "description": "the commander instance" - }, - "class": "DocumentModel" - }, - { - "file": "src/lib/interfaces/console.coffee", - "line": 248, - "description": "Destructor.", - "itemtype": "method", - "name": "destroy", - "params": [ - { - "name": "err", - "description": "", - "type": "Object" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/interfaces/console.coffee", - "line": 295, - "description": "Wrap Action", - "itemtype": "method", - "name": "wrapAction", - "params": [ - { - "name": "action", - "description": "", - "type": "Object" - }, - { - "name": "config", - "description": "", - "type": "Object" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/interfaces/console.coffee", - "line": 306, - "description": "Perform Action", - "itemtype": "method", - "name": "performAction", - "params": [ - { - "name": "action", - "description": "", - "type": "Object" - }, - { - "name": "args", - "description": "", - "type": "Object" - }, - { - "name": "config", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/interfaces/console.coffee", - "line": 357, - "description": "Extract Configuration", - "itemtype": "method", - "name": "extractConfig", - "params": [ - { - "name": "customConfig", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - } - ], - "return": { - "description": "the DocPad config", - "type": "Object" - }, - "class": "DocumentModel" - }, - { - "file": "src/lib/interfaces/console.coffee", - "line": 405, - "description": "Select a skeleton", - "itemtype": "method", - "name": "selectSkeletonCallback", - "params": [ - { - "name": "skeletonsCollection", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/interfaces/console.coffee", - "line": 446, - "description": "Welcome Callback", - "itemtype": "method", - "name": "welcomeCallback", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/interfaces/console.coffee", - "line": 597, - "description": "Prompt for input", - "itemtype": "method", - "name": "prompt", - "params": [ - { - "name": "message", - "description": "", - "type": "String" - }, - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - }, - { - "name": "next", - "description": "", - "type": "Function" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/interfaces/console.coffee", - "line": 621, - "description": "Confirm an option", - "itemtype": "method", - "name": "confirm", - "params": [ - { - "name": "message", - "description": "", - "type": "String" - }, - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - }, - { - "name": "next", - "description": "", - "type": "Function" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/interfaces/console.coffee", - "line": 648, - "description": "Choose something", - "itemtype": "method", - "name": "choose", - "params": [ - { - "name": "message", - "description": "", - "type": "String" - }, - { - "name": "choices", - "description": "", - "type": "Object" - }, - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - }, - { - "name": "next", - "description": "", - "type": "Function" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/interfaces/console.coffee", - "line": 690, - "description": "Do action", - "itemtype": "method", - "name": "action", - "params": [ - { - "name": "next", - "description": "", - "type": "Function" - }, - { - "name": "opts", - "description": "", - "type": "Object" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/interfaces/console.coffee", - "line": 702, - "description": "Action initialise", - "itemtype": "method", - "name": "init", - "params": [ - { - "name": "next", - "description": "", - "type": "Function" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/interfaces/console.coffee", - "line": 711, - "description": "Generate action", - "itemtype": "method", - "name": "generate", - "params": [ - { - "name": "next", - "description": "", - "type": "Function" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/interfaces/console.coffee", - "line": 720, - "description": "Help method", - "itemtype": "method", - "name": "help", - "params": [ - { - "name": "next", - "description": "", - "type": "Function" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/interfaces/console.coffee", - "line": 731, - "description": "Info method", - "itemtype": "method", - "name": "info", - "params": [ - { - "name": "next", - "description": "", - "type": "Function" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/interfaces/console.coffee", - "line": 743, - "description": "Update method", - "itemtype": "method", - "name": "update", - "params": [ - { - "name": "next", - "description": "", - "type": "Function" - }, - { - "name": "opts", - "description": "", - "type": "Object" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/interfaces/console.coffee", - "line": 755, - "description": "Upgrade method", - "itemtype": "method", - "name": "upgrade", - "params": [ - { - "name": "next", - "description": "", - "type": "Function" - }, - { - "name": "opts", - "description": "", - "type": "Object" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/interfaces/console.coffee", - "line": 768, - "description": "Install method", - "itemtype": "method", - "name": "install", - "params": [ - { - "name": "next", - "description": "", - "type": "Function" - }, - { - "name": "opts", - "description": "", - "type": "Object" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/interfaces/console.coffee", - "line": 784, - "description": "Uninstall method", - "itemtype": "method", - "name": "uninstall", - "params": [ - { - "name": "next", - "description": "", - "type": "Function" - }, - { - "name": "opts", - "description": "", - "type": "Object" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/interfaces/console.coffee", - "line": 800, - "description": "Render method", - "itemtype": "method", - "name": "render", - "params": [ - { - "name": "next", - "description": "", - "type": "Function" - }, - { - "name": "opts", - "description": "", - "type": "Object" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/interfaces/console.coffee", - "line": 868, - "description": "Run method", - "itemtype": "method", - "name": "run", - "params": [ - { - "name": "next", - "description": "", - "type": "Function" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/interfaces/console.coffee", - "line": 880, - "description": "Server method", - "itemtype": "method", - "name": "server", - "params": [ - { - "name": "next", - "description": "", - "type": "Function" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/interfaces/console.coffee", - "line": 889, - "description": "Clean method", - "itemtype": "method", - "name": "clean", - "params": [ - { - "name": "next", - "description": "", - "type": "Function" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/interfaces/console.coffee", - "line": 898, - "description": "Watch method", - "itemtype": "method", - "name": "watch", - "params": [ - { - "name": "next", - "description": "", - "type": "Function" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/models/document.coffee", - "line": 73, - "description": "The document model class.", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "klass", - "type": "Object", - "class": "DocumentModel" - }, - { - "file": "src/lib/models/document.coffee", - "line": 80, - "description": "String name of the model type.\nIn this case, 'document'.", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "type", - "type": "String", - "class": "DocumentModel" - }, - { - "file": "src/lib/models/document.coffee", - "line": 92, - "description": "The default attributes for any document model.", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "", - "type": "Object", - "class": "DocumentModel" - }, - { - "file": "src/lib/models/document.coffee", - "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", - "return": { - "description": "", - "type": "String or Object" - }, - "class": "DocumentModel" - }, - { - "file": "src/lib/models/document.coffee", - "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", - "params": [ - { - "name": "flag", - "description": "", - "type": "Boolean", - "optional": true, - "optdefault": "true" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/models/document.coffee", - "line": 180, - "description": "Parse our buffer and extract meaningful data from it.\nnext(err).", - "itemtype": "method", - "name": "parse", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - }, - { - "name": "next", - "description": "callback", - "type": "Object" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/models/document.coffee", - "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", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - }, - { - "name": "next", - "description": "callback", - "type": "Object" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/models/document.coffee", - "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", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - }, - { - "name": "next", - "description": "callback", - "type": "Object" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/models/document.coffee", - "line": 418, - "description": "Checks if the file has a layout.", - "itemtype": "method", - "name": "hasLayout", - "return": { - "description": "", - "type": "Boolean" - }, - "class": "DocumentModel" - }, - { - "file": "src/lib/models/document.coffee", - "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", - "params": [ - { - "name": "next", - "description": "callback", - "type": "Function" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/models/document.coffee", - "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", - "params": [ - { - "name": "next", - "description": "", - "type": "Function" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/models/document.coffee", - "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": "", - "itemtype": "method", - "name": "renderExtensions", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "callback", - "type": "Function" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/models/document.coffee", - "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": "", - "itemtype": "method", - "name": "renderDocument", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "callback", - "type": "Function" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/models/document.coffee", - "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": "", - "itemtype": "method", - "name": "renderLayouts", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "callback", - "type": "Function" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/models/document.coffee", - "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", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - }, - { - "name": "next", - "description": "callback", - "type": "Function" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/models/document.coffee", - "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", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true - }, - { - "name": "next", - "description": "callback", - "type": "Object" - } - ], - "class": "DocumentModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 59, - "description": "The file model class. This should\nbe overridden in any descending classes.", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "klass", - "type": "Object", - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 67, - "description": "String name of the model type.\nIn this case, 'file'. This should\nbe overridden in any descending classes.", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "type", - "type": "String", - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 76, - "description": "Task Group Class", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "TaskGroup", - "type": "Object", - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 83, - "description": "The out directory path to put the relative path.", - "itemtype": "property", - "name": "rootOutDirPath", - "type": "String", - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 89, - "description": "Whether or not we should detect encoding", - "itemtype": "property", - "name": "detectEncoding", - "type": "Boolean", - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "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", - "type": "Object", - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "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", - "type": "Object", - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 112, - "description": "Buffer time.", - "itemtype": "property", - "name": "bufferTime", - "type": "Object", - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 118, - "description": "The parsed file meta data (header).\nIs a Model instance.", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "meta", - "type": "Object", - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 126, - "description": "Locale information for the file", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "locale", - "type": "Object", - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 132, - "description": "Get the file's locale information", - "itemtype": "method", - "name": "getLocale", - "return": { - "description": "the locale", - "type": "Object" - }, - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 139, - "description": "Get Options. Returns an object containing\nthe properties detectEncoding, rootOutDirPath\nlocale, stat, buffer, meta and TaskGroup.", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "getOptions", - "return": { - "description": "", - "type": "Object" - }, - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 151, - "description": "Checks whether the passed key is one\nof the options.", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "isOption", - "params": [ - { - "name": "key", - "description": "", - "type": "String" - } - ], - "return": { - "description": "", - "type": "Boolean" - }, - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 164, - "description": "Extract Options.", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "extractOptions", - "params": [ - { - "name": "attrs", - "description": "", - "type": "Object" - } - ], - "return": { - "description": "the options object", - "type": "Object" - }, - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "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", - "params": [ - { - "name": "attrs", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - } - ], - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 236, - "description": "Clone the model and return the newly cloned model.", - "itemtype": "method", - "name": "clone", - "return": { - "description": "cloned file model", - "type": "Object" - }, - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 265, - "description": "The default attributes for any file model.", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "", - "type": "Object", - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 415, - "description": "File encoding helper\nopts = {path, to, from, content}", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "encode", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - } - ], - "return": { - "description": "encoded result", - "type": "Object" - }, - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "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", - "params": [ - { - "name": "buffer", - "description": "", - "type": "Object", - "optional": true - } - ], - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 460, - "description": "Get the file model's buffer object.\nReturns a node.js buffer object.", - "itemtype": "method", - "name": "getBuffer", - "return": { - "description": "node.js buffer object", - "type": "Object" - }, - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 469, - "description": "Is Buffer Outdated\nTrue if there is no buffer OR the buffer time is outdated", - "itemtype": "method", - "name": "isBufferOutdated", - "return": { - "description": "", - "type": "Boolean" - }, - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 478, - "description": "Set the node.js file stat.", - "itemtype": "method", - "name": "setStat", - "params": [ - { - "name": "stat", - "description": "", - "type": "Object" - } - ], - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 491, - "description": "Get the node.js file stat.", - "itemtype": "method", - "name": "getStat", - "return": { - "description": "the file stat", - "type": "Object" - }, - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "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", - "params": [ - { - "name": "dereference", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "true" - } - ], - "return": { - "description": "", - "type": "Object" - }, - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "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", - "params": [ - { - "name": "dereference", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "false" - } - ], - "return": { - "description": "", - "type": "Object" - }, - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "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", - "params": [ - { - "name": "args...", - "description": "", - "type": "Object", - "optional": true - } - ], - "return": { - "description": "", - "type": "Object" - }, - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 550, - "description": "Assign attributes and options to the file model.", - "itemtype": "method", - "name": "set", - "params": [ - { - "name": "attrs", - "description": "the attributes to be applied", - "type": "Array" - }, - { - "name": "opts", - "description": "the options to be applied", - "type": "Object" - } - ], - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 578, - "description": "Set defaults. Apply default attributes\nand options to the file model", - "itemtype": "method", - "name": "setDefaults", - "params": [ - { - "name": "attrs", - "description": "the attributes to be applied", - "type": "Object" - }, - { - "name": "opts", - "description": "the options to be applied", - "type": "Object" - } - ], - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 601, - "description": "Set the file model meta data,\nattributes and options in one go.", - "itemtype": "method", - "name": "setMeta", - "params": [ - { - "name": "attrs", - "description": "the attributes to be applied", - "type": "Object" - }, - { - "name": "opts", - "description": "the options to be applied", - "type": "Object" - } - ], - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 626, - "description": "Set the file model meta data defaults", - "itemtype": "method", - "name": "setMetaDefaults", - "params": [ - { - "name": "attrs", - "description": "the attributes to be applied", - "type": "Object" - }, - { - "name": "opts", - "description": "the options to be applied", - "type": "Object" - } - ], - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "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", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - } - ], - "return": { - "description": "", - "type": "String" - }, - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "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", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - } - ], - "return": { - "description": "", - "type": "String" - }, - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "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", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - } - ], - "return": { - "description": "array of extension names", - "type": "Array" - }, - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 716, - "description": "Get the file content. This will be\nthe text content if loaded or the file buffer object.", - "itemtype": "method", - "name": "getContent", - "return": { - "description": "", - "type": "String or Object" - }, - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 725, - "description": "Get the file content for output.", - "itemtype": "method", - "name": "getOutContent", - "return": { - "description": "", - "type": "String or Object" - }, - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 733, - "description": "Is this a text file? ie - not\na binary file.", - "itemtype": "method", - "name": "isText", - "return": { - "description": "", - "type": "Boolean" - }, - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 742, - "description": "Is this a binary file?", - "itemtype": "method", - "name": "isBinary", - "return": { - "description": "", - "type": "Boolean" - }, - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 750, - "description": "Set the url for the file", - "itemtype": "method", - "name": "setUrl", - "params": [ - { - "name": "url", - "description": "", - "type": "String" - } - ], - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "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", - "params": [ - { - "name": "url", - "description": "", - "type": "String or Array" - } - ], - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 788, - "description": "Removes a url from the file\nmodel (files can have more than one url).", - "itemtype": "method", - "name": "removeUrl", - "params": [ - { - "name": "userUrl", - "description": "the url to be removed", - "type": "Object" - } - ], - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "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", - "params": [ - { - "name": "relativePath", - "description": "", - "type": "String" - }, - { - "name": "parentPath", - "description": "", - "type": "String" - } - ], - "return": { - "description": "", - "type": "String" - }, - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 827, - "description": "The action runner instance bound to DocPad", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "actionRunnerInstance", - "type": "Object", - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 833, - "description": "Get the action runner instance bound to DocPad", - "itemtype": "method", - "name": "getActionRunner", - "return": { - "description": "", - "type": "Object" - }, - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 839, - "description": "Apply an action with the supplied arguments.", - "itemtype": "method", - "name": "action", - "params": [ - { - "name": "args...", - "description": "", - "type": "Object" - } - ], - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 846, - "description": "Initialize the file model with the passed\nattributes and options. Emits the init event.", - "itemtype": "method", - "name": "initialize", - "params": [ - { - "name": "attrs", - "description": "the file model attributes", - "type": "Object" - }, - { - "name": "opts", - "description": "the file model options", - "type": "Object", - "optional": true, - "optdefault": "{}" - } - ], - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "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", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - }, - { - "name": "next", - "description": "callback", - "type": "Function" - } - ], - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "line": 959, - "description": "Parse our buffer and extract meaningful data from it.\nnext(err).", - "itemtype": "method", - "name": "parse", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - }, - { - "name": "next", - "description": "callback", - "type": "Object" - } - ], - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "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", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - }, - { - "name": "next", - "description": "callback", - "type": "Object" - } - ], - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "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", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - }, - { - "name": "next", - "description": "callback", - "type": "Object" - } - ], - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "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", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - }, - { - "name": "next", - "description": "callback", - "type": "Object" - } - ], - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "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", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "callback", - "type": "Function" - } - ], - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "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", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true - }, - { - "name": "next", - "description": "callback", - "type": "Object" - } - ], - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "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", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true - }, - { - "name": "next", - "description": "callback", - "type": "Object" - } - ], - "class": "FileModel" - }, - { - "file": "src/lib/models/file.coffee", - "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", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true - }, - { - "name": "next", - "description": "callback", - "type": "Object" - } - ], - "class": "FileModel" - }, - { - "file": "src/lib/docpad.coffee", - "line": 139, - "description": "Events class\nhttps://github.com/docpad/docpad/blob/master/src/lib/base.coffee", - "itemtype": "property", - "name": "Events", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 244, - "description": "Base class for all DocPad plugins\nhttps://github.com/docpad/docpad/blob/master/src/lib/plugin.coffee", - "itemtype": "property", - "name": "BasePlugin", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 254, - "description": "DocPad's version number", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "version", - "type": "Number", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 261, - "description": "Get the DocPad version number", - "itemtype": "method", - "name": "getVersion", - "return": { - "description": "", - "type": "Number" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 270, - "description": "Get the DocPad version string", - "itemtype": "method", - "name": "getVersionString", - "return": { - "description": "", - "type": "String" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 281, - "description": "The plugin version requirements", - "itemtype": "property", - "name": "pluginVersion", - "type": "String", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 288, - "description": "Get the process platform", - "itemtype": "method", - "name": "getProcessPlatform", - "return": { - "description": "", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 295, - "description": "Get the process version string", - "itemtype": "method", - "name": "getProcessVersion", - "return": { - "description": "", - "type": "String" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 302, - "description": "The express.js server instance bound to DocPad.\nhttp://expressjs.com", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "serverExpress", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 310, - "description": "The Node.js http server instance bound to DocPad\nhttps://nodejs.org/api/http.html", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "serverHttp", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 318, - "description": "Get the DocPad express.js server instance and, optionally,\nthe node.js https server instance", - "itemtype": "method", - "name": "getServer", - "params": [ - { - "name": "both", - "description": "", - "type": "Boolean", - "optional": true, - "optdefault": "false" - } - ], - "return": { - "description": "", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 332, - "description": "Set the express.js server and node.js http server\nto bind to DocPad", - "itemtype": "method", - "name": "setServer", - "params": [ - { - "name": "servers", - "description": "", - "type": "Object" - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 349, - "description": "Destructor. Close and destroy the node.js http server", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "destroyServer", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 360, - "description": "Internal property. The caterpillar logger instances bound to DocPad", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "loggerInstances", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 367, - "description": "Get the caterpillar logger instance bound to DocPad", - "itemtype": "method", - "name": "getLogger", - "return": { - "description": "caterpillar logger", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 374, - "description": "Get all the caterpillar logger instances bound to DocPad", - "itemtype": "method", - "name": "getLoggers", - "return": { - "description": "collection of caterpillar loggers", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 381, - "description": "Sets the caterpillar logger instances bound to DocPad", - "itemtype": "method", - "name": "setLoggers", - "params": [ - { - "name": "loggers", - "description": "", - "type": "Object" - } - ], - "return": { - "description": "logger instances bound to DocPad", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 396, - "description": "Destructor. Destroy the caterpillar logger instances bound to DocPad", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "destroyLoggers", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 407, - "description": "The action runner instance bound to docpad", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "actionRunnerInstance", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 414, - "description": "Get the action runner instance bound to docpad", - "itemtype": "method", - "name": "getActionRunner", - "return": { - "description": "the action runner instance", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 421, - "description": "Apply the passed DocPad action arguments", - "itemtype": "method", - "name": "action", - "type": "Object", - "params": [ - { - "name": "args", - "description": "", - "type": "Object" - } - ], - "return": { - "description": "", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 430, - "description": "The error runner instance bound to DocPad", - "itemtype": "property", - "name": "errorRunnerInstance", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 436, - "description": "Get the error runner instance", - "itemtype": "method", - "name": "getErrorRunner", - "type": "Object", - "return": { - "description": "the error runner instance", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 443, - "description": "The track runner instance bound to DocPad", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "trackRunnerInstance", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 450, - "description": "Get the track runner instance", - "itemtype": "method", - "name": "getTrackRunner", - "return": { - "description": "the track runner instance", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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": "", - "itemtype": "property", - "name": "string array of event names", - "type": "Array", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 493, - "description": "Get the list of available events", - "itemtype": "method", - "name": "getEvents", - "return": { - "description": "string array of event names", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 507, - "description": "QueryEngine collection", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "database", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 514, - "description": "A FilesCollection of models updated\nfrom the DocPad database after each regeneration.", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "databaseTempCache FileCollection of models", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 522, - "description": "Description for getDatabase", - "itemtype": "method", - "name": "getDatabase", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 528, - "description": "Safe method for retrieving the database by\neither returning the database itself or the temporary\ndatabase cache", - "itemtype": "method", - "name": "getDatabaseSafe", - "return": { - "description": "", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 537, - "description": "Destructor. Destroy the DocPad database", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "destroyDatabase", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 551, - "description": "Files by url. Used to speed up fetching", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "filesByUrl", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 558, - "description": "Files by Selector. Used to speed up fetching", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "filesBySelector", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 565, - "description": "Files by Out Path. Used to speed up conflict detection. Do not use for anything else", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "filesByOutPath", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 572, - "description": "Blocks", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "blocks", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 589, - "description": "Get a block by block name. Optionally clone block.", - "itemtype": "method", - "name": "getBlock", - "params": [ - { - "name": "name", - "description": "", - "type": "String" - }, - { - "name": "clone", - "description": "", - "type": "Object", - "optional": true - } - ], - "return": { - "description": "block", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 603, - "description": "Set a block by name and value", - "itemtype": "method", - "name": "setBlock", - "params": [ - { - "name": "name", - "description": "", - "type": "String" - }, - { - "name": "value", - "description": "", - "type": "Object" - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 620, - "description": "Get all blocks", - "itemtype": "method", - "name": "getBlocks", - "return": { - "description": "collection of blocks", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 627, - "description": "Set all blocks", - "itemtype": "method", - "name": "setBlocks", - "params": [ - { - "name": "blocks", - "description": "", - "type": "Object" - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 637, - "description": "Apply the passed function to each block", - "itemtype": "method", - "name": "eachBlock", - "params": [ - { - "name": "fn", - "description": "", - "type": "Function" - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 646, - "description": "Destructor. Destroy all blocks", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "destroyBlocks", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 658, - "description": "The DocPad collections", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "collections", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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", - "name": "getCollection", - "params": [ - { - "name": "value", - "description": "", - "type": "String" - } - ], - "return": { - "description": "collection", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 697, - "description": "Destroy a collection by collection name or key", - "itemtype": "method", - "name": "destroyCollection", - "params": [ - { - "name": "value", - "description": "", - "type": "String" - } - ], - "return": { - "description": "description", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 723, - "description": "Add a collection", - "itemtype": "method", - "name": "addCollection", - "params": [ - { - "name": "collection", - "description": "", - "type": "Object" - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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", - "params": [ - { - "name": "name", - "description": "the name to give to the collection", - "type": "String" - }, - { - "name": "collection", - "description": "a DocPad collection", - "type": "Object" - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 773, - "description": "Get the DocPad project's collections", - "itemtype": "method", - "name": "getCollections", - "return": { - "description": "the collections", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 781, - "description": "Set the DocPad project's collections", - "itemtype": "method", - "name": "setCollections", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 794, - "description": "Apply the passed function to each collection", - "itemtype": "method", - "name": "eachCollection", - "params": [ - { - "name": "fn", - "description": "", - "type": "Function" - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 805, - "description": "Destructor. Destroy the DocPad project's collections.", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "destroyCollections", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 821, - "description": "Get all the files in the DocPad database (will use live collections)", - "itemtype": "method", - "name": "getFiles", - "params": [ - { - "name": "query", - "description": "", - "type": "Object" - }, - { - "name": "sorting", - "description": "", - "type": "Object" - }, - { - "name": "paging", - "description": "", - "type": "Object" - } - ], - "return": { - "description": "collection", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 839, - "description": "Get a single file based on a query", - "itemtype": "method", - "name": "getFile", - "params": [ - { - "name": "query", - "description": "", - "type": "Object" - }, - { - "name": "sorting", - "description": "", - "type": "Object" - }, - { - "name": "paging", - "description": "", - "type": "Object" - } - ], - "return": { - "description": "a file", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 851, - "description": "Get files at a path", - "itemtype": "method", - "name": "getFilesAtPath", - "params": [ - { - "name": "path", - "description": "", - "type": "String" - }, - { - "name": "sorting", - "description": "", - "type": "Object" - }, - { - "name": "paging", - "description": "", - "type": "Object" - } - ], - "return": { - "description": "files", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 864, - "description": "Get a file at a relative or absolute path or url", - "itemtype": "method", - "name": "getFileAtPath", - "params": [ - { - "name": "path", - "description": "", - "type": "String" - }, - { - "name": "sorting", - "description": "", - "type": "Object" - }, - { - "name": "paging", - "description": "", - "type": "Object" - } - ], - "return": { - "description": "a file", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 878, - "description": "Get a file by its url", - "itemtype": "method", - "name": "getFileByUrl", - "params": [ - { - "name": "url", - "description": "", - "type": "String" - }, - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - } - ], - "return": { - "description": "a file", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 891, - "description": "Get a file by its id", - "itemtype": "method", - "name": "getFileById", - "params": [ - { - "name": "id", - "description": "", - "type": "String" - }, - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - } - ], - "return": { - "description": "a file", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 904, - "description": "Remove the query string from a url\nPathname convention taken from document.location.pathname", - "itemtype": "method", - "name": "getUrlPathname", - "params": [ - { - "name": "url", - "description": "", - "type": "String" - } - ], - "return": { - "description": "", - "type": "String" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 914, - "description": "Get a file by its route and return\nit to the supplied callback.", - "itemtype": "method", - "name": "getFileByRoute", - "params": [ - { - "name": "url", - "description": "", - "type": "String" - }, - { - "name": "next", - "description": "", - "type": "Object", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - }, - { - "name": "file", - "description": "", - "type": "String" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 956, - "description": "Get a file by its selector", - "itemtype": "method", - "name": "getFileBySelector", - "params": [ - { - "name": "selector", - "description": "", - "type": "Object" - }, - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - } - ], - "return": { - "description": "a file", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 977, - "description": "Skeletons Collection", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "skeletonsCollection", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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", - "params": [ - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - }, - { - "name": "skeletonsCollection", - "description": "DocPad collection of skeletons", - "type": "Object" - } - ] - } - ], - "return": { - "description": "DocPad skeleton collection", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 1039, - "description": "Plugins that are loading really slow", - "itemtype": "property", - "name": "slowPlugins", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 1045, - "description": "Loaded plugins indexed by name", - "itemtype": "property", - "name": "loadedPlugins", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 1051, - "description": "A listing of all the available extensions for DocPad", - "itemtype": "property", - "name": "exchange", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 1060, - "description": "The DocPad directory", - "itemtype": "property", - "name": "corePath", - "type": "String", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 1066, - "description": "The DocPad library directory", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "libPath", - "type": "String", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 1073, - "description": "The main DocPad file", - "itemtype": "property", - "name": "mainPath", - "type": "String", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 1079, - "description": "The DocPad package.json path", - "itemtype": "property", - "name": "packagePath", - "type": "String", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 1085, - "description": "The DocPad locale path", - "itemtype": "property", - "name": "localePath", - "type": "String", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 1091, - "description": "The DocPad debug log path (docpad-debug.log)", - "itemtype": "property", - "name": "debugLogPath", - "type": "String", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 1097, - "description": "The User's configuration path (.docpad.cson)", - "itemtype": "property", - "name": "userConfigPath", - "type": "String", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 1107, - "description": "Description for initialTemplateData", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "initialTemplateData", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 1114, - "description": "Plugin's Extended Template Data", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "pluginsTemplateData", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 1121, - "description": "Get Complete Template Data", - "itemtype": "method", - "name": "getTemplateData", - "params": [ - { - "name": "userTemplateData", - "description": "", - "type": "Object" - } - ], - "return": { - "description": "templateData", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 1238, - "description": "Determined locale", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "locale", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 1246, - "description": "Get the locale (language code and locale code)", - "itemtype": "method", - "name": "getLocale", - "return": { - "description": "locale", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 1266, - "description": "Load the locale", - "itemtype": "method", - "name": "loadLocale", - "params": [ - { - "name": "code", - "description": "", - "type": "String" - } - ], - "return": { - "description": "locale", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 1295, - "description": "Get the DocPad environment, eg: development,\nproduction or static", - "itemtype": "method", - "name": "getEnvironment", - "return": { - "description": "the environment", - "type": "String" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 1305, - "description": "Get the environments", - "itemtype": "method", - "name": "getEnvironments", - "return": { - "description": "array of environment strings", - "type": "Array" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 1319, - "description": "Hash Key\nThe key that we use to hash some data before sending it to our statistic server", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "string constant", - "type": "String", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 1327, - "description": "Website Package Configuration", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "websitePackageConfig", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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": "", - "itemtype": "property", - "name": "config", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 1349, - "description": "Instance Configuration", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "instanceConfig", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 1357, - "description": "Website Configuration\nMerged into the config property", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "websiteConfig", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 1365, - "description": "User Configuraiton\nMerged into the config property", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "userConfig", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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": "", - "itemtype": "property", - "name": "initialConfig", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 1683, - "description": "Regenerate Timer\nWhen config.regenerateEvery is set to a value, we create a timer here", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "regenerateTimer", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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", - "return": { - "description": "the DocPad configuration object", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 1716, - "description": "Get the port that DocPad is listening on (eg 9778)", - "itemtype": "method", - "name": "getPort", - "return": { - "description": "the port number", - "type": "Number" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 1724, - "description": "Get the Hostname", - "itemtype": "method", - "name": "getHostname", - "return": { - "description": "", - "type": "String" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 1732, - "description": "Get address", - "itemtype": "method", - "name": "getServerUrl", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - } - ], - "return": { - "description": "", - "type": "String" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 1747, - "description": "Get simple server URL (changes 0.0.0.0, ::, and ::1 to 127.0.0.1)", - "itemtype": "method", - "name": "getSimpleServerUrl", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}", - "props": [ - { - "name": "simple", - "description": "", - "type": "Boolean", - "optional": true, - "optdefault": "true" - } - ] - } - ], - "return": { - "description": "", - "type": "String" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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", - "params": [ - { - "name": "instanceConfig", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "callback", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 2069, - "description": "Emit event, serial", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "emitSerial", - "params": [ - { - "name": "eventName", - "description": "", - "type": "String" - }, - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 2101, - "description": "Emit event, parallel", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "emitParallel", - "params": [ - { - "name": "eventName", - "description": "", - "type": "String" - }, - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 2137, - "description": "Get the ignore options for the DocPad project", - "itemtype": "method", - "name": "getIgnoreOpts", - "return": { - "description": "string array of ignore options", - "type": "Array" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 2145, - "description": "Is the supplied path ignored?", - "itemtype": "method", - "name": "isIgnoredPath", - "params": [ - { - "name": "path", - "description": "", - "type": "String" - }, - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - } - ], - "return": { - "description": "", - "type": "Boolean" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 2156, - "description": "Scan directory", - "itemtype": "method", - "name": "scandir", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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": "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": { - "description": "the watcher", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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": "", - "itemtype": "method", - "name": "ready", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - }, - { - "name": "docpadInstance", - "description": "", - "type": "Object" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 2291, - "description": "Performs the merging of the passed configuration objects", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "mergeConfigurations", - "params": [ - { - "name": "configPackages", - "description": "", - "type": "Object" - }, - { - "name": "configsToMerge", - "description": "", - "type": "Object" - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 2316, - "description": "Set the instance configuration\nby merging the properties of the passed object\nwith the existing DocPad instanceConfig object", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "setInstanceConfig", - "params": [ - { - "name": "instanceConfig", - "description": "", - "type": "Object" - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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": "", - "itemtype": "method", - "name": "setConfig", - "params": [ - { - "name": "instanceConfig", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Object", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - }, - { - "name": "config", - "description": "", - "type": "Object" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 2434, - "description": "Load the various configuration files from the\nfile system. Set the instanceConfig.\nnext(err,config)", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "load", - "params": [ - { - "name": "instanceConfig", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - }, - { - "name": "config", - "description": "", - "type": "Object" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 2568, - "description": "Update user configuration with the passed data", - "itemtype": "method", - "name": "updateUserConfig", - "params": [ - { - "name": "data", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 2600, - "description": "Load a configuration url.", - "itemtype": "method", - "name": "loadConfigUrl", - "params": [ - { - "name": "configUrl", - "description": "", - "type": "String" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - }, - { - "name": "parsedData", - "description": "", - "type": "Object" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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": "", - "itemtype": "method", - "name": "loadConfigPath", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - }, - { - "name": "parsedData", - "description": "", - "type": "Object" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 2696, - "description": "Get config paths and check that those\npaths exist", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "getConfigPath", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Object", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - }, - { - "name": "path", - "description": "", - "type": "String" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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": "", - "itemtype": "method", - "name": "extendCollections", - "params": [ - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 2883, - "description": "Reset collections. Perform a complete clean of our collections", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "resetCollections", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 2921, - "description": "Initialise git repo", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "initGitRepo", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - }, - { - "name": "results", - "description": "", - "type": "Object" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 2946, - "description": "Init node modules", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "initNodeModules", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - }, - { - "name": "results", - "description": "", - "type": "Object" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 2979, - "description": "Fix node package versions\nCombat to https://github.com/npm/npm/issues/4587#issuecomment-35370453", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "fixNodePackageVersions", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 3008, - "description": "Install node module. Same as running\n'npm install' through the command line", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "installNodeModule", - "params": [ - { - "name": "names", - "description": "", - "type": "Array" - }, - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - }, - { - "name": "result", - "description": "", - "type": "Object" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 3071, - "description": "Uninstall node module. Same as running\n'npm uninstall' through the command line", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "uninstallNodeModule", - "params": [ - { - "name": "names", - "description": "", - "type": "Array" - }, - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - }, - { - "name": "result", - "description": "", - "type": "Object" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 3127, - "description": "Set the log level", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "setLogLevel", - "params": [ - { - "name": "level", - "description": "", - "type": "Number" - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 3147, - "description": "Get the log level", - "itemtype": "method", - "name": "getLogLevel", - "return": { - "description": "the log level", - "type": "Number" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 3155, - "description": "Are we debugging?", - "itemtype": "method", - "name": "getDebugging", - "return": { - "description": "", - "type": "Boolean" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 3164, - "description": "Handle a fatal error", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "fatal", - "params": [ - { - "name": "err", - "description": "", - "type": "Object" - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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", - "params": [ - { - "name": "obj", - "description": "", - "type": "Object" - }, - { - "name": "opts", - "description": "", - "type": "Object" - } - ], - "return": { - "description": "JSON string of passed object", - "type": "String" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 3204, - "description": "Log arguments", - "itemtype": "property", - "name": "log", - "type": "Object", - "class": "Docpad", - "subprops": [ - { - "name": "args...", - "description": "", - "type": "Mixed" - } - ] - }, - { - "file": "src/lib/docpad.coffee", - "line": 3218, - "description": "Create an error object", - "itemtype": "method", - "name": "createError", - "params": [ - { - "name": "err", - "description": "", - "type": "Object" - }, - { - "name": "opts", - "description": "", - "type": "Object" - } - ], - "return": { - "description": "the error", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 3252, - "description": "Create an error (tracks it) and log it", - "itemtype": "method", - "name": "error", - "params": [ - { - "name": "err", - "description": "", - "type": "Object" - }, - { - "name": "level", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "'err'" - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 3277, - "description": "Log an error", - "itemtype": "method", - "name": "logError", - "params": [ - { - "name": "err", - "description": "", - "type": "Object" - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 3308, - "description": "Track an error in the background", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "trackError", - "params": [ - { - "name": "err", - "description": "", - "type": "Object" - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 3332, - "description": "Notify error", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "notifyError", - "params": [ - { - "name": "err", - "description": "", - "type": "Object" - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 3356, - "description": "Log an error of level 'warn'", - "itemtype": "method", - "name": "warn", - "params": [ - { - "name": "message", - "description": "", - "type": "String" - }, - { - "name": "err", - "description": "", - "type": "Object" - } - ], - "return": { - "description": "description", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 3382, - "description": "Send a notify event to plugins (like growl)", - "itemtype": "method", - "name": "notify", - "params": [ - { - "name": "message", - "description": "", - "type": "String" - }, - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 3400, - "description": "Check Request", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "checkRequest", - "params": [ - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - }, - { - "name": "res", - "description": "", - "type": "Object" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 3423, - "description": "Subscribe to the DocPad email list.", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "subscribe", - "params": [ - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 3462, - "description": "Track", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "track", - "params": [ - { - "name": "name", - "description": "", - "type": "String" - }, - { - "name": "things", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 3519, - "description": "Identify DocPad user", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "identify", - "params": [ - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 3597, - "description": "Create file model. Calls\n{{#crossLink \"DocPad/createModel:method\"}}{{/crossLink}}\nwith the 'file' modelType.", - "itemtype": "method", - "name": "createFile", - "params": [ - { - "name": "attrs", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - }, - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - } - ], - "return": { - "description": "FileModel", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 3610, - "description": "Create document model. Calls\n{{#crossLink \"DocPad/createModel:method\"}}{{/crossLink}}\nwith the 'document' modelType.", - "itemtype": "method", - "name": "createDocument", - "params": [ - { - "name": "attrs", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - }, - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - } - ], - "return": { - "description": "DocumentModel", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 3624, - "description": "Parse the files directory and\nreturn a files collection to\nthe passed callback", - "itemtype": "method", - "name": "parseFileDirectory", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - }, - { - "name": "next", - "description": "callback", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - }, - { - "name": "files", - "description": "files collection", - "type": "Object" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}", - "props": [ - { - "name": "modelType", - "description": "", - "type": "String", - "optional": true, - "optdefault": "'document'" - }, - { - "name": "collection", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "docpad.database" - }, - { - "name": "path", - "description": "", - "type": "Object", - "optional": true - } - ] - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - }, - { - "name": "files", - "description": "files collection of documents", - "type": "Object" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 3669, - "description": "Attach events to a document model.", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "attachModelEvents", - "params": [ - { - "name": "model", - "description": "", - "type": "Object" - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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", - "params": [ - { - "name": "model", - "description": "either a plain object defining the required properties, in particular\nthe file path or an actual model object", - "type": "Object" - }, - { - "name": "opts", - "description": "", - "type": "Object" - } - ], - "return": { - "description": "the model", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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", - "params": [ - { - "name": "models", - "description": "DocPad collection of models", - "type": "Object" - }, - { - "name": "opts", - "description": "", - "type": "Object" - } - ], - "return": { - "description": "the models", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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": "", - "itemtype": "method", - "name": "createModels", - "params": [ - { - "name": "models", - "description": "DocPad collection of models", - "type": "Object" - }, - { - "name": "opts", - "description": "", - "type": "Object" - } - ], - "return": { - "description": "the models", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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", - "name": "createModel", - "params": [ - { - "name": "attrs", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}", - "props": [ - { - "name": "fullPath", - "description": "the full path to the file", - "type": "String" - } - ] - }, - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}", - "props": [ - { - "name": "modelType", - "description": "either 'file' or 'document'", - "type": "String" - } - ] - } - ], - "return": { - "description": "the file or document model", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 3886, - "description": "Parse a directory and return a\nfiles collection", - "itemtype": "method", - "name": "parseDirectory", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - }, - { - "name": "next", - "description": "", - "type": "Object", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - }, - { - "name": "files", - "description": "files collection", - "type": "Object" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 3976, - "description": "Get a plugin by it's name", - "itemtype": "method", - "name": "getPlugin", - "params": [ - { - "name": "pluginName", - "description": "", - "type": "Object" - } - ], - "return": { - "description": "a DocPad plugin", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 3986, - "description": "Check if we have any plugins", - "itemtype": "method", - "name": "hasPlugins", - "return": { - "description": "", - "type": "Boolean" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 3994, - "description": "Destructor. Destroy plugins", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "destroyPlugins", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 4005, - "description": "Load plugins from the file system\nnext(err)", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "loadPlugins", - "params": [ - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 4049, - "description": "Checks if a plugin was loaded succesfully.", - "itemtype": "method", - "name": "loadedPlugin", - "params": [ - { - "name": "pluginName", - "description": "", - "type": "String" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - }, - { - "name": "loaded", - "description": "", - "type": "Boolean" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 4068, - "description": "Load a plugin from its full file path\n_next(err)", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "loadPlugin", - "params": [ - { - "name": "fileFullPath", - "description": "", - "type": "String" - }, - { - "name": "_next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "return": { - "description": "description", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 4165, - "description": "Load plugins from a directory path", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "loadPluginsIn", - "params": [ - { - "name": "pluginsPath", - "description": "", - "type": "String" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 4224, - "description": "Compare current DocPad version to the latest\nand print out the result to the console.\nUsed at startup.", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "compareVersion", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 4263, - "description": "Get DocPad's exchange data\nRequires internet access\nnext(err,exchange)", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "getExchange", - "params": [ - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - }, - { - "name": "exchange", - "description": "docpad.exchange", - "type": "Object" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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": "", - "itemtype": "method", - "name": "contextualizeFiles", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 4392, - "description": "Render the DocPad project's files.\nThe renderCollectionBefore, renderCollectionAfter,\nrenderBefore, renderAfter events are all emitted here.", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "renderFiles", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 4516, - "description": "Write rendered files to the DocPad out directory.\nThe writeBefore and writeAfter events are emitted here.", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "writeFiles", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 4612, - "description": "Has DocPad's generation process started?", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "generateStarted", - "type": "Boolean", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 4619, - "description": "Has DocPad's generation process ended?", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "generateEnded", - "type": "Boolean", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 4626, - "description": "Is DocPad currently generating?", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "generating", - "type": "Boolean", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 4633, - "description": "Has DocPad done at least one generation?\nTrue once the first generation has occured.", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "generated", - "type": "Object", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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": "", - "itemtype": "method", - "name": "createProgress", - "return": { - "description": "the progress object", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 4670, - "description": "Destructor. Destroy the progress object", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "destroyProgress", - "params": [ - { - "name": "progress", - "description": "", - "type": "Object" - } - ], - "return": { - "description": "the progress object", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 4686, - "description": "Destructor. Destroy the regeneration timer.", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "destroyRegenerateTimer", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 4703, - "description": "Create the regeneration timer", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "createRegenerateTimer", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "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", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 5110, - "description": "Load a document", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "loadDocument", - "params": [ - { - "name": "document", - "description": "", - "type": "Object" - }, - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - }, - { - "name": "document", - "description": "", - "type": "Object" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 5131, - "description": "Load and render a document", - "itemtype": "method", - "name": "loadAndRenderDocument", - "params": [ - { - "name": "document", - "description": "", - "type": "Object" - }, - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - }, - { - "name": "document", - "description": "", - "type": "Object" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 5155, - "description": "Render a document", - "itemtype": "method", - "name": "renderDocument", - "params": [ - { - "name": "document", - "description": "", - "type": "Object" - }, - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Object", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - }, - { - "name": "result", - "description": "", - "type": "Object" - }, - { - "name": "document", - "description": "", - "type": "Object" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 5177, - "description": "Render a document at a file path\nnext(err,result)", - "itemtype": "method", - "name": "renderPath", - "params": [ - { - "name": "path", - "description": "", - "type": "String" - }, - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - }, - { - "name": "result", - "description": "the rendered document", - "type": "Object" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 5201, - "description": "Render the passed content data as a\ndocument. Required option, filename\n(opts.filename)\nnext(err,result)", - "itemtype": "method", - "name": "renderData", - "params": [ - { - "name": "content", - "description": "", - "type": "String" - }, - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - }, - { - "name": "result", - "description": "the rendered document", - "type": "Object" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 5232, - "description": "Render the passed text data as a\ndocument. Required option, filename\n(opts.filename)\nnext(err,result)", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "renderText", - "params": [ - { - "name": "text", - "description": "", - "type": "String" - }, - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - }, - { - "name": "result", - "description": "the rendered content", - "type": "Object" - }, - { - "name": "document", - "description": "the rendered document model", - "type": "Object" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 5268, - "description": "Render action\nnext(err,document,result)", - "itemtype": "method", - "name": "render", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 5304, - "description": "Array of file watchers", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "watchers", - "type": "Array", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 5311, - "description": "Destructor. Destroy the watchers used\nby DocPad", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "destroyWatchers", - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 5333, - "description": "Start up file watchers used by DocPad", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "watch", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 5518, - "description": "Run an action", - "itemtype": "method", - "name": "run", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 5583, - "description": "Initialize the skeleton install process.", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "initInstall", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 5630, - "description": "Uninstall a plugin.", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "uninstall", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 5669, - "description": "Install a plugin", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "install", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 5720, - "description": "Update global NPM and DocPad", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "upgrade", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Object", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "return": { - "description": "description", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 5740, - "description": "Update the local DocPad and plugin dependencies", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "update", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Object", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 5803, - "description": "DocPad cleanup tasks.", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "clean", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Object", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "return": { - "description": "description", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 5857, - "description": "Initialize a Skeleton into to a Directory", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "initSkeleton", - "params": [ - { - "name": "skeletonModel", - "description": "", - "type": "Object" - }, - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 5957, - "description": "Install a Skeleton into a Directory", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "installSkeleton", - "params": [ - { - "name": "skeletonModel", - "description": "", - "type": "Object" - }, - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 5985, - "description": "Use a Skeleton", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "useSkeleton", - "params": [ - { - "name": "skeletonModel", - "description": "", - "type": "Object" - }, - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Object", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "return": { - "description": "description", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 6029, - "description": "Select a Skeleton", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "selectSkeleton", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - }, - { - "name": "skeletonModel", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 6058, - "description": "Skeleton Empty?", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "skeletonEmpty", - "params": [ - { - "name": "path", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 6086, - "description": "Initialize the project directory\nwith the basic skeleton.", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "skeleton", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 6117, - "description": "Initialize the project directory\nwith the basic skeleton.", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "init", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Object", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "return": { - "description": "description", - "type": "Object" - }, - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 6147, - "description": "Serve a document", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "serveDocument", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 6240, - "description": "Server Middleware: Header", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "serverMiddlewareHeader", - "params": [ - { - "name": "req", - "description": "", - "type": "Object" - }, - { - "name": "res", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Object" - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 6267, - "description": "Server Middleware: Router", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "serverMiddlewareRouter", - "params": [ - { - "name": "req", - "description": "", - "type": "Object" - }, - { - "name": "res", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function", - "props": [ - { - "name": "err", - "description": "", - "type": "Error" - } - ] - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 6299, - "description": "Server Middleware: 404", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "serverMiddleware404", - "params": [ - { - "name": "req", - "description": "", - "type": "Object" - }, - { - "name": "res", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Object" - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 6326, - "description": "Server Middleware: 500", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "serverMiddleware500", - "params": [ - { - "name": "err", - "description": "", - "type": "Object" - }, - { - "name": "req", - "description": "", - "type": "Object" - }, - { - "name": "res", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function" - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/docpad.coffee", - "line": 6350, - "description": "Configure and start up the DocPad web server.\nHttp and express server is created, extended with\nmiddleware, started up and begins listening.\nThe events serverBefore, serverExtend and\nserverAfter emitted here.", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "server", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function" - } - ], - "class": "Docpad" - }, - { - "file": "src/lib/plugin-loader.coffee", - "line": 28, - "description": "The DocPad Instance", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "docpad", - "type": "Object", - "class": "PluginLoader" - }, - { - "file": "src/lib/plugin-loader.coffee", - "line": 36, - "description": "The BasePlugin Class", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "", - "type": "Object", - "class": "PluginLoader" - }, - { - "file": "src/lib/plugin-loader.coffee", - "line": 44, - "description": "The full path of the plugin's directory", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "", - "type": "String", - "class": "PluginLoader" - }, - { - "file": "src/lib/plugin-loader.coffee", - "line": 55, - "description": "The full path of the plugin's package.json file", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "", - "type": "String", - "class": "PluginLoader" - }, - { - "file": "src/lib/plugin-loader.coffee", - "line": 62, - "description": "The parsed contents of the plugin's package.json file", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "", - "type": "Object", - "class": "PluginLoader" - }, - { - "file": "src/lib/plugin-loader.coffee", - "line": 69, - "description": "The full path of the plugin's main file", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "", - "type": "String", - "class": "PluginLoader" - }, - { - "file": "src/lib/plugin-loader.coffee", - "line": 77, - "description": "The parsed content of the plugin's main file", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "", - "type": "Object", - "class": "PluginLoader" - }, - { - "file": "src/lib/plugin-loader.coffee", - "line": 84, - "description": "The plugin name", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "", - "type": "String", - "class": "PluginLoader" - }, - { - "file": "src/lib/plugin-loader.coffee", - "line": 91, - "description": "The plugin version", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "", - "type": "String", - "class": "PluginLoader" - }, - { - "file": "src/lib/plugin-loader.coffee", - "line": 98, - "description": "Node modules path", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "", - "type": "String", - "class": "PluginLoader" - }, - { - "file": "src/lib/plugin-loader.coffee", - "line": 109, - "description": "Constructor method", - "itemtype": "method", - "name": "constructor", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object", - "props": [ - { - "name": "docpad", - "description": "The docpad instance that we are loading plugins for", - "type": "Object" - }, - { - "name": "dirPath", - "description": "The directory path of the plugin", - "type": "String" - }, - { - "name": "BasePlugin", - "description": "The base plugin class", - "type": "Object" - } - ] - } - ], - "class": "PluginLoader" - }, - { - "file": "src/lib/plugin-loader.coffee", - "line": 128, - "description": "Loads the package.json file and extracts the main path\nnext(err,exists)", - "itemtype": "method", - "name": "exists", - "params": [ - { - "name": "next", - "description": "", - "type": "Function" - } - ], - "class": "PluginLoader" - }, - { - "file": "src/lib/plugin-loader.coffee", - "line": 177, - "description": "Check if this plugin is unsupported\nBoolean value returned as a parameter\nin the passed callback\nnext(err,supported)", - "itemtype": "method", - "name": "unsupported", - "params": [ - { - "name": "next", - "description": "", - "type": "Function" - } - ], - "class": "PluginLoader" - }, - { - "file": "src/lib/plugin-loader.coffee", - "line": 232, - "description": "Installs the plugins node modules.\nnext(err)", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "install", - "params": [ - { - "name": "next", - "description": "", - "type": "Function" - } - ], - "class": "PluginLoader" - }, - { - "file": "src/lib/plugin-loader.coffee", - "line": 259, - "description": "Load in the pluginClass from the plugin file.\nThe plugin class that has been loaded is returned\nin the passed callback\nnext(err,pluginClass)", - "itemtype": "method", - "name": "load", - "params": [ - { - "name": "next", - "description": "", - "type": "Function" - } - ], - "class": "PluginLoader" - }, - { - "file": "src/lib/plugin-loader.coffee", - "line": 322, - "description": "Create an instance of a plugin\ndefined by the passed config.\nThe plugin instance is returned in\nthe passed callback.\nnext(err,pluginInstance)", - "itemtype": "method", - "name": "create", - "params": [ - { - "name": "config", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function" - } - ], - "class": "PluginLoader" - }, - { - "file": "src/lib/plugin.coffee", - "line": 22, - "description": "Add support for BasePlugin.extend(proto)", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "@extend", - "type": "Object", - "class": "BasePlugin" - }, - { - "file": "src/lib/plugin.coffee", - "line": 32, - "description": "The DocPad Instance", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "docpad", - "type": "Object", - "class": "BasePlugin" - }, - { - "file": "src/lib/plugin.coffee", - "line": 42, - "description": "The plugin name", - "itemtype": "property", - "name": "", - "type": "String", - "class": "BasePlugin" - }, - { - "file": "src/lib/plugin.coffee", - "line": 48, - "description": "The plugin config", - "itemtype": "property", - "name": "", - "type": "Object", - "class": "BasePlugin" - }, - { - "file": "src/lib/plugin.coffee", - "line": 54, - "description": "The instance config.", - "itemtype": "property", - "name": "", - "type": "Object", - "class": "BasePlugin" - }, - { - "file": "src/lib/plugin.coffee", - "line": 60, - "description": "Plugin priority", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "", - "type": "Number", - "class": "BasePlugin" - }, - { - "file": "src/lib/plugin.coffee", - "line": 67, - "description": "Constructor method for the plugin", - "itemtype": "method", - "name": "constructor", - "params": [ - { - "name": "opts", - "description": "", - "type": "Object" - } - ], - "class": "BasePlugin" - }, - { - "file": "src/lib/plugin.coffee", - "line": 96, - "description": "Set Instance Configuration", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "setInstanceConfig", - "params": [ - { - "name": "instanceConfig", - "description": "", - "type": "Object" - } - ], - "class": "BasePlugin" - }, - { - "file": "src/lib/plugin.coffee", - "line": 109, - "description": "Set Configuration", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "setConfig", - "type": "Object", - "params": [ - { - "name": "instanceConfig", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "null" - } - ], - "class": "BasePlugin" - }, - { - "file": "src/lib/plugin.coffee", - "line": 135, - "description": "Get the Configuration", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "", - "type": "Object", - "class": "BasePlugin" - }, - { - "file": "src/lib/plugin.coffee", - "line": 143, - "description": "Alias for b/c", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "bindEvents", - "class": "BasePlugin" - }, - { - "file": "src/lib/plugin.coffee", - "line": 151, - "description": "Bind Listeners", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "bindListeners", - "class": "BasePlugin" - }, - { - "file": "src/lib/plugin.coffee", - "line": 176, - "description": "Add Listeners", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "addListeners", - "class": "BasePlugin" - }, - { - "file": "src/lib/plugin.coffee", - "line": 209, - "description": "Remove Listeners", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "removeListeners", - "class": "BasePlugin" - }, - { - "file": "src/lib/plugin.coffee", - "line": 233, - "description": "Destructor. Calls removeListeners", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "destroy", - "class": "BasePlugin" - }, - { - "file": "src/lib/plugin.coffee", - "line": 243, - "description": "Is Enabled?", - "itemtype": "method", - "name": "isEnabled", - "return": { - "description": "", - "type": "Boolean" - }, - "class": "BasePlugin" - }, - { - "file": "src/lib/testers.coffee", - "line": 48, - "description": "Default plugin config", - "itemtype": "property", - "name": "", - "type": "Object", - "class": "PluginTester" - }, - { - "file": "src/lib/testers.coffee", - "line": 62, - "description": "Default DocPad config", - "itemtype": "property", - "name": "", - "type": "Object", - "class": "PluginTester" - }, - { - "file": "src/lib/testers.coffee", - "line": 81, - "description": "The DocPad instance", - "access": "private", - "tagname": "", - "itemtype": "property", - "name": "", - "type": "Object", - "class": "PluginTester" - }, - { - "file": "src/lib/testers.coffee", - "line": 88, - "description": "Constructor method", - "itemtype": "method", - "name": "constructor", - "params": [ - { - "name": "config", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - }, - { - "name": "docpadConfig", - "description": "", - "type": "Object", - "optional": true, - "optdefault": "{}" - }, - { - "name": "next", - "description": "", - "type": "Function" - } - ], - "class": "PluginTester" - }, - { - "file": "src/lib/testers.coffee", - "line": 128, - "description": "Get tester Configuration", - "itemtype": "method", - "name": "getConfig", - "return": { - "description": "", - "type": "Object" - }, - "class": "PluginTester" - }, - { - "file": "src/lib/testers.coffee", - "line": 136, - "description": "Get the plugin instance", - "itemtype": "method", - "name": "getPlugin", - "return": { - "description": "the plugin", - "type": "Object" - }, - "class": "PluginTester" - }, - { - "file": "src/lib/testers.coffee", - "line": 145, - "description": "Create the DocPad instance", - "itemtype": "method", - "name": "testCreate", - "class": "PluginTester" - }, - { - "file": "src/lib/testers.coffee", - "line": 175, - "description": "Test Loaded", - "itemtype": "method", - "name": "", - "class": "PluginTester" - }, - { - "file": "src/lib/testers.coffee", - "line": 206, - "description": "Test generate", - "itemtype": "method", - "name": "", - "class": "PluginTester" - }, - { - "file": "src/lib/testers.coffee", - "line": 222, - "description": "Test everything", - "itemtype": "method", - "name": "", - "type": "Object", - "class": "PluginTester" - }, - { - "file": "src/lib/testers.coffee", - "line": 243, - "description": "Finish", - "itemtype": "method", - "name": "finish", - "class": "PluginTester" - }, - { - "file": "src/lib/testers.coffee", - "line": 335, - "description": "Test a plugin\ntest({pluginPath: String})", - "itemtype": "property", - "name": "test", - "class": "ServerTester" - }, - { - "file": "src/lib/util.coffee", - "line": 24, - "description": "Write to stderr", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "writeStderr", - "params": [ - { - "name": "data", - "description": "", - "type": "String" - } - ], - "class": "docpadUtil" - }, - { - "file": "src/lib/util.coffee", - "line": 36, - "description": "Write an error", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "writeError", - "params": [ - { - "name": "err", - "description": "", - "type": "Object" - } - ], - "class": "docpadUtil" - }, - { - "file": "src/lib/util.coffee", - "line": 45, - "description": "Wait. Wrapper for setTimeout", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "wait", - "params": [ - { - "name": "time", - "description": "", - "type": "Number" - }, - { - "name": "fn", - "description": "", - "type": "Function" - } - ], - "class": "docpadUtil" - }, - { - "file": "src/lib/util.coffee", - "line": 55, - "description": "Get Default Log Level", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "getDefaultLogLevel", - "return": { - "description": "default log level", - "type": "Number" - }, - "class": "docpadUtil" - }, - { - "file": "src/lib/util.coffee", - "line": 67, - "description": "Are we executing on Travis", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "isTravis", - "return": { - "description": "The travis node version", - "type": "String" - }, - "class": "docpadUtil" - }, - { - "file": "src/lib/util.coffee", - "line": 76, - "description": "Is this TTY", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "isTTY", - "return": { - "description": "", - "type": "Boolean" - }, - "class": "docpadUtil" - }, - { - "file": "src/lib/util.coffee", - "line": 86, - "description": "Is Standadlone", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "isStandalone", - "return": { - "description": "", - "type": "Object" - }, - "class": "docpadUtil" - }, - { - "file": "src/lib/util.coffee", - "line": 95, - "description": "Is user", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "isUser", - "return": { - "description": "", - "type": "Boolean" - }, - "class": "docpadUtil" - }, - { - "file": "src/lib/util.coffee", - "line": 104, - "description": "Wrapper for the node.js method util.inspect", - "itemtype": "method", - "name": "inspect", - "params": [ - { - "name": "obj", - "description": "", - "type": "Object" - }, - { - "name": "opts", - "description": "", - "type": "Object" - } - ], - "return": { - "description": "", - "type": "String" - }, - "class": "docpadUtil" - }, - { - "file": "src/lib/util.coffee", - "line": 126, - "description": "Are we using standard encoding?", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "isStandardEncoding", - "params": [ - { - "name": "encoding", - "description": "", - "type": "String" - } - ], - "return": { - "description": "", - "type": "Boolean" - }, - "class": "docpadUtil" - }, - { - "file": "src/lib/util.coffee", - "line": 137, - "description": "Get Local DocPad Installation Executable - ie\nnot the global installation", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "getLocalDocPadExecutable", - "return": { - "description": "the path to the local DocPad executable", - "type": "String" - }, - "class": "docpadUtil" - }, - { - "file": "src/lib/util.coffee", - "line": 147, - "description": "Is Local DocPad Installation", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "isLocalDocPadExecutable", - "return": { - "description": "", - "type": "Boolean" - }, - "class": "docpadUtil" - }, - { - "file": "src/lib/util.coffee", - "line": 156, - "description": "Does the local DocPad Installation Exist?", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "getLocalDocPadExecutableExistance", - "return": { - "description": "", - "type": "Boolean" - }, - "class": "docpadUtil" - }, - { - "file": "src/lib/util.coffee", - "line": 165, - "description": "Spawn Local DocPad Executable", - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "startLocalDocPadExecutable", - "params": [ - { - "name": "next", - "description": "", - "type": "Function" - } - ], - "return": { - "description": "don't know what", - "type": "Object" - }, - "class": "docpadUtil" - }, - { - "file": "src/lib/util.coffee", - "line": 186, - "description": "get a filename without the extension", - "itemtype": "method", - "name": "getBasename", - "params": [ - { - "name": "filename", - "description": "", - "type": "String" - } - ], - "return": { - "description": "base name", - "type": "String" - }, - "class": "docpadUtil" - }, - { - "file": "src/lib/util.coffee", - "line": 200, - "description": "Get the extensions of a filename", - "itemtype": "method", - "name": "getExtensions", - "params": [ - { - "name": "filename", - "description": "", - "type": "String" - } - ], - "return": { - "description": "array of string", - "type": "Array" - }, - "class": "docpadUtil" - }, - { - "file": "src/lib/util.coffee", - "line": 211, - "description": "Get the extension from a bunch of extensions", - "itemtype": "method", - "name": "getExtension", - "params": [ - { - "name": "extensions", - "description": "", - "type": "Array" - } - ], - "return": { - "description": "the extension", - "type": "String" - }, - "class": "docpadUtil" - }, - { - "file": "src/lib/util.coffee", - "line": 228, - "description": "Get the directory path.\nWrapper around the node.js path.dirname method", - "itemtype": "method", - "name": "getDirPath", - "params": [ - { - "name": "path", - "description": "", - "type": "String" - } - ], - "return": { - "description": "", - "type": "String" - }, - "class": "docpadUtil" - }, - { - "file": "src/lib/util.coffee", - "line": 238, - "description": "Get the file name.\nWrapper around the node.js path.basename method", - "itemtype": "method", - "name": "getFilename", - "params": [ - { - "name": "path", - "description": "", - "type": "String" - } - ], - "return": { - "description": "", - "type": "String" - }, - "class": "docpadUtil" - }, - { - "file": "src/lib/util.coffee", - "line": 248, - "description": "Get the DocPad out file name", - "itemtype": "method", - "name": "getOutFilename", - "params": [ - { - "name": "basename", - "description": "", - "type": "String" - }, - { - "name": "extension", - "description": "", - "type": "String" - } - ], - "return": { - "description": "", - "type": "String" - }, - "class": "docpadUtil" - }, - { - "file": "src/lib/util.coffee", - "line": 261, - "description": "Get the URL", - "itemtype": "method", - "name": "getUrl", - "params": [ - { - "name": "relativePath", - "description": "", - "type": "String" - } - ], - "return": { - "description": "", - "type": "String" - }, - "class": "docpadUtil" - }, - { - "file": "src/lib/util.coffee", - "line": 270, - "description": "Get the post slug from the URL", - "itemtype": "method", - "name": "getSlug", - "params": [ - { - "name": "relativeBase", - "description": "", - "type": "String" - } - ], - "return": { - "description": "the slug", - "type": "String" - }, - "class": "docpadUtil" - }, - { - "file": "src/lib/util.coffee", - "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", - "params": [ - { - "name": "action", - "description": "", - "type": "Object" - }, - { - "name": "opts", - "description": "", - "type": "Object" - }, - { - "name": "next", - "description": "", - "type": "Function" - } - ], - "class": "docpadUtil" - } - ], - "warnings": [ - { - "message": "unknown tag: getcollection", - "line": " src/lib/collections/files.coffee:15" - }, - { - "message": "unknown tag: docpad", - "line": " src/lib/models/document.coffee:25" - }, - { - "message": "unknown tag: getcollection", - "line": " src/lib/docpad.coffee:665" - }, - { - "message": "unknown tag: docpad", - "line": " src/lib/docpad.coffee:3787" - }, - { - "message": "Missing item type\nConsole Interface", - "line": " src/lib/interfaces/console.coffee:21" - } - ] -} \ No newline at end of file diff --git a/docs/elements/index.html b/docs/elements/index.html deleted file mode 100644 index 487fe15b..00000000 --- a/docs/elements/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Redirector - - - - Click here to redirect - - diff --git a/docs/files/index.html b/docs/files/index.html deleted file mode 100644 index 487fe15b..00000000 --- a/docs/files/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Redirector - - - - Click here to redirect - - diff --git a/docs/files/src_lib_base.coffee.html b/docs/files/src_lib_base.coffee.html deleted file mode 100644 index 5d2c12c2..00000000 --- a/docs/files/src_lib_base.coffee.html +++ /dev/null @@ -1,228 +0,0 @@ - - - - - src/lib/base.coffee - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    File: src/lib/base.coffee

    - -
    -
    -# =====================================
    -# Requires
    -
    -# External
    -extendr = require('extendr')
    -queryEngine = require('query-engine')
    -
    -
    -# =====================================
    -# Helpers
    -
    -# Log a message
    -log = (args...) ->
    -	args.unshift('log')
    -	@emit.apply(@, args)
    -	@
    -emit = (args...) ->
    -	@trigger.apply(@, args)
    -
    -
    -# =====================================
    -# Classes
    -
    -
    -# -------------------------------------
    -# Backbone
    -
    -###*
    -# Base class for the DocPad Events object
    -# Extends the backbone.js events object
    -# http://backbonejs.org/#Events
    -# @class Events
    -# @constructor
    -# @extends queryEngine.Backbone.Events
    -###
    -class Events
    -	log: log
    -	emit: emit
    -extendr.extend(Events::, queryEngine.Backbone.Events)
    -
    -###*
    -# Base class for the DocPad file and document model
    -# Extends the backbone.js model
    -# http://backbonejs.org/#Model
    -# @class Model
    -# @constructor
    -# @extends queryEngine.Backbone.Model
    -###
    -class Model extends queryEngine.Backbone.Model
    -	log: log
    -	emit: emit
    -
    -	# Set Defaults
    -	setDefaults: (attrs={},opts) ->
    -		# Extract
    -		set = {}
    -		for own key,value of attrs
    -			set[key] = value  if @get(key) is @defaults?[key]
    -
    -		# Forward
    -		return @set(set, opts)
    -
    -
    -###*
    -# Base class for the DocPad collection object
    -# Extends the backbone.js collection object
    -# http://backbonejs.org/#Collection
    -# @class Collection
    -# @constructor
    -# @extends queryEngine.Backbone.Collection
    -###
    -class Collection extends queryEngine.Backbone.Collection
    -	log: log
    -	emit: emit
    -	destroy: =>
    -		@emit('destroy')
    -		@off().stopListening()
    -		@
    -Collection::model = Model
    -Collection::collection = Collection
    -
    -
    -###*
    -# Base class for the DocPad query collection object
    -# Extends the bevry QueryEngine object
    -# http://github.com/bevry/query-engine
    -# @class QueryCollection
    -# @constructor
    -# @extends queryEngine.QueryCollection
    -###
    -class QueryCollection extends queryEngine.QueryCollection
    -	log: log
    -	emit: emit
    -
    -	setParentCollection: ->
    -		super
    -		parentCollection = @getParentCollection()
    -		parentCollection.on('destroy', @destroy)
    -		@
    -
    -	destroy: =>
    -		@emit('destroy')
    -		@off().stopListening()
    -		@
    -QueryCollection::model = Model
    -QueryCollection::collection = QueryCollection
    -
    -
    -# =====================================
    -# Export our base models
    -module.exports = {Events, Model, Collection, QueryCollection}
    -
    -    
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/files/src_lib_collections_elements.coffee.html b/docs/files/src_lib_collections_elements.coffee.html deleted file mode 100644 index 1aeb897d..00000000 --- a/docs/files/src_lib_collections_elements.coffee.html +++ /dev/null @@ -1,198 +0,0 @@ - - - - - src/lib/collections/elements.coffee - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    File: src/lib/collections/elements.coffee

    - -
    -
    -# =====================================
    -# Requires
    -
    -# External
    -typeChecker = require('typechecker')
    -
    -# Local
    -{Collection,Model} = require('../base')
    -
    -
    -# =====================================
    -# Classes
    -
    -###*
    -# Base class for the DocPad Elements Collection object
    -# Extends the DocPad collection class
    -# https://github.com/docpad/docpad/blob/master/src/lib/base.coffee#L72
    -# Used as the base collection class for specific collection of file types.
    -# In particular metadata, scripts and styles.
    -# @class ElementsCollection
    -# @constructor
    -# @extends Collection
    -###
    -class ElementsCollection extends Collection
    -
    -	###*
    -	# Base Model for all items in this collection
    -	# @property {Object} model
    -	###
    -	model: Model
    -
    -	###*
    -	# Add an element to the collection.
    -	# Right now we just support strings.
    -	# @method add
    -	# @param {Array} values string array of values
    -	# @param {Object} opts
    -	###
    -	add: (values,opts) ->
    -		# Ensure array
    -		if typeChecker.isArray(values)
    -			values = values.slice()
    -		else if values
    -			values = [values]
    -		else
    -			values = []
    -
    -		# Convert string based array properties into html
    -		for value,key in values
    -			if typeChecker.isString(value)
    -				values[key] = new Model({html:value})
    -
    -		# Call the super with our values
    -		super(values, opts)
    -
    -		# Chain
    -		@
    -
    -	# Chain
    -	set: -> super; @
    -	remove: -> super; @
    -	reset: -> super; @
    -
    -	###*
    -	# Create a way to output our elements to HTML
    -	# @method toHTML
    -	# @return {String}
    -	###
    -	toHTML: ->
    -		html = ''
    -		@forEach (item) ->
    -			html += item.get('html') or ''
    -		html
    -
    -	# Join alias toHTML for b/c
    -	join: -> @toHTML()
    -
    -
    -# =====================================
    -# Export
    -module.exports = ElementsCollection
    -
    -    
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/files/src_lib_collections_files.coffee.html b/docs/files/src_lib_collections_files.coffee.html deleted file mode 100644 index f7294486..00000000 --- a/docs/files/src_lib_collections_files.coffee.html +++ /dev/null @@ -1,210 +0,0 @@ - - - - - src/lib/collections/files.coffee - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    File: src/lib/collections/files.coffee

    - -
    -
    -# =====================================
    -# Requires
    -
    -# Standard Library
    -pathUtil = require('path')
    -
    -# Local
    -{QueryCollection,Model} = require('../base')
    -FileModel = require('../models/file')
    -
    -
    -# =====================================
    -# Classes
    -
    -###*
    -# The DocPad files and documents query collection class
    -# Extends the DocPad QueryCollection class
    -# https://github.com/docpad/docpad/blob/master/src/lib/base.coffee#L91
    -# Used as the query collection class for DocPad files and documents.
    -# This differs from standard collections in that it provides backbone.js,
    -# noSQL style methods for querying the file system. In DocPad this
    -# is the various files that make up a web project. Typically this is the documents,
    -# css, script and image files.
    -#
    -# Most often a developer will use this class to find (and possibly sort) documents,
    -# such as blog posts, by some criteria.
    -# 	posts: ->
    -# 		@getCollection('documents').findAllLive({relativeOutDirPath: 'posts'},[{date:-1}])
    -# @class FilesCollection
    -# @constructor
    -# @extends QueryCollection
    -###
    -class FilesCollection extends QueryCollection
    -
    -	###*
    -	# Base Model for all items in this collection
    -	# @private
    -	# @property {Object} model
    -	###
    -	model: FileModel
    -
    -	###*
    -	# Base Collection for all child collections
    -	# @private
    -	# @property {Object} collection
    -	###
    -	collection: FilesCollection
    -
    -	###*
    -	# Initialize the collection
    -	# @private
    -	# @method initialize
    -	# @param {Object} attrs
    -	# @param {Object} [opts={}]
    -	###
    -	initialize: (attrs,opts={}) ->
    -		@options ?= {}
    -		@options.name ?= opts.name or null
    -		super
    -
    -	###*
    -	# Fuzzy find one
    -	# Useful for layout searching
    -	# @method fuzzyFindOne
    -	# @param {Object} data
    -	# @param {Object} sorting
    -	# @param {Object} paging
    -	# @return {Object} the file, if found
    -	###
    -	fuzzyFindOne: (data,sorting,paging) ->
    -		# Prepare
    -		escapedData = data?.replace(/[\/]/g, pathUtil.sep)
    -		queries = [
    -			{relativePath: escapedData}
    -			{relativeBase: escapedData}
    -			{url: data}
    -			{relativePath: $startsWith: escapedData}
    -			{fullPath: $startsWith: escapedData}
    -			{url: $startsWith: data}
    -		]
    -
    -		# Try the queries
    -		for query in queries
    -			file = @findOne(query, sorting, paging)
    -			return file  if file
    -
    -		# Didn't find a file
    -		return null
    -
    -
    -# =====================================
    -# Export
    -module.exports = FilesCollection
    -
    -    
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/files/src_lib_collections_meta.coffee.html b/docs/files/src_lib_collections_meta.coffee.html deleted file mode 100644 index 73fb452c..00000000 --- a/docs/files/src_lib_collections_meta.coffee.html +++ /dev/null @@ -1,140 +0,0 @@ - - - - - src/lib/collections/meta.coffee - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    File: src/lib/collections/meta.coffee

    - -
    -
    -# =====================================
    -# Requires
    -
    -# Local
    -ElementsCollection = require('./elements')
    -
    -
    -# =====================================
    -# Classes
    -
    -###*
    -# Meta collection class. Collection of
    -# document meta data strings
    -# @class MetaCollection
    -# @constructor
    -# @extends ElementsCollection
    -###
    -class MetaCollection extends ElementsCollection
    -
    -
    -# =====================================
    -# Export
    -module.exports = MetaCollection
    -
    -    
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/files/src_lib_collections_scripts.coffee.html b/docs/files/src_lib_collections_scripts.coffee.html deleted file mode 100644 index 8364f254..00000000 --- a/docs/files/src_lib_collections_scripts.coffee.html +++ /dev/null @@ -1,186 +0,0 @@ - - - - - src/lib/collections/scripts.coffee - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    File: src/lib/collections/scripts.coffee

    - -
    -
    -# =====================================
    -# Requires
    -
    -# External
    -typeChecker = require('typechecker')
    -
    -# Local
    -ElementsCollection = require('./elements')
    -
    -
    -# =====================================
    -# Classes
    -
    -###*
    -# Scripts collection class. A DocPad
    -# project's script file paths
    -# @class ScriptCollection
    -# @constructor
    -# @extends ElementsCollection
    -###
    -class ScriptsCollection extends ElementsCollection
    -
    -	###*
    -	# Add an element to the collection
    -	# Right now we just support strings
    -	# @method add
    -	# @param {Array} values string array of file paths
    -	# @param {Object} opts
    -	###
    -	add: (values,opts) ->
    -		# Prepare
    -		opts or= {}
    -		opts.defer ?= true
    -		opts.async ?= false
    -		opts.attrs or= ''
    -		if typeChecker.isArray(values)
    -			values = values.slice()
    -		else if values
    -			values = [values]
    -		else
    -			values = []
    -
    -		# Build attrs
    -		opts.attrs += """defer="defer" """  if opts.defer
    -		opts.attrs += """async="async" """  if opts.async
    -
    -		# Convert urls into script element html
    -		for value,key in values
    -			if typeChecker.isString(value)
    -				if value[0] is '<'
    -					continue  # we are an element already, don't bother doing anything
    -				else if value.indexOf(' ') is -1
    -					# we are a url
    -					values[key] = """
    -						<script #{opts.attrs} src="#{value}"></script>
    -						"""
    -				else
    -					# we are inline
    -					values[key] = """
    -						<script #{opts.attrs}>#{value}</script>
    -						"""
    -
    -		# Call the super with our values
    -		super(values, opts)
    -
    -
    -# =====================================
    -# Export
    -module.exports = ScriptsCollection
    -
    -    
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/files/src_lib_collections_styles.coffee.html b/docs/files/src_lib_collections_styles.coffee.html deleted file mode 100644 index 5a7edce8..00000000 --- a/docs/files/src_lib_collections_styles.coffee.html +++ /dev/null @@ -1,182 +0,0 @@ - - - - - src/lib/collections/styles.coffee - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    File: src/lib/collections/styles.coffee

    - -
    -
    -# =====================================
    -# Requires
    -
    -# External
    -typeChecker = require('typechecker')
    -
    -# Local
    -ElementsCollection = require('./elements')
    -
    -
    -# =====================================
    -# Classes
    -
    -###*
    -# Styles collection class. A DocPad
    -# project's style (css) file paths
    -# @class StylesCollection
    -# @constructor
    -# @extends ElementsCollection
    -###
    -class StylesCollection extends ElementsCollection
    -
    -	###*
    -	# Add an element to the collection
    -	# Right now we just support strings
    -	# @method add
    -	# @param {Array} values string array of file paths
    -	# @param {Object} opts
    -	###
    -	add: (values,opts) ->
    -		# Prepare
    -		opts or= {}
    -		opts.attrs or= ''
    -
    -		# Ensure array
    -		if typeChecker.isArray(values)
    -			values = values.slice()
    -		else if values
    -			values = [values]
    -		else
    -			values = []
    -
    -		# Convert urls into script element html
    -		for value,key in values
    -			if typeChecker.isString(value)
    -				if value[0] is '<'
    -					continue  # we are an element already, don't bother doing anything
    -				else if value.indexOf(' ') is -1
    -					# we are a url
    -					values[key] = """
    -						<link #{opts.attrs} rel="stylesheet" href="#{value}" />
    -						"""
    -				else
    -					# we are inline
    -					values[key] = """
    -						<style #{opts.attrs}>#{value}</style>
    -						"""
    -
    -		# Call the super with our values
    -		super(values, opts)
    -
    -
    -# =====================================
    -# Export
    -module.exports = StylesCollection
    -
    -    
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/files/src_lib_docpad.coffee.html b/docs/files/src_lib_docpad.coffee.html deleted file mode 100644 index e2012d3e..00000000 --- a/docs/files/src_lib_docpad.coffee.html +++ /dev/null @@ -1,6621 +0,0 @@ - - - - - src/lib/docpad.coffee - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    File: src/lib/docpad.coffee

    - -
    -
    -##*
    -# The central module for DocPad
    -# @module DocPad
    -##
    -
    -# =====================================
    -# This block *must* come first
    -
    -# Node 0.10 compat
    -require('babel-polyfill')
    -
    -# Important
    -pathUtil = require('path')
    -lazyRequire = require('lazy-require')
    -corePath = pathUtil.resolve(__dirname, '..', '..')
    -
    -
    -# =====================================
    -# Requires
    -
    -# Standard Library
    -util     = require('util')
    -
    -# External
    -queryEngine = require('query-engine')
    -{uniq, union, pick} = require('underscore')
    -CSON = require('cson')
    -balUtil = require('bal-util')
    -scandir = require('scandirectory')
    -extendr = require('extendr')
    -eachr = require('eachr')
    -typeChecker = require('typechecker')
    -ambi = require('ambi')
    -{TaskGroup} = require('taskgroup')
    -safefs = require('safefs')
    -safeps = require('safeps')
    -ignorefs = require('ignorefs')
    -rimraf = require('rimraf')
    -superAgent = require('superagent')
    -extractOptsAndCallback = require('extract-opts')
    -{EventEmitterGrouped} = require('event-emitter-grouped')
    -
    -# Base
    -{Events,Model,Collection,QueryCollection} = require('./base')
    -
    -# Utils
    -docpadUtil = require('./util')
    -
    -# Models
    -FileModel = require('./models/file')
    -DocumentModel = require('./models/document')
    -
    -# Collections
    -FilesCollection = require('./collections/files')
    -ElementsCollection = require('./collections/elements')
    -MetaCollection = require('./collections/meta')
    -ScriptsCollection = require('./collections/scripts')
    -StylesCollection = require('./collections/styles')
    -
    -# Plugins
    -PluginLoader = require('./plugin-loader')
    -BasePlugin = require('./plugin')
    -
    -
    -# ---------------------------------
    -# Helpers
    -
    -setImmediate = global?.setImmediate or process.nextTick  # node 0.8 b/c
    -
    -
    -# ---------------------------------
    -# Variables
    -
    -isUser = docpadUtil.isUser()
    -
    -
    -###*
    -# Contains methods for managing the DocPad application.
    -# This includes managing a DocPad projects files and
    -# documents, watching directories, emitting events and
    -# managing the node.js/express.js web server.
    -# Extends https://github.com/bevry/event-emitter-grouped
    -#
    -# The class is instantiated in the docpad-server.js file
    -# which is the entry point for a DocPad application.
    -#
    -# 	new DocPad(docpadConfig, function(err, docpad) {
    -# 		if (err) {
    -# 			return docpadUtil.writeError(err);
    -# 		}
    -# 		return docpad.action(action, function(err) {
    -# 			if (err) {
    -# 				return docpadUtil.writeError(err);
    -# 			}
    -# 			return console.log('OK');
    -# 		});
    -# 	});
    -#
    -# @class Docpad
    -# @constructor
    -# @extends EventEmitterGrouped
    -###
    -class DocPad extends EventEmitterGrouped
    -	# Libraries
    -	# Here for legacy API reasons
    -	#@DocPad: DocPad
    -	#@Backbone: require('backbone')
    -	#@queryEngine: queryEngine
    -
    -	# Allow for `DocPad.create()` as an alias for `new DocPad()`
    -	# Allow for `DocPad.createInstance()` as an alias for `new DocPad()` (legacy alias)
    -	@create: (args...) -> return new @(args...)
    -	@createInstance: (args...) -> return new @(args...)
    -
    -	# Require a local DocPad file
    -	# Before v6.73.0 this allowed requiring of files inside src/lib, as well as files inside src
    -	# Now it only allows requiring of files inside src/lib as that makes more sense
    -	@require: (relativePath) ->
    -		# Absolute the path
    -		absolutePath = pathUtil.normalize(pathUtil.join(__dirname, relativePath))
    -
    -		# Check if we are actually a local docpad file
    -		if absolutePath.replace(__dirname, '') is absolutePath
    -			throw new Error("docpad.require is limited to local docpad files only: #{relativePath}")
    -
    -		# Require the path
    -		return require(absolutePath)
    -
    -
    -	# =================================
    -	# Variables
    -
    -	# ---------------------------------
    -	# Modules
    -
    -	# ---------------------------------
    -	# Base
    -
    -	###*
    -	# Events class
    -	# https://github.com/docpad/docpad/blob/master/src/lib/base.coffee
    -	# @property {Object} Events
    -	###
    -	Events: Events
    -
    -	###*
    -	# Model class
    -	# Extension of the Backbone Model class
    -	# http://backbonejs.org/#Model
    -	# https://github.com/docpad/docpad/blob/master/src/lib/base.coffee
    -	# @property {Object} Model
    -	###
    -	Model: Model
    -
    -	###*
    -	# Collection class
    -	# Extension of the Backbone Collection class
    -	# https://github.com/docpad/docpad/blob/master/src/lib/base.coffee
    -	# http://backbonejs.org/#Collection
    -	# @property {Object} Collection
    -	###
    -	Collection: Collection
    -
    -	###*
    -	# QueryCollection class
    -	# Extension of the Query Engine QueryCollection class
    -	# https://github.com/docpad/docpad/blob/master/src/lib/base.coffee
    -	# https://github.com/bevry/query-engine/blob/master/src/documents/lib/query-engine.js.coffee
    -	# @property {Object} QueryCollection
    -	###
    -	QueryCollection: QueryCollection
    -
    -	# ---------------------------------
    -	# Models
    -
    -	###*
    -	# File Model class
    -	# Extension of the Model class
    -	# https://github.com/docpad/docpad/blob/master/src/lib/models/file.coffee
    -	# @property {Object} FileModel
    -	###
    -	FileModel: FileModel
    -
    -	###*
    -	# Document Model class
    -	# Extension of the File Model class
    -	# https://github.com/docpad/docpad/blob/master/src/lib/models/document.coffee
    -	# @property {Object} DocumentModel
    -	###
    -	DocumentModel: DocumentModel
    -
    -	# ---------------------------------
    -	# Collections
    -
    -	###*
    -	# Collection of files in a DocPad project
    -	# Extension of the QueryCollection class
    -	# https://github.com/docpad/docpad/blob/master/src/lib/collections/files.coffee
    -	# @property {Object} FilesCollection
    -	###
    -	FilesCollection: FilesCollection
    -
    -	###*
    -	# Collection of elements in a DocPad project
    -	# Extension of the Collection class
    -	# https://github.com/docpad/docpad/blob/master/src/lib/collections/elements.coffee
    -	# @property {Object} ElementsCollection
    -	###
    -	ElementsCollection: ElementsCollection
    -
    -	###*
    -	# Collection of metadata in a DocPad project
    -	# Extension of the ElementsCollection class
    -	# https://github.com/docpad/docpad/blob/master/src/lib/collections/meta.coffee
    -	# @property {Object} MetaCollection
    -	###
    -	MetaCollection: MetaCollection
    -
    -	###*
    -	# Collection of JS script files in a DocPad project
    -	# Extension of the ElementsCollection class
    -	# https://github.com/docpad/docpad/blob/master/src/lib/collections/scripts.coffee
    -	# @property {Object} ScriptsCollection
    -	###
    -	ScriptsCollection: ScriptsCollection
    -
    -	###*
    -	# Collection of CSS style files in a DocPad project
    -	# Extension of the ElementsCollection class
    -	# https://github.com/docpad/docpad/blob/master/src/lib/collections/styles.coffee
    -	# @property {Object} StylesCollection
    -	###
    -	StylesCollection: StylesCollection
    -
    -	###*
    -	# Plugin Loader class
    -	# https://github.com/docpad/docpad/blob/master/src/lib/plugin-loader.coffee
    -	# Loads the DocPad plugins from the file system into
    -	# a DocPad project
    -	# @property {Object} PluginLoader
    -	###
    -	PluginLoader: PluginLoader
    -
    -	###*
    -	# Base class for all DocPad plugins
    -	# https://github.com/docpad/docpad/blob/master/src/lib/plugin.coffee
    -	# @property {Object} BasePlugin
    -	###
    -	BasePlugin: BasePlugin
    -
    -	# ---------------------------------
    -	# DocPad
    -
    -	###*
    -	# DocPad's version number
    -	# @private
    -	# @property {Number} version
    -	###
    -	version: null
    -
    -	###*
    -	# Get the DocPad version number
    -	# @method getVersion
    -	# @return {Number}
    -	###
    -	getVersion: ->
    -		@version ?= require(@packagePath).version
    -		return @version
    -
    -	###*
    -	# Get the DocPad version string
    -	# @method getVersionString
    -	# @return {String}
    -	###
    -	getVersionString: ->
    -		if docpadUtil.isLocalDocPadExecutable()
    -			return util.format(@getLocale().versionLocal, @getVersion(), @corePath)
    -		else
    -			return util.format(@getLocale().versionGlobal, @getVersion(), @corePath)
    -
    -	###*
    -	# The plugin version requirements
    -	# @property {String} pluginVersion
    -	###
    -	pluginVersion: '2'
    -
    -	# Process getters
    -	###*
    -	# Get the process platform
    -	# @method getProcessPlatform
    -	# @return {Object}
    -	###
    -	getProcessPlatform: -> process.platform
    -
    -	###*
    -	# Get the process version string
    -	# @method getProcessVersion
    -	# @return {String}
    -	###
    -	getProcessVersion: -> process.version.replace(/^v/,'')
    -
    -	###*
    -	# The express.js server instance bound to DocPad.
    -	# http://expressjs.com
    -	# @private
    -	# @property {Object} serverExpress
    -	###
    -	serverExpress: null
    -
    -	###*
    -	# The Node.js http server instance bound to DocPad
    -	# https://nodejs.org/api/http.html
    -	# @private
    -	# @property {Object} serverHttp
    -	###
    -	serverHttp: null
    -
    -	###*
    -	# Get the DocPad express.js server instance and, optionally,
    -	# the node.js https server instance
    -	# @method getServer
    -	# @param {Boolean} [both=false]
    -	# @return {Object}
    -	###
    -	getServer: (both=false) ->
    -		{serverExpress,serverHttp} = @
    -		if both
    -			return {serverExpress, serverHttp}
    -		else
    -			return serverExpress
    -
    -	###*
    -	# Set the express.js server and node.js http server
    -	# to bind to DocPad
    -	# @method setServer
    -	# @param {Object} servers
    -	###
    -	setServer: (servers) ->
    -		# Apply
    -		if servers.serverExpress and servers.serverHttp
    -			@serverExpress = servers.serverExpress
    -			@serverHttp = servers.serverHttp
    -
    -		# Cleanup
    -		delete @config.serverHttp
    -		delete @config.serverExpress
    -		delete @config.server
    -
    -	###*
    -	# Destructor. Close and destroy the node.js http server
    -	# @private
    -	# @method destroyServer
    -	###
    -	destroyServer: ->
    -		@serverHttp?.close()
    -		@serverHttp = null
    -		# @TODO figure out how to destroy the express server
    -
    -	#
    -	###*
    -	# Internal property. The caterpillar logger instances bound to DocPad
    -	# @private
    -	# @property {Object} loggerInstances
    -	###
    -	loggerInstances: null
    -
    -	###*
    -	# Get the caterpillar logger instance bound to DocPad
    -	# @method getLogger
    -	# @return {Object} caterpillar logger
    -	###
    -	getLogger: -> @loggerInstances?.logger
    -
    -	###*
    -	# Get all the caterpillar logger instances bound to DocPad
    -	# @method getLoggers
    -	# @return {Object} collection of caterpillar loggers
    -	###
    -	getLoggers: -> @loggerInstances
    -
    -	###*
    -	# Sets the caterpillar logger instances bound to DocPad
    -	# @method setLoggers
    -	# @param {Object} loggers
    -	# @return {Object} logger instances bound to DocPad
    -	###
    -	setLoggers: (loggers) ->
    -		if @loggerInstances
    -			@warn @getLocale().loggersAlreadyDefined
    -		else
    -			@loggerInstances = loggers
    -			@loggerInstances.logger.setConfig(dry:true)
    -			@loggerInstances.console.setConfig(dry:false).pipe(process.stdout)
    -		return loggers
    -
    -	###*
    -	# Destructor. Destroy the caterpillar logger instances bound to DocPad
    -	# @private
    -	# @method {Object} destroyLoggers
    -	###
    -	destroyLoggers: ->
    -		if @loggerInstances
    -			for own key,value of @loggerInstances
    -				value.end()
    -		@
    -
    -	###*
    -	# The action runner instance bound to docpad
    -	# @private
    -	# @property {Object} actionRunnerInstance
    -	###
    -	actionRunnerInstance: null
    -
    -	###*
    -	# Get the action runner instance bound to docpad
    -	# @method getActionRunner
    -	# @return {Object} the action runner instance
    -	###
    -	getActionRunner: -> @actionRunnerInstance
    -
    -	###*
    -	# Apply the passed DocPad action arguments
    -	# @method {Object} action
    -	# @param {Object} args
    -	# @return {Object}
    -	###
    -	action: (args...) -> docpadUtil.action.apply(@, args)
    -
    -
    -	###*
    -	# The error runner instance bound to DocPad
    -	# @property {Object} errorRunnerInstance
    -	###
    -	errorRunnerInstance: null
    -
    -	###*
    -	# Get the error runner instance
    -	# @method {Object} getErrorRunner
    -	# @return {Object} the error runner instance
    -	###
    -	getErrorRunner: -> @errorRunnerInstance
    -
    -	###*
    -	# The track runner instance bound to DocPad
    -	# @private
    -	# @property {Object} trackRunnerInstance
    -	###
    -	trackRunnerInstance: null
    -
    -	###*
    -	# Get the track runner instance
    -	# @method getTrackRunner
    -	# @return {Object} the track runner instance
    -	###
    -	getTrackRunner: -> @trackRunnerInstance
    -
    -
    -	###*
    -	# Event Listing. String array of event names.
    -	# Whenever an event is created, it must be applied here to be available to plugins and configuration files
    -	# https://github.com/bevry/docpad/wiki/Events
    -	# @private
    -	# @property {Array} string array of event names
    -	###
    -	events: [
    -		'extendTemplateData'           # fired each load
    -		'extendCollections'            # fired each load
    -		'docpadLoaded'                 # fired multiple times, first time command line configuration hasn't been applied yet
    -		'docpadReady'                  # fired only once
    -		'docpadDestroy'                # fired once on shutdown
    -		'consoleSetup'                 # fired once
    -		'generateBefore'
    -		'populateCollectionsBefore'
    -		'populateCollections'
    -		'contextualizeBefore'
    -		'contextualizeAfter'
    -		'renderBefore'
    -		'renderCollectionBefore'
    -		'render'                       # fired for each extension conversion
    -		'renderDocument'               # fired for each document render, including layouts and render passes
    -		'renderCollectionAfter'
    -		'renderAfter'
    -		'writeBefore'
    -		'writeAfter'
    -		'generateAfter'
    -		'generated'
    -		'serverBefore'
    -		'serverExtend'
    -		'serverAfter'
    -		'notify'
    -	]
    -
    -	###*
    -	# Get the list of available events
    -	# @method getEvents
    -	# @return {Object} string array of event names
    -	###
    -	getEvents: ->
    -		@events
    -
    -
    -	# ---------------------------------
    -	# Collections
    -
    -	# Database collection
    -
    -	###*
    -	# QueryEngine collection
    -	# @private
    -	# @property {Object} database
    -	###
    -	database: null
    -
    -	###*
    -	# A FilesCollection of models updated
    -	# from the DocPad database after each regeneration.
    -	# @private
    -	# @property {Object} databaseTempCache FileCollection of models
    -	###
    -	databaseTempCache: null
    -
    -	###*
    -	# Description for getDatabase
    -	# @method {Object} getDatabase
    -	###
    -	getDatabase: -> @database
    -
    -	###*
    -	# Safe method for retrieving the database by
    -	# either returning the database itself or the temporary
    -	# database cache
    -	# @method getDatabaseSafe
    -	# @return {Object}
    -	###
    -	getDatabaseSafe: -> @databaseTempCache or @database
    -
    -	###*
    -	# Destructor. Destroy the DocPad database
    -	# @private
    -	# @method destroyDatabase
    -	###
    -	destroyDatabase: ->
    -		if @database?
    -			@database.destroy()
    -			@database = null
    -		if @databaseTempCache?
    -			@databaseTempCache.destroy()
    -			@databaseTempCache = null
    -		@
    -
    -	###*
    -	# Files by url. Used to speed up fetching
    -	# @private
    -	# @property {Object} filesByUrl
    -	###
    -	filesByUrl: null
    -
    -	###*
    -	# Files by Selector. Used to speed up fetching
    -	# @private
    -	# @property {Object} filesBySelector
    -	###
    -	filesBySelector: null
    -
    -	###*
    -	# Files by Out Path. Used to speed up conflict detection. Do not use for anything else
    -	# @private
    -	# @property {Object} filesByOutPath
    -	###
    -	filesByOutPath: null
    -
    -	###*
    -	# Blocks
    -	# @private
    -	# @property {Object} blocks
    -	###
    -	blocks: null
    -	### {
    -		# A collection of meta elements
    -		meta: null  # Elements Collection
    -
    -		# A collection of script elements
    -		scripts: null  # Scripts Collection
    -
    -		# Collection of style elements
    -		styles: null  # Styles Collection
    -	} ###
    -
    -	###*
    -	# Get a block by block name. Optionally clone block.
    -	# @method getBlock
    -	# @param {String} name
    -	# @param {Object} [clone]
    -	# @return {Object} block
    -	###
    -	getBlock: (name,clone) ->
    -		block = @blocks[name]
    -		if clone
    -			classname = name[0].toUpperCase()+name[1..]+'Collection'
    -			block = new @[classname](block.models)
    -		return block
    -
    -	###*
    -	# Set a block by name and value
    -	# @method setBlock
    -	# @param {String} name
    -	# @param {Object} value
    -	###
    -	setBlock: (name,value) ->
    -		if @blocks[name]?
    -			@blocks[name].destroy()
    -			if value
    -				@blocks[name] = value
    -			else
    -				delete @blocks[name]
    -		else
    -			@blocks[name] = value
    -		@
    -
    -	###*
    -	# Get all blocks
    -	# @method getBlocks
    -	# @return {Object} collection of blocks
    -	###
    -	getBlocks: -> @blocks
    -
    -	###*
    -	# Set all blocks
    -	# @method setBlocks
    -	# @param {Object} blocks
    -	###
    -	setBlocks: (blocks) ->
    -		for own name,value of blocks
    -			@setBlock(name,value)
    -		@
    -
    -	###*
    -	# Apply the passed function to each block
    -	# @method eachBlock
    -	# @param {Function} fn
    -	###
    -	eachBlock: (fn) ->
    -		eachr(@blocks, fn)
    -		@
    -
    -	###*
    -	# Destructor. Destroy all blocks
    -	# @private
    -	# @method destroyBlocks
    -	###
    -	destroyBlocks: ->
    -		if @blocks
    -			for own name,block of @blocks
    -				block.destroy()
    -				@blocks[name] = null
    -		@
    -
    -	###*
    -	# The DocPad collections
    -	# @private
    -	# @property {Object} collections
    -	###
    -	collections: null
    -
    -	###*
    -	# Get a collection by collection name or key.
    -	# This is often accessed within the docpad.coffee
    -	# file or a layout/page via @getCollection.
    -	# Because getCollection returns a docpad collection,
    -	# a call to this method is often chained with a
    -	# QueryEngine style query.
    -	#
    -	# 	@getCollection('documents').findAllLive({relativeOutDirPath: 'posts'},[{date:-1}])
    -	#
    -	# @method getCollection
    -	# @param {String} value
    -	# @return {Object} collection
    -	###
    -	getCollection: (value) ->
    -		if value
    -			if typeof value is 'string'
    -				if value is 'database'
    -					return @getDatabase()
    -
    -				else
    -					for collection in @collections
    -						if value in [collection.options.name, collection.options.key]
    -							return collection
    -
    -			else
    -				for collection in @collections
    -					if value is collection
    -						return collection
    -
    -		return null
    -
    -	###*
    -	# Destroy a collection by collection name or key
    -	# @method destroyCollection
    -	# @param {String} value
    -	# @return {Object} description
    -	###
    -	destroyCollection: (value) ->
    -		if value
    -			if typeof value is 'string' and value isnt 'database'
    -				@collections = @collections.filter (collection) ->
    -					if value in [collection.options.name, collection.options.key]
    -						collection?.destroy()
    -						return false
    -					else
    -						return true
    -
    -			else if value isnt @getDatabase()
    -				@collections = @collections.filter (collection) ->
    -					if value is collection
    -						collection?.destroy()
    -						return false
    -					else
    -						return true
    -
    -		return null
    -
    -	###*
    -	# Add a collection
    -	# @method addCollection
    -	# @param {Object} collection
    -	###
    -	addCollection: (collection) ->
    -		if collection and collection not in [@getDatabase(), @getCollection(collection)]
    -			@collections.push(collection)
    -		@
    -
    -	###*
    -	# Set a name for a collection.
    -	# A collection can have multiple names
    -	#
    -	# The partials plugin (https://github.com/docpad/docpad-plugin-partials)
    -	# creates a live collection and passes this to setCollection with
    -	# the name 'partials'.
    -	#
    -	# 	# Add our partials collection
    -	#	docpad.setCollection('partials', database.createLiveChildCollection()
    -	#		.setQuery('isPartial', {
    -	#				$or:
    -	#					isPartial: true
    -	#					fullPath: $startsWith: config.partialsPath
    -	#		})
    -	#		.on('add', (model) ->
    -	#			docpad.log('debug', util.format(locale.addingPartial, model.getFilePath()))
    -	#			model.setDefaults(
    -	#				isPartial: true
    -	#				render: false
    -	#				write: false
    -	#			)
    -	#		)
    -	#	)
    -	#
    -	#
    -	# @method setCollection
    -	# @param {String} name the name to give to the collection
    -	# @param {Object} collection a DocPad collection
    -	###
    -	setCollection: (name, collection) ->
    -		if collection
    -			if name
    -				collection.options.name = name
    -				if @getCollection(name) isnt collection
    -					@destroyCollection(name)
    -			@addCollection(collection)
    -		else
    -			@destroyCollection(name)
    -
    -	###*
    -	# Get the DocPad project's collections
    -	# @method getCollections
    -	# @return {Object} the collections
    -	###
    -	getCollections: ->
    -		return @collections
    -
    -	###*
    -	# Set the DocPad project's collections
    -	# @method setCollections
    -	###
    -	setCollections: (collections) ->
    -		if Array.isArray(collections)
    -			for value in collections
    -				@addCollection(value)
    -		else
    -			for own name,value of collections
    -				@setCollection(name, value)
    -		@
    -
    -	###*
    -	# Apply the passed function to each collection
    -	# @method eachCollection
    -	# @param {Function} fn
    -	###
    -	eachCollection: (fn) ->
    -		fn(@getDatabase(), 'database')
    -		for collection,index in @collections
    -			fn(collection, collection.options.name or collection.options.key or index)
    -		@
    -
    -	###*
    -	# Destructor. Destroy the DocPad project's collections.
    -	# @private
    -	# @method destroyCollections
    -	###
    -	destroyCollections: ->
    -		if @collections
    -			for collection in @collections
    -				collection.destroy()
    -			@collections = []
    -		@
    -
    -
    -	# ---------------------------------
    -	# Collection Helpers
    -
    -	###*
    -	# Get all the files in the DocPad database (will use live collections)
    -	# @method getFiles
    -	# @param {Object} query
    -	# @param {Object} sorting
    -	# @param {Object} paging
    -	# @return {Object} collection
    -	###
    -	getFiles: (query,sorting,paging) ->
    -		key = JSON.stringify({query, sorting, paging})
    -		collection = @getCollection(key)
    -		unless collection
    -			collection = @getDatabase().findAllLive(query, sorting, paging)
    -			collection.options.key = key
    -			@addCollection(collection)
    -		return collection
    -
    -
    -	###*
    -	# Get a single file based on a query
    -	# @method getFile
    -	# @param {Object} query
    -	# @param {Object} sorting
    -	# @param {Object} paging
    -	# @return {Object} a file
    -	###
    -	getFile: (query,sorting,paging) ->
    -		file = @getDatabase().findOne(query, sorting, paging)
    -		return file
    -
    -	###*
    -	# Get files at a path
    -	# @method getFilesAtPath
    -	# @param {String} path
    -	# @param {Object} sorting
    -	# @param {Object} paging
    -	# @return {Object} files
    -	###
    -	getFilesAtPath: (path,sorting,paging) ->
    -		query = $or: [{relativePath: $startsWith: path}, {fullPath: $startsWith: path}]
    -		files = @getFiles(query, sorting, paging)
    -		return files
    -
    -	###*
    -	# Get a file at a relative or absolute path or url
    -	# @method getFileAtPath
    -	# @param {String} path
    -	# @param {Object} sorting
    -	# @param {Object} paging
    -	# @return {Object} a file
    -	###
    -	getFileAtPath: (path,sorting,paging) ->
    -		file = @getDatabase().fuzzyFindOne(path, sorting, paging)
    -		return file
    -
    -
    -	# TODO: Does this still work???
    -	###*
    -	# Get a file by its url
    -	# @method getFileByUrl
    -	# @param {String} url
    -	# @param {Object} [opts={}]
    -	# @return {Object} a file
    -	###
    -	getFileByUrl: (url,opts={}) ->
    -		opts.collection ?= @getDatabase()
    -		file = opts.collection.get(@filesByUrl[url])
    -		return file
    -
    -
    -	###*
    -	# Get a file by its id
    -	# @method getFileById
    -	# @param {String} id
    -	# @param {Object} [opts={}]
    -	# @return {Object} a file
    -	###
    -	getFileById: (id,opts={}) ->
    -		opts.collection ?= @getDatabase()
    -		file = opts.collection.get(id)
    -		return file
    -
    -
    -	###*
    -	# Remove the query string from a url
    -	# Pathname convention taken from document.location.pathname
    -	# @method getUrlPathname
    -	# @param {String} url
    -	# @return {String}
    -	###
    -	getUrlPathname: (url) ->
    -		return url.replace(/\?.*/,'')
    -
    -	###*
    -	# Get a file by its route and return
    -	# it to the supplied callback.
    -	# @method getFileByRoute
    -	# @param {String} url
    -	# @param {Object} next
    -	# @param {Error} next.err
    -	# @param {String} next.file
    -	###
    -	getFileByRoute: (url,next) ->
    -		# Prepare
    -		docpad = @
    -
    -		# If we have not performed a generation yet then wait until the initial generation has completed
    -		if docpad.generated is false
    -			# Wait until generation has completed and recall ourselves
    -			docpad.once 'generated', ->
    -				return docpad.getFileByRoute(url, next)
    -
    -			# hain
    -			return @
    -
    -		# @TODO the above causes a signifcant delay when importing external documents (like tumblr data) into the database
    -		# we need to figure out a better way of doing this
    -		# perhaps it is via `writeSource: once` for imported documents
    -		# or providing an option to disable this so it forward onto the static handler instead
    -
    -		# Prepare
    -		database = docpad.getDatabaseSafe()
    -
    -		# Fetch
    -		cleanUrl = docpad.getUrlPathname(url)
    -		file = docpad.getFileByUrl(url, {collection:database}) or docpad.getFileByUrl(cleanUrl, {collection:database})
    -
    -		# Forward
    -		next(null, file)
    -
    -		# Chain
    -		@
    -
    -
    -	# TODO: What on earth is a selector?
    -	###*
    -	# Get a file by its selector
    -	# @method getFileBySelector
    -	# @param {Object} selector
    -	# @param {Object} [opts={}]
    -	# @return {Object} a file
    -	###
    -	getFileBySelector: (selector,opts={}) ->
    -		opts.collection ?= @getDatabase()
    -		file = opts.collection.get(@filesBySelector[selector])
    -		unless file
    -			file = opts.collection.fuzzyFindOne(selector)
    -			if file
    -				@filesBySelector[selector] = file.id
    -		return file
    -
    -
    -	# ---------------------------------
    -	# Skeletons
    -
    -
    -	###*
    -	# Skeletons Collection
    -	# @private
    -	# @property {Object} skeletonsCollection
    -	###
    -	skeletonsCollection: null
    -
    -	###*
    -	# Get Skeletons
    -	# Get all the available skeletons with their details and
    -	# return this collection to the supplied callback.
    -	# @method getSkeletons
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	# @param {Object} next.skeletonsCollection DocPad collection of skeletons
    -	# @return {Object} DocPad skeleton collection
    -	###
    -	getSkeletons: (next) ->
    -		# Prepare
    -		docpad = @
    -		locale = @getLocale()
    -
    -		# Check if we have cached locally
    -		if @skeletonsCollection?
    -			return next(null, @skeletonsCollection)
    -
    -		# Fetch the skeletons from the exchange
    -		@skeletonsCollection = new Collection()
    -		@skeletonsCollection.comparator = queryEngine.generateComparator(position:1, name:1)
    -		@getExchange (err,exchange) ->
    -			# Check
    -			return next(err)  if err
    -
    -			# Prepare
    -			index = 0
    -
    -			# If we have the exchange data, then add the skeletons from it
    -			if exchange
    -				eachr exchange.skeletons, (skeleton, skeletonKey) ->
    -					skeleton.id ?= skeletonKey
    -					skeleton.name ?= skeletonKey
    -					skeleton.position ?= index
    -					docpad.skeletonsCollection.add(new Model(skeleton))
    -					++index
    -
    -			# Add No Skeleton Option
    -			docpad.skeletonsCollection.add(new Model(
    -				id: 'none'
    -				name: locale.skeletonNoneName
    -				description: locale.skeletonNoneDescription
    -				position: index
    -			))
    -
    -			# Return Collection
    -			return next(null, docpad.skeletonsCollection)
    -		@
    -
    -
    -	# ---------------------------------
    -	# Plugins
    -
    -
    -	###*
    -	# Plugins that are loading really slow
    -	# @property {Object} slowPlugins
    -	###
    -	slowPlugins: null  # {}
    -
    -	###*
    -	# Loaded plugins indexed by name
    -	# @property {Object} loadedPlugins
    -	###
    -	loadedPlugins: null  # {}
    -
    -	###*
    -	# A listing of all the available extensions for DocPad
    -	# @property {Object} exchange
    -	###
    -	exchange: null  # {}
    -
    -	# -----------------------------
    -	# Paths
    -
    -	###*
    -	# The DocPad directory
    -	# @property {String} corePath
    -	###
    -	corePath: corePath
    -
    -	###*
    -	# The DocPad library directory
    -	# @private
    -	# @property {String} libPath
    -	###
    -	libPath: __dirname
    -
    -	###*
    -	# The main DocPad file
    -	# @property {String} mainPath
    -	###
    -	mainPath: pathUtil.resolve(__dirname, 'docpad')
    -
    -	###*
    -	# The DocPad package.json path
    -	# @property {String} packagePath
    -	###
    -	packagePath: pathUtil.resolve(__dirname, '..', '..', 'package.json')
    -
    -	###*
    -	# The DocPad locale path
    -	# @property {String} localePath
    -	###
    -	localePath: pathUtil.resolve(__dirname, '..', '..', 'locale')
    -
    -	###*
    -	# The DocPad debug log path (docpad-debug.log)
    -	# @property {String} debugLogPath
    -	###
    -	debugLogPath: pathUtil.join(process.cwd(), 'docpad-debug.log')
    -
    -	###*
    -	# The User's configuration path (.docpad.cson)
    -	# @property {String} userConfigPath
    -	###
    -	userConfigPath: '.docpad.cson'
    -
    -	# -----------------------------
    -	# Template Data
    -
    -
    -	###*
    -	# Description for initialTemplateData
    -	# @private
    -	# @property {Object} initialTemplateData
    -	###
    -	initialTemplateData: null  # {}
    -
    -	###*
    -	# Plugin's Extended Template Data
    -	# @private
    -	# @property {Object} pluginsTemplateData
    -	###
    -	pluginsTemplateData: null  # {}
    -
    -	###*
    -	# Get Complete Template Data
    -	# @method getTemplateData
    -	# @param {Object} userTemplateData
    -	# @return {Object} templateData
    -	###
    -	getTemplateData: (userTemplateData) ->
    -		# Prepare
    -		userTemplateData or= {}
    -		docpad = @
    -		locale = @getLocale()
    -
    -		# Set the initial docpad template data
    -		@initialTemplateData ?=
    -			# Site Properties
    -			site: {}
    -
    -			# Environment
    -			getEnvironment: ->
    -				return docpad.getEnvironment()
    -
    -			# Environments
    -			getEnvironments: ->
    -				return docpad.getEnvironments()
    -
    -			# Set that we reference other files
    -			referencesOthers: (flag) ->
    -				document = @getDocument()
    -				document.referencesOthers()
    -				return null
    -
    -			# Get the Document
    -			getDocument: ->
    -				return @documentModel
    -
    -			# Get a Path in respect to the current document
    -			getPath: (path,parentPath) ->
    -				document = @getDocument()
    -				path = document.getPath(path, parentPath)
    -				return path
    -
    -			# Get Files
    -			getFiles: (query,sorting,paging) ->
    -				@referencesOthers()
    -				result = docpad.getFiles(query, sorting, paging)
    -				return result
    -
    -			# Get another file's URL based on a relative path
    -			getFile: (query,sorting,paging) ->
    -				@referencesOthers()
    -				result = docpad.getFile(query,sorting,paging)
    -				return result
    -
    -			# Get Files At Path
    -			getFilesAtPath: (path,sorting,paging) ->
    -				@referencesOthers()
    -				path = @getPath(path)
    -				result = docpad.getFilesAtPath(path, sorting, paging)
    -				return result
    -
    -			# Get another file's model based on a relative path
    -			getFileAtPath: (relativePath) ->
    -				@referencesOthers()
    -				path = @getPath(relativePath)
    -				result = docpad.getFileAtPath(path)
    -				return result
    -
    -			# Get a specific file by its id
    -			getFileById: (id) ->
    -				@referencesOthers()
    -				result = docpad.getFileById(id)
    -				return result
    -
    -			# Get the entire database
    -			getDatabase: ->
    -				@referencesOthers()
    -				return docpad.getDatabase()
    -
    -			# Get a pre-defined collection
    -			getCollection: (name) ->
    -				@referencesOthers()
    -				return docpad.getCollection(name)
    -
    -			# Get a block
    -			getBlock: (name) ->
    -				return docpad.getBlock(name,true)
    -
    -			# Include another file taking in a relative path
    -			include: (subRelativePath,strict=true) ->
    -				file = @getFileAtPath(subRelativePath)
    -				if file
    -					if strict and file.get('rendered') is false
    -						if docpad.getConfig().renderPasses is 1
    -							docpad.warn util.format(locale.renderedEarlyViaInclude, subRelativePath)
    -						return null
    -					return file.getOutContent()
    -				else
    -					err = new Error(util.format(locale.includeFailed, subRelativePath))
    -					throw err
    -
    -		# Fetch our result template data
    -		templateData = extendr.extend({}, @initialTemplateData, @pluginsTemplateData, @getConfig().templateData, userTemplateData)
    -
    -		# Add site data
    -		templateData.site.url or= @getSimpleServerUrl()
    -		templateData.site.date or= new Date()
    -		templateData.site.keywords or= []
    -		if typeChecker.isString(templateData.site.keywords)
    -			templateData.site.keywords = templateData.site.keywords.split(/,\s*/g)
    -
    -		# Return
    -		templateData
    -
    -
    -	# -----------------------------
    -	# Locales
    -
    -	###*
    -	# Determined locale
    -	# @private
    -	# @property {Object} locale
    -	###
    -	locale: null
    -
    -
    -	###*
    -	# Get the locale (language code and locale code)
    -	# @method getLocale
    -	# @return {Object} locale
    -	###
    -	getLocale: ->
    -		if @locale? is false
    -			config = @getConfig()
    -			codes = uniq [
    -				'en'
    -				safeps.getLanguageCode config.localeCode
    -				safeps.getLanguageCode safeps.getLocaleCode()
    -				safeps.getLocaleCode   config.localeCode
    -				safeps.getLocaleCode   safeps.getLocaleCode()
    -			]
    -			locales = (@loadLocale(code)  for code in codes).filter((l) -> l)
    -			@locale = extendr.extend(locales...)
    -
    -		return @locale
    -
    -	###*
    -	# Load the locale
    -	# @method loadLocale
    -	# @param {String} code
    -	# @return {Object} locale
    -	###
    -	loadLocale: (code) ->
    -		# Check if it exists
    -		localeFilename = "#{code}.cson"
    -		localePath = pathUtil.join(@localePath, localeFilename)
    -		return null  unless safefs.existsSync(localePath)
    -
    -		# Load it
    -		locale = CSON.parseCSONFile(localePath)
    -
    -		# Log the error in the background and continue
    -		if locale instanceof Error
    -			locale.context = "Failed to parse the CSON locale file: #{localePath}"
    -			docpad.error(locale)  # @TODO: should this be a fatal error instead?
    -			return null
    -
    -		# Success
    -		return locale
    -
    -
    -	# -----------------------------
    -	# Environments
    -
    -
    -	###*
    -	# Get the DocPad environment, eg: development,
    -	# production or static
    -	# @method getEnvironment
    -	# @return {String} the environment
    -	###
    -	getEnvironment: ->
    -		env = @getConfig().env or 'development'
    -		return env
    -
    -	###*
    -	# Get the environments
    -	# @method getEnvironments
    -	# @return {Array} array of environment strings
    -	###
    -	getEnvironments: ->
    -		env = @getEnvironment()
    -		envs = env.split(/[, ]+/)
    -		return envs
    -
    -
    -	# -----------------------------
    -	# Configuration
    -
    -	###*
    -	# Hash Key
    -	# The key that we use to hash some data before sending it to our statistic server
    -	# @private
    -	# @property {String} string constant
    -	###
    -	hashKey: '7>9}$3hP86o,4=@T'  # const
    -
    -	###*
    -	# Website Package Configuration
    -	# @private
    -	# @property {Object} websitePackageConfig
    -	###
    -	websitePackageConfig: null  # {}
    -
    -	###*
    -	# Merged Configuration
    -	# Merged in the order of:
    -	# - initialConfig
    -	# - userConfig
    -	# - websiteConfig
    -	# - instanceConfig
    -	# - environmentConfig
    -	# Use getConfig to retrieve this value
    -	# @private
    -	# @property {Object} config
    -	###
    -	config: null  # {}
    -
    -
    -	###*
    -	# Instance Configuration
    -
    -	# @private
    -	# @property {Object} instanceConfig
    -	###
    -	instanceConfig: null  # {}
    -
    -	###*
    -	# Website Configuration
    -	# Merged into the config property
    -	# @private
    -	# @property {Object} websiteConfig
    -	###
    -	websiteConfig: null  # {}
    -
    -	###*
    -	# User Configuraiton
    -	# Merged into the config property
    -	# @private
    -	# @property {Object} userConfig
    -	###
    -	userConfig:
    -		# Name
    -		name: null
    -
    -		# Email
    -		email: null
    -
    -		# Username
    -		username: null
    -
    -		# Subscribed
    -		subscribed: null
    -
    -		# Subcribe Try Again
    -		# If our subscription has failed, when should we try again?
    -		subscribeTryAgain: null
    -
    -		# Terms of Service
    -		tos: null
    -
    -		# Identified
    -		identified: null
    -
    -	###*
    -	# Initial Configuration. The default docpadConfig
    -	# settings that can be overridden in a project's docpad.coffee file.
    -	# Merged into the config property
    -	# @private
    -	# @property {Object} initialConfig
    -	###
    -	initialConfig:
    -
    -		# -----------------------------
    -		# Plugins
    -
    -		# Force re-install of all plugin dependencies
    -		force: false
    -
    -		# Whether or not we should use the global docpad instance
    -		global: false
    -
    -		# Whether or not we should enable plugins that have not been listed or not
    -		enableUnlistedPlugins: true
    -
    -		# Plugins which should be enabled or not pluginName: pluginEnabled
    -		enabledPlugins: {}
    -
    -		# Whether or not we should skip unsupported plugins
    -		skipUnsupportedPlugins: true
    -
    -		# Whether or not to warn about uncompiled private plugins
    -		warnUncompiledPrivatePlugins: true
    -
    -		# Configuration to pass to any plugins pluginName: pluginConfiguration
    -		plugins: {}
    -
    -
    -		# -----------------------------
    -		# Project Paths
    -
    -		# The project directory
    -		rootPath: process.cwd()
    -
    -		# The project's database cache path
    -		databaseCachePath: '.docpad.db'
    -
    -		# The project's package.json path
    -		packagePath: 'package.json'
    -
    -		# The project's configuration paths
    -		# Reads only the first one that exists
    -		# If you want to read multiple configuration paths, then point it to a coffee|js file that requires
    -		# the other paths you want and exports the merged config
    -		configPaths: [
    -			'docpad.js'
    -			'docpad.coffee'
    -			'docpad.json'
    -			'docpad.cson'
    -		]
    -
    -		# Plugin directories to load
    -		pluginPaths: []
    -
    -		# The project's plugins directory
    -		pluginsPaths: [
    -			'node_modules'
    -			'plugins'
    -		]
    -
    -		# Paths that we should watch for reload changes in
    -		reloadPaths: []
    -
    -		# Paths that we should watch for regeneration changes in
    -		regeneratePaths: []
    -
    -		# The time to wait after a source file has changed before using it to regenerate
    -		regenerateDelay: 100
    -
    -		# The time to wait before outputting the files we are waiting on
    -		slowFilesDelay: 20*1000
    -
    -		# The project's out directory
    -		outPath: 'out'
    -
    -		# The project's src directory
    -		srcPath: 'src'
    -
    -		# The project's documents directories
    -		# relative to the srcPath
    -		documentsPaths: [
    -			'documents'
    -			'render'
    -		]
    -
    -		# The project's files directories
    -		# relative to the srcPath
    -		filesPaths: [
    -			'files'
    -			'static'
    -			'public'
    -		]
    -
    -		# The project's layouts directory
    -		# relative to the srcPath
    -		layoutsPaths: [
    -			'layouts'
    -		]
    -
    -		# Ignored file patterns during directory parsing
    -		ignorePaths: false
    -		ignoreHiddenFiles: false
    -		ignoreCommonPatterns: true
    -		ignoreCustomPatterns: false
    -
    -		# Watch options
    -		watchOptions: null
    -
    -
    -		# -----------------------------
    -		# Server
    -
    -		# Port
    -		# The port that the server should use
    -		# Defaults to these environment variables:
    -		# - PORT — Heroku, Nodejitsu, Custom
    -		# - VCAP_APP_PORT — AppFog
    -		# - VMC_APP_PORT — CloudFoundry
    -		port: null
    -
    -		# Hostname
    -		# The hostname we wish to listen to
    -		# Defaults to these environment variables:
    -		# HOSTNAME — Generic
    -		# Do not set to "localhost" it does not work on heroku
    -		hostname: null
    -
    -		# Max Age
    -		# The caching time limit that is sent to the client
    -		maxAge: 86400000
    -
    -		# Server
    -		# The Express.js server that we want docpad to use
    -		serverExpress: null
    -		# The HTTP server that we want docpad to use
    -		serverHttp: null
    -
    -		# Extend Server
    -		# Whether or not we should extend the server with extra middleware and routing
    -		extendServer: true
    -
    -		# Which middlewares would you like us to activate
    -		# The standard middlewares (bodyParser, methodOverride, express router)
    -		middlewareStandard: true
    -		# The standard bodyParser middleware
    -		middlewareBodyParser: true
    -		# The standard methodOverride middleware
    -		middlewareMethodOverride: true
    -		# The standard express router middleware
    -		middlewareExpressRouter: true
    -		# Our own 404 middleware
    -		middleware404: true
    -		# Our own 500 middleware
    -		middleware500: true
    -
    -
    -		# -----------------------------
    -		# Logging
    -
    -		# Log Level
    -		# Which level of logging should we actually output
    -		logLevel: (if ('-d' in process.argv) then 7 else 6)
    -
    -		# Catch uncaught exceptions
    -		catchExceptions: true
    -
    -		# Report Errors
    -		# Whether or not we should report our errors back to DocPad
    -		# By default it is only enabled if we are not running inside a test
    -		reportErrors: process.argv.join('').indexOf('test') is -1
    -
    -		# Report Statistics
    -		# Whether or not we should report statistics back to DocPad
    -		# By default it is only enabled if we are not running inside a test
    -		reportStatistics: process.argv.join('').indexOf('test') is -1
    -
    -		# Color
    -		# Whether or not our terminal output should have color
    -		# `null` will default to what the terminal supports
    -		color: null
    -
    -
    -		# -----------------------------
    -		# Other
    -
    -		# Utilise the database cache
    -		databaseCache: false  # [false, true, 'write']
    -
    -		# Detect Encoding
    -		# Should we attempt to auto detect the encoding of our files?
    -		# Useful when you are using foreign encoding (e.g. GBK) for your files
    -		detectEncoding: false
    -
    -		# Render Single Extensions
    -		# Whether or not we should render single extensions by default
    -		renderSingleExtensions: false
    -
    -		# Render Passes
    -		# How many times should we render documents that reference other documents?
    -		renderPasses: 1
    -
    -		# Offline
    -		# Whether or not we should run in offline mode
    -		# Offline will disable the following:
    -		# - checkVersion
    -		# - reportErrors
    -		# - reportStatistics
    -		offline: false
    -
    -		# Check Version
    -		# Whether or not to check for newer versions of DocPad
    -		checkVersion: false
    -
    -		# Welcome
    -		# Whether or not we should display any custom welcome callbacks
    -		welcome: false
    -
    -		# Prompts
    -		# Whether or not we should display any prompts
    -		prompts: false
    -
    -		# Progress
    -		# Whether or not we should display any progress bars
    -		# Requires prompts being true, and log level 6 or above
    -		progress: true
    -
    -		# Powered By DocPad
    -		# Whether or not we should include DocPad in the Powered-By meta header
    -		# Please leave this enabled as it is a standard practice and promotes DocPad in the web eco-system
    -		poweredByDocPad: true
    -
    -		# Helper Url
    -		# Used for subscribing to newsletter, account information, and statistics etc
    -		# 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/'
    -
    -		# Template Data
    -		# What data would you like to expose to your templates
    -		templateData: {}
    -
    -		# Collections
    -		# A hash of functions that create collections
    -		collections: {}
    -
    -		# Events
    -		# A hash of event handlers
    -		events: {}
    -
    -		# Regenerate Every
    -		# Performs a regenerate every x milliseconds, useful for always having the latest data
    -		regenerateEvery: false
    -
    -		# Regerenate Every Options
    -		# The generate options to use on the regenerate every call
    -		regenerateEveryOptions:
    -			populate: true
    -			partial:  false
    -
    -
    -		# -----------------------------
    -		# Environment Configuration
    -
    -		# Locale Code
    -		# The code we shall use for our locale (e.g. en, fr, etc)
    -		localeCode: null
    -
    -		# Environment
    -		# Whether or not we are in production or development
    -		# Separate environments using a comma or a space
    -		env: null
    -
    -		# Environments
    -		# Environment specific configuration to over-ride the global configuration
    -		environments:
    -			development:
    -				# Always refresh from server
    -				maxAge: false
    -
    -				# Only do these if we are running standalone (aka not included in a module)
    -				checkVersion: isUser
    -				welcome: isUser
    -				prompts: isUser
    -
    -	###*
    -	# Regenerate Timer
    -	# When config.regenerateEvery is set to a value, we create a timer here
    -	# @private
    -	# @property {Object} regenerateTimer
    -	###
    -	regenerateTimer: null
    -
    -	###*
    -	# Get the DocPad configuration. Commonly
    -	# called within the docpad.coffee file or within
    -	# plugins to access application specific configurations.
    -	# 	serverExtend: (opts) ->
    -			# Extract the server from the options
    -			{server} = opts
    -			docpad = @docpad
    -
    -			# As we are now running in an event,
    -			# ensure we are using the latest copy of the docpad configuraiton
    -			# and fetch our urls from it
    -			latestConfig = docpad.getConfig()
    -			oldUrls = latestConfig.templateData.site.oldUrls or []
    -			newUrl = latestConfig.templateData.site.url
    -
    -			# Redirect any requests accessing one of our sites oldUrls to the new site url
    -			server.use (req,res,next) ->
    -				...
    -	# @method getConfig
    -	# @return {Object} the DocPad configuration object
    -	###
    -	getConfig: ->
    -		return @config or {}
    -
    -	###*
    -	# Get the port that DocPad is listening on (eg 9778)
    -	# @method getPort
    -	# @return {Number} the port number
    -	###
    -	getPort: ->
    -		return @getConfig().port ? require('hostenv').PORT ? 9778
    -
    -	###*
    -	# Get the Hostname
    -	# @method getHostname
    -	# @return {String}
    -	###
    -	getHostname: ->
    -		return @getConfig().hostname ? require('hostenv').HOSTNAME ? '0.0.0.0'
    -
    -	###*
    -	# Get address
    -	# @method getServerUrl
    -	# @param {Object} [opts={}]
    -	# @return {String}
    -	###
    -	getServerUrl: (opts={}) ->
    -		opts.hostname ?= @getHostname()
    -		opts.port ?= @getPort()
    -		opts.simple ?= false
    -		if opts.simple is true and opts.hostname in ['0.0.0.0', '::', '::1']
    -			return "http://127.0.0.1:#{opts.port}"
    -		else
    -			return "http://#{opts.hostname}:#{opts.port}"
    -
    -	###*
    -	# Get simple server URL (changes 0.0.0.0, ::, and ::1 to 127.0.0.1)
    -	# @method getSimpleServerUrl
    -	# @param {Object} [opts={}]
    -	# @param {Boolean} [opts.simple=true]
    -	# @return {String}
    -	###
    -	getSimpleServerUrl: (opts={}) ->
    -		opts.simple = true
    -		return @getServerUrl(opts)
    -
    -
    -	# =================================
    -	# 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)
    -	# @method constructor
    -	# @param {Object} instanceConfig
    -	# @param {Function} next callback
    -	# @param {Error} next.err
    -	###
    -	constructor: (instanceConfig,next) ->
    -		# Prepare
    -		[instanceConfig,next] = extractOptsAndCallback(instanceConfig, next)
    -		docpad = @
    -
    -		# Binders
    -		# Using this over coffescript's => on class methods, ensures that the method length is kept
    -		for methodName in """
    -			action
    -			log warn error fatal inspector notify track identify subscribe checkRequest
    -			serverMiddlewareRouter serverMiddlewareHeader serverMiddleware404 serverMiddleware500
    -			destroyWatchers
    -			""".split(/\s+/)
    -			@[methodName] = @[methodName].bind(@)
    -
    -		# Allow DocPad to have unlimited event listeners
    -		@setMaxListeners(0)
    -
    -		# Setup configuration event wrappers
    -		configEventContext = {docpad}  # here to allow the config event context to persist between event calls
    -		@getEvents().forEach (eventName) ->
    -			# Bind to the event
    -			docpad.on eventName, (opts,next) ->
    -				eventHandler = docpad.getConfig().events?[eventName]
    -				# Fire the config event handler for this event, if it exists
    -				if typeChecker.isFunction(eventHandler)
    -					args = [opts,next]
    -					ambi(eventHandler.bind(configEventContext), args...)
    -				# It doesn't exist, so lets continue
    -				else
    -					next()
    -
    -		# Create our action runner
    -		@actionRunnerInstance = @createTaskGroup('action runner', {abortOnError: false, destroyOnceDone: false}).whenDone (err) ->
    -			docpad.error(err)  if err
    -
    -		# Create our track runner
    -		@trackRunnerInstance = @createTaskGroup('track runner', {abortOnError: false, destroyOnceDone: false}).whenDone (err) ->
    -			if err and docpad.getDebugging()
    -				locale = docpad.getLocale()
    -				docpad.warn(locale.trackError, err)
    -
    -		# Initialize the loggers
    -		if (loggers = instanceConfig.loggers)
    -			delete instanceConfig.loggers
    -		else
    -			# Create
    -			logger = require('caterpillar').create(lineOffset: 2)
    -
    -			# console
    -			loggerConsole = logger
    -				.pipe(
    -					require('caterpillar-filter').create()
    -				)
    -				.pipe(
    -					require('caterpillar-human').create()
    -				)
    -
    -			# Apply
    -			loggers = {logger, console:loggerConsole}
    -
    -		# Apply the loggers
    -		safefs.unlink(@debugLogPath, -> )  # Remove the old debug log file
    -		@setLoggers(loggers)  # Apply the logger streams
    -		@setLogLevel(instanceConfig.logLevel ? @initialConfig.logLevel)  # Set the default log level
    -
    -		# Log to bubbled events
    -		@on 'log', (args...) ->
    -			docpad.log.apply(@,args)
    -
    -		# Dereference and initialise advanced variables
    -		# we deliberately ommit initialTemplateData here, as it is setup in getTemplateData
    -		@slowPlugins = {}
    -		@loadedPlugins = {}
    -		@exchange = {}
    -		@pluginsTemplateData = {}
    -		@instanceConfig = {}
    -		@collections = []
    -		@blocks = {}
    -		@filesByUrl = {}
    -		@filesBySelector = {}
    -		@filesByOutPath = {}
    -		@database = new FilesCollection(null, {name:'database'})
    -			.on('remove', (model,options) ->
    -				# Skip if we are not a writeable file
    -				return  if model.get('write') is false
    -
    -				# Delete the urls
    -				for url in model.get('urls') or []
    -					delete docpad.filesByUrl[url]
    -
    -				# Ensure we regenerate anything (on the next regeneration) that was using the same outPath
    -				outPath = model.get('outPath')
    -				if outPath
    -					updatedModels = docpad.database.findAll({outPath})
    -					updatedModels.remove(model)
    -					updatedModels.each (model) ->
    -						model.set('mtime': new Date())
    -
    -					# Log
    -					docpad.log('debug', 'Updated mtime for these models due to remove of a similar one', updatedModels.pluck('relativePath'))
    -
    -				# Return safely
    -				return true
    -			)
    -			.on('add change:urls', (model) ->
    -				# Skip if we are not a writeable file
    -				return  if model.get('write') is false
    -
    -				# Delete the old urls
    -				for url in model.previous('urls') or []
    -					delete docpad.filesByUrl[url]
    -
    -				# Add the new urls
    -				for url in model.get('urls')
    -					docpad.filesByUrl[url] = model.cid
    -
    -				# Return safely
    -				return true
    -			)
    -			.on('add change:outPath', (model) ->
    -				# Skip if we are not a writeable file
    -				return  if model.get('write') is false
    -
    -				# Check if we have changed our outPath
    -				previousOutPath = model.previous('outPath')
    -				if previousOutPath
    -					# Ensure we regenerate anything (on the next regeneration) that was using the same outPath
    -					previousModels = docpad.database.findAll(outPath:previousOutPath)
    -					previousModels.remove(model)
    -					previousModels.each (model) ->
    -						model.set('mtime': new Date())
    -
    -					# Log
    -					docpad.log('debug', 'Updated mtime for these models due to addition of a similar one', previousModels.pluck('relativePath'))
    -
    -					# Update the cache entry with another file that has the same outPath or delete it if there aren't any others
    -					previousModelId = docpad.filesByOutPath[previousOutPath]
    -					if previousModelId is model.id
    -						if previousModels.length
    -							docpad.filesByOutPath[previousOutPath] = previousModelId
    -						else
    -							delete docpad.filesByOutPath[previousOutPath]
    -
    -				# Update the cache entry and fetch the latest if it was already set
    -				if (outPath = model.get('outPath'))
    -					existingModelId = docpad.filesByOutPath[outPath] ?= model.id
    -					if existingModelId isnt model.id
    -						existingModel = docpad.database.get(existingModelId)
    -						if existingModel
    -							# We have a conflict, let the user know
    -							modelPath = model.get('fullPath') or (model.get('relativePath')+':'+model.id)
    -							existingModelPath = existingModel.get('fullPath') or (existingModel.get('relativePath')+':'+existingModel.id)
    -							docpad.warn util.format(docpad.getLocale().outPathConflict, outPath, modelPath, existingModelPath)
    -						else
    -							# There reference was old, update it with our new one
    -							docpad.filesByOutPath[outPath] = model.id
    -
    -				# Return safely
    -				return true
    -			)
    -		@userConfig = extendr.dereferenceJSON(@userConfig)
    -		@initialConfig = extendr.dereferenceJSON(@initialConfig)
    -
    -		# Extract action
    -		if instanceConfig.action?
    -			action = instanceConfig.action
    -		else
    -			action = 'load ready'
    -
    -		# Check if we want to perform an action
    -		if action
    -			@action action, instanceConfig, (err) ->
    -				if next?
    -					next(err, docpad)
    -				else if err
    -					docpad.fatal(err)
    -		else
    -			next?(null, docpad)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Destructor. Destroy the DocPad instance
    -	# This is an action, and should be called as such
    -	# E.g. docpad.action('destroy', next)
    -	# @method destroy
    -	# @param {Object} opts
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	###
    -	destroy: (opts, next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts, next)
    -		docpad = @
    -
    -		# Destroy Regenerate Timer
    -		docpad.destroyRegenerateTimer()
    -
    -		# Wait one second to wait for any logging to complete
    -		docpadUtil.wait 1000, ->
    -
    -			# Destroy Plugins
    -			docpad.emitSerial 'docpadDestroy', (err) ->
    -				# Check
    -				return next?(err)  if err
    -
    -				# Destroy Plugins
    -				docpad.destroyPlugins()
    -
    -				# Destroy Server
    -				docpad.destroyServer()
    -
    -				# Destroy Watchers
    -				docpad.destroyWatchers()
    -
    -				# Destroy Blocks
    -				docpad.destroyBlocks()
    -
    -				# Destroy Collections
    -				docpad.destroyCollections()
    -
    -				# Destroy Database
    -				docpad.destroyDatabase()
    -
    -				# Destroy Logging
    -				docpad.destroyLoggers()
    -
    -				# Destroy Process Listners
    -				process.removeListener('uncaughtException', docpad.error)
    -
    -				# Destroy DocPad Listeners
    -				docpad.removeAllListeners()
    -
    -				# Forward
    -				return next?()
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Emit event, serial
    -	# @private
    -	# @method emitSerial
    -	# @param {String} eventName
    -	# @param {Object} opts
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	###
    -	emitSerial: (eventName, opts, next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts, next)
    -		docpad = @
    -		locale = docpad.getLocale()
    -
    -		# Log
    -		docpad.log 'debug', util.format(locale.emittingEvent, eventName)
    -
    -		# Emit
    -		super eventName, opts, (err) ->
    -			# Check
    -			return next(err)  if err
    -
    -			# Log
    -			docpad.log 'debug', util.format(locale.emittedEvent, eventName)
    -
    -			# Forward
    -			return next(err)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Emit event, parallel
    -	# @private
    -	# @method emitParallel
    -	# @param {String} eventName
    -	# @param {Object} opts
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	###
    -	emitParallel: (eventName, opts, next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts, next)
    -		docpad = @
    -		locale = docpad.getLocale()
    -
    -		# Log
    -		docpad.log 'debug', util.format(locale.emittingEvent, eventName)
    -
    -		# Emit
    -		super eventName, opts, (err) ->
    -			# Check
    -			return next(err)  if err
    -
    -			# Log
    -			docpad.log 'debug', util.format(locale.emittedEvent, eventName)
    -
    -			# Forward
    -			return next(err)
    -
    -		# Chain
    -		@
    -
    -
    -	# =================================
    -	# Helpers
    -
    -	###*
    -	# Get the ignore options for the DocPad project
    -	# @method getIgnoreOpts
    -	# @return {Array} string array of ignore options
    -	###
    -	getIgnoreOpts: ->
    -		return pick(@config, ['ignorePaths', 'ignoreHiddenFiles', 'ignoreCommonPatterns', 'ignoreCustomPatterns'])
    -
    -	###*
    -	# Is the supplied path ignored?
    -	# @method isIgnoredPath
    -	# @param {String} path
    -	# @param {Object} [opts={}]
    -	# @return {Boolean}
    -	###
    -	isIgnoredPath: (path,opts={}) ->
    -		opts = extendr.extend(@getIgnoreOpts(), opts)
    -		return ignorefs.isIgnoredPath(path, opts)
    -
    -	###*
    -	# Scan directory
    -	# @method scandir
    -	# @param {Object} [opts={}]
    -	###
    -	#NB: How does this work? What is returned?
    -	#Does it require a callback (next) passed as
    -	#one of the options
    -	scandir: (opts={}) ->
    -		opts = extendr.extend(@getIgnoreOpts(), opts)
    -		return scandir(opts)
    -
    -	###*
    -	# Watch Directory. Wrapper around the Bevry watchr
    -	# module (https://github.com/bevry/watchr). Used
    -	# internally by DocPad to watch project documents
    -	# and files and then activate the regeneration process
    -	# when any of those items are updated.
    -	# @private
    -	# @method watchdir
    -	# @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: (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
    -		@
    -
    -
    -	# =================================
    -	# Setup and Loading
    -
    -	###*
    -	# DocPad is ready. Peforms the tasks needed after DocPad construction
    -	# and DocPad has loaded. Triggers the docpadReady event.
    -	# next(err,docpadInstance)
    -	# @private
    -	# @method ready
    -	# @param {Object} [opts]
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	# @param {Object} next.docpadInstance
    -	###
    -	ready: (opts,next) ->
    -		# Prepare
    -		[instanceConfig,next] = extractOptsAndCallback(instanceConfig,next)
    -		docpad = @
    -		config = @getConfig()
    -		locale = @getLocale()
    -
    -		# Render Single Extensions
    -		@DocumentModel::defaults.renderSingleExtensions = config.renderSingleExtensions
    -
    -		# Version Check
    -		@compareVersion()
    -
    -		# Welcome Prepare
    -		if @getDebugging()
    -			pluginsList = ("#{pluginName} v#{@loadedPlugins[pluginName].version}"  for pluginName in Object.keys(@loadedPlugins).sort()).join(', ')
    -		else
    -			pluginsList = Object.keys(@loadedPlugins).sort().join(', ')
    -
    -		# Welcome Output
    -		docpad.log 'info', util.format(locale.welcome, @getVersionString())
    -		docpad.log 'notice', locale.welcomeDonate
    -		docpad.log 'info', locale.welcomeContribute
    -		docpad.log 'info', util.format(locale.welcomePlugins, pluginsList)
    -		docpad.log 'info', util.format(locale.welcomeEnvironment, @getEnvironment())
    -
    -		# Prepare
    -		tasks = @createTaskGroup 'ready tasks', next:(err) ->
    -			# Error?
    -			return docpad.error(err)  if err
    -
    -			# All done, forward our DocPad instance onto our creator
    -			return next?(null,docpad)
    -
    -		tasks.addTask 'welcome event', (complete) ->
    -			# No welcome
    -			return complete()  unless config.welcome
    -
    -			# Welcome
    -			docpad.emitSerial('welcome', {docpad}, complete)
    -
    -		tasks.addTask 'track', (complete) ->
    -			# Identify
    -			return docpad.identify(complete)
    -
    -		tasks.addTask 'emit docpadReady', (complete) ->
    -			docpad.emitSerial('docpadReady', {docpad}, complete)
    -
    -		# Run tasks
    -		tasks.run()
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Performs the merging of the passed configuration objects
    -	# @private
    -	# @method mergeConfigurations
    -	# @param {Object} configPackages
    -	# @param {Object} configsToMerge
    -	###
    -	mergeConfigurations: (configPackages,configsToMerge) ->
    -		# Prepare
    -		envs = @getEnvironments()
    -
    -		# Figure out merging
    -		for configPackage in configPackages
    -			continue  unless configPackage
    -			configsToMerge.push(configPackage)
    -			for env in envs
    -				envConfig = configPackage.environments?[env]
    -				configsToMerge.push(envConfig)  if envConfig
    -
    -		# Merge
    -		extendr.deep(configsToMerge...)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Set the instance configuration
    -	# by merging the properties of the passed object
    -	# with the existing DocPad instanceConfig object
    -	# @private
    -	# @method setInstanceConfig
    -	# @param {Object} instanceConfig
    -	###
    -	setInstanceConfig: (instanceConfig) ->
    -		# Merge in the instance configurations
    -		if instanceConfig
    -			logLevel = @getLogLevel()
    -			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
    -		@
    -
    -	###*
    -	# Set the DocPad configuration object.
    -	# Performs a number of tasks, including
    -	# merging the pass instanceConfig with DocPad's
    -	# other config objects.
    -	# next(err,config)
    -	# @private
    -	# @method setConfig
    -	# @param {Object} instanceConfig
    -	# @param {Object} next
    -	# @param {Error} next.err
    -	# @param {Object} next.config
    -	###
    -	setConfig: (instanceConfig,next) ->
    -		# Prepare
    -		[instanceConfig,next] = extractOptsAndCallback(instanceConfig,next)
    -		docpad = @
    -		locale = @getLocale()
    -
    -		# Apply the instance configuration, generally we won't have it at this level
    -		# as it would have been applied earlier the load step
    -		@setInstanceConfig(instanceConfig)  if instanceConfig
    -
    -		# Apply the environment
    -		# websitePackageConfig.env is left out of the detection here as it is usually an object
    -		# that is already merged with our process.env by the environment runner
    -		# rather than a string which is the docpad convention
    -		@config.env = @instanceConfig.env or @websiteConfig.env or @initialConfig.env or process.env.NODE_ENV
    -
    -		# Merge configurations
    -		configPackages = [@initialConfig, @userConfig, @websiteConfig, @instanceConfig]
    -		configsToMerge = [@config]
    -		docpad.mergeConfigurations(configPackages, configsToMerge)
    -
    -		# Extract and apply the server
    -		@setServer extendr.defaults({
    -			serverHttp: @config.serverHttp
    -			serverExpress: @config.serverExpress
    -		}, @config.server or {})
    -
    -		# Extract and apply the logger
    -		@setLogLevel(@config.logLevel)
    -
    -		# Resolve any paths
    -		@config.rootPath = pathUtil.resolve(@config.rootPath)
    -		@config.outPath = pathUtil.resolve(@config.rootPath, @config.outPath)
    -		@config.srcPath = pathUtil.resolve(@config.rootPath, @config.srcPath)
    -		@config.databaseCachePath = pathUtil.resolve(@config.rootPath, @config.databaseCachePath)
    -		@config.packagePath = pathUtil.resolve(@config.rootPath, @config.packagePath)
    -
    -		# Resolve Documents, Files, Layouts paths
    -		for type in ['documents','files','layouts']
    -			typePaths = @config[type+'Paths']
    -			for typePath,key in typePaths
    -				typePaths[key] = pathUtil.resolve(@config.srcPath, typePath)
    -
    -		# Resolve Plugins paths
    -		for type in ['plugins']
    -			typePaths = @config[type+'Paths']
    -			for typePath,key in typePaths
    -				typePaths[key] = pathUtil.resolve(@config.rootPath, typePath)
    -
    -		# Bind the error handler, so we don't crash on errors
    -		process.removeListener('uncaughtException', @error)
    -		@removeListener('error', @error)
    -		if @config.catchExceptions
    -			process.setMaxListeners(0)
    -			process.on('uncaughtException', @error)
    -			@on('error', @error)
    -
    -		# Prepare the Post Tasks
    -		postTasks = @createTaskGroup 'setConfig post tasks', next:(err) ->
    -			return next(err, docpad.config)
    -
    -		###
    -		postTasks.addTask 'lazy depedencnies: encoding', (complete) =>
    -			return complete()  unless @config.detectEncoding
    -			return lazyRequire 'encoding', {cwd:corePath, stdio:'inherit'}, (err) ->
    -				docpad.warn(locale.encodingLoadFailed)  if err
    -				return complete()
    -		###
    -
    -		postTasks.addTask 'load plugins', (complete) ->
    -			docpad.loadPlugins(complete)
    -
    -		postTasks.addTask 'extend collections', (complete) ->
    -			docpad.extendCollections(complete)
    -
    -		postTasks.addTask 'fetch plugins templateData', (complete) ->
    -			docpad.emitSerial('extendTemplateData', {templateData:docpad.pluginsTemplateData}, complete)
    -
    -		postTasks.addTask 'fire the docpadLoaded event', (complete) ->
    -			docpad.emitSerial('docpadLoaded', complete)
    -
    -		# Fire post tasks
    -		postTasks.run()
    -
    -		# Chain
    -		@
    -
    -
    -	###*
    -	# Load the various configuration files from the
    -	# file system. Set the instanceConfig.
    -	# next(err,config)
    -	# @private
    -	# @method load
    -	# @param {Object} instanceConfig
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	# @param {Object} next.config
    -	###
    -	load: (instanceConfig,next) ->
    -		# Prepare
    -		[instanceConfig,next] = extractOptsAndCallback(instanceConfig,next)
    -		docpad = @
    -		locale = @getLocale()
    -		instanceConfig or= {}
    -
    -		# Reset non persistant configurations
    -		@websitePackageConfig = {}
    -		@websiteConfig = {}
    -		@config = {}
    -
    -		# Merge in the instance configurations
    -		@setInstanceConfig(instanceConfig)
    -
    -		# Prepare the Load Tasks
    -		preTasks = @createTaskGroup 'load tasks', next:(err) =>
    -			return next(err)  if err
    -			return @setConfig(next)
    -
    -		preTasks.addTask 'normalize the userConfigPath', (complete) =>
    -			safeps.getHomePath (err,homePath) =>
    -				return complete(err)  if err
    -				dropboxPath = pathUtil.resolve(homePath, 'Dropbox')
    -				safefs.exists dropboxPath, (dropboxPathExists) =>
    -					# @TODO: Implement checks here for
    -					# https://github.com/bevry/docpad/issues/799
    -					userConfigDirPath = if dropboxPathExists then dropboxPath else homePath
    -					@userConfigPath = pathUtil.resolve(userConfigDirPath, @userConfigPath)
    -					return complete()
    -
    -		preTasks.addTask "load the user's configuration", (complete) =>
    -			configPath = @userConfigPath
    -			docpad.log 'debug', util.format(locale.loadingUserConfig, configPath)
    -			@loadConfigPath {configPath}, (err,data) =>
    -				return complete(err)  if err
    -
    -				# Apply loaded data
    -				extendr.extend(@userConfig, data or {})
    -
    -				# Done
    -				docpad.log 'debug', util.format(locale.loadingUserConfig, configPath)
    -				return complete()
    -
    -		preTasks.addTask "load the anonymous user's configuration", (complete) =>
    -			# Ignore if username is already identified
    -			return complete()  if @userConfig.username
    -
    -			# User is anonymous, set their username to the hashed and salted mac address
    -			require('getmac').getMac (err,macAddress) =>
    -				if err or !macAddress
    -					docpad.warn(locale.macError, err)
    -					return complete()
    -
    -				# Hash with salt
    -				try
    -					macAddressHash = require('crypto').createHmac('sha1', docpad.hashKey).update(macAddress).digest('hex')
    -				catch err
    -					return complete()  if err
    -
    -				# Apply
    -				if macAddressHash
    -					@userConfig.name ?= "MAC #{macAddressHash}"
    -					@userConfig.username ?= macAddressHash
    -
    -				# Next
    -				return complete()
    -
    -		preTasks.addTask "load the website's package data", (complete) =>
    -			rootPath = pathUtil.resolve(@instanceConfig.rootPath or @initialConfig.rootPath)
    -			configPath = pathUtil.resolve(rootPath, @instanceConfig.packagePath or @initialConfig.packagePath)
    -			docpad.log 'debug', util.format(locale.loadingWebsitePackageConfig, configPath)
    -			@loadConfigPath {configPath}, (err,data) =>
    -				return complete(err)  if err
    -				data or= {}
    -
    -				# Apply loaded data
    -				@websitePackageConfig = data
    -
    -				# Done
    -				docpad.log 'debug', util.format(locale.loadedWebsitePackageConfig, configPath)
    -				return complete()
    -
    -		preTasks.addTask "read the .env file if it exists", (complete) =>
    -			rootPath = pathUtil.resolve(@instanceConfig.rootPath or @websitePackageConfig.rootPath or @initialConfig.rootPath)
    -			configPath = pathUtil.resolve(rootPath, '.env')
    -			docpad.log 'debug', util.format(locale.loadingEnvConfig, configPath)
    -			safefs.exists configPath, (exists) ->
    -				return complete()  unless exists
    -				require('envfile').parseFile configPath, (err,data) ->
    -					return complete(err)  if err
    -					for own key,value of data
    -						process.env[key] = value
    -					docpad.log 'debug', util.format(locale.loadingEnvConfig, configPath)
    -					return complete()
    -
    -		preTasks.addTask "load the website's configuration", (complete) =>
    -			docpad.log 'debug', util.format(locale.loadingWebsiteConfig)
    -			rootPath = pathUtil.resolve(@instanceConfig.rootPath or @initialConfig.rootPath)
    -			configPaths = @instanceConfig.configPaths or @initialConfig.configPaths
    -			for configPath, index in configPaths
    -				configPaths[index] = pathUtil.resolve(rootPath, configPath)
    -			@loadConfigPath {configPaths}, (err,data) =>
    -				return complete(err)  if err
    -				data or= {}
    -
    -				# Apply loaded data
    -				extendr.extend(@websiteConfig, data)
    -
    -				# Done
    -				docpad.log 'debug', util.format(locale.loadedWebsiteConfig)
    -				return complete()
    -
    -		# Run the load tasks synchronously
    -		preTasks.run()
    -
    -		# Chain
    -		@
    -
    -
    -	# =================================
    -	# Configuration
    -
    -	###*
    -	# Update user configuration with the passed data
    -	# @method updateUserConfig
    -	# @param {Object} [data={}]
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	###
    -	updateUserConfig: (data={},next) ->
    -		# Prepare
    -		[data,next] = extractOptsAndCallback(data,next)
    -		docpad = @
    -		userConfigPath = @userConfigPath
    -
    -		# Apply back to our loaded configuration
    -		# does not apply to @config as we would have to reparse everything
    -		# and that appears to be an imaginary problem
    -		extendr.extend(@userConfig, data)  if data
    -
    -		# Convert to CSON
    -		CSON.createCSONString @userConfig, (err, userConfigString) ->
    -			if err
    -				err.context = "Failed to create the CSON string for the user configuration"
    -				return next(err)
    -
    -			# Write it
    -			safefs.writeFile userConfigPath, userConfigString, 'utf8', (err) ->
    -				# Forward
    -				return next(err)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Load a configuration url.
    -	# @method loadConfigUrl
    -	# @param {String} configUrl
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	# @param {Object} next.parsedData
    -	###
    -	loadConfigUrl: (configUrl,next) ->
    -		# Prepare
    -		docpad = @
    -		locale = @getLocale()
    -
    -		# Log
    -		docpad.log 'debug', util.format(locale.loadingConfigUrl, configUrl)
    -
    -		# Read the URL
    -		superAgent
    -			.get(configUrl)
    -			.timeout(30*1000)
    -			.end (err,res) ->
    -				# Check
    -				return next(err)  if err
    -
    -				# Read the string using CSON
    -				CSON.parseCSONString(res.text, next)
    -
    -		# Chain
    -		@
    -
    -
    -	###*
    -	# Load the configuration from a file path
    -	# passed as one of the options (opts.configPath) or
    -	# from DocPad's configPaths
    -	# @private
    -	# @method loadConfigPath
    -	# @param {Object} opts
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	# @param {Object} next.parsedData
    -	###
    -	loadConfigPath: (opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts, next)
    -		docpad = @
    -		locale = @getLocale()
    -
    -		# Prepare
    -		load = (configPath) ->
    -			# Check
    -			return next()  unless configPath
    -
    -			# Log
    -			docpad.log 'debug', util.format(locale.loadingConfigPath, configPath)
    -
    -			# Check that it exists
    -			safefs.exists configPath, (exists) ->
    -				return next()  unless exists
    -
    -				# Prepare CSON Options
    -				csonOptions =
    -					cson: true
    -					json: true
    -					coffeescript: true
    -					javascript: true
    -
    -				# Read the path using CSON
    -				CSON.requireFile configPath, csonOptions, (err, data) ->
    -					if err
    -						err.context = util.format(locale.loadingConfigPathFailed, configPath)
    -						return next(err)
    -
    -					# Check if the data is a function, if so, then execute it as one
    -					while typeChecker.isFunction(data)
    -						try
    -							data = data(docpad)
    -						catch err
    -							return next(err)
    -					unless typeChecker.isObject(data)
    -						err = new Error("Loading the configuration #{docpad.inspector configPath} returned an invalid result #{docpad.inspector data}")
    -						return next(err)  if err
    -
    -					# Return the data
    -					return next(null, data)
    -
    -		# Check
    -		if opts.configPath
    -			load(opts.configPath)
    -		else
    -			@getConfigPath opts, (err,configPath) ->
    -				load(configPath)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Get config paths and check that those
    -	# paths exist
    -	# @private
    -	# @method getConfigPath
    -	# @param {Object} opts
    -	# @param {Object} next
    -	# @param {Error} next.err
    -	# @param {String} next.path
    -	###
    -	getConfigPath: (opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts, next)
    -		docpad = @
    -		config = @getConfig()
    -		result = null
    -
    -		# Ensure array
    -		opts.configPaths ?= config.configPaths
    -		opts.configPaths = [opts.configPaths]  unless typeChecker.isArray(opts.configPaths)
    -
    -		tasks = @createTaskGroup 'getConfigPath tasks', next:(err) ->
    -			return next(err, result)
    -
    -		# Determine our configuration path
    -		opts.configPaths.forEach (configPath) ->
    -			tasks.addTask "Checking if [#{configPath}] exists", (complete) ->
    -				return complete()  if result
    -				safefs.exists configPath, (exists) ->
    -					if exists
    -						result = configPath
    -						tasks.clear()
    -						complete()
    -					else
    -						complete()
    -
    -		# Run them synchronously
    -		tasks.run()
    -
    -		# Chain
    -		@
    -
    -
    -	###*
    -	# Extend collecitons. Create DocPad's
    -	# standard (documents, files
    -	# layouts) and special (generate, referencesOthers,
    -	# hasLayout, html, stylesheet) collections. Set blocks
    -	# @private
    -	# @method extendCollections
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	###
    -	extendCollections: (next) ->
    -		# Prepare
    -		docpad = @
    -		docpadConfig = @getConfig()
    -		locale = @getLocale()
    -		database = @getDatabase()
    -
    -		# Standard Collections
    -		@setCollections({
    -			# Standard Collections
    -			documents: database.createLiveChildCollection()
    -				.setQuery('isDocument', {
    -					render: true
    -					write: true
    -				})
    -				.on('add', (model) ->
    -					docpad.log('debug', util.format(locale.addingDocument, model.getFilePath()))
    -				)
    -			files: database.createLiveChildCollection()
    -				.setQuery('isFile', {
    -					render: false
    -					write: true
    -				})
    -				.on('add', (model) ->
    -					docpad.log('debug', util.format(locale.addingFile, model.getFilePath()))
    -				)
    -			layouts: database.createLiveChildCollection()
    -				.setQuery('isLayout', {
    -					$or:
    -						isLayout: true
    -						fullPath: $startsWith: docpadConfig.layoutsPaths
    -				})
    -				.on('add', (model) ->
    -					docpad.log('debug', util.format(locale.addingLayout, model.getFilePath()))
    -					model.setDefaults({
    -						isLayout: true
    -						render: false
    -						write: false
    -					})
    -				)
    -
    -			# Special Collections
    -			generate: database.createLiveChildCollection()
    -				.setQuery('generate', {
    -					dynamic: false
    -					ignored: false
    -				})
    -				.on('add', (model) ->
    -					docpad.log('debug', util.format(locale.addingGenerate, model.getFilePath()))
    -				)
    -			referencesOthers: database.createLiveChildCollection()
    -				.setQuery('referencesOthers', {
    -					dynamic: false
    -					ignored: false
    -					referencesOthers: true
    -				})
    -				.on('add', (model) ->
    -					docpad.log('debug', util.format(locale.addingReferencesOthers, model.getFilePath()))
    -				)
    -			hasLayout: database.createLiveChildCollection()
    -				.setQuery('hasLayout', {
    -					dynamic: false
    -					ignored: false
    -					layout: $exists: true
    -				})
    -				.on('add', (model) ->
    -					docpad.log('debug', util.format(locale.addingHasLayout, model.getFilePath()))
    -				)
    -			html: database.createLiveChildCollection()
    -				.setQuery('isHTML', {
    -					write: true
    -					outExtension: 'html'
    -				})
    -				.on('add', (model) ->
    -					docpad.log('debug', util.format(locale.addingHtml, model.getFilePath()))
    -				)
    -			stylesheet: database.createLiveChildCollection()
    -				.setQuery('isStylesheet', {
    -					write: true
    -					outExtension: 'css'
    -				})
    -		})
    -
    -		# Blocks
    -		@setBlocks({
    -			meta: new MetaCollection()
    -			scripts: new ScriptsCollection()
    -			styles: new StylesCollection()
    -		})
    -
    -		# Custom Collections Group
    -		tasks = @createTaskGroup "extendCollections tasks", concurrency:0, next:(err) ->
    -			docpad.error(err)  if err
    -			docpad.emitSerial('extendCollections', next)
    -
    -		# Cycle through Custom Collections
    -		eachr docpadConfig.collections or {}, (fn,name) ->
    -			if !name or !typeChecker.isString(name)
    -				err = new Error("Inside your DocPad configuration you have a custom collection with an invalid name of: #{docpad.inspector name}")
    -				docpad.error(err)
    -				return
    -
    -			if !fn or !typeChecker.isFunction(fn)
    -				err = new Error("Inside your DocPad configuration you have a custom collection called #{docpad.inspector name} with an invalid method of: #{docpad.inspector fn}")
    -				docpad.error(err)
    -				return
    -
    -			tasks.addTask "creating the custom collection: #{name}", (complete) ->
    -				# Init
    -				ambi [fn.bind(docpad), fn], database, (err, collection) ->
    -					# Check for error
    -					if err
    -						docpad.error(err)
    -						return complete()
    -
    -					# Check the type of the collection
    -					else unless collection instanceof QueryCollection
    -						docpad.warn util.format(locale.errorInvalidCollection, name)
    -						return complete()
    -
    -					# Make it a live collection
    -					collection.live(true)  if collection
    -
    -					# Apply the collection
    -					docpad.setCollection(name, collection)
    -					return complete()
    -
    -		# Run Custom collections
    -		tasks.run()
    -
    -		# Chain
    -		@
    -
    -
    -	###*
    -	# Reset collections. Perform a complete clean of our collections
    -	# @private
    -	# @method resetCollections
    -	# @param {Object} opts
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	###
    -	resetCollections: (opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts, next)
    -		docpad = @
    -		database = docpad.getDatabase()
    -
    -		# Make it as if we have never generated before
    -		docpad.generated = false
    -
    -		# Perform a complete clean of our collections
    -		database.reset([])
    -		meta = @getBlock('meta').reset([])
    -		scripts = @getBlock('scripts').reset([])
    -		styles = @getBlock('styles').reset([])
    -		# ^ Backbone.js v1.1 changes the return values of these, however we change that in our Element class
    -		# because if we didn't, all our skeletons would fail
    -
    -		# Add default block entries
    -		meta.add("""<meta name="generator" content="DocPad v#{docpad.getVersion()}" />""")  if docpad.getConfig().poweredByDocPad isnt false
    -
    -		# Reset caches
    -		@filesByUrl = {}
    -		@filesBySelector = {}
    -		@filesByOutPath = {}
    -
    -		# Chain
    -		next()
    -		@
    -
    -
    -	###*
    -	# Initialise git repo
    -	# @private
    -	# @method initGitRepo
    -	# @param {Object} opts
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	# @param {Object} next.results
    -	###
    -	initGitRepo: (opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts, next)
    -		docpad = @
    -		config = @getConfig()
    -
    -		# Extract
    -		opts.cwd ?= config.rootPath
    -		opts.output ?= @getDebugging()
    -
    -		# Forward
    -		safeps.initGitRepo(opts, next)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Init node modules
    -	# @private
    -	# @method initNodeModules
    -	# @param {Object} opts
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	# @param {Object} next.results
    -	###
    -	initNodeModules: (opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts, next)
    -		docpad = @
    -		config = @getConfig()
    -
    -		# Extract
    -		opts.cwd ?= config.rootPath
    -		opts.output ?= docpad.getDebugging()
    -		opts.force ?= if config.offline then false else true
    -		# ^ @todo this line causes --force to be added, when it shouldn't be
    -		opts.args ?= []
    -		opts.args.push('--force')  if config.force
    -		opts.args.push('--no-registry')  if config.offline
    -
    -		# Log
    -		docpad.log('info', 'npm install')  if opts.output
    -
    -		# Forward
    -		safeps.initNodeModules(opts, next)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Fix node package versions
    -	# Combat to https://github.com/npm/npm/issues/4587#issuecomment-35370453
    -	# @private
    -	# @method fixNodePackageVersions
    -	# @param {Object} opts
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	###
    -	fixNodePackageVersions: (opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts, next)
    -		docpad = @
    -		config = @getConfig()
    -
    -		# Extract
    -		opts.packagePath ?= config.packagePath
    -
    -		# Read and replace
    -		safefs.readFile opts.packagePath, (err,buffer) ->
    -			data = buffer.toString()
    -			data = data.replace(/("docpad(?:.*?)": ")\^/g, '$1~')
    -			safefs.writeFile opts.packagePath, data, (err) ->
    -				return next(err)
    -
    -		# Chain
    -		@
    -
    -
    -	###*
    -	# Install node module. Same as running
    -	# 'npm install' through the command line
    -	# @private
    -	# @method installNodeModule
    -	# @param {Array} names
    -	# @param {Object} opts
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	# @param {Object} next.result
    -	###
    -	installNodeModule: (names,opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts, next)
    -		docpad = @
    -		config = @getConfig()
    -
    -		# Extract
    -		opts.cwd ?= config.rootPath
    -		opts.args ?= []
    -		if docpad.getDebugging()
    -			opts.stdio ?= 'inherit'
    -
    -		opts.global ?= false
    -		opts.global = ['--global']             if opts.global is true
    -		opts.global = [opts.global]            if opts.global and Array.isArray(opts.global) is false
    -
    -		opts.save ?= !opts.global
    -		opts.save = ['--save']                 if opts.save is true
    -		opts.save = [opts.save]                if opts.save and Array.isArray(opts.save) is false
    -
    -		# Command
    -		command = ['npm', 'install']
    -
    -		# Names
    -		names = names.split(/[,\s]+/)  unless typeChecker.isArray(names)
    -		names.forEach (name) ->
    -			# Check
    -			return  unless name
    -
    -			# Ensure latest if version isn't specfied
    -			name += '@latest'  if name.indexOf('@') is -1
    -
    -			# Push the name to the commands
    -			command.push(name)
    -
    -		# Arguments
    -		command.push(opts.args...)
    -		command.push('--force')           if config.force
    -		command.push('--no-registry')     if config.offline
    -		command.push(opts.save...)        if opts.save
    -		command.push(opts.global...)      if opts.global
    -
    -		# Log
    -		docpad.log('info', command.join(' '))  if opts.output
    -
    -		# Forward
    -		safeps.spawn(command, opts, next)
    -
    -		# Chain
    -		@
    -
    -
    -	###*
    -	# Uninstall node module. Same as running
    -	# 'npm uninstall' through the command line
    -	# @private
    -	# @method uninstallNodeModule
    -	# @param {Array} names
    -	# @param {Object} opts
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	# @param {Object} next.result
    -	###
    -	uninstallNodeModule: (names,opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts, next)
    -		docpad = @
    -		config = @getConfig()
    -
    -		# Extract
    -		opts.cwd ?= config.rootPath
    -		opts.output ?= docpad.getDebugging()
    -		opts.args ?= []
    -
    -		opts.global ?= false
    -		opts.global = ['--global']             if opts.global is true
    -		opts.global = [opts.global]            if opts.global and Array.isArray(opts.global) is false
    -
    -		opts.save ?= !opts.global
    -		opts.save = ['--save', '--save-dev']   if opts.save is true
    -		opts.save = [opts.save]                if opts.save and Array.isArray(opts.save) is false
    -
    -		# Command
    -		command = ['npm', 'uninstall']
    -
    -		# Names
    -		names = names.split(/[,\s]+/)  unless typeChecker.isArray(names)
    -		command.push(names...)
    -
    -		# Arguments
    -		command.push(opts.args...)
    -		command.push(opts.save...)        if opts.save
    -		command.push(opts.global...)      if opts.global
    -
    -		# Log
    -		docpad.log('info', command.join(' '))  if opts.output
    -
    -		# Forward
    -		safeps.spawn(command, opts, next)
    -
    -		# Chain
    -		@
    -
    -
    -
    -	# =================================
    -	# Logging
    -
    -	###*
    -	# Set the log level
    -	# @private
    -	# @method setLogLevel
    -	# @param {Number} level
    -	###
    -	setLogLevel: (level) ->
    -		@getLogger().setConfig({level})
    -		if level is 7
    -			loggers = @getLoggers()
    -			if loggers.debug? is false
    -				loggers.debug = loggers.logger
    -					.pipe(
    -						require('caterpillar-human').create(color:false)
    -					)
    -					.pipe(
    -						require('fs').createWriteStream(@debugLogPath)
    -					)
    -		@
    -
    -	###*
    -	# Get the log level
    -	# @method getLogLevel
    -	# @return {Number} the log level
    -	###
    -	getLogLevel: ->
    -		return @getConfig().logLevel
    -
    -	###*
    -	# Are we debugging?
    -	# @method getDebugging
    -	# @return {Boolean}
    -	###
    -	getDebugging: ->
    -		return @getLogLevel() is 7
    -
    -
    -	###*
    -	# Handle a fatal error
    -	# @private
    -	# @method fatal
    -	# @param {Object} err
    -	###
    -	fatal: (err) ->
    -		docpad = @
    -		config = @getConfig()
    -
    -		# Check
    -		return @  unless err
    -
    -		# Handle
    -		@error(err)
    -
    -		# Even though the error would have already been logged by the above
    -		# Ensure it is definitely outputted in the case the above fails
    -		docpadUtil.writeError(err)
    -
    -		# Destroy DocPad
    -		@destroy()
    -
    -		# Chain
    -		@
    -
    -
    -	###*
    -	# Inspect. Converts object to JSON string. Wrapper around nodes util.inspect method.
    -	# Can't use the inspect namespace as for some silly reason it destroys everything
    -	# @method inspector
    -	# @param {Object} obj
    -	# @param {Object} opts
    -	# @return {String} JSON string of passed object
    -	###
    -	inspector: (obj, opts) ->
    -		opts ?= {}
    -		opts.colors ?= @getConfig().color
    -		return docpadUtil.inspect(obj, opts)
    -
    -	###*
    -	# Log arguments
    -	# @property {Object} log
    -	# @param {Mixed} args...
    -	###
    -	log: (args...) ->
    -		# Log
    -		logger = @getLogger() or console
    -		logger.log.apply(logger, args)
    -
    -		# Chain
    -		@
    -
    -
    -	###*
    -	# Create an error object
    -	# @method createError
    -	# @param {Object} err
    -	# @param {Object} opts
    -	# @return {Object} the error
    -	###
    -	# @TODO: Decide whether or not we should track warnings
    -	# Previously we didn't, but perhaps it would be useful
    -	# If the statistics gets polluted after a while, we will remove it
    -	# Ask @balupton to check the stats after March 30th 2015
    -	createError: (err, opts) ->
    -		# Prepare
    -		opts ?= {}
    -		opts.level ?= err.level ? 'error'
    -		opts.track ?= err.track ? true
    -		opts.tracked ?= err.tracked ? false
    -		opts.log ?= err.log ? true
    -		opts.logged ?= err.logged ? false
    -		opts.notify ?= err.notify ? true
    -		opts.notified ?= err.notified ? false
    -		opts.context ?= err.context  if err.context?
    -
    -		# Ensure we have an error object
    -		err = new Error(err)  unless err.stack
    -
    -		# Add our options to the error object
    -		for own key,value of opts
    -			err[key] ?= value
    -
    -		# Return the error
    -		return err
    -
    -
    -	###*
    -	# Create an error (tracks it) and log it
    -	# @method error
    -	# @param {Object} err
    -	# @param {Object} [level='err']
    -	###
    -	error: (err, level='err') ->
    -		# Prepare
    -		docpad = @
    -
    -		# Create the error and track it
    -		err = @createError(err, {level})
    -
    -		# Track the error
    -		@trackError(err)
    -
    -		# Log the error
    -		@logError(err)
    -
    -		# Notify the error
    -		@notifyError(err)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Log an error
    -	# @method logError
    -	# @param {Object} err
    -	###
    -	logError: (err) ->
    -		# Prepare
    -		docpad = @
    -		locale = @getLocale()
    -
    -		# Track
    -		if err and err.log isnt false and err.logged isnt true
    -			err = @createError(err, {logged:true})
    -			occured =
    -				if err.level in ['warn', 'warning']
    -					locale.warnOccured
    -				else
    -					locale.errorOccured
    -			message =
    -				if err.context
    -					err.context+locale.errorFollows
    -				else
    -					occured
    -			message += '\n\n'+err.stack.toString().trim()
    -			message += '\n\n'+locale.errorSubmission
    -			docpad.log(err.level, message)
    -
    -		# Chain
    -		@
    -
    -
    -	###*
    -	# Track an error in the background
    -	# @private
    -	# @method trackError
    -	# @param {Object} err
    -	###
    -	trackError: (err) ->
    -		# Prepare
    -		docpad = @
    -		config = @getConfig()
    -
    -		# Track
    -		if err and err.track isnt false and err.tracked isnt true and config.offline is false and config.reportErrors is true
    -			err = @createError(err, {tracked:true})
    -			data = {}
    -			data.message = err.message
    -			data.stack = err.stack.toString().trim()  if err.stack
    -			data.config = config
    -			data.env = process.env
    -			docpad.track('error', data)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Notify error
    -	# @private
    -	# @method notifyError
    -	# @param {Object} err
    -	###
    -	notifyError: (err) ->
    -		# Prepare
    -		docpad = @
    -		locale = @getLocale()
    -
    -		# Check
    -		if err.notify isnt false and err.notified isnt true
    -			err.notified = true
    -			occured =
    -				if err.level in ['warn', 'warning']
    -					locale.warnOccured
    -				else
    -					locale.errorOccured
    -			docpad.notify(err.message, {title:occured})
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Log an error of level 'warn'
    -	# @method warn
    -	# @param {String} message
    -	# @param {Object} err
    -	# @return {Object} description
    -	###
    -	warn: (message, err) ->
    -		# Handle
    -		if err
    -			err.context = message
    -			err.level = 'warn'
    -			@error(err)
    -		else
    -			err =
    -				if message instanceof Error
    -					message
    -				else
    -					new Error(message)
    -			err.level = 'warn'
    -			@error(err)
    -
    -		# Chain
    -		@
    -
    -
    -	###*
    -	# Send a notify event to plugins (like growl)
    -	# @method notify
    -	# @param {String} message
    -	# @param {Object} [opts={}]
    -	###
    -	notify: (message,opts={}) ->
    -		# Prepare
    -		docpad = @
    -
    -		# Emit
    -		docpad.emitSerial 'notify', {message,opts}, (err) ->
    -			docpad.error(err)  if err
    -
    -		# Chain
    -		@
    -
    -
    -	###*
    -	# Check Request
    -	# @private
    -	# @method checkRequest
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	# @param {Object} next.res
    -	###
    -	checkRequest: (next) ->
    -		next ?= @error.bind(@)
    -		return (err,res) ->
    -			# Check
    -			return next(err, res)  if err
    -
    -			# Check
    -			if res.body?.success is false or res.body?.error
    -				err = new Error(res.body.error or 'unknown request error')  # @TODO localise this
    -				return next(err, res)
    -
    -			# Success
    -			return next(null, res)
    -
    -
    -	###*
    -	# Subscribe to the DocPad email list.
    -	# @private
    -	# @method subscribe
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	###
    -	subscribe: (next) ->
    -		# Prepare
    -		config = @getConfig()
    -
    -		# Check
    -		if config.offline is false
    -			if @userConfig?.email
    -				# Data
    -				data = {}
    -				data.email = @userConfig.email  # required
    -				data.name = @userConfig.name or null
    -				data.username = @userConfig.username or null
    -
    -				# Apply
    -				superAgent
    -					.post(config.helperUrl)
    -					.type('json').set('Accept', 'application/json')
    -					.query(
    -						method: 'add-subscriber'
    -					)
    -					.send(data)
    -					.timeout(30*1000)
    -					.end @checkRequest next
    -			else
    -				err = new Error('Email not provided')  # @TODO localise this
    -				next?(err)
    -		else
    -			next?()
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Track
    -	# @private
    -	# @method track
    -	# @param {String} name
    -	# @param {Object} [things={}]
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	###
    -	track: (name,things={},next) ->
    -		# Prepare
    -		docpad = @
    -		config = @getConfig()
    -
    -		# Check
    -		if config.offline is false and config.reportStatistics
    -			# Data
    -			data = {}
    -			data.userId = @userConfig.username or null
    -			data.event = name
    -			data.properties = things
    -
    -			# Things
    -			things.websiteName = @websitePackageConfig.name  if @websitePackageConfig?.name
    -			things.platform = @getProcessPlatform()
    -			things.environment = @getEnvironment()
    -			things.version = @getVersion()
    -			things.nodeVersion = @getProcessVersion()
    -
    -			# Plugins
    -			eachr docpad.loadedPlugins, (value,key) ->
    -				things['plugin-'+key] = value.version or true
    -
    -			# Apply
    -			trackRunner = docpad.getTrackRunner()
    -			trackRunner.addTask 'track task', (complete) ->
    -				superAgent
    -					.post(config.helperUrl)
    -					.type('json').set('Accept', 'application/json')
    -					.query(
    -						method: 'analytics'
    -						action: 'track'
    -					)
    -					.send(data)
    -					.timeout(30*1000)
    -					.end docpad.checkRequest (err) ->
    -						next?(err)
    -						complete(err)  # we pass the error here, as if we error, we want to stop all tracking
    -
    -			# Execute the tracker tasks
    -			trackRunner.run()
    -		else
    -			next?()
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Identify DocPad user
    -	# @private
    -	# @method identify
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	###
    -	identify: (next) ->
    -		# Prepare
    -		docpad = @
    -		config = @getConfig()
    -
    -		# Check
    -		if config.offline is false and config.reportStatistics and @userConfig?.username
    -			# Data
    -			data = {}
    -			data.userId = @userConfig.username  # required
    -			data.traits = things = {}
    -
    -			# Things
    -			now = new Date()
    -			things.username = @userConfig.username  # required
    -			things.email = @userConfig.email or null
    -			things.name = @userConfig.name or null
    -			things.lastLogin = now.toISOString()
    -			things.lastSeen = now.toISOString()
    -			things.countryCode = safeps.getCountryCode()
    -			things.languageCode = safeps.getLanguageCode()
    -			things.platform = @getProcessPlatform()
    -			things.version = @getVersion()
    -			things.nodeVersion = @getProcessVersion()
    -
    -			# Is this a new user?
    -			if docpad.userConfig.identified isnt true
    -				# Update
    -				things.created = now.toISOString()
    -
    -				# Create the new user
    -				docpad.getTrackRunner().addTask 'create new user', (complete) ->
    -					superAgent
    -						.post(config.helperUrl)
    -						.type('json').set('Accept', 'application/json')
    -						.query(
    -							method: 'analytics'
    -							action: 'identify'
    -						)
    -						.send(data)
    -						.timeout(30*1000)
    -						.end docpad.checkRequest (err) ->
    -							# Save the changes with these
    -							docpad.updateUserConfig({identified:true}, complete)
    -
    -			# Or an existing user?
    -			else
    -				# Update the existing user's information witht he latest
    -				docpad.getTrackRunner().addTask 'update user', (complete) ->
    -					superAgent
    -						.post(config.helperUrl)
    -						.type('json').set('Accept', 'application/json')
    -						.query(
    -							method: 'analytics'
    -							action: 'identify'
    -						)
    -						.send(data)
    -						.timeout(30*1000)
    -						.end docpad.checkRequest complete
    -
    -		# Chain
    -		next?()
    -		@
    -
    -
    -	# =================================
    -	# Models and Collections
    -
    -	# ---------------------------------
    -	# b/c compat functions
    -
    -	###*
    -	# Create file model. Calls
    -	# {{#crossLink "DocPad/createModel:method"}}{{/crossLink}}
    -	# with the 'file' modelType.
    -	# @method createFile
    -	# @param {Object} [attrs={}]
    -	# @param {Object} [opts={}]
    -	# @return {Object} FileModel
    -	###
    -	createFile: (attrs={},opts={}) ->
    -		opts.modelType = 'file'
    -		return @createModel(attrs, opts)
    -
    -	###*
    -	# Create document model. Calls
    -	# {{#crossLink "DocPad/createModel:method"}}{{/crossLink}}
    -	# with the 'document' modelType.
    -	# @method createDocument
    -	# @param {Object} [attrs={}]
    -	# @param {Object} [opts={}]
    -	# @return {Object} DocumentModel
    -	###
    -	createDocument: (attrs={},opts={}) ->
    -		opts.modelType = 'document'
    -		return @createModel(attrs, opts)
    -
    -
    -	###*
    -	# Parse the files directory and
    -	# return a files collection to
    -	# the passed callback
    -	# @method parseFileDirectory
    -	# @param {Object} [opts={}]
    -	# @param {Function} next callback
    -	# @param {Error} next.err
    -	# @param {Object} next.files files collection
    -	###
    -	parseFileDirectory: (opts={},next) ->
    -		opts.modelType ?= 'file'
    -		opts.collection ?= @getDatabase()
    -		return @parseDirectory(opts, next)
    -
    -	###*
    -	# Parse the documents directory and
    -	# return a documents collection to
    -	# the passed callback.
    -	#
    -	# The partials plugin (https://github.com/docpad/docpad-plugin-partials)
    -	# uses this method to load a collection of
    -	# files from the partials directory.
    -	#
    -	# 	docpad.parseDocumentDirectory({path: config.partialsPath}, next)
    -	#
    -	# @method parseDocumentDirectory
    -	# @param {Object} [opts={}]
    -	# @param {String} [opts.modelType='document']
    -	# @param {Object} [opts.collection=docpad.database]
    -	# @param {Object} [opts.path]
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	# @param {Object} next.files files collection of documents
    -	###
    -	parseDocumentDirectory: (opts={},next) ->
    -		opts.modelType ?= 'document'
    -		opts.collection ?= @getDatabase()
    -		return @parseDirectory(opts, next)
    -
    -
    -	# ---------------------------------
    -	# Standard functions
    -
    -
    -	###*
    -	# Attach events to a document model.
    -	# @private
    -	# @method attachModelEvents
    -	# @param {Object} model
    -	###
    -	attachModelEvents: (model) ->
    -		# Prepare
    -		docpad = @
    -
    -		# Only attach events if we haven't already done so
    -		if model.attachedDocumentEvents isnt true
    -			model.attachedDocumentEvents = true
    -
    -			# Attach document events
    -			if model.type is 'document'
    -				# Clone
    -				model.on 'clone', (clonedModel) ->
    -					docpad.attachModelEvents(clonedModel)
    -
    -				# Render
    -				model.on 'render', (args...) ->
    -					docpad.emitSerial('render', args...)
    -
    -				# Render document
    -				model.on 'renderDocument', (args...) ->
    -					docpad.emitSerial('renderDocument', args...)
    -
    -				# Fetch a layout
    -				model.on 'getLayout', (opts={},next) ->
    -					opts.collection = docpad.getCollection('layouts')
    -					layout = docpad.getFileBySelector(opts.selector, opts)
    -					next(null, {layout})
    -
    -			# Remove
    -			#model.on 'remove', (file) ->
    -			#	docpad.getDatabase().remove(file)
    -			# ^ Commented out as for some reason this stops layouts from working
    -
    -			# Error
    -			model.on 'error', (args...) ->
    -				docpad.error(args...)
    -
    -			# Log
    -			model.on 'log', (args...) ->
    -				if args.length is 2
    -					if args[0] in ['err', 'error']
    -						docpad.error(args[1])
    -						return
    -
    -					if args[0] in ['warn', 'warning']
    -						docpad.warn(args[1])
    -						return
    -
    -				docpad.log(args...)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Add supplied model to the DocPad database. If the passed
    -	# model definition is a plain object of properties, a new
    -	# model will be created prior to adding to the database.
    -	# Calls {{#crossLink "DocPad/createModel:method"}}{{/crossLink}}
    -	# before adding the model to the database.
    -	#
    -	#	# Override the stat's mtime to now
    -	#	# This is because renames will not update the mtime
    -	#	fileCurrentStat?.mtime = new Date()
    -	#
    -	#	# Create the file object
    -	#	file = docpad.addModel({fullPath:filePath, stat:fileCurrentStat})
    -	#
    -	# @method addModel
    -	# @param {Object} model either a plain object defining the required properties, in particular
    -	# the file path or an actual model object
    -	# @param {Object} opts
    -	# @return {Object} the model
    -	###
    -	addModel: (model, opts) ->
    -		model = @createModel(model, opts)
    -		@getDatabase().add(model)
    -		return model
    -
    -	###*
    -	# Add the supplied collection of models to the DocPad database.
    -	# Calls {{#crossLink "DocPad/createModels:method"}}{{/crossLink}}
    -	# before adding the models to the database.
    -	#
    -	# 	databaseData = JSON.parse data.toString()
    -	#	models = docpad.addModels(databaseData.models)
    -	#
    -	# @method addModels
    -	# @param {Object} models DocPad collection of models
    -	# @param {Object} opts
    -	# @return {Object} the models
    -	###
    -	addModels: (models, opts) ->
    -		models = @createModels(models, opts)
    -		@getDatabase().add(models)
    -		return models
    -
    -	###*
    -	# Create a collection of models from the supplied collection
    -	# ensuring that the collection is suitable for adding to the
    -	# DocPad database. The method calls {{#crossLink "DocPad/createModel"}}{{/crossLink}}
    -	# for each model in the models array.
    -	# @private
    -	# @method createModels
    -	# @param {Object} models DocPad collection of models
    -	# @param {Object} opts
    -	# @return {Object} the models
    -	###
    -	createModels: (models, opts) ->
    -		for model in models
    -			@createModel(model, opts)
    -		# return the for loop results
    -
    -	###*
    -	# Creates either a file or document model.
    -	# The model type to be created can be passed
    -	# as an opts property, if not, the method will
    -	# attempt to determing the model type by checking
    -	# if the file is in one of the documents or
    -	# layout paths.
    -	#
    -	# Ensures a duplicate model is not created
    -	# and all required attributes are present and
    -	# events attached.
    -	#
    -	# Generally it is not necessary for an application
    -	# to manually create a model via creatModel as DocPad
    -	# will handle this process when watching a project's
    -	# file and document directories. However, it is possible
    -	# that a plugin might have a requirement to do so.
    -	#
    -	# 	model = @docpad.createModel({fullPath:fullPath})
    -    #   model.load()
    -    #   @docpad.getDatabase().add(model)
    -	#
    -	# @method createModel
    -	# @param {Object} [attrs={}]
    -	# @param {String} attrs.fullPath the full path to the file
    -	# @param {Object} [opts={}]
    -	# @param {String} opts.modelType either 'file' or 'document'
    -	# @return {Object} the file or document model
    -	###
    -	createModel: (attrs={},opts={}) ->
    -		# Check
    -		if attrs instanceof FileModel
    -			return attrs
    -
    -		# Prepare
    -		docpad = @
    -		config = @getConfig()
    -		database = @getDatabase()
    -		fileFullPath = attrs.fullPath or null
    -
    -
    -		# Find or create
    -		# This functionality use to be inside ensureModel
    -		# But that caused duplicates in some instances
    -		# So now we will always check
    -		if attrs.fullPath
    -			result = database.findOne(fullPath: attrs.fullPath)
    -			if result
    -				return result
    -
    -
    -		# -----------------------------
    -		# Try and determine the model type
    -
    -		# If the type hasn't been specified try and detemrine it based on the full path
    -		if fileFullPath
    -			# Check if we have a document or layout
    -			unless opts.modelType
    -				for dirPath in config.documentsPaths.concat(config.layoutsPaths)
    -					if fileFullPath.indexOf(dirPath) is 0
    -						attrs.relativePath or= fileFullPath.replace(dirPath, '').replace(/^[\/\\]/,'')
    -						opts.modelType = 'document'
    -						break
    -
    -			# Check if we have a file
    -			unless opts.modelType
    -				for dirPath in config.filesPaths
    -					if fileFullPath.indexOf(dirPath) is 0
    -						attrs.relativePath or= fileFullPath.replace(dirPath, '').replace(/^[\/\\]/,'')
    -						opts.modelType = 'file'
    -						break
    -
    -		# -----------------------------
    -		# Create the appropriate emodel
    -
    -		# Extend the opts with things we need
    -		opts = extendr.extend({
    -			detectEncoding: config.detectEncoding
    -			rootOutDirPath: config.outPath
    -			locale: @getLocale()
    -			TaskGroup: @createTaskGroup  # @TODO this a bit dodgy, but works well enough
    -		}, opts)
    -
    -		if opts.modelType is 'file'
    -			# Create a file model
    -			model = new FileModel(attrs, opts)
    -		else
    -			# Create document model
    -			model = new DocumentModel(attrs, opts)
    -
    -		# -----------------------------
    -		# Finish up
    -
    -		# Attach Events
    -		@attachModelEvents(model)
    -
    -		# Return
    -		return model
    -
    -	###*
    -	# Parse a directory and return a
    -	# files collection
    -	# @method parseDirectory
    -	# @param {Object} [opts={}]
    -	# @param {Object} next
    -	# @param {Error} next.err
    -	# @param {Object} next.files files collection
    -	###
    -	parseDirectory: (opts={},next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts, next)
    -		docpad = @
    -		locale = @getLocale()
    -
    -		# Extract
    -		{path,createFunction} = opts
    -		createFunction ?= @createModel
    -		files = opts.collection or new FilesCollection()
    -
    -		# Check if the directory exists
    -		safefs.exists path, (exists) ->
    -			# Check
    -			unless exists
    -				# Log
    -				docpad.log 'debug', util.format(locale.renderDirectoryNonexistant, path)
    -
    -				# Forward
    -				return next()
    -
    -			# 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, filename, fileStat) ->
    -					# Prepare
    -					data =
    -						fullPath: fileFullPath
    -						relativePath: fileRelativePath
    -						stat: fileStat
    -
    -					# Create file
    -					file = createFunction.call(docpad, data, opts)
    -
    -					# 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)
    -
    -							# Next
    -							complete()
    -
    -					# Return
    -					return
    -
    -				# Next
    -				next: (err) ->
    -					return next(err)  if err
    -					tasks.run()
    -			)
    -
    -		# Chain
    -		@
    -
    -
    -	# =================================
    -	# Plugins
    -
    -	###*
    -	# Get a plugin by it's name
    -	# @method getPlugin
    -	# @param {Object} pluginName
    -	# @return {Object} a DocPad plugin
    -	###
    -	getPlugin: (pluginName) ->
    -		@loadedPlugins[pluginName]
    -
    -
    -	###*
    -	# Check if we have any plugins
    -	# @method hasPlugins
    -	# @return {Boolean}
    -	###
    -	hasPlugins: ->
    -		return typeChecker.isEmptyObject(@loadedPlugins) is false
    -
    -	###*
    -	# Destructor. Destroy plugins
    -	# @private
    -	# @method destroyPlugins
    -	###
    -	destroyPlugins: ->
    -		for own name,plugin of @loadedPlugins
    -			plugin.destroy()
    -			@loadedPlugins[name] = null
    -		@
    -
    -	###*
    -	# Load plugins from the file system
    -	# next(err)
    -	# @private
    -	# @method loadPlugins
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	###
    -	loadPlugins: (next) ->
    -		# Prepare
    -		docpad = @
    -		locale = @getLocale()
    -
    -		# Snore
    -		@slowPlugins = {}
    -		snore = balUtil.createSnore ->
    -			docpad.log 'notice', util.format(locale.pluginsSlow, Object.keys(docpad.slowPlugins).join(', '))
    -
    -		# Async
    -		tasks = @createTaskGroup "loadPlugins tasks", concurrency:0, next:(err) ->
    -			docpad.slowPlugins = {}
    -			snore.clear()
    -			return next(err)
    -
    -		# Load website plugins
    -		(@config.pluginsPaths or []).forEach (pluginsPath) ->
    -			tasks.addTask "load the website's plugins at: #{pluginsPath}", (complete) ->
    -				safefs.exists pluginsPath, (exists) ->
    -					return complete()  unless exists
    -					docpad.loadPluginsIn(pluginsPath, complete)
    -
    -		# Load specific plugins
    -		(@config.pluginPaths or []).forEach (pluginPath) ->
    -			tasks.addTask "load custom plugins at: #{pluginPath}", (complete) ->
    -				safefs.exists pluginPath, (exists) ->
    -					return complete()  unless exists
    -					docpad.loadPlugin(pluginPath, complete)
    -
    -		# Execute the loading asynchronously
    -		tasks.run()
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Checks if a plugin was loaded succesfully.
    -	# @method loadedPlugin
    -	# @param {String} pluginName
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	# @param {Boolean} next.loaded
    -	###
    -	loadedPlugin: (pluginName,next) ->
    -		# Prepare
    -		docpad = @
    -
    -		# Check
    -		loaded = docpad.loadedPlugins[pluginName]?
    -		next(null,loaded)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Load a plugin from its full file path
    -	# _next(err)
    -	# @private
    -	# @method loadPlugin
    -	# @param {String} fileFullPath
    -	# @param {Function} _next
    -	# @param {Error} _next.err
    -	# @return {Object} description
    -	###
    -	loadPlugin: (fileFullPath,_next) ->
    -		# Prepare
    -		docpad = @
    -		config = @getConfig()
    -		locale = @getLocale()
    -		next = (err) ->
    -			# Remove from slow plugins
    -			delete docpad.slowPlugins[pluginName]
    -			# Forward
    -			return _next(err)
    -
    -		# Prepare variables
    -		loader = new PluginLoader(
    -			dirPath: fileFullPath
    -			docpad: @
    -			BasePlugin: BasePlugin
    -		)
    -		pluginName = loader.pluginName
    -		enabled = (
    -			(config.enableUnlistedPlugins  and  config.enabledPlugins[pluginName]? is false)  or
    -			config.enabledPlugins[pluginName] is true
    -		)
    -
    -		# If we've already been loaded, then exit early as there is no use for us to load again
    -		if docpad.loadedPlugins[pluginName]?
    -			# However we probably want to reload the configuration as perhaps the user or environment configuration has changed
    -			docpad.loadedPlugins[pluginName].setConfig()
    -			# Complete
    -			return _next()
    -
    -		# Add to loading stores
    -		docpad.slowPlugins[pluginName] = true
    -
    -		# Check
    -		unless enabled
    -			# Skip
    -			docpad.log 'debug', util.format(locale.pluginSkipped, pluginName)
    -			return next()
    -		else
    -			# Load
    -			docpad.log 'debug', util.format(locale.pluginLoading, pluginName)
    -
    -			# Check existance
    -			loader.exists (err,exists) ->
    -				# Error or doesn't exist?
    -				return next(err)  if err or not exists
    -
    -				# Check support
    -				loader.unsupported (err,unsupported) ->
    -					# Error?
    -					return next(err)  if err
    -
    -					# Unsupported?
    -					if unsupported
    -						# Version?
    -						if unsupported in ['version-docpad','version-plugin'] and config.skipUnsupportedPlugins is false
    -							docpad.log 'warn', util.format(locale.pluginContinued, pluginName)
    -						else
    -							# Type?
    -							if unsupported is 'type'
    -								docpad.log 'debug', util.format(locale.pluginSkippedDueTo, pluginName, unsupported)
    -
    -							# Something else?
    -							else
    -								docpad.log 'warn', util.format(locale.pluginSkippedDueTo, pluginName, unsupported)
    -							return next()
    -
    -					# Load the class
    -					loader.load (err) ->
    -						return next(err)  if err
    -
    -						# Create an instance
    -						loader.create {}, (err,pluginInstance) ->
    -							return next(err)  if err
    -
    -							# Add to plugin stores
    -							docpad.loadedPlugins[loader.pluginName] = pluginInstance
    -
    -							# Log completion
    -							docpad.log 'debug', util.format(locale.pluginLoaded, pluginName)
    -
    -							# Forward
    -							return next()
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Load plugins from a directory path
    -	# @private
    -	# @method loadPluginsIn
    -	# @param {String} pluginsPath
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	###
    -	loadPluginsIn: (pluginsPath, next) ->
    -		# Prepare
    -		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)
    -		docpad.scandir(
    -			# Path
    -			path: pluginsPath
    -
    -			# Skip files
    -			fileAction: false
    -
    -			# Handle directories
    -			dirAction: (fileFullPath, fileRelativePath, pluginName) ->
    -				# Prepare
    -				pluginName = pathUtil.basename(fileFullPath)
    -
    -				# 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 complete()
    -
    -			# Next
    -			next: (err) ->
    -				return next(err)  if err
    -				tasks.run()
    -		)
    -
    -		# Chain
    -		@
    -
    -
    -	# =================================
    -	# Utilities
    -
    -	# ---------------------------------
    -	# Utilities: Misc
    -
    -	###*
    -	# Compare current DocPad version to the latest
    -	# and print out the result to the console.
    -	# Used at startup.
    -	# @private
    -	# @method compareVersion
    -	###
    -	compareVersion: ->
    -		# Prepare
    -		docpad = @
    -		config = @getConfig()
    -		locale = @getLocale()
    -
    -		# Check
    -		return @  if config.offline or !config.checkVersion
    -
    -		# Check
    -		balUtil.packageCompare(
    -			local: @packagePath
    -			remote: config.helperUrl+'latest'
    -			newVersionCallback: (details) ->
    -				isLocalInstallation = docpadUtil.isLocalDocPadExecutable()
    -				message = (if isLocalInstallation then locale.versionOutdatedLocal else locale.versionOutdatedGlobal)
    -				currentVersion = 'v'+details.local.version
    -				latestVersion = 'v'+details.remote.version
    -				upgradeUrl = details.local.upgradeUrl or details.remote.installUrl or details.remote.homepage
    -				messageFilled = util.format(message, currentVersion, latestVersion, upgradeUrl)
    -				docpad.notify(latestVersion, title:locale.versionOutdatedNotification)
    -				docpad.log('notice', messageFilled)
    -		)
    -
    -		# Chain
    -		@
    -
    -
    -	# ---------------------------------
    -	# Utilities: Exchange
    -
    -
    -	###*
    -	# Get DocPad's exchange data
    -	# Requires internet access
    -	# next(err,exchange)
    -	# @private
    -	# @method getExchange
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	# @param {Object} next.exchange docpad.exchange
    -	###
    -	getExchange: (next) ->
    -		# Prepare
    -		docpad = @
    -		config = @getConfig()
    -		locale = @getLocale()
    -
    -		# Check if it is stored locally
    -		return next(null, docpad.exchange)  if typeChecker.isEmptyObject(docpad.exchange) is false
    -
    -		# Offline?
    -		return next(null, null)  if config.offline
    -
    -		# Log
    -		docpad.log('info', locale.exchangeUpdate+' '+locale.pleaseWait)
    -
    -		# Otherwise fetch it from the exchangeUrl
    -		exchangeUrl = config.helperUrl+'?method=exchange&version='+@version
    -		docpad.loadConfigUrl exchangeUrl, (err,parsedData) ->
    -			# Check
    -			if err
    -				locale = docpad.getLocale()
    -				docpad.warn(locale.exchangeError, err)
    -				return next()
    -
    -			# Log
    -			docpad.log('info', locale.exchangeUpdated)
    -
    -			# Success
    -			docpad.exchange = parsedData
    -			return next(null, parsedData)
    -
    -		# Chain
    -		@
    -
    -
    -	# ---------------------------------
    -	# Utilities: Files
    -
    -	###*
    -	# Contextualize files.
    -	# Contextualizing is the process of adding layouts and
    -	# awareness of other documents to our document. The
    -	# contextualizeBefore and contextualizeAfter events
    -	# are emitted here.
    -	# @private
    -	# @method contextualizeFiles
    -	# @param {Object} [opts={}]
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	###
    -	contextualizeFiles: (opts={},next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -		{collection,templateData} = opts
    -		docpad = @
    -		config = @getConfig()
    -		locale = @getLocale()
    -		slowFilesObject = {}
    -		slowFilesTimer = null
    -
    -		# Update progress
    -		opts.progress?.step("contextualizeFiles (preparing)").total(1).setTick(0)
    -
    -		# Log
    -		docpad.log 'debug', util.format(locale.contextualizingFiles, collection.length)
    -
    -		# Start contextualizing
    -		docpad.emitSerial 'contextualizeBefore', {collection,templateData}, (err) ->
    -			# Prepare
    -			return next(err)  if err
    -
    -			# Completion callback
    -			tasks = docpad.createTaskGroup "contextualizeFiles tasks", concurrency:0, next:(err) ->
    -				# Kill the timer
    -				clearInterval(slowFilesTimer)
    -				slowFilesTimer = null
    -
    -				# Check
    -				return next(err)  if err
    -
    -				# Update progress
    -				opts.progress?.step("contextualizeFiles (postparing)").total(1).setTick(0)
    -
    -				# After
    -				docpad.emitSerial 'contextualizeAfter', {collection}, (err) ->
    -					# Check
    -					return next(err)  if err
    -
    -					# Log
    -					docpad.log 'debug', util.format(locale.contextualizedFiles, collection.length)
    -
    -					# Forward
    -					return next()
    -
    -			# Add contextualize tasks
    -			opts.progress?.step('contextualizeFiles').total(collection.length).setTick(0)
    -			collection.forEach (file,index) ->
    -				filePath = file.getFilePath()
    -				slowFilesObject[file.id] = file.get('relativePath') or file.id
    -				tasks.addTask "conextualizing: #{filePath}", (complete) ->
    -					file.action 'contextualize', (err) ->
    -						delete slowFilesObject[file.id]
    -						opts.progress?.tick()
    -						return complete(err)
    -
    -			# Setup the timer
    -			slowFilesTimer = setInterval(
    -				->
    -					slowFilesArray = (value or key  for own key,value of slowFilesObject)
    -					docpad.log('info', util.format(locale.slowFiles, 'contextualizeFiles')+' \n'+slowFilesArray.join('\n'))
    -				config.slowFilesDelay
    -			)
    -
    -			# Run tasks
    -			tasks.run()
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Render the DocPad project's files.
    -	# The renderCollectionBefore, renderCollectionAfter,
    -	# renderBefore, renderAfter events are all emitted here.
    -	# @private
    -	# @method renderFiles
    -	# @param {Object} [opts={}]
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	###
    -	renderFiles: (opts={},next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -		{collection,templateData,renderPasses} = opts
    -		docpad = @
    -		config = @getConfig()
    -		locale = @getLocale()
    -		slowFilesObject = {}
    -		slowFilesTimer = null
    -
    -		# Update progress
    -		opts.progress?.step("renderFiles (preparing)").total(1).setTick(0)
    -
    -		# Log
    -		docpad.log 'debug', util.format(locale.renderingFiles, collection.length)
    -
    -		# Render File
    -		# next(null, outContent, file)
    -		renderFile = (file,next) ->
    -			# Render
    -			if file.get('render') is false or !file.get('relativePath')
    -				file.attributes.rtime = new Date()
    -				next(null, file.getOutContent(), file)
    -			else
    -				file.action('render', {templateData}, next)
    -
    -			# Return
    -			return file
    -
    -		# Render Collection
    -		renderCollection = (collectionToRender,{renderPass},next) ->
    -			# Plugin Event
    -			docpad.emitSerial 'renderCollectionBefore', {collection:collectionToRender,renderPass}, (err) ->
    -				# Prepare
    -				return next(err)  if err
    -
    -				subTasks = docpad.createTaskGroup "renderCollection: #{collectionToRender.options.name}", concurrency:0, next:(err) ->
    -					# Prepare
    -					return next(err)  if err
    -
    -					# Plugin Event
    -					docpad.emitSerial('renderCollectionAfter', {collection:collectionToRender,renderPass}, next)
    -
    -				# Cycle
    -				opts.progress?.step("renderFiles (pass #{renderPass})").total(collectionToRender.length).setTick(0)
    -				collectionToRender.forEach (file) ->
    -					filePath = file.getFilePath()
    -					slowFilesObject[file.id] = file.get('relativePath')
    -					subTasks.addTask "rendering: #{filePath}", (complete) ->
    -						renderFile file, (err) ->
    -							delete slowFilesObject[file.id] or file.id
    -							opts.progress?.tick()
    -							return complete(err)
    -
    -				# Return
    -				subTasks.run()
    -				return collectionToRender
    -
    -		# Plugin Event
    -		docpad.emitSerial 'renderBefore', {collection,templateData}, (err) ->
    -			# Prepare
    -			return next(err)  if err
    -
    -			# Async
    -			tasks = docpad.createTaskGroup "renderCollection: renderBefore tasks", next:(err) ->
    -				# Kill the timer
    -				clearInterval(slowFilesTimer)
    -				slowFilesTimer = null
    -
    -				# Check
    -				return next(err)  if err
    -
    -				# Update progress
    -				opts.progress?.step("renderFiles (postparing)").total(1).setTick(0)
    -
    -				# After
    -				docpad.emitSerial 'renderAfter', {collection}, (err) ->
    -					# Check
    -					return next(err)  if err
    -
    -					# Log
    -					docpad.log 'debug', util.format(locale.renderedFiles, collection.length)
    -
    -					# Forward
    -					return next()
    -
    -			# Queue the initial render
    -			initialCollection = collection.findAll('referencesOthers':false)
    -			subsequentCollection = null
    -			tasks.addTask "rendering the initial collection", (complete) ->
    -				renderCollection initialCollection, {renderPass:1}, (err) ->
    -					return complete(err)  if err
    -					subsequentCollection = collection.findAll('referencesOthers':true)
    -					renderCollection(subsequentCollection, {renderPass:2}, complete)
    -
    -			# Queue the subsequent renders
    -			if renderPasses > 1
    -				[3..renderPasses].forEach (renderPass) ->  tasks.addTask "rendering the subsequent collection index #{renderPass}", (complete) ->
    -					renderCollection(subsequentCollection, {renderPass}, complete)
    -
    -			# Setup the timer
    -			slowFilesTimer = setInterval(
    -				->
    -					slowFilesArray = (value or key  for own key,value of slowFilesObject)
    -					docpad.log('info', util.format(locale.slowFiles, 'renderFiles')+' \n'+slowFilesArray.join('\n'))
    -				config.slowFilesDelay
    -			)
    -
    -			# Run tasks
    -			tasks.run()
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Write rendered files to the DocPad out directory.
    -	# The writeBefore and writeAfter events are emitted here.
    -	# @private
    -	# @method writeFiles
    -	# @param {Object} [opts={}]
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	###
    -	writeFiles: (opts={},next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -		{collection,templateData} = opts
    -		docpad = @
    -		config = @getConfig()
    -		locale = @getLocale()
    -		slowFilesObject = {}
    -		slowFilesTimer = null
    -
    -		# Update progress
    -		opts.progress?.step("writeFiles (preparing)").total(1).setTick(0)
    -
    -		# Log
    -		docpad.log 'debug', util.format(locale.writingFiles, collection.length)
    -
    -		# Plugin Event
    -		docpad.emitSerial 'writeBefore', {collection,templateData}, (err) ->
    -			# Prepare
    -			return next(err)  if err
    -
    -			# Completion callback
    -			tasks = docpad.createTaskGroup "writeFiles tasks", concurrency:0, next:(err) ->
    -				# Kill the timer
    -				clearInterval(slowFilesTimer)
    -				slowFilesTimer = null
    -
    -				# Check
    -				return next(err)  if err
    -
    -				# Update progress
    -				opts.progress?.step("writeFiles (postparing)").total(1).setTick(0)
    -
    -				# After
    -				docpad.emitSerial 'writeAfter', {collection}, (err) ->
    -					# Check
    -					return next(err)  if err
    -
    -					# docpad.log 'debug', util.format(locale.wroteFiles, collection.length)
    -					return next()
    -
    -			# Add write tasks
    -			opts.progress?.step('writeFiles').total(collection.length).setTick(0)
    -			collection.forEach (file,index) ->
    -				filePath = file.getFilePath()
    -				tasks.addTask "writing the file: #{filePath}", (complete) ->
    -					# Prepare
    -					slowFilesObject[file.id] = file.get('relativePath')
    -
    -					# Create sub tasks
    -					fileTasks = docpad.createTaskGroup "tasks for file write: #{filePath}", concurrency:0, next:(err) ->
    -						delete slowFilesObject[file.id]
    -						opts.progress?.tick()
    -						return complete(err)
    -
    -					# Write out
    -					if file.get('write') isnt false and file.get('dynamic') isnt true and file.get('outPath')
    -						fileTasks.addTask "write out", (complete) ->
    -							file.action('write', complete)
    -
    -					# Write source
    -					if file.get('writeSource') is true and file.get('fullPath')
    -						fileTasks.addTask "write source", (complete) ->
    -							file.action('writeSource', complete)
    -
    -					# Run sub tasks
    -					fileTasks.run()
    -
    -			# Setup the timer
    -			slowFilesTimer = setInterval(
    -				->
    -					slowFilesArray = (value or key  for own key,value of slowFilesObject)
    -					docpad.log('info', util.format(locale.slowFiles, 'writeFiles')+' \n'+slowFilesArray.join('\n'))
    -				config.slowFilesDelay
    -			)
    -
    -			# Run tasks
    -			tasks.run()
    -
    -		# Chain
    -		@
    -
    -
    -	# ---------------------------------
    -	# Generate
    -
    -	# Generate Helpers
    -	###*
    -	# Has DocPad's generation process started?
    -	# @private
    -	# @property {Boolean} generateStarted
    -	###
    -	generateStarted: null
    -
    -	###*
    -	# Has DocPad's generation process ended?
    -	# @private
    -	# @property {Boolean} generateEnded
    -	###
    -	generateEnded: null
    -
    -	###*
    -	# Is DocPad currently generating?
    -	# @private
    -	# @property {Boolean} generating
    -	###
    -	generating: false
    -
    -	###*
    -	# Has DocPad done at least one generation?
    -	# True once the first generation has occured.
    -	# @private
    -	# @property {Object} generated
    -	###
    -	generated: false
    -
    -	###*
    -	# Create the console progress bar.
    -	# Progress only shown if the DocPad config 'progress'
    -	# option is true, the DocPad config 'prompts' option is true
    -	# and the log level is 6 (default)
    -	# @private
    -	# @method createProgress
    -	# @return {Object} the progress object
    -	###
    -	createProgress: ->
    -		# Prepare
    -		docpad = @
    -		config = docpad.getConfig()
    -
    -		# Only show progress if
    -		# - progress is true
    -		# - prompts are supported (so no servers)
    -		# - and we are log level 6 (the default level)
    -		progress = null
    -		if config.progress and config.prompts and @getLogLevel() is 6
    -			progress = require('progressbar').create()
    -			@getLoggers().console.unpipe(process.stdout)
    -			@getLogger().once 'log', progress.logListener ?= (data) ->
    -				if data.levelNumber <= 5  # notice or higher
    -					docpad.destroyProgress(progress)
    -
    -		# Return
    -		return progress
    -
    -	###*
    -	# Destructor. Destroy the progress object
    -	# @private
    -	# @method destroyProgress
    -	# @param {Object} progress
    -	# @return {Object} the progress object
    -	###
    -	destroyProgress: (progress) ->
    -		# Fetch
    -		if progress
    -			progress.finish()
    -			@getLoggers().console.unpipe(process.stdout).pipe(process.stdout)
    -
    -		# Return
    -		return progress
    -
    -	###*
    -	# Destructor. Destroy the regeneration timer.
    -	# @private
    -	# @method destroyRegenerateTimer
    -	###
    -	destroyRegenerateTimer: ->
    -		# Prepare
    -		docpad = @
    -
    -		# Clear Regenerate Timer
    -		if docpad.regenerateTimer
    -			clearTimeout(docpad.regenerateTimer)
    -			docpad.regenerateTimer = null
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Create the regeneration timer
    -	# @private
    -	# @method createRegenerateTimer
    -	###
    -	createRegenerateTimer: ->
    -		# Prepare
    -		docpad = @
    -		locale = docpad.getLocale()
    -		config = docpad.getConfig()
    -
    -		# Create Regenerate Timer
    -		if config.regenerateEvery
    -			docpad.regenerateTimer = setTimeout(
    -				->
    -					docpad.log('info', locale.renderInterval)
    -					docpad.action('generate', config.regenerateEveryOptions)
    -				config.regenerateEvery
    -			)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Set off DocPad's generation process.
    -	# The generated, populateCollectionsBefore, populateCollections, populateCollections
    -	# generateBefore and generateAfter events are emitted here
    -	# @method generate
    -	# @param {Object} opts
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	###
    -	generate: (opts, next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -		docpad = @
    -		config = docpad.getConfig()
    -		locale = docpad.getLocale()
    -		database = docpad.getDatabase()
    -
    -		# Check
    -		return next()  if opts.collection?.length is 0
    -
    -
    -		# Update generating flag
    -		lastGenerateStarted = docpad.generateStarted
    -		docpad.generateStarted = new Date()
    -		docpad.generateEnded = null
    -		docpad.generating = true
    -
    -		# Update the cached database
    -		docpad.databaseTempCache = new FilesCollection(database.models)  if database.models.length
    -
    -		# Create Progress
    -		# Can be over-written by API calls
    -		opts.progress ?= docpad.createProgress()
    -
    -		# Grab the template data we will use for rendering
    -		opts.templateData = docpad.getTemplateData(opts.templateData or {})
    -
    -		# How many render passes will we require?
    -		# Can be over-written by API calls
    -		opts.renderPasses or= config.renderPasses
    -
    -
    -		# Destroy Regenerate Timer
    -		docpad.destroyRegenerateTimer()
    -
    -		# Check plugin count
    -		docpad.log('notice', locale.renderNoPlugins)  unless docpad.hasPlugins()
    -
    -		# Log
    -		docpad.log('info', locale.renderGenerating)
    -		docpad.notify (new Date()).toLocaleTimeString(), {title: locale.renderGeneratingNotification}
    -
    -		# Tasks
    -		tasks = @createTaskGroup("generate tasks", {progress: opts.progress}).done (err) ->
    -			# Update generating flag
    -			docpad.generating = false
    -			docpad.generateEnded = new Date()
    -
    -			# Update caches
    -			docpad.databaseTempCache = null
    -
    -			# Create Regenerate Timer
    -			docpad.createRegenerateTimer()
    -
    -			# Clear Progress
    -			if opts.progress
    -				docpad.destroyProgress(opts.progress)
    -				opts.progress = null
    -
    -			# Error?
    -			return next(err)  if err
    -
    -			# Log success message
    -			seconds = (docpad.generateEnded - docpad.generateStarted) / 1000
    -			howMany = "#{opts.collection?.length or 0}/#{database.length}"
    -			docpad.log 'info', util.format(locale.renderGenerated, howMany, seconds)
    -			docpad.notify (new Date()).toLocaleTimeString(), {title: locale.renderGeneratedNotification}
    -
    -			# Generated
    -			if opts.initial is true
    -				docpad.generated = true
    -				return docpad.emitSerial('generated', opts, next)
    -
    -			# Safety check if generated is false but initial was false too
    -			# https://github.com/bevry/docpad/issues/811
    -			else if docpad.generated is false
    -				return next(
    -					new Error('DocPad is in an invalid state, please report this on the github issue tracker. Reference 3360')
    -				)
    -
    -			else
    -				return next()
    -
    -		# Extract functions from tasks for simplicity
    -		# when dealing with nested tasks/groups
    -		addGroup = tasks.addGroup.bind(tasks)
    -		addTask = tasks.addTask.bind(tasks)
    -
    -
    -		# Setup a clean database
    -		addTask 'Reset our collections', (complete) ->
    -			# Skip if we are not a reset generation, or an initial generation (generated is false)
    -			return complete()  unless opts.reset is true or docpad.generated is false
    -			return docpad.resetCollections(opts, complete)
    -
    -
    -		# Figure out the options
    -		# This is here as resetCollections could change our state
    -		# https://github.com/bevry/docpad/issues/811
    -		addTask 'Figure out options', ->
    -			# Mode: Cache
    -			# Shall we write to the database cache?
    -			# Set to true if the configuration option says we can, and we are the initial generation
    -			opts.cache     ?= config.databaseCache
    -
    -			# Mode: Initial
    -			# Shall we do some basic initial checks
    -			# Set to the opts.reset value if specified, or whether are the initial generation
    -			opts.initial   ?= !(docpad.generated)
    -
    -			# Mode: Reset
    -			# Shall we reset the database
    -			# Set to true if we are the initial generation
    -			opts.reset     ?= opts.initial
    -
    -			# Mode: Populate
    -			# Shall we fetch in new data?
    -			# Set to the opts.reset value if specified, or the opts.initial value
    -			opts.populate  ?= opts.reset
    -
    -			# Mode: Reload
    -			# Shall we rescan the file system for changes?
    -			# Set to the opts.reset value if specified, or the opts.initial value
    -			opts.reload    ?= opts.reset
    -
    -			# Mode: Partial
    -			# Shall we perform a partial generation (false) or a completion generation (true)?
    -			# Set to false if we are the initial generation
    -			opts.partial   ?= !(opts.reset)
    -
    -			# Log our opts
    -			docpad.log(
    -				'debug'
    -				'Generate options:'
    -				pick(opts, ['cache', 'initial', 'reset', 'populate', 'reload', 'partial', 'renderPasses'])
    -			)
    -
    -
    -		# Check directory structure
    -		addTask 'check source directory exists', (complete) ->
    -			# Skip if we are not the initial generation
    -			return complete()  unless opts.initial is true
    -
    -			# Continue if we are the initial generation
    -			safefs.exists config.srcPath, (exists) ->
    -				# Check
    -				unless exists
    -					err = new Error(locale.renderNonexistant)
    -					return complete(err)
    -
    -				# Forward
    -				return complete()
    -
    -
    -		addGroup 'fetch data to render', (addGroup, addTask) ->
    -			# Fetch new data
    -			# If we are a populate generation (by default an initial generation)
    -			if opts.populate is true
    -				# This will pull in new data from plugins
    -				addTask 'populateCollectionsBefore', (complete) ->
    -					docpad.emitSerial('populateCollectionsBefore', opts, complete)
    -
    -				# Import the cached data
    -				# If we are the initial generation, and we have caching enabled
    -				if opts.initial is true and opts.cache in [true, 'read']
    -					addTask 'import data from cache', (complete) ->
    -						# Check if we do have a databae cache
    -						safefs.exists config.databaseCachePath, (exists) ->
    -							return complete()  if exists is false
    -
    -							# Read the database cache if it exists
    -							safefs.readFile config.databaseCachePath, (err, data) ->
    -								return complete(err)  if err
    -
    -								# Parse it and apply the data values
    -								databaseData = JSON.parse data.toString()
    -								opts.cache     = true
    -								opts.initial   = true
    -								opts.reset     = false
    -								opts.populate  = true
    -								opts.reload    = true
    -								opts.partial   = true
    -
    -								lastGenerateStarted = new Date(databaseData.generateStarted)
    -								addedModels = docpad.addModels(databaseData.models)
    -								docpad.log 'info', util.format(locale.databaseCacheRead, database.length, databaseData.models.length)
    -
    -								# @TODO we need a way of detecting deleted files between generations
    -
    -								return complete()
    -
    -				# Rescan the file system
    -				# If we are a reload generation (by default an initial generation)
    -				# This is useful when the database is out of sync with the source files
    -				# For instance, someone shut down docpad, and made some changes, then ran docpad again
    -				# See https://github.com/bevry/docpad/issues/705#issuecomment-29243666 for details
    -				if opts.reload is true
    -					addGroup 'import data from file system', (addGroup, addTask) ->
    -						# Documents
    -						config.documentsPaths.forEach (documentsPath) ->
    -							addTask 'import documents', (complete) ->
    -								docpad.parseDirectory({
    -									modelType: 'document'
    -									collection: database
    -									path: documentsPath
    -									next: complete
    -								})
    -
    -						# Files
    -						config.filesPaths.forEach (filesPath) ->
    -							addTask 'import files', (complete) ->
    -								docpad.parseDirectory({
    -									modelType: 'file'
    -									collection: database
    -									path: filesPath
    -									next: complete
    -								})
    -
    -						# Layouts
    -						config.layoutsPaths.forEach (layoutsPath) ->
    -							addTask 'import layouts', (complete) ->
    -								docpad.parseDirectory({
    -									modelType: 'document'
    -									collection: database
    -									path: layoutsPath
    -									next: complete
    -								})
    -
    -				# This will pull in new data from plugins
    -				addTask 'populateCollections', (complete) ->
    -					docpad.emitSerial('populateCollections', opts, complete)
    -
    -
    -		addGroup 'determine files to render', (addGroup, addTask) ->
    -			# Perform a complete regeneration
    -			# If we are a reset generation (by default an initial non-cached generation)
    -			if opts.partial is false
    -				# Use Entire Collection
    -				addTask 'Add all database models to render queue', ->
    -					opts.collection ?= new FilesCollection().add(docpad.getCollection('generate').models)
    -
    -			# Perform a partial regeneration
    -			# If we are not a reset generation (by default any non-initial generation)
    -			else
    -				# Use Partial Collection
    -				addTask 'Add only changed models to render queue', ->
    -					changedQuery =
    -						$or:
    -							# Get changed files
    -							mtime: $gte: lastGenerateStarted
    -
    -							# Get new files
    -							$and:
    -								wtime: null
    -								write: true
    -					opts.collection ?= new FilesCollection().add(docpad.getCollection('generate').findAll(changedQuery).models)
    -
    -
    -		addTask 'generateBefore', (complete) ->
    -			# If we have nothing to generate
    -			if opts.collection.length is 0
    -				# then there is no need to execute further tasks
    -				tasks.clear()
    -				complete()
    -
    -			# Otherwise continue down the task loop
    -			else
    -				docpad.emitSerial('generateBefore', opts, complete)
    -
    -
    -		addTask 'prepare files', (complete) ->
    -			# Log the files to generate if we are in debug mode
    -			docpad.log 'debug', 'Files to generate at', (lastGenerateStarted), '\n', (
    -				{
    -					id: model.id
    -					path: model.getFilePath()
    -					mtime: model.get('mtime')
    -					wtime: model.get('wtime')
    -					dynamic: model.get('dynamic')
    -					ignored: model.get('ignored')
    -					write: model.get('write')
    -				}  for model in opts.collection.models
    -			)
    -
    -			# Add anything that references other documents (e.g. partials, listing, etc)
    -			# This could eventually be way better
    -			standalones = opts.collection.pluck('standalone')
    -			allStandalone = standalones.indexOf(false) is -1
    -			if allStandalone is false
    -				opts.collection.add(docpad.getCollection('referencesOthers').models)
    -
    -			# Deeply/recursively add the layout children
    -			addLayoutChildren = (collection) ->
    -				collection.forEach (file) ->
    -					if file.get('isLayout') is true
    -						# Find
    -						layoutChildrenQuery =
    -							layoutRelativePath: file.get('relativePath')
    -						layoutChildrenCollection = docpad.getCollection('hasLayout').findAll(layoutChildrenQuery)
    -
    -						# Log the files to generate if we are in debug mode
    -						docpad.log 'debug', 'Layout children to generate at', (lastGenerateStarted), '\n', (
    -							{
    -								id: model.id
    -								path: model.getFilePath()
    -								mtime: model.get('mtime')
    -								wtime: model.get('wtime')
    -								write: model.get('write')
    -							}  for model in layoutChildrenCollection.models
    -						), '\n', layoutChildrenQuery
    -
    -						# Recurse
    -						addLayoutChildren(layoutChildrenCollection)
    -
    -						# Add
    -						opts.collection.add(layoutChildrenCollection.models)
    -			addLayoutChildren(opts.collection)
    -
    -			# Filter out ignored, and no-render no-write files
    -			opts.collection.reset opts.collection.reject (file) ->
    -				return (file.get('render') is false and file.get('write') is false)
    -
    -			# Log the files to generate if we are in debug mode
    -			docpad.log 'debug', 'Files to generate at', (lastGenerateStarted), '\n', (
    -				{
    -					id: model.id
    -					path: model.getFilePath()
    -					mtime: model.get('mtime')
    -					wtime: model.get('wtime')
    -					dynamic: model.get('dynamic')
    -					ignored: model.get('ignored')
    -					write: model.get('write')
    -				}  for model in opts.collection.models
    -			)
    -
    -			# Forward
    -			return complete()
    -
    -
    -		addGroup 'process file', (addGroup, addTask) ->
    -			addTask 'contextualizeFiles', {args:[opts]}, docpad.contextualizeFiles.bind(docpad)
    -			addTask 'renderFiles', {args:[opts]}, docpad.renderFiles.bind(docpad)
    -			addTask 'writeFiles', {args:[opts]}, docpad.writeFiles.bind(docpad)
    -
    -
    -		addTask 'generateAfter', (complete) ->
    -			docpad.emitSerial('generateAfter', opts, complete)
    -
    -
    -		# Write the cache file
    -		addTask 'Write the database cache', (complete) ->
    -			# Skip if we do not care for writing the cache
    -			return complete()  unless opts.cache in [true, 'write']
    -
    -			# Write the cache
    -			databaseData =
    -				generateStarted: docpad.generateStarted
    -				generateEnded: docpad.generateEnded
    -				models: (model.getAttributes()  for model in database.models)
    -			databaseDataDump = JSON.stringify(databaseData, null, '  ')
    -			docpad.log 'info', util.format(locale.databaseCacheWrite, databaseData.models.length)
    -			return safefs.writeFile(config.databaseCachePath, databaseDataDump, complete)
    -
    -
    -		# Run
    -		tasks.run()
    -
    -		# Chain
    -		@
    -
    -
    -	# ---------------------------------
    -	# Render
    -
    -	###*
    -	# Load a document
    -	# @private
    -	# @method loadDocument
    -	# @param {Object} document
    -	# @param {Object} opts
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	# @param {Object} next.document
    -	###
    -	loadDocument: (document,opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -
    -		# Load
    -		# @TODO: don't load if already loaded
    -		document.action('load contextualize', opts, next)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Load and render a document
    -	# @method loadAndRenderDocument
    -	# @param {Object} document
    -	# @param {Object} opts
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	# @param {Object} next.document
    -	###
    -	loadAndRenderDocument: (document,opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -		docpad = @
    -
    -		# Load
    -		docpad.loadDocument document, opts, (err) ->
    -			return next(err)  if err
    -
    -			# Render
    -			docpad.renderDocument(document, opts, next)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Render a document
    -	# @method renderDocument
    -	# @param {Object} document
    -	# @param {Object} opts
    -	# @param {Object} next
    -	# @param {Error} next.err
    -	# @param {Object} next.result
    -	# @param {Object} next.document
    -	###
    -	renderDocument: (document,opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -
    -		# Render
    -		clone = document.clone().action 'render', opts, (err) ->
    -			result = clone.getOutContent()
    -			return next(err, result, document)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Render a document at a file path
    -	# next(err,result)
    -	# @method renderPath
    -	# @param {String} path
    -	# @param {Object} opts
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	# @param {Object} next.result the rendered document
    -	###
    -	renderPath: (path,opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -		attributes = extendr.extend({
    -			fullPath: path
    -		}, opts.attributes or {})
    -
    -		# Handle
    -		document = @createDocument(attributes)
    -		@loadAndRenderDocument(document, opts, next)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Render the passed content data as a
    -	# document. Required option, filename
    -	# (opts.filename)
    -	# next(err,result)
    -	# @method renderData
    -	# @param {String} content
    -	# @param {Object} opts
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	# @param {Object} next.result the rendered document
    -	###
    -	renderData: (content,opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -		attributes = extendr.extend({
    -			filename: opts.filename
    -			data: content
    -		}, opts.attributes or {})
    -
    -		# Handle
    -		document = @createDocument(attributes)
    -		@loadAndRenderDocument(document, opts, next)
    -
    -		# Chain
    -		@
    -
    -	# Render Text
    -	# Doesn't extract meta information, or render layouts
    -	# TODO: Why not? Why not just have renderData?
    -
    -	###*
    -	# Render the passed text data as a
    -	# document. Required option, filename
    -	# (opts.filename)
    -	# next(err,result)
    -	# @private
    -	# @method renderText
    -	# @param {String} text
    -	# @param {Object} opts
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	# @param {Object} next.result the rendered content
    -	# @param {Object} next.document the rendered document model
    -	###
    -	renderText: (text,opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -		opts.actions ?= ['renderExtensions', 'renderDocument']
    -		attributes = extendr.extend({
    -			filename: opts.filename
    -			data: text
    -			body: text
    -			content: text
    -		}, opts.attributes or {})
    -
    -		# Handle
    -		document = @createDocument(attributes)
    -
    -		# Render
    -		clone = document.clone().action 'normalize contextualize render', opts, (err) ->
    -			result = clone.getOutContent()
    -			return next(err, result, document)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Render action
    -	# next(err,document,result)
    -	# @method render
    -	# @param {Object} opts
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	###
    -	render: (opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -		locale = @getLocale()
    -
    -		# Extract document
    -		if opts.document
    -			@renderDocument(opts.document, opts, next)
    -		else if opts.data
    -			@renderData(opts.data, opts, next)
    -		else if opts.text
    -			@renderText(opts.text, opts, next)
    -		else
    -			path = opts.path or opts.fullPath or opts.filename or null
    -			if path
    -				@renderPath(path, opts, next)
    -			else
    -				# Check
    -				err = new Error(locale.renderInvalidOptions)
    -				return next(err)
    -
    -		# Chain
    -		@
    -
    -
    -	# ---------------------------------
    -	# Watch
    -
    -	###*
    -	# Array of file watchers
    -	# @private
    -	# @property {Array} watchers
    -	###
    -	watchers: null
    -
    -	###*
    -	# Destructor. Destroy the watchers used
    -	# by DocPad
    -	# @private
    -	# @method destroyWatchers
    -	###
    -	destroyWatchers: ->
    -		# Prepare
    -		docpad = @
    -
    -		# Check
    -		if docpad.watchers
    -			# Close each of them
    -			for watcher in docpad.watchers
    -				watcher.close()
    -
    -			# Reset the array
    -			docpad.watchers = []
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Start up file watchers used by DocPad
    -	# @private
    -	# @method watch
    -	# @param {Object} opts
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	###
    -	watch: (opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -		docpad = @
    -		config = @getConfig()
    -		locale = @getLocale()
    -		database = @getDatabase()
    -		@watchers ?= []
    -
    -		# Restart our watchers
    -		restartWatchers = (next) ->
    -			# Close our watchers
    -			docpad.destroyWatchers()
    -
    -			# Start a group
    -			tasks = docpad.createTaskGroup("watch tasks", {concurrency:0, next})
    -
    -			# Watch reload paths
    -			reloadPaths = union(config.reloadPaths, config.configPaths)
    -			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()
    -				)
    -
    -			# Watch regenerate paths
    -			regeneratePaths = config.regeneratePaths
    -			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()
    -				)
    -
    -			# Watch the source
    -			srcPath = config.srcPath
    -			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()
    -				)
    -
    -			# Run
    -			tasks.run()
    -
    -			# Chain
    -			@
    -
    -		# Timer
    -		regenerateTimer = null
    -		queueRegeneration = ->
    -			# Reset the wait
    -			if regenerateTimer
    -				clearTimeout(regenerateTimer)
    -				regenerateTimer = null
    -
    -			# Regenerat after a while
    -			regenerateTimer = setTimeout(performGenerate, config.regenerateDelay)
    -
    -		performGenerate = (opts={}) ->
    -			# Q: Should we also pass over the collection?
    -			# A: No, doing the mtime query in generate is more robust
    -
    -			# Log
    -			docpad.log util.format(locale.watchRegenerating, new Date().toLocaleTimeString())
    -
    -			# Afterwards, re-render anything that should always re-render
    -			docpad.action 'generate', opts, (err) ->
    -				docpad.error(err)  if err
    -				docpad.log util.format(locale.watchRegenerated, new Date().toLocaleTimeString())
    -
    -		# Change event handler
    -		changeHandler = (changeType,filePath,fileCurrentStat,filePreviousStat) ->
    -			# Prepare
    -			fileEitherStat = (fileCurrentStat or filePreviousStat)
    -
    -			# For some reason neither of the stats may exist, this will cause errors as this is an invalid state
    -			# as we depend on at least one stat existing, otherwise, what on earth is going on?
    -			# Whatever the case, this should be fixed within watchr, not docpad
    -			# as watchr should not be giving us invalid data
    -			# https://github.com/bevry/docpad/issues/792
    -			unless fileEitherStat
    -				err = new Error("""
    -						DocPad has encountered an invalid state while detecting changes for your files.
    -						So the DocPad team can fix this right away, please provide any information you can to:
    -						https://github.com/bevry/docpad/issues/792
    -						""")
    -				return docpad.error(err)
    -
    -			# Log the change
    -			docpad.log 'info', util.format(locale.watchChange, new Date().toLocaleTimeString()), changeType, filePath
    -
    -			# Check if we are a file we don't care about
    -			# This check should not be needed with v2.3.3 of watchr
    -			# however we've still got it here as it may still be an issue
    -			isIgnored = docpad.isIgnoredPath(filePath)
    -			if isIgnored
    -				docpad.log 'debug', util.format(locale.watchIgnoredChange, new Date().toLocaleTimeString()), filePath
    -				return
    -
    -			# Don't care if we are a directory
    -			isDirectory = fileEitherStat.isDirectory()
    -			if isDirectory
    -				docpad.log 'debug', util.format(locale.watchDirectoryChange, new Date().toLocaleTimeString()), filePath
    -				return
    -
    -			# Override the stat's mtime to now
    -			# This is because renames will not update the mtime
    -			fileCurrentStat?.mtime = new Date()
    -
    -			# Create the file object
    -			file = docpad.addModel({fullPath:filePath, stat:fileCurrentStat})
    -			file.setStat(fileCurrentStat)  if changeType is 'update'
    -
    -			# File was deleted, delete the rendered file, and remove it from the database
    -			if changeType is 'delete'
    -				database.remove(file)
    -				file.action 'delete', (err) ->
    -					return docpad.error(err)  if err
    -					queueRegeneration()
    -
    -			# File is new or was changed, update it's mtime by setting the stat
    -			else if changeType in ['create', 'update']
    -				file.action 'load', (err) ->
    -					return docpad.error(err)  if err
    -					queueRegeneration()
    -
    -		# Watch
    -		docpad.log(locale.watchStart)
    -		restartWatchers (err) ->
    -			return next(err)  if err
    -			docpad.log(locale.watchStarted)
    -			return next()
    -
    -		# Chain
    -		@
    -
    -
    -	# ---------------------------------
    -	# Run Action
    -
    -	###*
    -	# Run an action
    -	# @method run
    -	# @param {Object} opts
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	###
    -	run: (opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts, next)
    -		docpad = @
    -		locale = @getLocale()
    -		config = @getConfig()
    -		{srcPath, rootPath} = config
    -
    -		# Prepare
    -		run = (complete) ->
    -			balUtil.flow(
    -				object: docpad
    -				action: 'server generate watch'
    -				args: [opts]
    -				next: complete
    -			)
    -
    -		# Check if we have the docpad structure
    -		safefs.exists srcPath, (exists) ->
    -			# Check if have the correct structure, if so let's proceed with DocPad
    -			return run(next)  if exists
    -
    -			# We don't have the correct structure
    -			# Check if we are running on an empty directory
    -			safefs.readdir rootPath, (err,files) ->
    -				return next(err)  if err
    -
    -				# Check if our directory is empty
    -				if files.length
    -					# It isn't empty, display a warning
    -					docpad.warn util.format(locale.skeletonNonexistant, rootPath)
    -					return next()
    -				else
    -					docpad.skeleton opts, (err) ->
    -						# Check
    -						return next(err)  if err
    -
    -						# Keep in global?
    -						return run(next)  if opts.global is true or docpad.getConfig().global is true
    -
    -						# Log
    -						docpad.log('notice', locale.startLocal)
    -
    -						# Destroy our DocPad instance so we can boot the local one
    -						docpad.destroy (err) ->
    -							# Check
    -							return next(err)  if err
    -
    -							# Forward onto the local DocPad Instance now that it has been installed
    -							return docpadUtil.startLocalDocPadExecutable(next)
    -
    -		# Chain
    -		@
    -
    -
    -	# ---------------------------------
    -	# Skeleton
    -
    -	###*
    -	# Initialize the skeleton install process.
    -	# @private
    -	# @method initInstall
    -	# @param {Object} opts
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	###
    -	initInstall: (opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -		docpad = @
    -		config = @getConfig()
    -
    -		# Tasks
    -		tasks = @createTaskGroup("initInstall tasks", {concurrency:0, next})
    -
    -		tasks.addTask "node modules", (complete) ->
    -			path = pathUtil.join(config.rootPath, 'node_modules')
    -			safefs.ensurePath(path, complete)
    -
    -		tasks.addTask "package", (complete) ->
    -			# Exists?
    -			path = pathUtil.join(config.rootPath, 'package.json')
    -			safefs.exists path, (exists) ->
    -				# Check
    -				return complete()  if exists
    -
    -				# Write
    -				data = JSON.stringify({
    -					name: 'no-skeleton.docpad'
    -					version: '0.1.0'
    -					description: 'New DocPad project without using a skeleton'
    -					dependencies:
    -						docpad: '~'+docpad.getVersion()
    -					main: 'node_modules/.bin/docpad-server'
    -					scripts:
    -						start: 'node_modules/.bin/docpad-server'
    -				}, null, '  ')
    -				safefs.writeFile(path, data, complete)
    -
    -		# Run
    -		tasks.run()
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Uninstall a plugin.
    -	# @private
    -	# @method uninstall
    -	# @param {Object} opts
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	###
    -	uninstall: (opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -		docpad = @
    -		config = @getConfig()
    -
    -		# Tasks
    -		tasks = @createTaskGroup("uninstall tasks", {next})
    -
    -		# Uninstall a plugin
    -		if opts.plugin
    -			tasks.addTask "uninstall the plugin: #{opts.plugin}", (complete) ->
    -				plugins =
    -					for plugin in opts.plugin.split(/[,\s]+/)
    -						plugin = "docpad-plugin-#{plugin}"  if plugin.indexOf('docpad-plugin-') isnt 0
    -						plugin
    -				docpad.uninstallNodeModule(plugins, {
    -					stdio: 'inherit'
    -					next: complete
    -				})
    -
    -		# Re-load configuration
    -		tasks.addTask "re-load configuration", (complete) ->
    -			docpad.load(complete)
    -
    -		# Run
    -		tasks.run()
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Install a plugin
    -	# @private
    -	# @method install
    -	# @param {Object} opts
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	###
    -	install: (opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -		docpad = @
    -		config = @getConfig()
    -
    -		# Tasks
    -		tasks = @createTaskGroup("install tasks", {next})
    -
    -		tasks.addTask "init the installation", (complete) ->
    -			docpad.initInstall(opts, complete)
    -
    -		# Install a plugin
    -		if opts.plugin
    -			tasks.addTask "install the plugin: #{opts.plugin}", (complete) ->
    -				plugins =
    -					for plugin in opts.plugin.split(/[,\s]+/)
    -						plugin = "docpad-plugin-#{plugin}"  if plugin.indexOf('docpad-plugin-') isnt 0
    -						plugin += '@'+docpad.pluginVersion  if plugin.indexOf('@') is -1
    -						plugin
    -				docpad.installNodeModule(plugins, {
    -					stdio: 'inherit'
    -					next: complete
    -				})
    -
    -		tasks.addTask "re-initialize the website's modules", (complete) ->
    -			docpad.initNodeModules({
    -				stdio: 'inherit'
    -				next: complete
    -			})
    -
    -		tasks.addTask "fix node package versions", (complete) ->
    -			docpad.fixNodePackageVersions(complete)
    -
    -		tasks.addTask "re-load the configuration", (complete) ->
    -			docpad.load(complete)
    -
    -		# Run
    -		tasks.run()
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Update global NPM and DocPad
    -	# @private
    -	# @method upgrade
    -	# @param {Object} opts
    -	# @param {Object} next
    -	# @param {Error} next.err
    -	# @return {Object} description
    -	###
    -	upgrade: (opts,next) ->
    -		# Update Global NPM and DocPad
    -		@installNodeModule('npm docpad@6', {
    -			global: true
    -			stdio: 'inherit'
    -			next: next
    -		})
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Update the local DocPad and plugin dependencies
    -	# @private
    -	# @method update
    -	# @param {Object} opts
    -	# @param {Object} next
    -	# @param {Error} next.err
    -	###
    -	update: (opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -		docpad = @
    -		config = @getConfig()
    -
    -		# Tasks
    -		tasks = @createTaskGroup("update tasks", {next})
    -
    -		tasks.addTask "init the install", (complete) ->
    -			docpad.initInstall(opts, complete)
    -
    -		# Update the local docpad and plugin dependencies
    -		# Grouped together to avoid npm dependency shortcuts that can cause missing dependencies
    -		# But don't update git/http/https dependencies, those are special for some reason
    -		# > https://github.com/bevry/docpad/pull/701
    -		dependencies = []
    -		eachr docpad.websitePackageConfig.dependencies, (version,name) ->
    -			return  if /^docpad-plugin-/.test(name) is false or /// :// ///.test(version) is true
    -			dependencies.push(name+'@'+docpad.pluginVersion)
    -		if dependencies.length isnt 0
    -			tasks.addTask "update plugins that are dependencies", (complete) ->
    -				docpad.installNodeModule('docpad@6 '+dependencies, {
    -					stdio: 'inherit'
    -					next: complete
    -				})
    -
    -		# Update the plugin dev dependencies
    -		devDependencies = []
    -		eachr docpad.websitePackageConfig.devDependencies, (version,name) ->
    -			return  if /^docpad-plugin-/.test(name) is false
    -			devDependencies.push(name+'@'+docpad.pluginVersion)
    -		if devDependencies.length isnt 0
    -			tasks.addTask "update plugins that are dev dependencies", (complete) ->
    -				docpad.installNodeModule(devDependencies, {
    -					save: '--save-dev'
    -					stdio: 'inherit'
    -					next: complete
    -				})
    -
    -		tasks.addTask "fix node package versions", (complete) ->
    -			docpad.fixNodePackageVersions(complete)
    -
    -		tasks.addTask "re-initialize the rest of the website's modules", (complete) ->
    -			docpad.initNodeModules({
    -				stdio: 'inherit'
    -				next: complete
    -			})
    -
    -		# Run
    -		tasks.run()
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# DocPad cleanup tasks.
    -	# @private
    -	# @method clean
    -	# @param {Object} opts
    -	# @param {Object} next
    -	# @param {Error} next.err
    -	# @return {Object} description
    -	###
    -	clean: (opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -		docpad = @
    -		config = docpad.getConfig()
    -		locale = @getLocale()
    -
    -		# Log
    -		docpad.log('info', locale.renderCleaning)
    -
    -		# Tasks
    -		tasks = @createTaskGroup "clean tasks", {concurrency:0}, next:(err) ->
    -			# Error?
    -			return next(err)  if err
    -
    -			# Log
    -			docpad.log('info', locale.renderCleaned)
    -
    -			# Forward
    -			return next()
    -
    -		tasks.addTask 'reset the collecitons', (complete) ->
    -			docpad.resetCollections(opts, complete)
    -
    -		# Delete out path
    -		# but only if our outPath is not a parent of our rootPath
    -		tasks.addTask 'delete out path', (complete) ->
    -			# Check if our outPath is higher than our root path, so do not remove files
    -			return complete()  if config.rootPath.indexOf(config.outPath) isnt -1
    -
    -			# Our outPath is not related or lower than our root path, so do remove it
    -			rimraf(config.outPath, complete)
    -
    -		# Delete database cache
    -		tasks.addTask 'delete database cache file', (complete) ->
    -			safefs.unlink(config.databaseCachePath, complete)
    -
    -		# Run tasks
    -		tasks.run()
    -
    -		# Chain
    -		@
    -
    -
    -
    -	###*
    -	# Initialize a Skeleton into to a Directory
    -	# @private
    -	# @method initSkeleton
    -	# @param {Object} skeletonModel
    -	# @param {Object} opts
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	###
    -	initSkeleton: (skeletonModel,opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -		docpad = @
    -		config = @getConfig()
    -
    -		# Defaults
    -		opts.destinationPath ?= config.rootPath
    -
    -		# Tasks
    -		tasks = @createTaskGroup("initSkeleton tasks", {next})
    -
    -		tasks.addTask "ensure the path we are writing to exists", (complete) ->
    -			safefs.ensurePath(opts.destinationPath, complete)
    -
    -		# Clone out the repository if applicable
    -		if skeletonModel? and skeletonModel.id isnt 'none'
    -			tasks.addTask "clone out the git repo", (complete) ->
    -				docpad.initGitRepo({
    -					cwd: opts.destinationPath
    -					url: skeletonModel.get('repo')
    -					branch: skeletonModel.get('branch')
    -					remote: 'skeleton'
    -					stdio: 'inherit'
    -					next: complete
    -				})
    -		else
    -			tasks.addTask "ensure src path exists", (complete) ->
    -				safefs.ensurePath(config.srcPath, complete)
    -
    -			tasks.addGroup "initialize the website directory files", ->
    -				@setConfig(concurrency:0)
    -
    -				# README
    -				@addTask "README.md", (complete) ->
    -					# Exists?
    -					path = pathUtil.join(config.rootPath, 'README.md')
    -					safefs.exists path, (exists) ->
    -						# Check
    -						return complete()  if exists
    -
    -						# Write
    -						data = """
    -							# Your [DocPad](http://docpad.org) Project
    -
    -							## License
    -							Copyright &copy; #{(new Date()).getFullYear()}+ All rights reserved.
    -							"""
    -						safefs.writeFile(path, data, complete)
    -
    -				# Config
    -				@addTask "docpad.coffee configuration file", (complete) ->
    -					# Exists?
    -					docpad.getConfigPath (err,path) ->
    -						# Check
    -						return complete(err)  if err or path
    -						path = pathUtil.join(config.rootPath, 'docpad.coffee')
    -
    -						# Write
    -						data = """
    -							# DocPad Configuration File
    -							# http://docpad.org/docs/config
    -
    -							# Define the DocPad Configuration
    -							docpadConfig = {
    -								# ...
    -							}
    -
    -							# Export the DocPad Configuration
    -							module.exports = docpadConfig
    -							"""
    -						safefs.writeFile(path, data, complete)
    -
    -				# Documents
    -				@addTask "documents directory", (complete) ->
    -					safefs.ensurePath(config.documentsPaths[0], complete)
    -
    -				# Layouts
    -				@addTask "layouts directory", (complete) ->
    -					safefs.ensurePath(config.layoutsPaths[0], complete)
    -
    -				# Files
    -				@addTask "files directory", (complete) ->
    -					safefs.ensurePath(config.filesPaths[0], complete)
    -
    -		# Run
    -		tasks.run()
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Install a Skeleton into a Directory
    -	# @private
    -	# @method installSkeleton
    -	# @param {Object} skeletonModel
    -	# @param {Object} opts
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	###
    -	installSkeleton: (skeletonModel,opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -		docpad = @
    -
    -		# Defaults
    -		opts.destinationPath ?= @getConfig().rootPath
    -
    -		# Initialize and install the skeleton
    -		docpad.initSkeleton skeletonModel, opts, (err) ->
    -			# Check
    -			return next(err)  if err
    -
    -			# Forward
    -			docpad.install(opts, next)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Use a Skeleton
    -	# @private
    -	# @method useSkeleton
    -	# @param {Object} skeletonModel
    -	# @param {Object} opts
    -	# @param {Object} next
    -	# @param {Error} next.err
    -	# @return {Object} description
    -	###
    -	useSkeleton: (skeletonModel,opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -		docpad = @
    -		locale = @getLocale()
    -
    -		# Defaults
    -		opts.destinationPath ?= @getConfig().rootPath
    -
    -		# Extract
    -		skeletonId = skeletonModel?.id or 'none'
    -		skeletonName = skeletonModel?.get('name') or locale.skeletonNoneName
    -
    -		# Track
    -		docpad.track('skeleton-use', {skeletonId})
    -
    -		# Log
    -		docpad.log('info', util.format(locale.skeletonInstall, skeletonName, opts.destinationPath)+' '+locale.pleaseWait)
    -
    -		# Install Skeleton
    -		docpad.installSkeleton skeletonModel, opts, (err) ->
    -			# Error?
    -			return next(err)  if err
    -
    -			# Log
    -			docpad.log('info', locale.skeletonInstalled)
    -
    -			# Forward
    -			return next(err)
    -
    -		# Chain
    -		@
    -
    -
    -	###*
    -	# Select a Skeleton
    -	# @private
    -	# @method selectSkeleton
    -	# @param {Object} opts
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	# @param {Error} next.skeletonModel
    -	###
    -	selectSkeleton: (opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -		docpad = @
    -		opts.selectSkeletonCallback ?= null
    -
    -		# Track
    -		docpad.track('skeleton-ask')
    -
    -		# Get the available skeletons
    -		docpad.getSkeletons (err,skeletonsCollection) ->
    -			# Check
    -			return next(err)  if err
    -
    -			# Provide selection to the interface
    -			opts.selectSkeletonCallback(skeletonsCollection, next)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Skeleton Empty?
    -	# @private
    -	# @method skeletonEmpty
    -	# @param {Object} path
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	###
    -	skeletonEmpty: (path, next) ->
    -		# Prepare
    -		locale = @getLocale()
    -
    -		# Defaults
    -		path ?= @getConfig().rootPath
    -
    -		# Check the destination path is empty
    -		safefs.exists pathUtil.join(path, 'package.json'), (exists) ->
    -			# Check
    -			if exists
    -				err = new Error(locale.skeletonExists)
    -				return next(err)
    -
    -			# Success
    -			return next()
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Initialize the project directory
    -	# with the basic skeleton.
    -	# @private
    -	# @method skeleton
    -	# @param {Object} opts
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	###
    -	skeleton: (opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -		docpad = @
    -		opts.selectSkeletonCallback ?= null
    -
    -		# Init the directory with the basic skeleton
    -		@skeletonEmpty null, (err) ->
    -			# Check
    -			return next(err)  if err
    -
    -			# Select Skeleton
    -			docpad.selectSkeleton opts, (err,skeletonModel) ->
    -				# Check
    -				return next(err)  if err
    -
    -				# Use Skeleton
    -				docpad.useSkeleton(skeletonModel, next)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Initialize the project directory
    -	# with the basic skeleton.
    -	# @private
    -	# @method init
    -	# @param {Object} opts
    -	# @param {Object} next
    -	# @param {Error} next.err
    -	# @return {Object} description
    -	###
    -	init: (opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -		docpad = @
    -
    -		# Init the directory with the basic skeleton
    -		@skeletonEmpty null, (err) ->
    -			# Check
    -			return next(err)  if err
    -
    -			# Basic Skeleton
    -			docpad.useSkeleton(null, next)
    -
    -		# Chain
    -		@
    -
    -
    -	# ---------------------------------
    -	# Server
    -
    -	###*
    -	# Serve a document
    -	# @private
    -	# @method serveDocument
    -	# @param {Object} opts
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	###
    -	serveDocument: (opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -		{document,err,req,res} = opts
    -		docpad = @
    -		config = @getConfig()
    -
    -		# If no document, then exit early
    -		unless document
    -			if opts.statusCode?
    -				return res.send(opts.statusCode)
    -			else
    -				return next()
    -
    -		# Prepare
    -		res.setHeaderIfMissing ?= (name, value) ->
    -			res.setHeader(name, value)  unless res.getHeader(name)
    -
    -		# Content Type + Encoding/Charset
    -		encoding = document.get('encoding')
    -		charset = 'utf-8'  if encoding in ['utf8', 'utf-8']
    -		contentType = document.get('outContentType') or document.get('contentType')
    -		res.setHeaderIfMissing('Content-Type', contentType + (if charset then "; charset=#{charset}" else ''))
    -
    -		# Cache-Control (max-age)
    -		res.setHeaderIfMissing('Cache-Control', "public, max-age=#{config.maxAge}")  if config.maxAge
    -
    -		# Send
    -		dynamic = document.get('dynamic')
    -		if dynamic
    -			# If you are debugging why a dynamic document isn't rendering
    -			# it could be that you don't have cleanurls installed
    -			# e.g. if index.html is dynamic, and you are accessing it via /
    -			# then this code will not be reached, as we don't register that url
    -			# where if we have the cleanurls plugin installed, then do register that url
    -			# against the document, so this is reached
    -			collection = new FilesCollection([document], {name:'dynamic collection'})
    -			templateData = extendr.extend({}, req.templateData or {}, {req,err})
    -			docpad.action 'generate', {collection, templateData}, (err) ->
    -				content = document.getOutContent()
    -				if err
    -					docpad.error(err)
    -					return next(err)
    -				else
    -					if opts.statusCode?
    -						return res.send(opts.statusCode, content)
    -					else
    -						return res.send(content)
    -
    -		else
    -			# ETag: `"<size>-<mtime>"`
    -			ctime = document.get('date')    # use the date or mtime, it should always exist
    -			mtime = document.get('wtime')   # use the last generate time, it may not exist though
    -			stat = document.getStat()
    -			etag = stat.size + '-' + Number(mtime)   if mtime and stat
    -			res.setHeaderIfMissing('ETag', '"' + etag + '"')  if etag
    -
    -			# Date
    -			res.setHeaderIfMissing('Date', ctime.toUTCString())  if ctime?.toUTCString?
    -			res.setHeaderIfMissing('Last-Modified', mtime.toUTCString())  if mtime?.toUTCString?
    -			# @TODO:
    -			# The above .toUTCString? check is a workaround because sometimes the date object
    -			# isn't really a date object, this needs to be fixed properly
    -			# https://github.com/bevry/docpad/pull/781
    -
    -			# Send
    -			if etag and etag is (req.get('If-None-Match') or '').replace(/^"|"$/g, '')
    -				res.send(304)  # not modified
    -			else
    -				content = document.getOutContent()
    -				if content
    -					if opts.statusCode?
    -						res.send(opts.statusCode, content)
    -					else
    -						res.send(content)
    -				else
    -					if opts.statusCode?
    -						res.send(opts.statusCode)
    -					else
    -						next()
    -
    -		# Chain
    -		@
    -
    -
    -	###*
    -	# Server Middleware: Header
    -	# @private
    -	# @method serverMiddlewareHeader
    -	# @param {Object} req
    -	# @param {Object} res
    -	# @param {Object} next
    -	###
    -	serverMiddlewareHeader: (req,res,next) ->
    -		# Prepare
    -		docpad = @
    -
    -		# Handle
    -		# Always enable this until we get a complaint about not having it
    -		# For instance, Express.js also forces this
    -		tools = res.get('X-Powered-By').split(/[,\s]+/g)
    -		tools.push("DocPad v#{docpad.getVersion()}")
    -		tools = tools.join(', ')
    -		res.set('X-Powered-By', tools)
    -
    -		# Forward
    -		next()
    -
    -		# Chain
    -		@
    -
    -
    -	###*
    -	# Server Middleware: Router
    -	# @private
    -	# @method serverMiddlewareRouter
    -	# @param {Object} req
    -	# @param {Object} res
    -	# @param {Function} next
    -	# @param {Error} next.err
    -	###
    -	serverMiddlewareRouter: (req,res,next) ->
    -		# Prepare
    -		docpad = @
    -
    -		# Get the file
    -		docpad.getFileByRoute req.url, (err,file) ->
    -			# Check
    -			return next(err)  if err or file? is false
    -
    -			# Check if we are the desired url
    -			# if we aren't do a permanent redirect
    -			url = file.get('url')
    -			cleanUrl = docpad.getUrlPathname(req.url)
    -			if (url isnt cleanUrl) and (url isnt req.url)
    -				return res.redirect(301, url)
    -
    -			# Serve the file to the user
    -			docpad.serveDocument({document:file, req, res, next})
    -
    -		# Chain
    -		@
    -
    -
    -	###*
    -	# Server Middleware: 404
    -	# @private
    -	# @method serverMiddleware404
    -	# @param {Object} req
    -	# @param {Object} res
    -	# @param {Object} next
    -	###
    -	serverMiddleware404: (req,res,next) ->
    -		# Prepare
    -		docpad = @
    -		database = docpad.getDatabaseSafe()
    -
    -		# Notify the user of a 404
    -		docpad.log('notice', "404 Not Found:", req.url)
    -
    -		# Check
    -		return res.send(500)  unless database
    -
    -		# Serve the document to the user
    -		document = database.findOne({relativeOutPath: '404.html'})
    -		docpad.serveDocument({document, req, res, next, statusCode:404})
    -
    -		# Chain
    -		@
    -
    -
    -	###*
    -	# Server Middleware: 500
    -	# @private
    -	# @method serverMiddleware500
    -	# @param {Object} err
    -	# @param {Object} req
    -	# @param {Object} res
    -	# @param {Function} next
    -	###
    -	serverMiddleware500: (err,req,res,next) ->
    -		# Prepare
    -		docpad = @
    -		database = docpad.getDatabaseSafe()
    -
    -		# Check
    -		return res.send(500)  unless database
    -
    -		# Serve the document to the user
    -		document = database.findOne({relativeOutPath: '500.html'})
    -		docpad.serveDocument({document,err,req,res,next,statusCode:500})
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Configure and start up the DocPad web server.
    -	# Http and express server is created, extended with
    -	# middleware, started up and begins listening.
    -	# The events serverBefore, serverExtend and
    -	# serverAfter emitted here.
    -	# @private
    -	# @method server
    -	# @param {Object} opts
    -	# @param {Function} next
    -	###
    -	server: (opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -		docpad = @
    -		config = @config
    -		locale = @getLocale()
    -		port = @getPort()
    -		hostname = @getHostname()
    -
    -		# Require
    -		http = require('http')
    -		express = require('express')
    -
    -		# Config
    -		servers = @getServer(true)
    -		opts.serverExpress ?= servers.serverExpress
    -		opts.serverHttp ?= servers.serverHttp
    -		opts.middlewareBodyParser ?= config.middlewareBodyParser ? config.middlewareStandard
    -		opts.middlewareMethodOverride ?= config.middlewareMethodOverride ? config.middlewareStandard
    -		opts.middlewareExpressRouter ?= config.middlewareExpressRouter ? config.middlewareStandard
    -		opts.middleware404 ?= config.middleware404
    -		opts.middleware500 ?= config.middleware500
    -		# @TODO: Why do we do opts here instead of config???
    -
    -		# Tasks
    -		tasks = @createTaskGroup("server tasks", {next})
    -
    -		# Before Plugin Event
    -		tasks.addTask "emit serverBefore", (complete) ->
    -			docpad.emitSerial('serverBefore', complete)
    -
    -		# Create server when none is defined
    -		if !opts.serverExpress or !opts.serverHttp
    -			tasks.addTask "create server", ->
    -				opts.serverExpress or= express()
    -				opts.serverHttp or= http.createServer(opts.serverExpress)
    -				docpad.setServer(opts)
    -
    -		# Extend the server with our middlewares
    -		if config.extendServer is true
    -			tasks.addTask "extend the server", (complete) ->
    -				# Parse url-encoded and json encoded form data
    -				if opts.middlewareBodyParser isnt false
    -					opts.serverExpress.use(express.urlencoded())
    -					opts.serverExpress.use(express.json())
    -
    -				# Allow over-riding of the request type (e.g. GET, POST, PUT, DELETE)
    -				if opts.middlewareMethodOverride isnt false
    -					if typeChecker.isString(opts.middlewareMethodOverride)
    -						opts.serverExpress.use(require('method-override')(opts.middlewareMethodOverride))
    -					else
    -						opts.serverExpress.use(require('method-override')())
    -
    -				# Emit the serverExtend event
    -				# So plugins can define their routes earlier than the DocPad routes
    -				docpad.emitSerial 'serverExtend', {
    -					server: opts.serverExpress # b/c
    -					express: opts.serverExpress # b/c
    -					serverHttp: opts.serverHttp
    -					serverExpress: opts.serverExpress
    -				}, (err) ->
    -					return next(err)  if err
    -
    -					# DocPad Header Middleware
    -					# Keep it after the serverExtend event
    -					opts.serverExpress.use(docpad.serverMiddlewareHeader)
    -
    -					# Router Middleware
    -					# Keep it after the serverExtend event
    -					opts.serverExpress.use(opts.serverExpress.router)  if opts.middlewareExpressRouter isnt false
    -
    -					# DocPad Router Middleware
    -					# Keep it after the serverExtend event
    -					opts.serverExpress.use(docpad.serverMiddlewareRouter)
    -
    -					# Static
    -					# Keep it after the serverExtend event
    -					if config.maxAge
    -						opts.serverExpress.use(express.static(config.outPath, {maxAge:config.maxAge}))
    -					else
    -						opts.serverExpress.use(express.static(config.outPath))
    -
    -					# DocPad 404 Middleware
    -					# Keep it after the serverExtend event
    -					opts.serverExpress.use(docpad.serverMiddleware404)  if opts.middleware404 isnt false
    -
    -					# DocPad 500 Middleware
    -					# Keep it after the serverExtend event
    -					opts.serverExpress.use(docpad.serverMiddleware500)  if opts.middleware500 isnt false
    -
    -					# Done
    -					return complete()
    -
    -		# Start Server
    -		tasks.addTask "start the server", (complete) ->
    -			# Catch
    -			opts.serverHttp.once 'error', (err) ->
    -				# Friendlify the error message if it is what we suspect it is
    -				if err.message.indexOf('EADDRINUSE') isnt -1
    -					err = new Error(util.format(locale.serverInUse, port))
    -
    -				# Done
    -				return complete(err)
    -
    -			# Listen
    -			docpad.log 'debug', util.format(locale.serverStart, hostname, port)
    -			opts.serverHttp.listen port, hostname,  ->
    -				# Log
    -				address = opts.serverHttp.address()
    -				serverUrl = docpad.getServerUrl(
    -					hostname: address.hostname
    -					port: address.port
    -				)
    -				simpleServerUrl = docpad.getSimpleServerUrl(
    -					hostname: address.hostname
    -					port: address.port
    -				)
    -				docpad.log 'info', util.format(locale.serverStarted, serverUrl)
    -				if serverUrl isnt simpleServerUrl
    -					docpad.log 'info', util.format(locale.serverBrowse, simpleServerUrl)
    -
    -				# Done
    -				return complete()
    -
    -		# After Plugin Event
    -		tasks.addTask "emit serverAfter", (complete) ->
    -			docpad.emitSerial('serverAfter', {
    -				server: opts.serverExpress # b/c
    -				express: opts.serverExpress # b/c
    -				serverHttp: opts.serverHttp
    -				serverExpress: opts.serverExpress
    -			}, complete)
    -
    -		# Run the tasks
    -		tasks.run()
    -
    -		# Chain
    -		@
    -
    -
    -# ---------------------------------
    -# Export
    -
    -module.exports = DocPad
    -
    -    
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/files/src_lib_interfaces_console.coffee.html b/docs/files/src_lib_interfaces_console.coffee.html deleted file mode 100644 index 7e8ffce8..00000000 --- a/docs/files/src_lib_interfaces_console.coffee.html +++ /dev/null @@ -1,1027 +0,0 @@ - - - - - src/lib/interfaces/console.coffee - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    File: src/lib/interfaces/console.coffee

    - -
    -
    -# =====================================
    -# Requires
    -
    -# Standard Library
    -pathUtil = require('path')
    -
    -# External
    -safefs = require('safefs')
    -safeps = require('safeps')
    -{TaskGroup} = require('taskgroup')
    -extendr = require('extendr')
    -promptly = require('promptly')
    -
    -# Local
    -docpadUtil = require('../util')
    -
    -
    -# =====================================
    -# Classes
    -
    -###*
    -# Console Interface
    -# @constructor
    -###
    -class ConsoleInterface
    -
    -
    -	###*
    -	# Constructor method. Setup the CLI
    -	# @private
    -	# @method constructor
    -	# @param {Object} opts
    -	# @param {Function} next
    -	###
    -	constructor: (opts,next) ->
    -		# Prepare
    -		consoleInterface = @
    -		@docpad = docpad = opts.docpad
    -		@commander = commander = require('commander')
    -		locale = docpad.getLocale()
    -
    -
    -		# -----------------------------
    -		# Global config
    -
    -		commander
    -			.version(
    -				docpad.getVersionString()
    -			)
    -			.option(
    -				'-o, --out <outPath>'
    -				locale.consoleOptionOut
    -			)
    -			.option(
    -				'-c, --config <configPath>'
    -				locale.consoleOptionConfig
    -			)
    -			.option(
    -				'-e, --env <environment>'
    -				locale.consoleOptionEnv
    -			)
    -			.option(
    -				'-d, --debug [logLevel]'
    -				locale.consoleOptionDebug
    -				parseInt
    -			)
    -			.option(
    -				'-g, --global'
    -				locale.consoleOptionGlobal
    -			)
    -			.option(
    -				'-f, --force'
    -				locale.consoleOptionForce
    -			)
    -			.option(
    -				'--no-color'  # commander translates this to the `color` option for us
    -				locale.consoleOptionNoColor
    -			)
    -			.option(
    -				'-p, --port <port>'
    -				locale.consoleOptionPort
    -				parseInt
    -			)
    -			.option(
    -				'--cache'
    -				locale.consoleOptionCache
    -			)
    -			.option(
    -				'--silent'
    -				locale.consoleOptionSilent
    -			)
    -			.option(
    -				'--skeleton <skeleton>'
    -				locale.consoleOptionSkeleton
    -			)
    -			.option(
    -				'--offline'
    -				locale.consoleOptionOffline
    -			)
    -
    -
    -		# -----------------------------
    -		# Commands
    -
    -		# actions
    -		commander
    -			.command('action <actions>')
    -			.description(locale.consoleDescriptionRun)
    -			.action(consoleInterface.wrapAction(consoleInterface.action))
    -
    -		# init
    -		commander
    -			.command('init')
    -			.description(locale.consoleDescriptionInit)
    -			.action(consoleInterface.wrapAction(consoleInterface.init))
    -
    -		# run
    -		commander
    -			.command('run')
    -			.description(locale.consoleDescriptionRun)
    -			.action(consoleInterface.wrapAction(consoleInterface.run, {
    -				_stayAlive: true
    -			}))
    -
    -		# server
    -		commander
    -			.command('server')
    -			.description(locale.consoleDescriptionServer)
    -			.action(consoleInterface.wrapAction(consoleInterface.server, {
    -				_stayAlive: true
    -			}))
    -
    -		# render
    -		commander
    -			.command('render [path]')
    -			.description(locale.consoleDescriptionRender)
    -			.action(consoleInterface.wrapAction(consoleInterface.render, {
    -				# Disable anything unnecessary or that could cause extra output we don't want
    -				logLevel: 3  # 3:error, 2:critical, 1:alert, 0:emergency
    -				checkVersion: false
    -				welcome: false
    -				prompts: false
    -			}))
    -
    -		# generate
    -		commander
    -			.command('generate')
    -			.description(locale.consoleDescriptionGenerate)
    -			.action(consoleInterface.wrapAction(consoleInterface.generate))
    -
    -		# watch
    -		commander
    -			.command('watch')
    -			.description(locale.consoleDescriptionWatch)
    -			.action(consoleInterface.wrapAction(consoleInterface.watch, {
    -				_stayAlive: true
    -			}))
    -
    -		# update
    -		commander
    -			.command('update')
    -			.description(locale.consoleDescriptionUpdate)
    -			.action(consoleInterface.wrapAction(consoleInterface.update))
    -
    -		# upgrade
    -		commander
    -			.command('upgrade')
    -			.description(locale.consoleDescriptionUpgrade)
    -			.action(consoleInterface.wrapAction(consoleInterface.upgrade))
    -
    -		# install
    -		commander
    -			.command('install [pluginName]')
    -			.description(locale.consoleDescriptionInstall)
    -			.action(consoleInterface.wrapAction(consoleInterface.install))
    -
    -		# uninstall
    -		commander
    -			.command('uninstall <pluginName>')
    -			.description(locale.consoleDescriptionUninstall)
    -			.action(consoleInterface.wrapAction(consoleInterface.uninstall))
    -
    -		# clean
    -		commander
    -			.command('clean')
    -			.description(locale.consoleDescriptionClean)
    -			.action(consoleInterface.wrapAction(consoleInterface.clean))
    -
    -		# info
    -		commander
    -			.command('info')
    -			.description(locale.consoleDescriptionInfo)
    -			.action(consoleInterface.wrapAction(consoleInterface.info))
    -
    -		# help
    -		commander
    -			.command('help')
    -			.description(locale.consoleDescriptionHelp)
    -			.action(consoleInterface.wrapAction(consoleInterface.help))
    -
    -		# unknown
    -		commander
    -			.command('*')
    -			.description(locale.consoleDescriptionUnknown)
    -			.action(consoleInterface.wrapAction(consoleInterface.help))
    -
    -
    -		# -----------------------------
    -		# DocPad Listeners
    -
    -		# Welcome
    -		docpad.on 'welcome', (data,next) ->
    -			return consoleInterface.welcomeCallback(data,next)
    -
    -
    -		# -----------------------------
    -		# Finish Up
    -
    -		# Plugins
    -		docpad.emitSerial 'consoleSetup', {consoleInterface,commander}, (err) ->
    -			return consoleInterface.destroyWithError(err)  if err
    -			return next(null, consoleInterface)
    -
    -		# Chain
    -		@
    -
    -
    -	# =================================
    -	# Helpers
    -
    -	###*
    -	# Start the CLI
    -	# @method start
    -	# @param {Array} argv
    -	###
    -	start: (argv) =>
    -		@commander.parse(argv or process.argv)
    -		@
    -
    -	###*
    -	# Get the commander
    -	# @method getCommander
    -	# @return the commander instance
    -	###
    -	getCommander: =>
    -		@commander
    -
    -	###*
    -	# Destructor.
    -	# @method destroy
    -	# @param {Object} err
    -	###
    -	destroy: (err) =>
    -		# Prepare
    -		docpad = @docpad
    -		locale = docpad.getLocale()
    -		logLevel = docpad.getLogLevel()
    -
    -		# Error?
    -		docpadUtil.writeError(err)  if err
    -
    -		# Log Shutdown
    -		docpad.log('info', locale.consoleShutdown)
    -
    -		# Close stdin
    -		process.stdin.end()
    -
    -		# Destroy docpad
    -		docpad.destroy (err) ->
    -			# Error?
    -			docpadUtil.writeError(err)  if err
    -
    -			# Output if we are not in silent mode
    -			if 6 <= logLevel
    -				# Note any requests that are still active
    -				activeRequests = process._getActiveRequests()
    -				if activeRequests?.length
    -					console.log """
    -						Waiting on the requests:
    -						#{docpadUtil.inspect activeRequests}
    -						"""
    -
    -				# Note any handles that are still active
    -				activeHandles = process._getActiveHandles()
    -				if activeHandles?.length
    -					console.log """
    -						Waiting on the handles:
    -						#{docpadUtil.inspect activeHandles}
    -						"""
    -
    -		# Chain
    -		@
    -
    -
    -	###*
    -	# Wrap Action
    -	# @method wrapAction
    -	# @param {Object} action
    -	# @param {Object} config
    -	###
    -	wrapAction: (action,config) =>
    -		consoleInterface = @
    -		return (args...) ->
    -			consoleInterface.performAction(action, args, config)
    -
    -	###*
    -	# Perform Action
    -	# @method performAction
    -	# @param {Object} action
    -	# @param {Object} args
    -	# @param {Object} [config={}]
    -	###
    -	performAction: (action,args,config={}) =>
    -		# Prepare
    -		consoleInterface = @
    -		docpad = @docpad
    -
    -		# Special Opts
    -		stayAlive = false
    -		if config._stayAlive
    -			stayAlive = config._stayAlive
    -			delete config._stayAlive
    -
    -		# Create
    -		opts = {}
    -		opts.commander = args[-1...][0]
    -		opts.args = args[...-1]
    -		opts.instanceConfig = extendr.deepDefaults({}, @extractConfig(opts.commander), config)
    -
    -		# Complete Action
    -		completeAction = (err) ->
    -			# Prepare
    -			locale = docpad.getLocale()
    -
    -			# Handle the error
    -			if err
    -				docpad.log('error', locale.consoleSuccess)
    -				return docpad.fatal(err)
    -
    -			# Success
    -			docpad.log('info', locale.consoleSuccess)
    -
    -			# Shutdown
    -			return consoleInterface.destroy()  if stayAlive is false
    -
    -		# Load
    -		docpad.action 'load ready', opts.instanceConfig, (err) ->
    -			# Check
    -			return completeAction(err)  if err
    -
    -			# Action
    -			return action(completeAction, opts)  # this order for interface actions for b/c
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Extract Configuration
    -	# @method extractConfig
    -	# @param {Object} [customConfig={}]
    -	# @return {Object} the DocPad config
    -	###
    -	extractConfig: (customConfig={}) =>
    -		# Prepare
    -		config = {}
    -		commanderConfig = @commander
    -		sourceConfig = @docpad.initialConfig
    -
    -		# debug -> logLevel
    -		if commanderConfig.debug
    -			commanderConfig.debug = 7  if commanderConfig.debug is true
    -			commanderConfig.logLevel = commanderConfig.debug
    -
    -		# silent -> prompt
    -		if commanderConfig.silent?
    -			commanderConfig.prompts = !(commanderConfig.silent)
    -
    -		# cache -> databaseCache
    -		if commanderConfig.silent?
    -			commanderConfig.databaseCache = commanderConfig.cache
    -
    -		# config -> configPaths
    -		if commanderConfig.config
    -			configPath = pathUtil.resolve(process.cwd(),commanderConfig.config)
    -			commanderConfig.configPaths = [configPath]
    -
    -		# out -> outPath
    -		if commanderConfig.out
    -			outPath = pathUtil.resolve(process.cwd(),commanderConfig.out)
    -			commanderConfig.outPath = outPath
    -
    -		# Apply global configuration
    -		for own key, value of commanderConfig
    -			if typeof sourceConfig[key] isnt 'undefined'
    -				config[key] = value
    -
    -		# Apply custom configuration
    -		for own key, value of customConfig
    -			if typeof sourceConfig[key] isnt 'undefined'
    -				config[key] = value
    -
    -		# Return config object
    -		config
    -
    -	###*
    -	# Select a skeleton
    -	# @method selectSkeletonCallback
    -	# @param {Object} skeletonsCollection
    -	# @param {Function} next
    -	###
    -	selectSkeletonCallback: (skeletonsCollection,next) =>
    -		# Prepare
    -		consoleInterface = @
    -		commander = @commander
    -		docpad = @docpad
    -		locale = docpad.getLocale()
    -		skeletonNames = []
    -
    -		# Already selected?
    -		if @commander.skeleton
    -			skeletonModel = skeletonsCollection.get(@commander.skeleton)
    -			if skeletonModel
    -				next(null, skeletonModel)
    -			else
    -				err = new Error("Couldn't fetch the skeleton with id #{@commander.skeleton}")
    -				next(err)
    -			return @
    -
    -		# Show
    -		docpad.log 'info', locale.skeletonSelectionIntroduction+'\n'
    -		skeletonsCollection.forEach (skeletonModel) ->
    -			skeletonName = skeletonModel.get('name')
    -			skeletonDescription = skeletonModel.get('description').replace(/\n/g,'\n\t')
    -			skeletonNames.push(skeletonName)
    -			console.log "  #{skeletonModel.get('position')+1}.\t#{skeletonName}\n  \t#{skeletonDescription}\n"
    -
    -		# Select
    -		consoleInterface.choose locale.skeletonSelectionPrompt, skeletonNames, null, (err, choice) ->
    -			return next(err)  if err
    -			index = skeletonNames.indexOf(choice)
    -			return next(null, skeletonsCollection.at(index))
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Welcome Callback
    -	# @method welcomeCallback
    -	# @param {Object} opts
    -	# @param {Function} next
    -	###
    -	welcomeCallback: (opts,next) =>
    -		# Prepare
    -		consoleInterface = @
    -		commander = @commander
    -		docpad = @docpad
    -		locale = docpad.getLocale()
    -		userConfig = docpad.userConfig
    -		welcomeTasks = new TaskGroup('welcome tasks').done(next)
    -
    -		# TOS
    -		welcomeTasks.addTask 'tos', (complete) ->
    -			return complete()  if docpad.config.prompts is false or userConfig.tos is true
    -
    -			# Ask the user if they agree to the TOS
    -			consoleInterface.confirm locale.tosPrompt, {default:true}, (err, ok) ->
    -				# Check
    -				return complete(err)  if err
    -
    -				# Track
    -				docpad.track 'tos', {ok}, (err) ->
    -					# Check
    -					if ok
    -						userConfig.tos = true
    -						console.log locale.tosAgree
    -						docpad.updateUserConfig(complete)
    -						return
    -					else
    -						console.log locale.tosDisagree
    -						process.exit()
    -						return
    -
    -		# Newsletter
    -		welcomeTasks.addTask (complete) ->
    -			return complete()  if docpad.config.prompts is false or userConfig.subscribed? or (userConfig.subscribeTryAgain? and (new Date()) > (new Date(userConfig.subscribeTryAgain)))
    -
    -			# Ask the user if they want to subscribe to the newsletter
    -			consoleInterface.confirm locale.subscribePrompt, {default:true}, (err, ok) ->
    -				# Check
    -				return complete(err)  if err
    -
    -				# Track
    -				docpad.track 'subscribe', {ok}, (err) ->
    -					# If they don't want to, that's okay
    -					unless ok
    -						# Inform the user that we received their preference
    -						console.log locale.subscribeIgnore
    -
    -						# Save their preference in the user configuration
    -						userConfig.subscribed = false
    -						docpad.updateUserConfig (err) ->
    -							return complete(err)  if err
    -							setTimeout(complete, 2000)
    -						return
    -
    -					# Scan configuration to speed up the process
    -					commands = [
    -						['config','--get','user.name']
    -						['config','--get','user.email']
    -						['config','--get','github.user']
    -					]
    -					safeps.spawnCommands 'git', commands, (err,results) ->
    -						# Ignore error as it just means a config value wasn't defined
    -
    -						# Fetch
    -						# The or to '' is there because otherwise we will get "undefined" as a string if the value doesn't exist
    -						userConfig.name = String(results?[0]?[1] or '').toString().trim() or null
    -						userConfig.email = String(results?[1]?[1] or '').toString().trim() or null
    -						userConfig.username = String(results?[2]?[1] or '').toString().trim() or null
    -
    -						# Let the user know we scanned their configuration if we got anything useful
    -						if userConfig.name or userConfig.email or userConfig.username
    -							console.log locale.subscribeConfigNotify
    -
    -						# Tasks
    -						subscribeTasks = new TaskGroup('subscribe tasks').done (err) ->
    -							# Error?
    -							if err
    -								# Inform the user
    -								console.log locale.subscribeError
    -
    -								# Save a time when we should try to subscribe again
    -								userConfig.subscribeTryAgain = new Date().getTime() + 1000*60*60*24  # tomorrow
    -
    -							# Success
    -							else
    -								# Inform the user
    -								console.log locale.subscribeSuccess
    -
    -								# Save the updated subscription status, and continue to what is next
    -								userConfig.subscribed = true
    -								userConfig.subscribeTryAgain = null
    -
    -							# Save the new user configuration changes, and forward to the next task
    -							docpad.updateUserConfig(userConfig, complete)
    -
    -						# Name Fallback
    -						subscribeTasks.addTask 'name fallback', (complete) ->
    -							consoleInterface.prompt locale.subscribeNamePrompt, {default: userConfig.name}, (err, result) ->
    -								return complete(err)  if err
    -								userConfig.name = result
    -								return complete()
    -
    -						# Email Fallback
    -						subscribeTasks.addTask 'email fallback', (complete) ->
    -							consoleInterface.prompt locale.subscribeEmailPrompt, {default: userConfig.email}, (err, result) ->
    -								return complete(err)  if err
    -								userConfig.email = result
    -								return complete()
    -
    -						# Username Fallback
    -						subscribeTasks.addTask 'username fallback', (complete) ->
    -							consoleInterface.prompt locale.subscribeUsernamePrompt, {default: userConfig.username}, (err, result) ->
    -								return complete(err)  if err
    -								userConfig.username = result
    -								return complete()
    -
    -						# Save the details
    -						subscribeTasks.addTask 'save defaults', (complete) ->
    -							return docpad.updateUserConfig(complete)
    -
    -						# Perform the subscribe
    -						subscribeTasks.addTask 'subscribe', (complete) ->
    -							# Inform the user
    -							console.log locale.subscribeProgress
    -
    -							# Forward
    -							docpad.subscribe (err,res) ->
    -								# Check
    -								if err
    -									docpad.log 'debug', locale.subscribeRequestError, err.message
    -									return complete(err)
    -
    -								# Success
    -								docpad.log 'debug', locale.subscribeRequestData, res.text
    -								return complete()
    -
    -						# Run
    -						subscribeTasks.run()
    -
    -		# Run
    -		welcomeTasks.run()
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Prompt for input
    -	# @method prompt
    -	# @param {String} message
    -	# @param {Object} [opts={}]
    -	# @param {Function} next
    -	###
    -	prompt: (message, opts={}, next) ->
    -		# Default
    -		message += " [#{opts.default}]"  if opts.default
    -
    -		# Options
    -		opts = extendr.extend({
    -			trim: true
    -			retry: true
    -			silent: false
    -		}, opts)
    -
    -		# Log
    -		promptly.prompt(message, opts, next)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Confirm an option
    -	# @method confirm
    -	# @param {String} message
    -	# @param {Object} [opts={}]
    -	# @param {Function} next
    -	###
    -	confirm: (message, opts={}, next) ->
    -		# Default
    -		if opts.default is true
    -			message += " [Y/n]"
    -		else if opts.default is false
    -			message += " [y/N]"
    -
    -		# Options
    -		opts = extendr.extend({
    -			trim: true
    -			retry: true
    -			silent: false
    -		}, opts)
    -
    -		# Log
    -		promptly.confirm(message, opts, next)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Choose something
    -	# @method choose
    -	# @param {String} message
    -	# @param {Object} choices
    -	# @param {Object} [opts={}]
    -	# @param {Function} next
    -	###
    -	choose: (message, choices, opts={}, next) ->
    -		# Default
    -		message += " [1-#{choices.length}]"
    -		indexes = []
    -		for choice,i in choices
    -			index = i+1
    -			indexes.push(index)
    -			message += "\n  #{index}.\t#{choice}"
    -
    -		# Options
    -		opts = extendr.extend({
    -			trim: true
    -			retry: true
    -			silent: false
    -		}, opts)
    -
    -		# Prompt
    -		prompt = '> '
    -		prompt += " [#{opts.default}]"  if opts.default
    -
    -		# Log
    -		console.log(message)
    -		promptly.choose prompt, indexes, opts, (err, index) ->
    -			return next(err)  if err
    -			choice = choices[index-1]
    -			return next(null, choice)
    -
    -		# Chain
    -		@
    -
    -
    -	# =================================
    -	# Actions
    -
    -	###*
    -	# Do action
    -	# @method action
    -	# @param {Function} next
    -	# @param {Object} opts
    -	###
    -	action: (next,opts) =>
    -		actions = opts.args[0]
    -		@docpad.log 'info', 'Performing the actions:', actions
    -		@docpad.action(actions, next)
    -		@
    -
    -	###*
    -	# Action initialise
    -	# @method init
    -	# @param {Function} next
    -	###
    -	init: (next) =>
    -		@docpad.action('init', next)
    -		@
    -
    -	###*
    -	# Generate action
    -	# @method generate
    -	# @param {Function} next
    -	###
    -	generate: (next) =>
    -		@docpad.action('generate', next)
    -		@
    -
    -	###*
    -	# Help method
    -	# @method help
    -	# @param {Function} next
    -	###
    -	help: (next) =>
    -		help = @commander.helpInformation()
    -		console.log(help)
    -		next()
    -		@
    -
    -	###*
    -	# Info method
    -	# @method info
    -	# @param {Function} next
    -	###
    -	info: (next) =>
    -		docpad = @docpad
    -		info = docpad.inspector(docpad.config)
    -		console.log(info)
    -		next()
    -		@
    -
    -	###*
    -	# Update method
    -	# @method update
    -	# @param {Function} next
    -	# @param {Object} opts
    -	###
    -	update: (next,opts) =>
    -		# Act
    -		@docpad.action('clean update', next)
    -
    -		# Chain
    -		@
    -	###*
    -	# Upgrade method
    -	# @method upgrade
    -	# @param {Function} next
    -	# @param {Object} opts
    -	###
    -	upgrade: (next,opts) =>
    -		# Act
    -		@docpad.action('upgrade', next)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Install method
    -	# @method install
    -	# @param {Function} next
    -	# @param {Object} opts
    -	###
    -	install: (next,opts) =>
    -		# Extract
    -		plugin = opts.args[0] or null
    -
    -		# Act
    -		@docpad.action('install', {plugin}, next)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Uninstall method
    -	# @method uninstall
    -	# @param {Function} next
    -	# @param {Object} opts
    -	###
    -	uninstall: (next,opts) =>
    -		# Extract
    -		plugin = opts.args[0] or null
    -
    -		# Act
    -		@docpad.action('uninstall', {plugin}, next)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Render method
    -	# @method render
    -	# @param {Function} next
    -	# @param {Object} opts
    -	###
    -	render: (next,opts) =>
    -		# Prepare
    -		docpad = @docpad
    -		commander = @commander
    -		renderOpts = {}
    -
    -		# Extract
    -		filename = opts.args[0] or null
    -		basename = pathUtil.basename(filename)
    -		renderOpts.filename = filename
    -		renderOpts.renderSingleExtensions = 'auto'
    -
    -		# Prepare text
    -		data = ''
    -
    -		# Render
    -		useStdin = true
    -		renderDocument = (complete) ->
    -			# Perform the render
    -			docpad.action 'render', renderOpts, (err,result) ->
    -				return complete(err)  if err
    -
    -				# Path
    -				if commander.out?
    -					safefs.writeFile(commander.out, result, complete)
    -
    -				# Stdout
    -				else
    -					process.stdout.write(result)
    -					return complete()
    -
    -		# Timeout if we don't have stdin
    -		timeout = docpadUtil.wait 1000, ->
    -			# Clear timeout
    -			timeout = null
    -
    -			# Skip if we are using stdin
    -			return next()  if data.replace(/\s+/,'')
    -
    -			# Close stdin as we are not using it
    -			useStdin = false
    -			stdin.pause()
    -
    -			# Render the document
    -			renderDocument(next)
    -
    -		# Read stdin
    -		stdin = process.stdin
    -		stdin.resume()
    -		stdin.setEncoding('utf8')
    -		stdin.on 'data', (_data) ->
    -			data += _data.toString()
    -		process.stdin.on 'end', ->
    -			return  unless useStdin
    -			if timeout
    -				clearTimeout(timeout)
    -				timeout = null
    -			renderOpts.data = data
    -			renderDocument(next)
    -
    -		@
    -
    -	###*
    -	# Run method
    -	# @method run
    -	# @param {Function} next
    -	###
    -	run: (next) =>
    -		@docpad.action('run', {
    -			selectSkeletonCallback: @selectSkeletonCallback
    -			next: next
    -		})
    -		@
    -
    -	###*
    -	# Server method
    -	# @method server
    -	# @param {Function} next
    -	###
    -	server: (next) =>
    -		@docpad.action('server generate', next)
    -		@
    -
    -	###*
    -	# Clean method
    -	# @method clean
    -	# @param {Function} next
    -	###
    -	clean: (next) =>
    -		@docpad.action('clean', next)
    -		@
    -
    -	###*
    -	# Watch method
    -	# @method watch
    -	# @param {Function} next
    -	###
    -	watch: (next) =>
    -		@docpad.action('generate watch', next)
    -		@
    -
    -
    -# =====================================
    -# Export
    -module.exports = ConsoleInterface
    -
    -    
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/files/src_lib_models_document.coffee.html b/docs/files/src_lib_models_document.coffee.html deleted file mode 100644 index bf6d2872..00000000 --- a/docs/files/src_lib_models_document.coffee.html +++ /dev/null @@ -1,969 +0,0 @@ - - - - - src/lib/models/document.coffee - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    File: src/lib/models/document.coffee

    - -
    -
    -# =====================================
    -# Requires
    -
    -# Standard Library
    -util = require('util')
    -pathUtil = require('path')
    -docpadUtil = require('../util')
    -
    -# External
    -CSON = require('cson')
    -extendr = require('extendr')
    -eachr = require('eachr')
    -extractOptsAndCallback = require('extract-opts')
    -
    -# Local
    -FileModel = require('./file')
    -
    -# Optional
    -YAML = null
    -
    -
    -# =====================================
    -# Classes
    -
    -###*
    -# The DocumentModel class is DocPad's representation
    -# of a website or project's content files. This can be
    -# individual web pages or blog posts etc. Generally, this
    -# is not other website files such as css files, images, or scripts -
    -# unless there is a requirement to have DocPad do transformation on
    -# these files.
    -# Extends the DocPad FileModel class
    -# https://github.com/docpad/docpad/blob/master/src/lib/models/file.coffee
    -# DocumentModel primarily handles the rendering and parsing of document files.
    -# This includes merging the document with layouts and managing the rendering
    -# from one file extension to another. The class inherits many of the file
    -# specific operations and DocPad specific attributes from the FileModel class.
    -# However, it also overrides some parsing and file output operations contained
    -# in the FileModel class.
    -#
    -# Typically we do not need to create DocumentModels ourselves as DocPad handles
    -# all of that. Most of the time when we encounter DocumentModels is when
    -# querying DocPad's document collections either in the docpad.coffee file or
    -# from within a template.
    -#
    -# 	indexDoc = @getCollection('documents').findOne({relativeOutPath: 'index.html'})
    -#
    -# A plugin, however, may need to create a DocumentModel depending on its requirements.
    -# In such a case it is wise to use the built in DocPad methods to do so, in particular
    -# docpad.createModel
    -#
    -# 	#check to see if the document alread exists ie its an update
    -# 	docModel = @docpad.getCollection('posts').findOne({slug: 'some-slug'})
    -#
    -# 	#if so, load the existing document ready for regeneration
    -# 	if docModel
    -# 		docModel.load()
    -# 	else
    -# 		#if document doesn't already exist, create it and add to database
    -# 		docModel = @docpad.createModel({fullPath:'file/path/to/somewhere'})
    -# 		docModel.load()
    -# 		@docpad.getDatabase().add(docModel)
    -#
    -# @class DocumentModel
    -# @constructor
    -# @extends FileModel
    -###
    -class DocumentModel extends FileModel
    -
    -	# ---------------------------------
    -	# Properties
    -
    -	###*
    -	# The document model class.
    -	# @private
    -	# @property {Object} klass
    -	###
    -	klass: DocumentModel
    -
    -	###*
    -	# String name of the model type.
    -	# In this case, 'document'.
    -	# @private
    -	# @property {String} type
    -	###
    -	type: 'document'
    -
    -
    -	# ---------------------------------
    -	# Attributes
    -
    -	###*
    -	# The default attributes for any document model.
    -	# @private
    -	# @property {Object}
    -	###
    -	defaults: extendr.extend({}, FileModel::defaults, {
    -
    -		# ---------------------------------
    -		# Special variables
    -
    -		# outExtension
    -		# The final extension used for our file
    -		# Takes into accounts layouts
    -		# "layout.html", "post.md.eco" -> "html"
    -		# already defined in file.coffee
    -
    -		# Whether or not we reference other doucments
    -		referencesOthers: false
    -
    -
    -		# ---------------------------------
    -		# Content variables
    -
    -		# The file meta data (header) in string format before it has been parsed
    -		header: null
    -
    -		# The parser to use for the file's meta data (header)
    -		parser: null
    -
    -		# The file content (body) before rendering, excludes the meta data (header)
    -		body: null
    -
    -		# Have we been rendered yet?
    -		rendered: false
    -
    -		# The rendered content (after it has been wrapped in the layouts)
    -		contentRendered: null
    -
    -		# The rendered content (before being passed through the layouts)
    -		contentRenderedWithoutLayouts: null
    -
    -
    -		# ---------------------------------
    -		# User set variables
    -
    -		# Whether or not we should render this file
    -		render: true
    -
    -		# Whether or not we want to render single extensions
    -		renderSingleExtensions: false
    -	})
    -
    -
    -	# ---------------------------------
    -	# Helpers
    -
    -	###*
    -	# Get the file content for output. This
    -	# will be the text content AFTER it has
    -	# been through the rendering process. If
    -	# this has been called before the rendering
    -	# process, then the raw text content will be returned,
    -	# or, if early enough in the process, the file buffer object.
    -	# @method getOutContent
    -	# @return {String or Object}
    -	###
    -	getOutContent: ->
    -		content = @get('contentRendered') or @getContent()
    -		return content
    -
    -	###*
    -	# Set flag to indicate if the document
    -	# contains references to other documents.
    -	# Used in the rendering process to decide
    -	# on whether to render this document when
    -	# another document is updated.
    -	# @method referencesOthers
    -	# @param {Boolean} [flag=true]
    -	###
    -	referencesOthers: (flag) ->
    -		flag ?= true
    -		@set({referencesOthers:flag})
    -		@
    -
    -
    -	# ---------------------------------
    -	# Actions
    -
    -	###*
    -	# Parse our buffer and extract meaningful data from it.
    -	# next(err).
    -	# @method parse
    -	# @param {Object} [opts={}]
    -	# @param {Object} next callback
    -	###
    -	parse: (opts={},next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -		buffer = @getBuffer()
    -		locale = @getLocale()
    -		filePath = @getFilePath()
    -
    -		# Reparse the data and extract the content
    -		# With the content, fetch the new meta data, header, and body
    -		super opts, =>
    -			# Prepare
    -			meta = @getMeta()
    -			metaDataChanges = {}
    -			parser = header = body = content = null
    -
    -			# Content
    -			content = @get('content').replace(/\r\n?/gm,'\n')  # normalise line endings for the web, just for convience, if it causes problems we can remove
    -
    -			# Header
    -			regex = ///
    -				# allow some space
    -				^\s*
    -
    -				# allow potential comment characters in seperator
    -				[^\n]*?
    -
    -				# discover our seperator characters
    -				(
    -					([^\s\d\w])  #\2
    -					\2{2,}  # match the above (the first character of our seperator), 2 or more times
    -				) #\1
    -
    -				# discover our parser (optional)
    -				(?:
    -					\x20*  # allow zero or more space characters, see https://github.com/jashkenas/coffee-script/issues/2668
    -					(
    -						[a-z]+  # parser must be lowercase alpha
    -					)  #\3
    -				)?
    -
    -				# discover our meta content
    -				(
    -					[\s\S]*?  # match anything/everything lazily
    -				) #\4
    -
    -				# allow potential comment characters in seperator
    -				[^\n]*?
    -
    -				# match our seperator (the first group) exactly
    -				\1
    -
    -				# allow potential comment characters in seperator
    -				[^\n]*
    -				///
    -
    -			# Extract Meta Data
    -			match = regex.exec(content)
    -			if match
    -				# TODO: Wipe the old meta data
    -
    -				# Prepare
    -				seperator = match[1]
    -				parser = match[3] or 'yaml'
    -				header = match[4].trim()
    -				body = content.substring(match[0].length).trim()
    -
    -				# Parse
    -				try
    -					switch parser
    -						when 'cson', 'json', 'coffee', 'coffeescript', 'coffee-script', 'js', 'javascript'
    -							switch parser
    -								when 'coffee', 'coffeescript', 'coffee-script'
    -									parser = 'coffeescript'
    -								when 'js', 'javascript'
    -									parser = 'javascript'
    -
    -							csonOptions =
    -								format: parser
    -								json: true
    -								cson: true
    -								coffeescript: true
    -								javascript: true
    -
    -							metaParseResult = CSON.parseString(header, csonOptions)
    -							if metaParseResult instanceof Error
    -								metaParseResult.context = "Failed to parse #{parser} meta header for the file: #{filePath}"
    -								return next(metaParseResult)
    -
    -							extendr.extend(metaDataChanges, metaParseResult)
    -
    -						when 'yaml'
    -							YAML = require('yamljs')  unless YAML
    -							metaParseResult = YAML.parse(
    -								header.replace(/\t/g,'    ')  # YAML doesn't support tabs that well
    -							)
    -							extendr.extend(metaDataChanges, metaParseResult)
    -
    -						else
    -							err = new Error(util.format(locale.documentMissingParserError, parser, filePath))
    -							return next(err)
    -				catch err
    -					err.context = util.format(locale.documentParserError, parser, filePath)
    -					return next(err)
    -			else
    -				body = content
    -
    -			# Incorrect encoding detection?
    -			# If so, re-parse with the correct encoding conversion
    -			if metaDataChanges.encoding and metaDataChanges.encoding isnt @get('encoding')
    -				@set({
    -					encoding: metaDataChanges.encoding
    -				})
    -				opts.reencode = true
    -				return @parse(opts, next)
    -
    -			# Update meta data
    -			body = body.replace(/^\n+/,'')
    -			@set(
    -				source: content
    -				content: body
    -				header: header
    -				body: body
    -				parser: parser
    -				name: @get('name') or @get('title') or @get('basename')
    -			)
    -
    -			# Correct data format
    -			metaDataChanges.date = new Date(metaDataChanges.date)   if metaDataChanges.date
    -
    -			# Correct ignore
    -			for key in ['ignore','skip','draft']
    -				if metaDataChanges[key]?
    -					metaDataChanges.ignored = (metaDataChanges[key] ? false)
    -					delete metaDataChanges[key]
    -			for key in ['published']
    -				if metaDataChanges[key]?
    -					metaDataChanges.ignored = !(metaDataChanges[key] ? false)
    -					delete metaDataChanges[key]
    -
    -			# Handle urls
    -			@addUrl(metaDataChanges.urls)  if metaDataChanges.urls
    -			@setUrl(metaDataChanges.url)   if metaDataChanges.url
    -
    -			# Check if the id was being over-written
    -			if metaDataChanges.id?
    -				@log 'warn', util.format(locale.documentIdChangeError, filePath)
    -				delete metaDataChanges.id
    -
    -			# Apply meta data
    -			@setMeta(metaDataChanges)
    -
    -			# Next
    -			return next()
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Normalize any parsing we have done, because if a value has
    -	# updates it may have consequences on another value.
    -	# This will ensure everything is okay.
    -	# next(err)
    -	# @method normalize
    -	# @param {Object} [opts={}]
    -	# @param {Object} next callback
    -	###
    -	normalize: (opts={},next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -		changes = {}
    -		meta = @getMeta()
    -
    -		# Extract
    -		outExtension = opts.outExtension or meta.get('outExtension') or null
    -		filename = opts.filename or @get('filename') or null
    -		extensions = @getExtensions({filename}) or null
    -
    -		# Extension Rendered
    -		if !outExtension
    -			changes.outExtension = outExtension = extensions[0] or null
    -
    -		# Forward
    -		super(extendr.extend(opts, changes), next)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Contextualize the data. In other words,
    -	# put our data into the perspective of the bigger picture of the data.
    -	# For instance, generate the url for it's rendered equivalant.
    -	# next(err)
    -	# @method contextualize
    -	# @param {Object} [opts={}]
    -	# @param {Object} next callback
    -	###
    -	contextualize: (opts={},next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -
    -		# Get our highest ancestor
    -		@getEve (err,eve) =>
    -			# Prepare
    -			return next(err)  if err
    -			changes = {}
    -			meta = @getMeta()
    -
    -			# User specified
    -			outFilename = opts.outFilename or meta.get('outFilename') or null
    -			outPath = opts.outPath or meta.get('outPath') or null
    -			outExtension = opts.outExtension or meta.get('outExtension') or null
    -			extensions = @getExtensions({filename:outFilename}) or null
    -
    -			# outExtension
    -			if !outExtension
    -				if !outFilename and !outPath
    -					if eve?
    -						changes.outExtension = outExtension = eve.get('outExtension') or extensions[0] or null
    -					else
    -						changes.outExtension = extensions[0] or null
    -
    -			# Forward onto normalize to adjust for the outExtension change
    -			return @normalize(extendr.extend(opts, changes), next)
    -
    -		# Chain
    -		@
    -
    -
    -	# ---------------------------------
    -	# Layouts
    -
    -	###*
    -	# Checks if the file has a layout.
    -	# @method hasLayout
    -	# @return {Boolean}
    -	###
    -	hasLayout: ->
    -		return @get('layout')?
    -
    -	# Get Layout
    -
    -	###*
    -	# Get the layout object that this file references (if any).
    -	# We update the layoutRelativePath as it is
    -	# used for finding what documents are used by a
    -	# layout for when a layout changes.
    -	# next(err, layout)
    -	# @method getLayout
    -	# @param {Function} next callback
    -	###
    -	getLayout: (next) ->
    -		# Prepare
    -		file = @
    -		layoutSelector = @get('layout')
    -
    -		# Check
    -		return next(null, null)  unless layoutSelector
    -
    -		# Find parent
    -		@emit 'getLayout', {selector:layoutSelector}, (err,opts) ->
    -			# Prepare
    -			{layout} = opts
    -
    -			# Error
    -			if err
    -				file.set('layoutRelativePath': null)
    -				return next(err)
    -
    -			# Not Found
    -			else unless layout
    -				file.set('layoutRelativePath': null)
    -				return next()
    -
    -			# Found
    -			else
    -				file.set('layoutRelativePath': layout.get('relativePath'))
    -				return next(null, layout)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Get the most ancestoral (root) layout we
    -	# have - ie, the very top one. Often this
    -	# will be the base or default layout for
    -	# a project. The layout where the head and other
    -	# html on all pages is defined. In some projects,
    -	# however, there may be more than one root layout
    -	# so we can't assume there will always only be one.
    -	# This is used by the contextualize method to determine
    -	# the output extension of the document. In other words
    -	# the document's final output extension is determined by
    -	# the root layout.
    -	# next(err,layout)
    -	# @method getEve
    -	# @param {Function} next
    -	###
    -	getEve: (next) ->
    -		if @hasLayout()
    -			@getLayout (err,layout) ->
    -				if err
    -					return next(err, null)
    -				else if layout
    -					layout.getEve(next)
    -				else
    -					next(null, null)
    -		else
    -			next(null, @)
    -		@
    -
    -
    -	# ---------------------------------
    -	# Rendering
    -
    -	###*
    -	# Renders one extension to another depending
    -	# on the document model's extensions property.
    -	# Triggers the render event for each extension conversion.
    -	# This is the point where the various templating systems listen
    -	# for their extension and perform their conversions.
    -	# Common extension conversion is from md to html.
    -	# So the document source file maybe index.md.html.
    -	# This will be a markdown file to be converted to HTML.
    -	# However, documents can be rendered through more than
    -	# one conversion. Index.html.md.eco will be rendered from
    -	# eco to md and then from md to html. Two conversions.
    -	# next(err,result)
    -	# @private
    -	# @method renderExtensions
    -	# @param {Object} opts
    -	# @param {Function} next callback
    -	###
    -	renderExtensions: (opts,next) ->
    -		# Prepare
    -		file = @
    -		locale = @getLocale()
    -		[opts,next] = extractOptsAndCallback(opts, next)
    -		{content,templateData,renderSingleExtensions} = opts
    -		extensions = @get('extensions')
    -		filename = @get('filename')
    -		filePath = @getFilePath()
    -		content ?= @get('body')
    -		templateData ?= {}
    -		renderSingleExtensions ?= @get('renderSingleExtensions')
    -
    -		# Prepare result
    -		result = content
    -
    -		# Prepare extensions
    -		extensionsReversed = []
    -		if extensions.length is 0 and filename
    -			extensionsReversed.push(filename)
    -		for extension in extensions
    -			extensionsReversed.unshift(extension)
    -
    -		# If we want to allow rendering of single extensions, then add null to the extension list
    -		if renderSingleExtensions and extensionsReversed.length is 1
    -			if renderSingleExtensions isnt 'auto' or filename.replace(/^\./,'') is extensionsReversed[0]
    -				extensionsReversed.push(null)
    -
    -		# If we only have one extension, then skip ahead to rendering layouts
    -		return next(null, result)  if extensionsReversed.length <= 1
    -
    -		# Prepare the tasks
    -		tasks = new @TaskGroup "renderExtensions: #{filePath}", next:(err) ->
    -			# Forward with result
    -			return next(err, result)
    -
    -		# Cycle through all the extension groups and render them
    -		eachr extensionsReversed[1..], (extension,index) ->
    -			# Task
    -			tasks.addTask "renderExtension: #{filePath} [#{extensionsReversed[index]} => #{extension}]", (complete) ->
    -				# Prepare
    -				# eventData must be defined in the task
    -				# definining it in the above loop will cause eventData to persist between the tasks... very strange, but it happens
    -				# will cause the jade tests to fail
    -				eventData =
    -					inExtension: extensionsReversed[index]
    -					outExtension: extension
    -					templateData: templateData
    -					file: file
    -					content: result
    -
    -				# Render
    -				file.trigger 'render', eventData, (err) ->
    -					# Check
    -					return complete(err)  if err
    -
    -					# Check if the render did anything
    -					# and only check if we actually have content to render!
    -					# if this check fails, error with a suggestion
    -					if result and (result is eventData.content)
    -						file.log 'warn', util.format(locale.documentRenderExtensionNoChange, eventData.inExtension, eventData.outExtension, filePath)
    -						return complete()
    -
    -					# The render did something, so apply and continue
    -					result = eventData.content
    -					return complete()
    -
    -		# Run tasks synchronously
    -		tasks.run()
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Triggers the renderDocument event after
    -	# all extensions have been rendered. Listeners
    -	# can use this event to perform transformations
    -	# on the already rendered content.
    -	# @private
    -	# @method renderDocument
    -	# @param {Object} opts
    -	# @param {Function} next callback
    -	###
    -	renderDocument: (opts,next) ->
    -		# Prepare
    -		file = @
    -		[opts,next] = extractOptsAndCallback(opts, next)
    -		{content,templateData} = opts
    -		extension = @get('extensions')[0]
    -		content ?= @get('body')
    -		templateData ?= {}
    -
    -		# Prepare event data
    -		eventData = {extension,templateData,file,content}
    -
    -		# Render via plugins
    -		file.trigger 'renderDocument', eventData, (err) ->
    -			# Forward
    -			return next(err, eventData.content)
    -
    -		# Chain
    -		@
    -
    -
    -	###*
    -	# Render and merge layout content. Merge
    -	# layout metadata with document metadata.
    -	# Return the resulting merged content to
    -	# the callback result parameter.
    -	# next(err,result)
    -	# @private
    -	# @method renderLayouts
    -	# @param {Object} opts
    -	# @param {Function} next callback
    -	###
    -	renderLayouts: (opts,next) ->
    -		# Prepare
    -		file = @
    -		locale = @getLocale()
    -		filePath = @getFilePath()
    -		[opts,next] = extractOptsAndCallback(opts, next)
    -		{content,templateData} = opts
    -		content ?= @get('body')
    -		templateData ?= {}
    -
    -		# Grab the layout
    -		file.getLayout (err, layout) ->
    -			# Check
    -			return next(err, content)  if err
    -
    -			# We have a layout to render
    -			if layout
    -				# Assign the current rendering to the templateData.content
    -				templateData.content = content
    -
    -				# Merge in the layout meta data into the document JSON
    -				# and make the result available via documentMerged
    -				# templateData.document.metaMerged = extendr.extend({}, layout.getMeta().toJSON(), file.getMeta().toJSON())
    -
    -				# Render the layout with the templateData
    -				layout.clone().action 'render', {templateData}, (err,result) ->
    -					return next(err, result)
    -
    -			# We had a layout, but it is missing
    -			else if file.hasLayout()
    -				layoutSelector = file.get('layout')
    -				err = new Error(util.format(locale.documentMissingLayoutError, layoutSelector, filePath))
    -				return next(err, content)
    -
    -			# We never had a layout
    -			else
    -				return next(null, content)
    -
    -	###*
    -	# Triggers the render process for this document.
    -	# Calls the renderExtensions, renderDocument and
    -	# renderLayouts methods in sequence. This is the
    -	# method you want to call if you want to trigger
    -	# the rendering of a document manually.
    -	#
    -	# The rendered content is returned as the result
    -	# parameter to the passed callback and the DocumentModel
    -	# instance is returned in the document parameter.
    -	# next(err,result,document)
    -	# @method render
    -	# @param {Object} [opts={}]
    -	# @param {Function} next callback
    -	###
    -	render: (opts={},next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts, next)
    -		file = @
    -		locale = @getLocale()
    -
    -		# Prepare variables
    -		contentRenderedWithoutLayouts = null
    -		filePath = @getFilePath()
    -		relativePath = file.get('relativePath')
    -
    -		# Options
    -		opts = extendr.clone(opts or {})
    -		opts.actions ?= ['renderExtensions', 'renderDocument', 'renderLayouts']
    -		if opts.apply?
    -			err = new Error(locale.documentApplyError)
    -			return next(err)
    -
    -		# Prepare content
    -		opts.content ?= file.get('body')
    -
    -		# Prepare templateData
    -		opts.templateData = extendr.clone(opts.templateData or {})  # deepClone may be more suitable
    -		opts.templateData.document ?= file.toJSON()
    -		opts.templateData.documentModel ?= file
    -
    -		# Ensure template helpers are bound correctly
    -		for own key, value of opts.templateData
    -			if value?.bind is Function::bind  # we do this style of check, as underscore is a function that has it's own bind
    -				opts.templateData[key] = value.bind(opts.templateData)
    -
    -		# Prepare result
    -		# file.set({contentRendered:null, contentRenderedWithoutLayouts:null, rendered:false})
    -
    -		# Log
    -		file.log 'debug', util.format(locale.documentRender, filePath)
    -
    -		# Prepare the tasks
    -		tasks = new @TaskGroup "render tasks for: #{relativePath}", next:(err) ->
    -			# Error?
    -			if err
    -				err.context = util.format(locale.documentRenderError, filePath)
    -				return next(err, opts.content, file)
    -
    -			# Attributes
    -			contentRendered = opts.content
    -			contentRenderedWithoutLayouts ?= contentRendered
    -			rendered = true
    -			file.set({contentRendered, contentRenderedWithoutLayouts, rendered})
    -
    -			# Log
    -			file.log 'debug', util.format(locale.documentRendered, filePath)
    -
    -			# Apply
    -			file.attributes.rtime = new Date()
    -
    -			# Success
    -			return next(null, opts.content, file)
    -			# ^ do not use super here, even with =>
    -			# as it causes layout rendering to fail
    -			# the reasoning for this is that super uses the document's contentRendered
    -			# where, with layouts, opts.apply is false
    -			# so that isn't set
    -
    -		# Render Extensions Task
    -		if 'renderExtensions' in opts.actions
    -			tasks.addTask "renderExtensions: #{relativePath}", (complete) ->
    -				file.renderExtensions opts, (err,result) ->
    -					# Check
    -					return complete(err)  if err
    -
    -					# Apply the result
    -					opts.content = result
    -
    -					# Done
    -					return complete()
    -
    -		# Render Document Task
    -		if 'renderDocument' in opts.actions
    -			tasks.addTask "renderDocument: #{relativePath}", (complete) ->
    -				file.renderDocument opts, (err,result) ->
    -					# Check
    -					return complete(err)  if err
    -
    -					# Apply the result
    -					opts.content = result
    -					contentRenderedWithoutLayouts = result
    -
    -					# Done
    -					return complete()
    -
    -		# Render Layouts Task
    -		if 'renderLayouts' in opts.actions
    -			tasks.addTask "renderLayouts: #{relativePath}", (complete) ->
    -				file.renderLayouts opts, (err,result) ->
    -					# Check
    -					return complete(err)  if err
    -
    -					# Apply the result
    -					opts.content = result
    -
    -					# Done
    -					return complete()
    -
    -		# Fire the tasks
    -		tasks.run()
    -
    -		# Chain
    -		@
    -
    -
    -	# ---------------------------------
    -	# CRUD
    -
    -	###*
    -	# Write the source file. Optionally pass
    -	# the opts parameter to modify or set the file's
    -	# path, content or type.
    -	# next(err)
    -	# @method writeSource
    -	# @param {Object} [opts]
    -	# @param {Object} next callback
    -	###
    -	writeSource: (opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts, next)
    -		file = @
    -		filePath = @getFilePath()
    -
    -		# Fetch
    -		opts.content ?= (@getContent() or '').toString('')
    -
    -		# Adjust
    -		metaData  = @getMeta().toJSON(true)
    -		delete metaData.writeSource
    -		content   = body = opts.content.replace(/^\s+/,'')
    -		header    = CSON.stringify(metaData)
    -
    -		if header instanceof Error
    -			header.context = "Failed to write CSON meta header for the file: #{filePath}"
    -			return next(header)
    -
    -		if !header or header is '{}'
    -			# No meta data
    -			source    = body
    -		else
    -			# Has meta data
    -			parser    = 'cson'
    -			seperator = '###'
    -			source    = "#{seperator} #{parser}\n#{header}\n#{seperator}\n\n#{body}"
    -
    -		# Apply
    -		# @set({parser,header,body,content,source})
    -		# ^ commented out as we probably don't need to do this, it could be handled on the next load
    -		opts.content = source
    -
    -		# Write data
    -		super(opts, next)
    -
    -		# Chain
    -		@
    -
    -
    -# =====================================
    -# Export
    -module.exports = DocumentModel
    -
    -    
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/files/src_lib_models_file.coffee.html b/docs/files/src_lib_models_file.coffee.html deleted file mode 100644 index 08559d4f..00000000 --- a/docs/files/src_lib_models_file.coffee.html +++ /dev/null @@ -1,1522 +0,0 @@ - - - - - src/lib/models/file.coffee - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    File: src/lib/models/file.coffee

    - -
    -
    -# =====================================
    -# Requires
    -
    -# Standard Library
    -util = require('util')
    -pathUtil = require('path')
    -
    -# External
    -isTextOrBinary = require('istextorbinary')
    -typeChecker = require('typechecker')
    -safefs = require('safefs')
    -mime = require('mime')
    -extendr = require('extendr')
    -extractOptsAndCallback = require('extract-opts')
    -
    -# Optional
    -jschardet = null
    -encodingUtil = null
    -
    -# Local
    -{Model} = require('../base')
    -docpadUtil = require('../util')
    -
    -
    -# =====================================
    -# Classes
    -
    -###*
    -# The FileModel class is DocPad's representation
    -# of a file in the file system.
    -# Extends the DocPad Model class
    -# https://github.com/docpad/docpad/blob/master/src/lib/base.coffee#L49.
    -# FileModel manages the loading
    -# of a file and parsing both the content and the metadata (if any).
    -# Once loaded, the content, metadata and file stat (file info)
    -# properties of the FileModel are populated, as well
    -# as a number of DocPad specific attributes and properties.
    -# Typically we do not need to create FileModels ourselves as
    -# DocPad handles all of that. But it is possible that a plugin
    -# may need to manually create FileModels for some reason.
    -#
    -#	attrs =
    -#		fullPath: 'file/path/to/somewhere'
    -#	opts = {}
    -#	#we only really need the path to the source file to create
    -#	#a new file model
    -#	model = new FileModel(attrs, opts)
    -#
    -# The FileModel forms the base class for the DocPad DocumentModel class.
    -# @class FileModel
    -# @constructor
    -# @extends Model
    -###
    -class FileModel extends Model
    -
    -	# ---------------------------------
    -	# Properties
    -
    -	###*
    -	# The file model class. This should
    -	# be overridden in any descending classes.
    -	# @private
    -	# @property {Object} klass
    -	###
    -	klass: FileModel
    -
    -	###*
    -	# String name of the model type.
    -	# In this case, 'file'. This should
    -	# be overridden in any descending classes.
    -	# @private
    -	# @property {String} type
    -	###
    -	type: 'file'
    -
    -	###*
    -	# Task Group Class
    -	# @private
    -	# @property {Object} TaskGroup
    -	###
    -	TaskGroup: null
    -
    -	###*
    -	# The out directory path to put the relative path.
    -	# @property {String} rootOutDirPath
    -	###
    -	rootOutDirPath: null
    -
    -	###*
    -	# Whether or not we should detect encoding
    -	# @property {Boolean} detectEncoding
    -	###
    -	detectEncoding: false
    -
    -	###*
    -	# Node.js file stat object.
    -	# https://nodejs.org/api/fs.html#fs_class_fs_stats.
    -	# Basically, information about a file, including file
    -	# dates and size.
    -	# @property {Object} stat
    -	###
    -	stat: null
    -
    -	###*
    -	# File buffer. Node.js Buffer object.
    -	# https://nodejs.org/api/buffer.html#buffer_class_buffer.
    -	# Provides methods for dealing with binary data directly.
    -	# @property {Object} buffer
    -	###
    -	buffer: null
    -
    -	###*
    -	# Buffer time.
    -	# @property {Object} bufferTime
    -	###
    -	bufferTime: null
    -
    -	###*
    -	# The parsed file meta data (header).
    -	# Is a Model instance.
    -	# @private
    -	# @property {Object} meta
    -	###
    -	meta: null
    -
    -	###*
    -	# Locale information for the file
    -	# @private
    -	# @property {Object} locale
    -	###
    -	locale: null
    -	###*
    -	# Get the file's locale information
    -	# @method getLocale
    -	# @return {Object} the locale
    -	###
    -	getLocale: -> @locale
    -
    -	###*
    -	# Get Options. Returns an object containing
    -	# the properties detectEncoding, rootOutDirPath
    -	# locale, stat, buffer, meta and TaskGroup.
    -	# @private
    -	# @method getOptions
    -	# @return {Object}
    -	###
    -	# @TODO: why does this not use the isOption way?
    -	getOptions: ->
    -		return {@detectEncoding, @rootOutDirPath, @locale, @stat, @buffer, @meta, @TaskGroup}
    -
    -	###*
    -	# Checks whether the passed key is one
    -	# of the options.
    -	# @private
    -	# @method isOption
    -	# @param {String} key
    -	# @return {Boolean}
    -	###
    -	isOption: (key) ->
    -		names = ['detectEncoding', 'rootOutDirPath', 'locale', 'stat', 'data', 'buffer', 'meta', 'TaskGroup']
    -		result = key in names
    -		return result
    -
    -	###*
    -	# Extract Options.
    -	# @private
    -	# @method extractOptions
    -	# @param {Object} attrs
    -	# @return {Object} the options object
    -	###
    -	extractOptions: (attrs) ->
    -		# Prepare
    -		result = {}
    -
    -		# Extract
    -		for own key,value of attrs
    -			if @isOption(key)
    -				result[key] = value
    -				delete attrs[key]
    -
    -		# Return
    -		return result
    -
    -	###*
    -	# Set the options for the file model.
    -	# Valid properties for the attrs parameter:
    -	# TaskGroup, detectEncoding, rootOutDirPath,
    -	# locale, stat, data, buffer, meta.
    -	# @method setOptions
    -	# @param {Object} [attrs={}]
    -	###
    -	setOptions: (attrs={}) ->
    -		# TaskGroup
    -		if attrs.TaskGroup?
    -			@TaskGroup = attrs.TaskGroup
    -			delete @attributes.TaskGroup
    -
    -		# Root Out Path
    -		if attrs.detectEncoding?
    -			@rootOutDirPath = attrs.detectEncoding
    -			delete @attributes.detectEncoding
    -
    -		# Root Out Path
    -		if attrs.rootOutDirPath?
    -			@rootOutDirPath = attrs.rootOutDirPath
    -			delete @attributes.rootOutDirPath
    -
    -		# Locale
    -		if attrs.locale?
    -			@locale = attrs.locale
    -			delete @attributes.locale
    -
    -		# Stat
    -		if attrs.stat?
    -			@setStat(attrs.stat)
    -			delete @attributes.stat
    -
    -		# Data
    -		if attrs.data?
    -			@setBuffer(attrs.data)
    -			delete @attributes.data
    -
    -		# Buffer
    -		if attrs.buffer?
    -			@setBuffer(attrs.buffer)
    -			delete @attributes.buffer
    -
    -		# Meta
    -		if attrs.meta?
    -			@setMeta(attrs.meta)
    -			delete @attributes.meta
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Clone the model and return the newly cloned model.
    -	# @method clone
    -	# @return {Object} cloned file model
    -	###
    -	clone: ->
    -		# Fetch
    -		attrs = @getAttributes()
    -		opts = @getOptions()
    -
    -		# Clean up
    -		delete attrs.id
    -		delete attrs.meta.id
    -		delete opts.meta.id
    -		delete opts.meta.attributes.id
    -
    -		# Clone
    -		clonedModel = new @klass(attrs, opts)
    -
    -		# Emit clone event so parent can re-attach listeners
    -		@emit('clone', clonedModel)
    -
    -		# Return
    -		return clonedModel
    -
    -
    -	# ---------------------------------
    -	# Attributes
    -
    -	###*
    -	# The default attributes for any file model.
    -	# @private
    -	# @property {Object}
    -	###
    -	defaults:
    -
    -		# ---------------------------------
    -		# Automaticly set variables
    -
    -		# The unique document identifier
    -		id: null
    -
    -		# The file's name without the extension
    -		basename: null
    -
    -		# The out file's name without the extension
    -		outBasename: null
    -
    -		# The file's last extension
    -		# "hello.md.eco" -> "eco"
    -		extension: null
    -
    -		# The extension used for our output file
    -		outExtension: null
    -
    -		# The file's extensions as an array
    -		# "hello.md.eco" -> ["md","eco"]
    -		extensions: null  # Array
    -
    -		# The file's name with the extension
    -		filename: null
    -
    -		# The full path of our source file, only necessary if called by @load
    -		fullPath: null
    -
    -		# The full directory path of our source file
    -		fullDirPath: null
    -
    -		# The output path of our file
    -		outPath: null
    -
    -		# The output path of our file's directory
    -		outDirPath: null
    -
    -		# The file's name with the rendered extension
    -		outFilename: null
    -
    -		# The relative path of our source file (with extensions)
    -		relativePath: null
    -
    -		# The relative output path of our file
    -		relativeOutPath: null
    -
    -		# The relative directory path of our source file
    -		relativeDirPath: null
    -
    -		# The relative output path of our file's directory
    -		relativeOutDirPath: null
    -
    -		# The relative base of our source file (no extension)
    -		relativeBase: null
    -
    -		# The relative base of our out file (no extension)
    -		relativeOutBase: null
    -
    -		# The MIME content-type for the source file
    -		contentType: null
    -
    -		# The MIME content-type for the out file
    -		outContentType: null
    -
    -		# The date object for when this document was created
    -		ctime: null
    -
    -		# The date object for when this document was last modified
    -		mtime: null
    -
    -		# The date object for when this document was last rendered
    -		rtime: null
    -
    -		# The date object for when this document was last written
    -		wtime: null
    -
    -		# Does the file actually exist on the file system
    -		exists: null
    -
    -
    -		# ---------------------------------
    -		# Content variables
    -
    -		# The encoding of the file
    -		encoding: null
    -
    -		# The raw contents of the file, stored as a String
    -		source: null
    -
    -		# The contents of the file, stored as a String
    -		content: null
    -
    -
    -		# ---------------------------------
    -		# User set variables
    -
    -		# The tags for this document
    -		tags: null  # CSV/Array
    -
    -		# Whether or not we should render this file
    -		render: false
    -
    -		# Whether or not we should write this file to the output directory
    -		write: true
    -
    -		# Whether or not we should write this file to the source directory
    -		writeSource: false
    -
    -		# Whether or not this file should be re-rendered on each request
    -		dynamic: false
    -
    -		# The title for this document
    -		# Useful for page headings
    -		title: null
    -
    -		# The name for this document, defaults to the outFilename
    -		# Useful for navigation listings
    -		name: null
    -
    -		# The date object for this document, defaults to mtime
    -		date: null
    -
    -		# The generated slug (url safe seo title) for this document
    -		slug: null
    -
    -		# The url for this document
    -		url: null
    -
    -		# Alternative urls for this document
    -		urls: null  # Array
    -
    -		# Whether or not we ignore this file
    -		ignored: false
    -
    -		# Whether or not we should treat this file as standalone (that nothing depends on it)
    -		standalone: false
    -
    -
    -
    -	# ---------------------------------
    -	# Helpers
    -
    -	###*
    -	# File encoding helper
    -	# opts = {path, to, from, content}
    -	# @private
    -	# @method encode
    -	# @param {Object} opts
    -	# @return {Object} encoded result
    -	###
    -	encode: (opts) ->
    -		# Prepare
    -		locale = @getLocale()
    -		result = opts.content
    -		opts.to ?= 'utf8'
    -		opts.from ?= 'utf8'
    -
    -		# Import optional dependencies
    -		try encodingUtil ?= require('encoding')
    -
    -		# Convert
    -		if encodingUtil?
    -			@log 'info', util.format(locale.fileEncode, opts.to, opts.from, opts.path)
    -			try
    -				result = encodingUtil.convert(opts.content, opts.to, opts.from)
    -			catch err
    -				@log 'warn', util.format(locale.fileEncodeConvertError, opts.to, opts.from, opts.path)
    -		else
    -			@log 'warn', util.format(locale.fileEncodeConvertError, opts.to, opts.from, opts.path)
    -
    -		# Return
    -		return result
    -
    -	###*
    -	# Set the file model's buffer.
    -	# Creates a new node.js buffer
    -	# object if a buffer object is
    -	# is not passed as the parameter
    -	# @method setBuffer
    -	# @param {Object} [buffer]
    -	###
    -	setBuffer: (buffer) ->
    -		buffer = new Buffer(buffer)  unless Buffer.isBuffer(buffer)
    -		@bufferTime = @get('mtime') or new Date()
    -		@buffer = buffer
    -		@
    -
    -	###*
    -	# Get the file model's buffer object.
    -	# Returns a node.js buffer object.
    -	# @method getBuffer
    -	# @return {Object} node.js buffer object
    -	###
    -	getBuffer: ->
    -		return @buffer
    -
    -	###*
    -	# Is Buffer Outdated
    -	# True if there is no buffer OR the buffer time is outdated
    -	# @method isBufferOutdated
    -	# @return {Boolean}
    -	###
    -	isBufferOutdated: ->
    -		return @buffer? is false or @bufferTime < (@get('mtime') or new Date())
    -
    -	###*
    -	# Set the node.js file stat.
    -	# @method setStat
    -	# @param {Object} stat
    -	###
    -	setStat: (stat) ->
    -		@stat = stat
    -		@set(
    -			ctime: new Date(stat.ctime)
    -			mtime: new Date(stat.mtime)
    -		)
    -		@
    -
    -	###*
    -	# Get the node.js file stat.
    -	# @method getStat
    -	# @return {Object} the file stat
    -	###
    -	getStat: ->
    -		return @stat
    -
    -	###*
    -	# Get the file model attributes.
    -	# By default the attributes will be
    -	# dereferenced from the file model.
    -	# To maintain a reference, pass false
    -	# as the parameter. The returned object
    -	# will NOT contain the file model's ID attribute.
    -	# @method getAttributes
    -	# @param {Object} [dereference=true]
    -	# @return {Object}
    -	###
    -	#NOTE: will the file model's ID be deleted if
    -	#dereference=false is passed??
    -	getAttributes: (dereference=true) ->
    -		attrs = @toJSON(dereference)
    -		delete attrs.id
    -		return attrs
    -
    -	###*
    -	# Get the file model attributes.
    -	# By default the attributes will
    -	# maintain a reference to the file model.
    -	# To return a dereferenced object, pass true
    -	# as the parameter. The returned object
    -	# will contain the file model's ID attribute.
    -	# @method toJSON
    -	# @param {Object} [dereference=false]
    -	# @return {Object}
    -	###
    -	toJSON: (dereference=false) ->
    -		data = super
    -		data.meta = @getMeta().toJSON()
    -		data = extendr.dereferenceJSON(data)  if dereference is true
    -		return data
    -
    -	###*
    -	# Get the file model metadata object.
    -	# Optionally pass a list of metadata property
    -	# names corresponding to those properties that
    -	# you want returned.
    -	# @method getMeta
    -	# @param {Object} [args...]
    -	# @return {Object}
    -	###
    -	getMeta: (args...) ->
    -		@meta = new Model()  if @meta is null
    -		if args.length
    -			return @meta.get(args...)
    -		else
    -			return @meta
    -
    -	###*
    -	# Assign attributes and options to the file model.
    -	# @method set
    -	# @param {Array} attrs the attributes to be applied
    -	# @param {Object} opts the options to be applied
    -	###
    -	set: (attrs,opts) ->
    -		# Check
    -		if typeChecker.isString(attrs)
    -			newAttrs = {}
    -			newAttrs[attrs] = opts
    -			return @set(newAttrs, opts)
    -
    -		# Prepare
    -		attrs = attrs.toJSON?() ? attrs
    -
    -		# Extract options
    -		options = @extractOptions(attrs)
    -
    -		# Perform the set
    -		super(attrs, opts)
    -
    -		# Apply the options
    -		@setOptions(options, opts)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Set defaults. Apply default attributes
    -	# and options to the file model
    -	# @method setDefaults
    -	# @param {Object} attrs the attributes to be applied
    -	# @param {Object} opts the options to be applied
    -	###
    -	setDefaults: (attrs,opts) ->
    -		# Prepare
    -		attrs = attrs.toJSON?() ? attrs
    -
    -		# Extract options
    -		options = @extractOptions(attrs)
    -
    -		# Apply
    -		super(attrs, opts)
    -
    -		# Apply the options
    -		@setOptions(options, opts)
    -
    -		# Chain
    -		return @
    -
    -	###*
    -	# Set the file model meta data,
    -	# attributes and options in one go.
    -	# @method setMeta
    -	# @param {Object} attrs the attributes to be applied
    -	# @param {Object} opts the options to be applied
    -	###
    -	setMeta: (attrs,opts) ->
    -		# Prepare
    -		attrs = attrs.toJSON?() ? attrs
    -
    -		# Extract options
    -		options = @extractOptions(attrs)
    -
    -		# Apply
    -		@getMeta().set(attrs, opts)
    -		@set(attrs, opts)
    -
    -		# Apply the options
    -		@setOptions(options, opts)
    -
    -		# Chain
    -		return @
    -
    -
    -	###*
    -	# Set the file model meta data defaults
    -	# @method setMetaDefaults
    -	# @param {Object} attrs the attributes to be applied
    -	# @param {Object} opts the options to be applied
    -	###
    -	setMetaDefaults: (attrs,opts) ->
    -		# Prepare
    -		attrs = attrs.toJSON?() ? attrs
    -
    -		# Extract options
    -		options = @extractOptions(attrs)
    -
    -		# Apply
    -		@getMeta().setDefaults(attrs, opts)
    -		@setDefaults(attrs, opts)
    -
    -		# Apply the options
    -		@setOptions(options, opts)
    -
    -		# Chain
    -		return @
    -
    -	###*
    -	# Get the file name. Depending on the
    -	# parameters passed this will either be
    -	# the file model's filename property or,
    -	# the filename determined from the fullPath
    -	# or relativePath property. Valid values for
    -	# the opts parameter are: fullPath, relativePath
    -	# or filename. Format: {filename}
    -	# @method getFilename
    -	# @param {Object} [opts={}]
    -	# @return {String}
    -	###
    -	getFilename: (opts={}) ->
    -		# Prepare
    -		{fullPath,relativePath,filename} = opts
    -
    -		# Determine
    -		result = (filename ? @get('filename'))
    -		if !result
    -			result = (fullPath ? @get('fullPath')) or (relativePath ? @get('relativePath'))
    -			result = pathUtil.basename(result)  if result
    -		result or= null
    -
    -		# REturn
    -		return result
    -
    -	###*
    -	# Get the file path. Depending on the
    -	# parameters passed this will either be
    -	# the file model's fullPath property, the
    -	# relativePath property or the filename property.
    -	# Valid values for the opts parameter are:
    -	# fullPath, relativePath
    -	# or filename. Format: {fullPath}
    -	# @method getFilePath
    -	# @param {Object} [opts={}]
    -	# @return {String}
    -	###
    -	getFilePath: (opts={}) ->
    -		# Prepare
    -		{fullPath,relativePath,filename} = opts
    -
    -		# Determine
    -		result = (fullPath ? @get('fullPath')) or (relativePath ? @get('relativePath')) or (filename ? @get('filename')) or null
    -
    -		# Return
    -		return result
    -
    -	###*
    -	# Get file extensions. Depending on the
    -	# parameters passed this will either be
    -	# the file model's extensions property or
    -	# the extensions extracted from the file model's
    -	# filename property. The opts parameter is passed
    -	# in the format: {extensions,filename}.
    -	# @method getExtensions
    -	# @param {Object} opts
    -	# @return {Array} array of extension names
    -	###
    -	getExtensions: ({extensions,filename}) ->
    -		extensions or= @get('extensions') or null
    -		if (extensions or []).length is 0
    -			filename = @getFilename({filename})
    -			if filename
    -				extensions = docpadUtil.getExtensions(filename)
    -		return extensions or null
    -
    -	###*
    -	# Get the file content. This will be
    -	# the text content if loaded or the file buffer object.
    -	# @method getContent
    -	# @return {String or Object}
    -	###
    -	getContent: ->
    -		return @get('content') or @getBuffer()
    -
    -	###*
    -	# Get the file content for output.
    -	# @method getOutContent
    -	# @return {String or Object}
    -	###
    -	getOutContent: ->
    -		return @getContent()
    -
    -	###*
    -	# Is this a text file? ie - not
    -	# a binary file.
    -	# @method isText
    -	# @return {Boolean}
    -	###
    -	isText: ->
    -		return @get('encoding') isnt 'binary'
    -
    -	###*
    -	# Is this a binary file?
    -	# @method isBinary
    -	# @return {Boolean}
    -	###
    -	isBinary: ->
    -		return @get('encoding') is 'binary'
    -
    -	###*
    -	# Set the url for the file
    -	# @method setUrl
    -	# @param {String} url
    -	###
    -	setUrl: (url) ->
    -		@addUrl(url)
    -		@set({url})
    -		@
    -
    -	###*
    -	# A file can have multiple urls.
    -	# This method adds either a single url
    -	# or an array of urls to the file model.
    -	# @method addUrl
    -	# @param {String or Array} url
    -	###
    -	addUrl: (url) ->
    -		# Multiple Urls
    -		if url instanceof Array
    -			for newUrl in url
    -				@addUrl(newUrl)
    -
    -		# Single Url
    -		else if url
    -			found = false
    -			urls = @get('urls')
    -			for existingUrl in urls
    -				if existingUrl is url
    -					found = true
    -					break
    -			urls.push(url)  if not found
    -			@trigger('change:urls', @, urls, {})
    -			@trigger('change', @, {})
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Removes a url from the file
    -	# model (files can have more than one url).
    -	# @method removeUrl
    -	# @param {Object} userUrl the url to be removed
    -	###
    -	removeUrl: (userUrl) ->
    -		urls = @get('urls')
    -		for url,index in urls
    -			if url is userUrl
    -				urls.splice(index,1)
    -				break
    -		@
    -
    -	###*
    -	# Get a file path.
    -	# If the relativePath parameter starts with `.` then we get the
    -	# path in relation to the document that is calling it.
    -	# Otherwise we just return it as normal
    -	# @method getPath
    -	# @param {String} relativePath
    -	# @param {String} parentPath
    -	# @return {String}
    -	###
    -	getPath: (relativePath, parentPath) ->
    -		if /^\./.test(relativePath)
    -			relativeDirPath = @get('relativeDirPath')
    -			path = pathUtil.join(relativeDirPath, relativePath)
    -		else
    -			if parentPath
    -				path = pathUtil.join(parentPath, relativePath)
    -			else
    -				path = relativePath
    -		return path
    -
    -
    -	# ---------------------------------
    -	# Actions
    -
    -	###*
    -	# The action runner instance bound to DocPad
    -	# @private
    -	# @property {Object} actionRunnerInstance
    -	###
    -	actionRunnerInstance: null
    -	###*
    -	# Get the action runner instance bound to DocPad
    -	# @method getActionRunner
    -	# @return {Object}
    -	###
    -	getActionRunner: -> @actionRunnerInstance
    -	###*
    -	# Apply an action with the supplied arguments.
    -	# @method action
    -	# @param {Object} args...
    -	###
    -	action: (args...) => docpadUtil.action.apply(@, args)
    -
    -	###*
    -	# Initialize the file model with the passed
    -	# attributes and options. Emits the init event.
    -	# @method initialize
    -	# @param {Object} attrs the file model attributes
    -	# @param {Object} [opts={}] the file model options
    -	###
    -	initialize: (attrs,opts={}) ->
    -		# Defaults
    -		file = @
    -		@attributes ?= {}
    -		@attributes.extensions ?= []
    -		@attributes.urls ?= []
    -		now = new Date()
    -		@attributes.ctime ?= now
    -		@attributes.mtime ?= now
    -
    -		# Id
    -		@id ?= @attributes.id ?= @cid
    -
    -		# Options
    -		@setOptions(opts)
    -
    -		# Error
    -		if @rootOutDirPath? is false or @locale? is false
    -			throw new Error("Use docpad.createModel to create the file or document model")
    -
    -		# Create our action runner
    -		@actionRunnerInstance = new @TaskGroup("file action runner", {abortOnError: false, destroyOnceDone: false}).whenDone (err) ->
    -			file.emit('error', err)  if err
    -
    -		# Apply
    -		@emit('init')
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Load the file from the file system.
    -	# If the fullPath exists, load the file.
    -	# If it doesn't, then parse and normalize the file.
    -	# Optionally pass file options as a parameter.
    -	# @method load
    -	# @param {Object} [opts={}]
    -	# @param {Function} next callback
    -	###
    -	load: (opts={},next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -		file = @
    -		opts.exists ?= null
    -
    -		# Fetch
    -		fullPath = @get('fullPath')
    -		filePath = @getFilePath({fullPath})
    -
    -		# Apply options
    -		file.set(exists: opts.exists)  if opts.exists?
    -		file.setStat(opts.stat)        if opts.stat?
    -		file.setBuffer(opts.buffer)    if opts.buffer?
    -
    -		# Tasks
    -		tasks = new @TaskGroup("load tasks for file: #{filePath}", {next})
    -			.on('item.run', (item) ->
    -				file.log("debug", "#{item.getConfig().name}: #{file.type}: #{filePath}")
    -			)
    -
    -		# Detect the file
    -		tasks.addTask "Detect the file", (complete) ->
    -			if fullPath and opts.exists is null
    -				safefs.exists fullPath, (exists) ->
    -					opts.exists = exists
    -					file.set(exists: opts.exists)
    -					return complete()
    -			else
    -				return complete()
    -
    -		tasks.addTask "Stat the file and cache the result", (complete) ->
    -			# Otherwise fetch new stat
    -			if fullPath and opts.exists and opts.stat? is false
    -				return safefs.stat fullPath, (err,fileStat) ->
    -					return complete(err)  if err
    -					file.setStat(fileStat)
    -					return complete()
    -			else
    -				return complete()
    -
    -		# Process the file
    -		tasks.addTask "Read the file and cache the result", (complete) ->
    -			# Otherwise fetch new buffer
    -			if fullPath and opts.exists and opts.buffer? is false and file.isBufferOutdated()
    -				return safefs.readFile fullPath, (err,buffer) ->
    -					return complete(err)  if err
    -					file.setBuffer(buffer)
    -					return complete()
    -			else
    -				return complete()
    -
    -		tasks.addTask "Load -> Parse", (complete) ->
    -			file.parse(complete)
    -
    -		tasks.addTask "Parse -> Normalize", (complete) ->
    -			file.normalize(complete)
    -
    -		tasks.addTask "Normalize -> Contextualize", (complete) ->
    -			file.contextualize(complete)
    -
    -		# Run the tasks
    -		tasks.run()
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Parse our buffer and extract meaningful data from it.
    -	# next(err).
    -	# @method parse
    -	# @param {Object} [opts={}]
    -	# @param {Object} next callback
    -	###
    -	parse: (opts={},next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts, next)
    -		buffer = @getBuffer()
    -		relativePath = @get('relativePath')
    -		encoding = opts.encoding or @get('encoding') or null
    -		changes = {}
    -
    -		# Detect Encoding
    -		if buffer and encoding? is false or opts.reencode is true
    -			isText = isTextOrBinary.isTextSync(relativePath, buffer)
    -
    -			# Text
    -			if isText is true
    -				# Detect source encoding if not manually specified
    -				if @detectEncoding
    -					jschardet ?= require('jschardet')
    -					encoding ?= jschardet.detect(buffer)?.encoding
    -
    -				# Default the encoding
    -				encoding or= 'utf8'
    -
    -				# Convert into utf8
    -				if docpadUtil.isStandardEncoding(encoding) is false
    -					buffer = @encode({
    -						path: relativePath
    -						to: 'utf8'
    -						from: encoding
    -						content: buffer
    -					})
    -
    -				# Apply
    -				changes.encoding = encoding
    -
    -			# Binary
    -			else
    -				# Set
    -				encoding = changes.encoding = 'binary'
    -
    -		# Binary
    -		if encoding is 'binary'
    -			# Set
    -			content = source = ''
    -
    -			# Apply
    -			changes.content = content
    -			changes.source = source
    -
    -		# Text
    -		else
    -			# Default
    -			encoding = changes.encoding = 'utf8'  if encoding? is false
    -
    -			# Set
    -			source = buffer?.toString('utf8') or ''
    -			content = source
    -
    -			# Apply
    -			changes.content = content
    -			changes.source = source
    -
    -		# Apply
    -		@set(changes)
    -
    -		# Next
    -		next()
    -		@
    -
    -	###*
    -	# Normalize any parsing we have done, because if a value has
    -	# updates it may have consequences on another value.
    -	# This will ensure everything is okay.
    -	# next(err)
    -	# @method normalize
    -	# @param {Object} [opts={}]
    -	# @param {Object} next callback
    -	###
    -	normalize: (opts={},next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -		changes = {}
    -		meta = @getMeta()
    -		locale = @getLocale()
    -
    -		# App specified
    -		filename = opts.filename or @get('filename') or null
    -		relativePath = opts.relativePath or @get('relativePath') or null
    -		fullPath = opts.fullPath or @get('fullPath') or null
    -		mtime = opts.mtime or @get('mtime') or null
    -
    -		# User specified
    -		tags = opts.tags or meta.get('tags') or null
    -		date = opts.date or meta.get('date') or null
    -		name = opts.name or meta.get('name') or null
    -		slug = opts.slug or meta.get('slug') or null
    -		url = opts.url or meta.get('url') or null
    -		contentType = opts.contentType or meta.get('contentType') or null
    -		outContentType = opts.outContentType or meta.get('outContentType') or null
    -		outFilename = opts.outFilename or meta.get('outFilename') or null
    -		outExtension = opts.outExtension or meta.get('outExtension') or null
    -		outPath = opts.outPath or meta.get('outPath') or null
    -
    -		# Force specifeid
    -		extensions = null
    -		extension = null
    -		basename = null
    -		outBasename = null
    -		relativeOutPath = null
    -		relativeDirPath = null
    -		relativeOutDirPath = null
    -		relativeBase = null
    -		relativeOutBase = null
    -		outDirPath = null
    -		fullDirPath = null
    -
    -		# filename
    -		changes.filename = filename = @getFilename({filename, relativePath, fullPath})
    -
    -		# check
    -		if !filename
    -			err = new Error(locale.filenameMissingError)
    -			return next(err)
    -
    -		# relativePath
    -		if !relativePath and filename
    -			changes.relativePath = relativePath = filename
    -
    -		# force basename
    -		changes.basename = basename = docpadUtil.getBasename(filename)
    -
    -		# force extensions
    -		changes.extensions = extensions = @getExtensions({filename})
    -
    -		# force extension
    -		changes.extension = extension = docpadUtil.getExtension(extensions)
    -
    -		# force fullDirPath
    -		if fullPath
    -			changes.fullDirPath = fullDirPath = docpadUtil.getDirPath(fullPath)
    -
    -		# force relativeDirPath
    -		changes.relativeDirPath = relativeDirPath = docpadUtil.getDirPath(relativePath)
    -
    -		# force relativeBase
    -		changes.relativeBase = relativeBase =
    -			if relativeDirPath
    -				pathUtil.join(relativeDirPath, basename)
    -			else
    -				basename
    -
    -		# force contentType
    -		if !contentType
    -			changes.contentType = contentType = mime.lookup(fullPath or relativePath)
    -
    -		# adjust tags
    -		if tags and typeChecker.isArray(tags) is false
    -			changes.tags = tags = String(tags).split(/[\s,]+/)
    -
    -		# force date
    -		if !date
    -			changes.date = date = mtime or @get('date') or new Date()
    -
    -		# force outFilename
    -		if !outFilename and !outPath
    -			changes.outFilename = outFilename = docpadUtil.getOutFilename(basename, outExtension or extensions.join('.'))
    -
    -		# force outPath
    -		if !outPath
    -			changes.outPath = outPath =
    -				if @rootOutDirPath
    -					pathUtil.resolve(@rootOutDirPath, relativeDirPath, outFilename)
    -				else
    -					null
    -			# ^ we still do this set as outPath is a meta, and it may still be set as an attribute
    -
    -		# refresh outFilename
    -		if outPath
    -			changes.outFilename = outFilename = docpadUtil.getFilename(outPath)
    -
    -		# force outDirPath
    -		changes.outDirPath = outDirPath =
    -			if outPath
    -				docpadUtil.getDirPath(outPath)
    -			else
    -				null
    -
    -		# force outBasename
    -		changes.outBasename = outBasename = docpadUtil.getBasename(outFilename)
    -
    -		# force outExtension
    -		changes.outExtension = outExtension = docpadUtil.getExtension(outFilename)
    -
    -		# force relativeOutPath
    -		changes.relativeOutPath = relativeOutPath =
    -			if outPath
    -				outPath.replace(@rootOutDirPath, '').replace(/^[\/\\]/, '')
    -			else
    -				pathUtil.join(relativeDirPath, outFilename)
    -
    -		# force relativeOutDirPath
    -		changes.relativeOutDirPath = relativeOutDirPath = docpadUtil.getDirPath(relativeOutPath)
    -
    -		# force relativeOutBase
    -		changes.relativeOutBase = relativeOutBase = pathUtil.join(relativeOutDirPath, outBasename)
    -
    -		# force name
    -		if !name
    -			changes.name = name = outFilename
    -
    -		# force url
    -		_defaultUrl = docpadUtil.getUrl(relativeOutPath)
    -		if url
    -			@setUrl(url)
    -			@addUrl(_defaultUrl)
    -		else
    -			@setUrl(_defaultUrl)
    -
    -		# force outContentType
    -		if !outContentType and contentType
    -			changes.outContentType = outContentType = mime.lookup(outPath or relativeOutPath) or contentType
    -
    -		# force slug
    -		if !slug
    -			changes.slug = slug = docpadUtil.getSlug(relativeOutBase)
    -
    -		# Force date objects
    -		changes.wtime = wtime = new Date(wtime)  if typeof wtime is 'string'
    -		changes.rtime = rtime = new Date(rtime)  if typeof rtime is 'string'
    -		changes.ctime = ctime = new Date(ctime)  if typeof ctime is 'string'
    -		changes.mtime = mtime = new Date(mtime)  if typeof mtime is 'string'
    -		changes.date  = date  = new Date(date)   if typeof date is 'string'
    -
    -		# Apply
    -		@set(changes)
    -
    -		# Next
    -		next()
    -		@
    -
    -	###*
    -	# Contextualize the data. In other words,
    -	# put our data into the perspective of the bigger picture of the data.
    -	# For instance, generate the url for it's rendered equivalant.
    -	# next(err)
    -	# @method contextualize
    -	# @param {Object} [opts={}]
    -	# @param {Object} next callback
    -	###
    -	contextualize: (opts={},next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -
    -		# Forward
    -		next()
    -		@
    -
    -	###*
    -	# Render this file. The file model output content is
    -	# returned to the passed callback in the
    -	# result (2nd) parameter. The file model itself is returned
    -	# in the callback's document (3rd) parameter.
    -	# next(err,result,document)
    -	# @method render
    -	# @param {Object} [opts={}]
    -	# @param {Object} next callback
    -	###
    -	render: (opts={},next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts, next)
    -		file = @
    -
    -		# Apply
    -		file.attributes.rtime = new Date()
    -
    -		# Forward
    -		next(null, file.getOutContent(), file)
    -		@
    -
    -
    -	# ---------------------------------
    -	# CRUD
    -
    -	###*
    -	# Write the out file. The out file
    -	# may be different from the input file.
    -	# Often the input file is transformed in some way
    -	# and saved as another file format. A common example
    -	# is transforming a markdown input file to a HTML
    -	# output file.
    -	# next(err)
    -	# @method write
    -	# @param {Object} opts
    -	# @param {Function} next callback
    -	###
    -	write: (opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts, next)
    -		file = @
    -		locale = @getLocale()
    -
    -		# Fetch
    -		opts.path      or= file.get('outPath')
    -		opts.encoding  or= file.get('encoding') or 'utf8'
    -		opts.content   or= file.getOutContent()
    -		opts.type      or= 'out file'
    -
    -		# Check
    -		# Sometimes the out path could not be set if we are early on in the process
    -		unless opts.path
    -			next()
    -			return @
    -
    -		# Convert utf8 to original encoding
    -		unless opts.encoding.toLowerCase() in ['ascii','utf8','utf-8','binary']
    -			opts.content = @encode({
    -				path: opts.path
    -				to: opts.encoding
    -				from: 'utf8'
    -				content: opts.content
    -			})
    -
    -		# Log
    -		file.log 'debug', util.format(locale.fileWrite, opts.type, opts.path, opts.encoding)
    -
    -		# Write data
    -		safefs.writeFile opts.path, opts.content, (err) ->
    -			# Check
    -			return next(err)  if err
    -
    -			# Update the wtime
    -			if opts.type is 'out file'
    -				file.attributes.wtime = new Date()
    -
    -			# Log
    -			file.log 'debug',  util.format(locale.fileWrote, opts.type, opts.path, opts.encoding)
    -
    -			# Next
    -			return next()
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Write the source file. Optionally pass
    -	# the opts parameter to modify or set the file's
    -	# path, content or type.
    -	# next(err)
    -	# @method writeSource
    -	# @param {Object} [opts]
    -	# @param {Object} next callback
    -	###
    -	writeSource: (opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts, next)
    -		file = @
    -
    -		# Fetch
    -		opts.path      or= file.get('fullPath')
    -		opts.content   or= (file.getContent() or '').toString('')
    -		opts.type      or= 'source file'
    -
    -		# Write data
    -		@write(opts, next)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Delete the out file, perhaps ahead of regeneration.
    -	# Optionally pass the opts parameter to set the file path or type.
    -	# next(err)
    -	# @method delete
    -	# @param {Object} [opts]
    -	# @param {Object} next callback
    -	###
    -	'delete': (opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts, next)
    -		file = @
    -		locale = @getLocale()
    -
    -		# Fetch
    -		opts.path      or= file.get('outPath')
    -		opts.type      or= 'out file'
    -
    -		# Check
    -		# Sometimes the out path could not be set if we are early on in the process
    -		unless opts.path
    -			next()
    -			return @
    -
    -		# Log
    -		file.log 'debug',  util.format(locale.fileDelete, opts.type, opts.path)
    -
    -		# Check existance
    -		safefs.exists opts.path, (exists) ->
    -			# Exit if it doesn't exist
    -			return next()  unless exists
    -
    -			# If it does exist delete it
    -			safefs.unlink opts.path, (err) ->
    -				# Check
    -				return next(err)  if err
    -
    -				# Log
    -				file.log 'debug', util.format(locale.fileDeleted, opts.type, opts.path)
    -
    -				# Next
    -				next()
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Delete the source file.
    -	# Optionally pass the opts parameter to set the file path or type.
    -	# next(err)
    -	# @method deleteSource
    -	# @param {Object} [opts]
    -	# @param {Object} next callback
    -	###
    -	deleteSource: (opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts, next)
    -		file = @
    -
    -		# Fetch
    -		opts.path      or= file.get('fullPath')
    -		opts.type      or= 'source file'
    -
    -		# Write data
    -		@delete(opts, next)
    -
    -		# Chain
    -		@
    -
    -
    -# ---------------------------------
    -# Export
    -module.exports = FileModel
    -
    -    
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/files/src_lib_plugin-loader.coffee.html b/docs/files/src_lib_plugin-loader.coffee.html deleted file mode 100644 index c7c33c1f..00000000 --- a/docs/files/src_lib_plugin-loader.coffee.html +++ /dev/null @@ -1,468 +0,0 @@ - - - - - src/lib/plugin-loader.coffee - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    File: src/lib/plugin-loader.coffee

    - -
    -
    -# ---------------------------------
    -# Requires
    -
    -# Standard Library
    -pathUtil = require('path')
    -util = require('util')
    -
    -# External
    -semver = require('semver')
    -safefs = require('safefs')
    -
    -
    -
    -# ---------------------------------
    -# Classes
    -
    -# Define Plugin Loader
    -###*
    -# The Plugin Loader class
    -# @class PluginLoader
    -# @constructor
    -###
    -class PluginLoader
    -
    -	# ---------------------------------
    -	# Constructed
    -
    -	###*
    -	# The DocPad Instance
    -	# @private
    -	# @property {Object} docpad
    -	###
    -	docpad: null
    -
    -
    -	###*
    -	# The BasePlugin Class
    -	# @private
    -	# @property {Object}
    -	###
    -	BasePlugin: null
    -
    -
    -	###*
    -	# The full path of the plugin's directory
    -	# @private
    -	# @property {String}
    -	###
    -	dirPath: null
    -
    -
    -	# ---------------------------------
    -	# Loaded
    -
    -	###*
    -	# The full path of the plugin's package.json file
    -	# @private
    -	# @property {String}
    -	###
    -	packagePath: null
    -
    -	###*
    -	# The parsed contents of the plugin's package.json file
    -	# @private
    -	# @property {Object}
    -	###
    -	packageData: {}
    -
    -	###*
    -	# The full path of the plugin's main file
    -	# @private
    -	# @property {String}
    -	###
    -	pluginPath: null
    -
    -
    -	###*
    -	# The parsed content of the plugin's main file
    -	# @private
    -	# @property {Object}
    -	###
    -	pluginClass: {}
    -
    -	###*
    -	# The plugin name
    -	# @private
    -	# @property {String}
    -	###
    -	pluginName: null
    -
    -	###*
    -	# The plugin version
    -	# @private
    -	# @property {String}
    -	###
    -	pluginVersion: null
    -
    -	###*
    -	# Node modules path
    -	# @private
    -	# @property {String}
    -	###
    -	nodeModulesPath: null
    -
    -
    -	# ---------------------------------
    -	# Functions
    -
    -	###*
    -	# Constructor method
    -	# @method constructor
    -	# @param {Object} opts
    -	# @param {Object} opts.docpad The docpad instance that we are loading plugins for
    -	# @param {String} opts.dirPath The directory path of the plugin
    -	# @param {Object} opts.BasePlugin The base plugin class
    -	###
    -	constructor: ({@docpad,@dirPath,@BasePlugin}) ->
    -		# Prepare
    -		docpad = @docpad
    -
    -		# Apply
    -		@pluginName = pathUtil.basename(@dirPath).replace(/^docpad-plugin-/,'')
    -		@pluginClass = {}
    -		@packageData = {}
    -		@nodeModulesPath = pathUtil.resolve(@dirPath, 'node_modules')
    -
    -
    -	###*
    -	# Loads the package.json file and extracts the main path
    -	# next(err,exists)
    -	# @method exists
    -	# @param {Function} next
    -	###
    -	exists: (next) ->
    -		# Prepare
    -		packagePath = @packagePath or pathUtil.resolve(@dirPath, "package.json")
    -		failure = (err=null) ->
    -			return next(err, false)
    -		success = ->
    -			return next(null, true)
    -
    -		# Check the package
    -		safefs.exists packagePath, (exists) =>
    -			return failure()  unless exists
    -
    -			# Apply
    -			@packagePath = packagePath
    -
    -			# Read the package
    -			safefs.readFile packagePath, (err,data) =>
    -				return failure(err)  if err
    -
    -				# Parse the package
    -				try
    -					@packageData = JSON.parse data.toString()
    -				catch err
    -					return failure(err)
    -				finally
    -					return failure()  unless @packageData
    -
    -				# Extract the version and main
    -				pluginVersion = @packageData.version
    -				pluginPath = @packageData.main and pathUtil.join(@dirPath, @packageData.main)
    -
    -				# Check defined
    -				return failure()  unless pluginVersion
    -				return failure()  unless pluginPath
    -
    -				# Success
    -				@pluginVersion = pluginVersion
    -				@pluginPath = pluginPath
    -				return success()
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Check if this plugin is unsupported
    -	# Boolean value returned as a parameter
    -	# in the passed callback
    -	# next(err,supported)
    -	# @method unsupported
    -	# @param {Function} next
    -	###
    -	unsupported: (next) ->
    -		# Prepare
    -		docpad = @docpad
    -
    -		# Extract
    -		version = @packageData.version
    -		keywords = @packageData.keywords or []
    -		platforms = @packageData.platforms or []
    -		engines = @packageData.engines or {}
    -		peerDependencies = @packageData.peerDependencies or {}
    -
    -		# Check
    -		unsupported =
    -			# Check type
    -			if 'docpad-plugin' not in keywords
    -				'type'
    -
    -			# Check version
    -			else if version and not semver.satisfies(version, docpad.pluginVersion)
    -				'version-plugin'
    -
    -			# Check platform
    -			else if platforms.length and process.platform not in platforms
    -				'platform'
    -
    -			# Check node engine
    -			else if engines.node? and not semver.satisfies(process.version, engines.node)
    -				'engine-node'
    -
    -			# Check docpad engine
    -			else if engines.docpad? and not semver.satisfies(docpad.getVersion(), engines.docpad)
    -				'version-docpad'
    -
    -			# Check docpad peerDependencies
    -			else if peerDependencies.docpad? and not semver.satisfies(docpad.getVersion(), peerDependencies.docpad)
    -				'version-docpad'
    -
    -			# Supported
    -			else
    -				false
    -
    -		# Supported
    -		next(null, unsupported)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Installs the plugins node modules.
    -	# next(err)
    -	# @private
    -	# @method install
    -	# @param {Function} next
    -	###
    -	install: (next) ->
    -		# Prepare
    -		docpad = @docpad
    -
    -		# Only install if we have a package path
    -		if @packagePath
    -			# Install npm modules
    -			docpad.initNodeModules(
    -				path: @dirPath
    -				next: (err,results) ->
    -					# Forward
    -					return next(err)
    -			)
    -		else
    -			# Continue
    -			next()
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Load in the pluginClass from the plugin file.
    -	# The plugin class that has been loaded is returned
    -	# in the passed callback
    -	# next(err,pluginClass)
    -	# @method load
    -	# @param {Function} next
    -	###
    -	load: (next) ->
    -		# Prepare
    -		docpad = @docpad
    -		locale = docpad.getLocale()
    -
    -		# Ensure we still have deprecated support for old-style uncompiled plugins
    -		if pathUtil.extname(@pluginPath) is '.coffee'
    -			# Warn the user they are trying to include an uncompiled plugin (if they want to be warned)
    -			# They have the option of opting out of warnings for private plugins
    -			unless @packageData.private is true and docpad.getConfig().warnUncompiledPrivatePlugins is false
    -				docpad.warn util.format(locale.pluginUncompiled, @pluginName, @packageData.bugs?.url or locale.pluginIssueTracker)
    -
    -			# Attempt to include the coffee-script register extension
    -			# coffee-script is an external party dependency (docpad doesn't depend on it, so we don't install it)
    -			# so we may not have it, hence the try catch
    -			try
    -				require('coffee-script/register')
    -			catch err
    -				# Including coffee-script has failed, so let the user know, and exit
    -				err.context = util.format(locale.pluginUncompiledFailed, @pluginName, @packageData.bugs?.url or locale.pluginIssueTracker)
    -				return next(err); @
    -
    -
    -		# Attempt to load the plugin
    -		try
    -			@pluginClass = require(@pluginPath)(@BasePlugin)
    -		catch err
    -			# Loading the plugin has failed, so let the user know, and exit
    -			err.context = util.format(locale.pluginLoadFailed, @pluginName, @packageData.bugs?.url or locale.pluginIssueTracker)
    -			return next(err); @
    -
    -		# Plugin loaded, inject it's version and grab its name
    -		@pluginClass::version ?= @pluginVersion
    -		pluginPrototypeName = @pluginClass::name
    -
    -		# Check Alphanumeric Name
    -		if /^[a-z0-9]+$/.test(@pluginName) is false
    -			validPluginName = @pluginName.replace(/[^a-z0-9]/,'')
    -			docpad.warn util.format(locale.pluginNamingConventionInvalid, @pluginName, validPluginName)
    -
    -		# Check for Empty Name
    -		if pluginPrototypeName is null
    -			@pluginClass::name = @pluginName
    -			docpad.warn util.format(locale.pluginPrototypeNameUndefined, @pluginName)
    -
    -		# Check for Same Name
    -		else if pluginPrototypeName isnt @pluginName
    -			docpad.warn util.format(locale.pluginPrototypeNameDifferent, @pluginName, pluginPrototypeName)
    -
    -		# Return our plugin
    -		next(null, @pluginClass)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Create an instance of a plugin
    -	# defined by the passed config.
    -	# The plugin instance is returned in
    -	# the passed callback.
    -	# next(err,pluginInstance)
    -	# @method create
    -	# @param {Object} config
    -	# @param {Function} next
    -	###
    -	create: (config,next) ->
    -		# Load
    -		try
    -			# Create instance with merged configuration
    -			docpad = @docpad
    -			pluginInstance = new @pluginClass({docpad,config})
    -		catch err
    -			# An error occured, return it
    -			return next(err, null)
    -
    -		# Return our instance
    -		return next(null, pluginInstance)
    -
    -		# Chain
    -		@
    -
    -
    -# ---------------------------------
    -# Export
    -module.exports = PluginLoader
    -
    -    
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/files/src_lib_plugin.coffee.html b/docs/files/src_lib_plugin.coffee.html deleted file mode 100644 index 0b4e088f..00000000 --- a/docs/files/src_lib_plugin.coffee.html +++ /dev/null @@ -1,371 +0,0 @@ - - - - - src/lib/plugin.coffee - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    File: src/lib/plugin.coffee

    - -
    -
    -# ---------------------------------
    -# Requires
    -
    -# External
    -extendr = require('extendr')
    -typeChecker = require('typechecker')
    -ambi = require('ambi')
    -eachr = require('eachr')
    -
    -
    -# ---------------------------------
    -# Classes
    -
    -# Define Plugin
    -###*
    -# The base class for all DocPad plugins
    -# @class BasePlugin
    -# @constructor
    -###
    -class BasePlugin
    -
    -	###*
    -	# Add support for BasePlugin.extend(proto)
    -	# @private
    -	# @property {Object} @extend
    -	###
    -	@extend: require('csextends')
    -
    -	# ---------------------------------
    -	# Inherited
    -
    -	###*
    -	# The DocPad Instance
    -	# @private
    -	# @property {Object} docpad
    -	###
    -	docpad: null
    -
    -	# ---------------------------------
    -	# Variables
    -
    -	###*
    -	# The plugin name
    -	# @property {String}
    -	###
    -	name: null
    -
    -	###*
    -	# The plugin config
    -	# @property {Object}
    -	###
    -	config: {}
    -
    -	###*
    -	# The instance config.
    -	# @property {Object}
    -	###
    -	instanceConfig: {}
    -
    -	###*
    -	# Plugin priority
    -	# @private
    -	# @property {Number}
    -	###
    -	priority: 500
    -
    -	###*
    -	# Constructor method for the plugin
    -	# @method constructor
    -	# @param {Object} opts
    -	###
    -	constructor: (opts) ->
    -		# Prepare
    -		me = @
    -		{docpad,config} = opts
    -		@docpad = docpad
    -
    -		# Bind listeners
    -		@bindListeners()
    -
    -		# Swap out our configuration
    -		@config = extendr.clone(@config)
    -		@instanceConfig = extendr.clone(@instanceConfig)
    -		@initialConfig = @config
    -		@setConfig(config)
    -
    -		# Return early if we are disabled
    -		return @  if @isEnabled() is false
    -
    -		# Listen to events
    -		@addListeners()
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Set Instance Configuration
    -	# @private
    -	# @method setInstanceConfig
    -	# @param {Object} instanceConfig
    -	###
    -	setInstanceConfig: (instanceConfig) ->
    -		# Merge in the instance configurations
    -		if instanceConfig
    -			extendr.deepDefaults(@instanceConfig, instanceConfig)
    -			extendr.deepDefaults(@config, instanceConfig)  if @config
    -		@
    -
    -	###*
    -	# Set Configuration
    -	# @private
    -	# @method {Object} setConfig
    -	# @param {Object} [instanceConfig=null]
    -	###
    -	setConfig: (instanceConfig=null) =>
    -		# Prepare
    -		docpad = @docpad
    -		userConfig = @docpad.config.plugins[@name]
    -		@config = @docpad.config.plugins[@name] = {}
    -
    -		# Instance config
    -		@setInstanceConfig(instanceConfig)  if instanceConfig
    -
    -		# Merge configurations
    -		configPackages = [@initialConfig, userConfig, @instanceConfig]
    -		configsToMerge = [@config]
    -		docpad.mergeConfigurations(configPackages, configsToMerge)
    -
    -		# Remove listeners if we are disabled
    -		@removeListeners()  unless @isEnabled()
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Get the Configuration
    -	# @private
    -	# @method {Object}
    -	###
    -	getConfig: =>
    -		return @config
    -
    -	###*
    -	# Alias for b/c
    -	# @private
    -	# @method bindEvents
    -	###
    -	bindEvents: -> @addListeners()
    -
    -
    -	###*
    -	# Bind Listeners
    -	# @private
    -	# @method bindListeners
    -	###
    -	bindListeners: ->
    -		# Prepare
    -		pluginInstance = @
    -		docpad = @docpad
    -		events = docpad.getEvents()
    -
    -		# Bind events
    -		eachr events, (eventName) ->
    -			# Fetch the event handler
    -			eventHandler = pluginInstance[eventName]
    -
    -			# Check it exists and is a function
    -			if typeChecker.isFunction(eventHandler)
    -				# Bind the listener to the plugin
    -				pluginInstance[eventName] = eventHandler.bind(pluginInstance)
    -
    -		# Chain
    -		@
    -
    -
    -	###*
    -	# Add Listeners
    -	# @private
    -	# @method addListeners
    -	###
    -	addListeners: ->
    -		# Prepare
    -		pluginInstance = @
    -		docpad = @docpad
    -		events = docpad.getEvents()
    -
    -		# Bind events
    -		eachr events, (eventName) ->
    -			# Fetch the event handler
    -			eventHandler = pluginInstance[eventName]
    -
    -			# Check it exists and is a function
    -			if typeChecker.isFunction(eventHandler)
    -				# Apply the priority
    -				eventHandlerPriority = pluginInstance[eventName+'Priority'] or pluginInstance.priority or null
    -				eventHandler.priority ?= eventHandlerPriority
    -				eventHandler.name = "#{pluginInstance.name}: {eventName}"
    -				eventHandler.name += "(priority eventHandler.priority})"  if eventHandler.priority?
    -
    -				# Wrap the event handler, and bind it to docpad
    -				docpad
    -					.off(eventName, eventHandler)
    -					.on(eventName, eventHandler)
    -
    -		# Chain
    -		@
    -
    -
    -	###*
    -	# Remove Listeners
    -	# @private
    -	# @method removeListeners
    -	###
    -	removeListeners: ->
    -		# Prepare
    -		pluginInstance = @
    -		docpad = @docpad
    -		events = docpad.getEvents()
    -
    -		# Bind events
    -		eachr events, (eventName) ->
    -			# Fetch the event handler
    -			eventHandler = pluginInstance[eventName]
    -
    -			# Check it exists and is a function
    -			if typeChecker.isFunction(eventHandler)
    -				# Wrap the event handler, and unbind it from docpad
    -				docpad.off(eventName, eventHandler)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Destructor. Calls removeListeners
    -	# @private
    -	# @method destroy
    -	###
    -	destroy: ->
    -		@removeListeners()
    -		@
    -
    -
    -	###*
    -	# Is Enabled?
    -	# @method isEnabled
    -	# @return {Boolean}
    -	###
    -	isEnabled: ->
    -		return @config.enabled isnt false
    -
    -
    -# ---------------------------------
    -# Export Plugin
    -module.exports = BasePlugin
    -
    -    
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/files/src_lib_testers.coffee.html b/docs/files/src_lib_testers.coffee.html deleted file mode 100644 index c1a17d4d..00000000 --- a/docs/files/src_lib_testers.coffee.html +++ /dev/null @@ -1,494 +0,0 @@ - - - - - src/lib/testers.coffee - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    File: src/lib/testers.coffee

    - -
    -
    -# =====================================
    -# Requires
    -
    -# Standard Library
    -pathUtil = require('path')
    -
    -# External
    -safefs = require('safefs')
    -balUtil = require('bal-util')
    -extendr = require('extendr')
    -joe = require('joe')
    -assert = require('assert')
    -{equal, deepEqual, errorEqual} = require('assert-helpers')
    -CSON = require('cson')
    -{difference} = require('underscore')
    -
    -# Local
    -DocPad = require('./docpad')
    -docpadUtil = require('./util')
    -
    -
    -# =====================================
    -# Helpers
    -
    -# Prepare
    -# We want the plugn port to be a semi-random number above 2000
    -pluginPort = 2000 + parseInt(String(Date.now()).substr(-6, 4))
    -testers = {
    -	CSON,
    -	DocPad
    -}
    -
    -
    -# ---------------------------------
    -# Classes
    -
    -###*
    -# The Plugin Tester class
    -# @class PluginTester
    -# @constructor
    -###
    -testers.PluginTester =
    -class PluginTester
    -	# Add support for BasePlugin.extend(proto)
    -	@extend: require('csextends')
    -
    -
    -	###*
    -	# Default plugin config
    -	# @property {Object}
    -	###
    -	config:
    -		testerName: null
    -		pluginName: null
    -		pluginPath: null
    -		testPath: null
    -		outExpectedPath: null
    -		removeWhitespace: false
    -		contentRemoveRegex: null
    -		autoExit: 'safe'
    -
    -	###*
    -	# Default DocPad config
    -	# @property {Object}
    -	###
    -	docpadConfig:
    -		global: true
    -		port: null
    -		logLevel: (if ('-d' in process.argv) then 7 else 5)
    -		rootPath: null
    -		outPath: null
    -		srcPath: null
    -		pluginPaths: null
    -		enableUnlistedPlugins: true
    -		enabledPlugins: null
    -		skipUnsupportedPlugins: false
    -		catchExceptions: false
    -		environment: null
    -
    -
    -	###*
    -	# The DocPad instance
    -	# @private
    -	# @property {Object}
    -	###
    -	docpad: null
    -	
    -	###*
    -	# Constructor method
    -	# @method constructor
    -	# @param {Object} [config={}]
    -	# @param {Object} [docpadConfig={}]
    -	# @param {Function} next
    -	###
    -	constructor: (config={},docpadConfig={},next) ->
    -		# Apply Configuration
    -		tester = @
    -		@config = extendr.deepExtendPlainObjects({}, PluginTester::config, @config, config)
    -		@docpadConfig = extendr.deepExtendPlainObjects({}, PluginTester::docpadConfig, @docpadConfig, docpadConfig)
    -		@docpadConfig.port ?= ++pluginPort
    -		@config.testerName ?= "#{@config.pluginName} plugin"
    -
    -		# Extend Configuration
    -		@config.testPath or= pathUtil.join(@config.pluginPath, 'test')
    -		@config.outExpectedPath or= pathUtil.join(@config.testPath, 'out-expected')
    -
    -		# Extend DocPad Configuration
    -		@docpadConfig.rootPath or= @config.testPath
    -		@docpadConfig.outPath or= pathUtil.join(@docpadConfig.rootPath, 'out')
    -		@docpadConfig.srcPath or= pathUtil.join(@docpadConfig.rootPath, 'src')
    -		@docpadConfig.pluginPaths ?= [@config.pluginPath]
    -		defaultEnabledPlugins = {}
    -		defaultEnabledPlugins[@config.pluginName] = true
    -		@docpadConfig.enabledPlugins or= defaultEnabledPlugins
    -
    -		# Test API
    -		joe.describe @config.testerName, (suite,task) ->
    -			tester.describe = tester.suite = suite
    -			tester.it = tester.test = task
    -			tester.done = tester.exit = (next) ->
    -				tester.docpad?.action('destroy', next)
    -			next?(null, tester)
    -
    -		# Chain
    -		@
    -
    -
    -	###*
    -	# Get tester Configuration
    -	# @method getConfig
    -	# @return {Object}
    -	###
    -	getConfig: ->
    -		return @config
    -
    -	###*
    -	# Get the plugin instance
    -	# @method getPlugin
    -	# @return {Object} the plugin
    -	###
    -	getPlugin: ->
    -		return @docpad.getPlugin(@getConfig().pluginName)
    -
    -
    -	###*
    -	# Create the DocPad instance
    -	# @method testCreate
    -	###
    -	testCreate: =>
    -		# Prepare
    -		tester = @
    -		docpadConfig = @docpadConfig
    -
    -		# Create Instance
    -		@test "create", (done) ->
    -			new DocPad docpadConfig, (err, docpad) ->
    -				return done(err)  if err
    -				tester.docpad = docpad
    -
    -				# init docpad in case the plugin is starting from scratch
    -				tester.docpad.action 'init', (err) ->
    -					if err and err.message isnt tester.docpad.getLocale().skeletonExists
    -						return done(err)  # care about the error providing it isn't the skeleton exists error
    -
    -					# clean up the docpad out directory
    -					tester.docpad.action 'clean', (err) ->
    -						return done(err)  if err
    -
    -						# install anything on the website that needs to be installed
    -						tester.docpad.action('install', done)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Test Loaded
    -	# @method
    -	###
    -	testLoad: =>
    -		# Prepare
    -		tester = @
    -
    -		# Test
    -		@test "load plugin #{tester.config.pluginName}", (done) ->
    -			tester.docpad.loadedPlugin tester.config.pluginName, (err,loaded) ->
    -				return done(err)  if err
    -				assert.ok(loaded)
    -				return done()
    -
    -		# Chain
    -		@
    -
    -	# Perform Server
    -	testServer: (next) =>
    -		# Prepare
    -		tester = @
    -
    -		# Handle
    -		@test "server", (done) ->
    -			tester.docpad.action 'server', (err) ->
    -				return done(err)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Test generate
    -	# @method
    -	###
    -	testGenerate: =>
    -		# Prepare
    -		tester = @
    -
    -		# Test
    -		@test "generate", (done) ->
    -			tester.docpad.action 'generate', (err) ->
    -				return done(err)
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Test everything
    -	# @method {Object}
    -	###
    -	testEverything: =>
    -		# Prepare
    -		tester = @
    -
    -		# Tests
    -		@testCreate()
    -		@testLoad()
    -		@testGenerate()
    -		@testServer()
    -		@testCustom?()
    -
    -		# Finish
    -		@finish()
    -
    -		# Chain
    -		@
    -
    -	###*
    -	# Finish
    -	# @method finish
    -	###
    -	finish: ->
    -		# Prepare
    -		tester = @
    -
    -		# Finish
    -		if tester.config.autoExit
    -			@test 'finish up', (next) ->
    -				tester.exit(next)
    -
    -		# Chain
    -		@
    -
    -###*
    -# Server tester
    -# @class ServerTester
    -# @extends PluginTester
    -# @constructor
    -###
    -testers.ServerTester =
    -class ServerTester extends PluginTester
    -
    -
    -###*
    -# Rednderer tester
    -# @class ServerTester
    -# @extends PluginTester
    -# @constructor
    -###
    -testers.RendererTester =
    -class RendererTester extends PluginTester
    -	# Test Generation
    -	testGenerate: ->
    -		# Prepare
    -		tester = @
    -
    -		# Test
    -		@suite "generate", (suite,test) ->
    -			test 'action', (done) ->
    -				tester.docpad.action 'generate', (err) ->
    -					return done(err)
    -
    -			suite 'results', (suite,test,done) ->
    -				# Get actual results
    -				balUtil.scanlist tester.docpadConfig.outPath, (err,outResults) ->
    -					return done(err)  if err
    -
    -					# Get expected results
    -					balUtil.scanlist tester.config.outExpectedPath, (err,outExpectedResults) ->
    -						return done(err)  if err
    -
    -						# Prepare
    -						outResultsKeys = Object.keys(outResults)
    -						outExpectedResultsKeys = Object.keys(outExpectedResults)
    -
    -						# Check we have the same files
    -						test 'same files', ->
    -							outDifferenceKeys = difference(outExpectedResultsKeys, outResultsKeys)
    -							deepEqual(outDifferenceKeys, [], 'The following file(s) should have been generated')
    -							outDifferenceKeys = difference(outResultsKeys, outExpectedResultsKeys)
    -							deepEqual(outDifferenceKeys, [], 'The following file(s) should not have been generated')
    -
    -						# Check the contents of those files match
    -						outResultsKeys.forEach (key) ->
    -							test "same file content for: #{key}", ->
    -								# Fetch file value
    -								actual = outResults[key]
    -								expected = outExpectedResults[key]
    -
    -								# Remove empty lines
    -								if tester.config.removeWhitespace is true
    -									replaceLinesRegex = /\s+/g
    -									actual = actual.replace(replaceLinesRegex, '')
    -									expected = expected.replace(replaceLinesRegex, '')
    -
    -								# Content regex
    -								if tester.config.contentRemoveRegex
    -									actual = actual.replace(tester.config.contentRemoveRegex, '')
    -									expected = expected.replace(tester.config.contentRemoveRegex, '')
    -
    -								# Compare
    -								equal(actual, expected)
    -
    -						# Forward
    -						done()
    -
    -		# Chain
    -		@
    -
    -###*
    -# Test a plugin
    -# test({pluginPath: String})
    -# @property test
    -###
    -testers.test =
    -test = (testerConfig, docpadConfig) ->
    -	# Configure
    -	testerConfig.testerClass ?= PluginTester
    -	testerConfig.pluginPath = pathUtil.resolve(testerConfig.pluginPath)
    -	testerConfig.pluginName ?= pathUtil.basename(testerConfig.pluginPath).replace('docpad-plugin-','')
    -	testerConfig.testerPath ?= pathUtil.join('out', "#{testerConfig.pluginName}.tester.js")
    -	testerConfig.testerPath = pathUtil.resolve(testerConfig.pluginPath, testerConfig.testerPath)  if testerConfig.testerPath
    -
    -	# Create tester
    -	complete = ->
    -		# Accept string inputs for testerClass
    -		testerConfig.testerClass = testers[testerConfig.testerClass]  if typeof testerConfig.testerClass is 'string'
    -
    -		# Create our tester
    -		new testerConfig.testerClass testerConfig, docpadConfig, (err,testerInstance) ->
    -			throw err  if err
    -
    -			# Run the tests
    -			testerInstance.testEverything()
    -
    -	# Load the tester file
    -	if testerConfig.testerPath
    -		safefs.exists testerConfig.testerPath, (exists) ->
    -			testerConfig.testerClass = require(testerConfig.testerPath)(testers)  if exists
    -			complete()
    -
    -	# User the default tester
    -	else
    -		complete()
    -
    -	# Chain
    -	return testers
    -
    -
    -# ---------------------------------
    -# Export Testers
    -module.exports = testers
    -
    -    
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/files/src_lib_util.coffee.html b/docs/files/src_lib_util.coffee.html deleted file mode 100644 index edf8af36..00000000 --- a/docs/files/src_lib_util.coffee.html +++ /dev/null @@ -1,482 +0,0 @@ - - - - - src/lib/util.coffee - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -

    File: src/lib/util.coffee

    - -
    -
    -# =====================================
    -# Requires
    -
    -# Standard Library
    -pathUtil = require('path')
    -util = require('util')
    -
    -# External
    -{uniq, compact} = require('underscore')
    -extractOptsAndCallback = require('extract-opts')
    -
    -
    -# =====================================
    -# Export
    -###*
    -# The DocPad Util Class.
    -# Collection of DocPad utility methods
    -# @class docpadUtil
    -# @constructor
    -# @static
    -###
    -module.exports = docpadUtil =
    -
    -	###*
    -	# Write to stderr
    -	# @private
    -	# @method writeStderr
    -	# @param {String} data
    -	###
    -	writeStderr: (data) ->
    -		try
    -			process.stderr.write(data)
    -		catch err
    -			process.stdout.write(data)
    -
    -	###*
    -	# Write an error
    -	# @private
    -	# @method writeError
    -	# @param {Object} err
    -	###
    -	writeError: (err) ->
    -		docpadUtil.writeStderr(err.stack?.toString?() or err.message or err)
    -
    -	###*
    -	# Wait. Wrapper for setTimeout
    -	# @private
    -	# @method wait
    -	# @param {Number} time
    -	# @param {function} fn
    -	###
    -	wait: (time, fn) -> setTimeout(fn, time)
    -
    -
    -	###*
    -	# Get Default Log Level
    -	# @private
    -	# @method getDefaultLogLevel
    -	# @return {Number} default log level
    -	###
    -	getDefaultLogLevel: ->
    -		if docpadUtil.isTravis() or ('-d' in process.argv)
    -			return 7
    -		else
    -			return 5
    -
    -	###*
    -	# Are we executing on Travis
    -	# @private
    -	# @method isTravis
    -	# @return {String} The travis node version
    -	###
    -	isTravis: ->
    -		return process.env.TRAVIS_NODE_VERSION?
    -
    -	###*
    -	# Is this TTY
    -	# @private
    -	# @method isTTY
    -	# @return {Boolean}
    -	###
    -	isTTY: ->
    -		return process.stdout?.isTTY is true and process.stderr?.isTTY is true
    -
    -
    -	###*
    -	# Is Standadlone
    -	# @private
    -	# @method isStandalone
    -	# @return {Object}
    -	###
    -	isStandalone: ->
    -		return /docpad$/.test(process.argv[1] or '')
    -
    -	###*
    -	# Is user
    -	# @private
    -	# @method isUser
    -	# @return {Boolean}
    -	###
    -	isUser: ->
    -		return docpadUtil.isStandalone() and docpadUtil.isTTY() and docpadUtil.isTravis() is false
    -
    -	###*
    -	# Wrapper for the node.js method util.inspect
    -	# @method inspect
    -	# @param {Object} obj
    -	# @param {Object} opts
    -	# @return {String}
    -	###
    -	inspect: (obj, opts) ->
    -		# Prepare
    -		opts ?= {}
    -
    -		# If the terminal supports colours, and the user hasn't set anything, then default to a sensible default
    -		if docpadUtil.isTTY()
    -			opts.colors ?= '--no-colors' not in process.argv
    -
    -		# If the terminal doesn't support colours, then over-write whatever the user set
    -		else
    -			opts.colors = false
    -
    -		# Inspect and return
    -		return util.inspect(obj, opts)
    -
    -	###*
    -	# Are we using standard encoding?
    -	# @private
    -	# @method isStandardEncoding
    -	# @param {String} encoding
    -	# @return {Boolean}
    -	###
    -	isStandardEncoding: (encoding) ->
    -		return encoding.toLowerCase() in ['ascii', 'utf8', 'utf-8']
    -
    -
    -	###*
    -	# Get Local DocPad Installation Executable - ie
    -	# not the global installation
    -	# @private
    -	# @method getLocalDocPadExecutable
    -	# @return {String} the path to the local DocPad executable
    -	###
    -	getLocalDocPadExecutable: ->
    -		return pathUtil.join(process.cwd(), 'node_modules', 'docpad', 'bin', 'docpad')
    -
    -	###*
    -	# Is Local DocPad Installation
    -	# @private
    -	# @method isLocalDocPadExecutable
    -	# @return {Boolean}
    -	###
    -	isLocalDocPadExecutable: ->
    -		return docpadUtil.getLocalDocPadExecutable() in process.argv
    -
    -	###*
    -	# Does the local DocPad Installation Exist?
    -	# @private
    -	# @method getLocalDocPadExecutableExistance
    -	# @return {Boolean}
    -	###
    -	getLocalDocPadExecutableExistance: ->
    -		return require('safefs').existsSync(docpadUtil.getLocalDocPadExecutable()) is true
    -
    -	###*
    -	# Spawn Local DocPad Executable
    -	# @private
    -	# @method startLocalDocPadExecutable
    -	# @param {Function} next
    -	# @return {Object} don't know what
    -	###
    -	startLocalDocPadExecutable: (next) ->
    -		args = process.argv.slice(2)
    -		command = ['node', docpadUtil.getLocalDocPadExecutable()].concat(args)
    -		return require('safeps').spawn command, {stdio:'inherit'}, (err) ->
    -			if err
    -				if next
    -					next(err)
    -				else
    -					message = 'An error occured within the child DocPad instance: '+err.message+'\n'
    -					docpadUtil.writeStderr(message)
    -			else
    -				next?()
    -
    -
    -	###*
    -	# get a filename without the extension
    -	# @method getBasename
    -	# @param {String} filename
    -	# @return {String} base name
    -	###
    -	getBasename: (filename) ->
    -		if filename[0] is '.'
    -			basename = filename.replace(/^(\.[^\.]+)\..*$/, '$1')
    -		else
    -			basename = filename.replace(/\..*$/, '')
    -		return basename
    -
    -
    -	###*
    -	# Get the extensions of a filename
    -	# @method getExtensions
    -	# @param {String} filename
    -	# @return {Array} array of string
    -	###
    -	getExtensions: (filename) ->
    -		extensions = filename.split(/\./g).slice(1)
    -		return extensions
    -
    -
    -	###*
    -	# Get the extension from a bunch of extensions
    -	# @method getExtension
    -	# @param {Array} extensions
    -	# @return {String} the extension
    -	###
    -	getExtension: (extensions) ->
    -		unless require('typechecker').isArray(extensions)
    -			extensions = docpadUtil.getExtensions(extensions)
    -
    -		if extensions.length isnt 0
    -			extension = extensions.slice(-1)[0] or null
    -		else
    -			extension = null
    -
    -		return extension
    -
    -	###*
    -	# Get the directory path.
    -	# Wrapper around the node.js path.dirname method
    -	# @method getDirPath
    -	# @param {String} path
    -	# @return {String}
    -	###
    -	getDirPath: (path) ->
    -		return pathUtil.dirname(path) or ''
    -
    -	###*
    -	# Get the file name.
    -	# Wrapper around the node.js path.basename method
    -	# @method getFilename
    -	# @param {String} path
    -	# @return {String}
    -	###
    -	getFilename: (path) ->
    -		return pathUtil.basename(path)
    -
    -	###*
    -	# Get the DocPad out file name
    -	# @method getOutFilename
    -	# @param {String} basename
    -	# @param {String} extension
    -	# @return {String}
    -	###
    -	getOutFilename: (basename, extension) ->
    -		if basename is '.'+extension  # prevent: .htaccess.htaccess
    -			return basename
    -		else
    -			return basename+(if extension then '.'+extension else '')
    -
    -	###*
    -	# Get the URL
    -	# @method getUrl
    -	# @param {String} relativePath
    -	# @return {String}
    -	###
    -	getUrl: (relativePath) ->
    -		return '/'+relativePath.replace(/[\\]/g, '/')
    -
    -	###*
    -	# Get the post slug from the URL
    -	# @method getSlug
    -	# @param {String} relativeBase
    -	# @return {String} the slug
    -	###
    -	getSlug: (relativeBase) ->
    -		return require('bal-util').generateSlugSync(relativeBase)
    -
    -	###*
    -	# Perform an action
    -	# next(err,...), ... = any special arguments from the action
    -	# this should be it's own npm module
    -	# as we also use the concept of actions in a few other packages.
    -	# Important concept in DocPad.
    -	# @method action
    -	# @param {Object} action
    -	# @param {Object} opts
    -	# @param {Function} next
    -	###
    -	action: (action,opts,next) ->
    -		# Prepare
    -		[opts,next] = extractOptsAndCallback(opts,next)
    -		me = @
    -		locale = me.getLocale()
    -		run = opts.run ? true
    -		runner = opts.runner ? me.getActionRunner()
    -
    -		# Array?
    -		if Array.isArray(action)
    -			actions = action
    -		else
    -			actions = action.split(/[,\s]+/g)
    -
    -		# Clean actions
    -		actions = uniq compact actions
    -
    -		# Exit if we have no actions
    -		if actions.length is 0
    -			err = new Error(locale.actionEmpty)
    -			return next(err); me
    -
    -		# We have multiple actions
    -		if actions.length > 1
    -			actionTaskOrGroup = runner.createTaskGroup 'actions bundle: '+actions.join(' ')
    -
    -			for action in actions
    -				# Fetch
    -				actionMethod = me[action].bind(me)
    -
    -				# Check
    -				unless actionMethod
    -					err = new Error(util.format(locale.actionNonexistant, action))
    -					return next(err); me
    -
    -				# Task
    -				task = actionTaskOrGroup.createTask(action, actionMethod, {args: [opts]})
    -				actionTaskOrGroup.addTask(task)
    -
    -		# We have single actions
    -		else
    -			# Fetch the action
    -			action = actions[0]
    -
    -			# Fetch
    -			actionMethod = me[action].bind(me)
    -
    -			# Check
    -			unless actionMethod
    -				err = new Error(util.format(locale.actionNonexistant, action))
    -				return next(err); me
    -
    -			# Task
    -			actionTaskOrGroup = runner.createTask(action, actionMethod, {args: [opts]})
    -
    -		# Create our runner task
    -		runnerTask = runner.createTask "runner task for action: #{action}", (continueWithRunner) ->
    -			# Add our listener for our action
    -			actionTaskOrGroup.done (args...) ->
    -				# If we have a completion callback, let it handle the error
    -				if next
    -					next(args...)
    -					args[0] = null
    -
    -				# Continue with our runner
    -				continueWithRunner(args...)
    -
    -			# Run our action
    -			actionTaskOrGroup.run()
    -
    -		# Add it and run it
    -		runner.addTask(runnerTask)
    -		runner.run()  if run is true
    -
    -		# Chain
    -		return me
    -
    -    
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index a84e4932..00000000 --- a/docs/index.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - - - - - -
    -
    -
    -

    -
    -
    - API Docs for: -
    -
    -
    - - -
    -
    - Show: - - - - - - - -
    - -
    -
    -
    -
    -
    -

    - Browse to a module or class using the sidebar to view its API documentation. -

    - -

    Keyboard Shortcuts

    - -
      -
    • Press s to focus the API search box.

    • - -
    • Use Up and Down to select classes, modules, and search results.

    • - -
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • - -
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/docs/modules/index.html b/docs/modules/index.html deleted file mode 100644 index 487fe15b..00000000 --- a/docs/modules/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Redirector - - - - Click here to redirect - - diff --git a/package.json b/package.json index 4d8de680..d54a08e3 100644 --- a/package.json +++ b/package.json @@ -16,19 +16,22 @@ "daviddm", "daviddmdev", "---", - "slackin", "patreon", + "opencollective", "gratipay", "flattr", "paypal", "bitcoin", - "wishlist" + "wishlist", + "---", + "slackin" ], "config": { "patreonUsername": "bevry", + "opencollectiveUsername": "bevry", "gratipayUsername": "bevry", - "flattrCode": "344188/balupton-on-Flattr", - "paypalButtonID": "QB8GQPZAH84N6", + "flattrUsername": "balupton", + "paypalURL": "https://bevry.me/paypal", "bitcoinURL": "https://bevry.me/bitcoin", "wishlistURL": "https://bevry.me/wishlist", "slackinURL": "https://slack.bevry.me" @@ -96,7 +99,7 @@ "Chase Colman (https://github.com/chase)", "Lukasz Gornicki (http://derberg.github.io/)", "eldios (https://github.com/eldios)", - "Shih-Yung Lee (blog.sylee.tw)", + "sylee (blog.sylee.tw)", "Eduardo Lavaque (http://greduan.com)", "Homme Zwaagstra (https://github.com/homme)", "JT Turner (http://www.jtwebman.com)", @@ -127,7 +130,7 @@ "vsopvsop (https://github.com/vsopvsop)", "Zearin (https://github.com/Zearin)", "Firede (http://firede.us)", - "JT Turner (https://github.com/jtwebman)", + "JT Turner (http://jtwebman.com)", "Anton Wilhelm (https://github.com/timaschew)", "Bahtiar Gadimov (http://bahtiar.gadimov.de/)", "Ke Zhu (http://blog.shawnzhu.com)", @@ -234,20 +237,23 @@ "docpad-trace": "bin/docpad-trace" }, "scripts": { - "setup": "npm install", - "clean": "rm -Rf ./docs ./out", - "compile": "npm run compile:coffeescript", - "compile:coffeescript": "coffee -bco ./out ./src", - "meta": "npm run meta:docs && npm run meta:projectz", - "meta:docs": "yuidoc -o ./docs --syntaxtype coffee -e .coffee ./src", - "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 --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", - "test:coffeelint": "coffeelint ./src", - "test": "node --harmony ./out/test/everything-test.js" + "our:setup": "npm install", + "our:clean": "rm -Rf ./docs ./es2015 ./out", + "our:compile": "npm run our:compile:coffeescript", + "our:compile:coffeescript": "coffee -bco ./out ./src", + "our:meta": "npm run our:meta:docs && npm run our:meta:projectz", + "our:meta:docs": "yuidoc -o ./docs --syntaxtype coffee -e .coffee ./src", + "our:meta:projectz": "projectz compile", + "our:verify": "npm run our:verify:coffeelint", + "our:verify:coffeelint": "coffeelint ./src", + "our:test": "npm run our:verify && npm test", + "our:release": "npm run our:release:prepare && npm run our:release:check && npm run our:release:tag && npm run our:release:push", + "our:release:prepare": "npm run our:clean && npm run our:compile && npm run our:test && npm run our:meta", + "our:release:check": "npm run our:release:check:changelog && npm run our:release:check:dirty", + "our:release:check:changelog": "cat ./HISTORY.md | grep v$npm_package_version || (echo add a changelog entry for v$npm_package_version && exit -1)", + "our:release:check:dirty": "git diff --exit-code", + "our:release:tag": "export MESSAGE=$(cat ./HISTORY.md | sed -n \"/## v$npm_package_version/,/##/p\" | sed 's/## //' | awk 'NR>1{print buf}{buf = $0}') && test \"$MESSAGE\" || (echo 'proper changelog entry not found' && exit -1) && git tag v$npm_package_version -am \"$MESSAGE\"", + "our:release:push": "git push origin master && git push origin --tags", + "test": "node --harmony ./out/test/everything-test.js --joe-reporter=console" } }