From 2cfedc71c5d8d958b4c60dc06f153c116b81c060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Jaenisch?= Date: Thu, 20 Jun 2019 20:54:34 +0200 Subject: [PATCH] docs(Eleventy): document Eleventy constructor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: André Jaenisch --- package.json | 2 +- src/Eleventy.js | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 850cdca3c..cc0499b4d 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ }, "scripts": { "default": "npm run test", - "doc": "jsdoc -c .jsdoc.conf.json -d ./api-docs -p ./package.json -R README.md -t ./node_modules/ink-docstrap/template -r src/**/*.js", + "doc": "jsdoc -c .jsdoc.conf.json -d ./api-docs -p ./package.json -R README.md -t ./node_modules/ink-docstrap/template -r src/*.js", "test": "npx ava --verbose", "lint-staged": "lint-staged", "coverage": "npx nyc ava && npx nyc report --reporter=json-summary && cp coverage/coverage-summary.json docs-src/_data/coverage.json && node cmd.js --config=docs-src/.eleventy.docs.js" diff --git a/src/Eleventy.js b/src/Eleventy.js index ad3e92a78..e93293465 100644 --- a/src/Eleventy.js +++ b/src/Eleventy.js @@ -11,22 +11,68 @@ const config = require("./Config"); const bench = require("./BenchmarkManager"); const debug = require("debug")("Eleventy"); +/** + * @module @11ty/eleventy/Eleventy + */ + +/** + * Runtime of eleventy. + * + * @param {String} input - Where to read files from. + * @param {Output} output - Where to write rendered files to. + * @returns {undefined} + */ class Eleventy { constructor(input, output) { + /** @member {Object} - tbd. */ this.config = config.getConfig(); + + /** + * @member {String} - The path to Eleventy's config file. + * @default null + */ this.configPath = null; + + /** + * @member {Boolean} - Is Eleventy running in verbose mode? + * @default true + */ this.isVerbose = true; + + /** + * @member {Boolean} - Is Eleventy running in debug mode? + * @default false + */ this.isDebug = false; + + /** + * @member {Boolean} - Is Eleventy running in dry mode? + * @default false + */ this.isDryRun = false; + /** @member {Date} - The time of instantiation. */ this.start = new Date(); + + /** + * @member {Array} - Subset of template types. + * @default null + */ this.formatsOverride = null; + + /** @member {Object} - tbd. */ this.eleventyServe = new EleventyServe(); + /** @member {String} - Holds the path to the input directory. */ this.rawInput = input; + + /** @member {String} - Holds the path to the output directory. */ this.rawOutput = output; + /** @member {Object} - tbd. */ this.watchTargets = new EleventyWatchTargets(); + + /** @member {Object} - tbd. */ this.watchTargets.watchJavaScriptDependencies = this.config.watchJavaScriptDependencies; }