mirror of
https://github.com/documentationjs/documentation.git
synced 2026-01-25 14:26:29 +00:00
* feat(core): Switch to Promises everywhere. Adopt Node v4 ES6 Big changes: * Uses template strings where appropriate * Config and argument parsing is unified and there is no such thing as formatterOptions anymore. All user-passed options go through mergeConfig. * The node API surface changed (again): `buildSync` is removed, building operations return Promises. * Now using Flow for internal type annotations. More changes: * Remove buildSync command * feat(inference): Partially implement object shorthand support * Refs #649 * Use Flow annotations to enforce types * Keep flow but switch to comment syntax * Clarify types * More flow improvements * Turn server into class * LinkerStack becomes class too * Fix comment description type * Run flow on lint * Many more flow fixes * More intense flow refactoring * Simplify inference steps * Update inference tests, flow errors down to 1 * Continue refining types * Fix more flow issues * Use 'use strict' everywhere * Make 'ast' property configurable * Fix many tests * Fix more tests * Fix more tests * Fix augments * Test Markdown meta support * Improve test coverage * Switch back from for of to for for speed
119 lines
3.4 KiB
JavaScript
119 lines
3.4 KiB
JavaScript
/* @flow */
|
|
'use strict';
|
|
|
|
/**
|
|
* Adds shared options to any command that runs documentation
|
|
*/
|
|
module.exports.sharedInputOptions = {
|
|
strict: true,
|
|
'shallow': {
|
|
describe: 'shallow mode turns off dependency resolution, ' +
|
|
'only processing the specified files (or the main script specified in package.json)',
|
|
default: false,
|
|
type: 'boolean'
|
|
},
|
|
'config': {
|
|
describe: 'configuration file. an array defining explicit sort order',
|
|
alias: 'c',
|
|
type: 'string'
|
|
},
|
|
'no-package': {
|
|
describe: 'dont find and use package.json for project- configuration option defaults',
|
|
alias: 'np',
|
|
type: 'boolean',
|
|
default: false
|
|
},
|
|
'external': {
|
|
describe: 'a string / glob match pattern that defines which external ' +
|
|
'modules will be whitelisted and included in the generated documentation.',
|
|
default: null
|
|
},
|
|
'require-extension': {
|
|
describe: 'additional extensions to include in require() and import\'s search algorithm.' +
|
|
'For instance, adding .es5 would allow require("adder") to find "adder.es5"',
|
|
// Ensure that the value is an array
|
|
coerce: (value/*: string | Array<string>*/) => [].concat(value),
|
|
alias: 're'
|
|
},
|
|
'parse-extension': {
|
|
describe: 'additional extensions to parse as source code.',
|
|
// Ensure that the value is an array
|
|
coerce: (value/*: string | Array<string>*/) => [].concat(value),
|
|
alias: 'pe'
|
|
},
|
|
'polyglot': {
|
|
type: 'boolean',
|
|
describe: 'polyglot mode turns off dependency resolution and ' +
|
|
'enables multi-language support. use this to document c++'
|
|
},
|
|
'private': {
|
|
describe: 'generate documentation tagged as private',
|
|
type: 'boolean',
|
|
default: false,
|
|
alias: 'p'
|
|
},
|
|
'access': {
|
|
describe: 'Include only comments with a given access level, out of private, ' +
|
|
'protected, public, undefined. By default, public, protected, and undefined access ' +
|
|
'levels are included',
|
|
choices: ['public', 'private', 'protected', 'undefined'],
|
|
array: true,
|
|
alias: 'a'
|
|
},
|
|
'github': {
|
|
type: 'boolean',
|
|
describe: 'infer links to github in documentation',
|
|
alias: 'g'
|
|
},
|
|
'infer-private': {
|
|
type: 'string',
|
|
describe: 'Infer private access based on the name. This is a regular expression that ' +
|
|
'is used to match the name'
|
|
},
|
|
'document-exported': {
|
|
type: 'boolean',
|
|
describe: 'Generate documentation for all exported bindings and members ' +
|
|
'even if there is no JSDoc for them',
|
|
default: false
|
|
},
|
|
'sort-order': {
|
|
describe: 'The order to sort the documentation',
|
|
choices: ['source', 'alpha'],
|
|
default: 'source'
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Adds shared options to any command that runs documentation
|
|
*/
|
|
module.exports.sharedOutputOptions = {
|
|
theme: {
|
|
describe: 'specify a theme: this must be a valid theme module',
|
|
alias: 't'
|
|
},
|
|
'project-name': {
|
|
describe: 'project name. by default, inferred from package.json'
|
|
},
|
|
'project-version': {
|
|
describe: 'project version. by default, inferred from package.json'
|
|
},
|
|
'project-homepage': {
|
|
describe: 'project homepage. by default, inferred from package.json'
|
|
},
|
|
format: {
|
|
alias: 'f',
|
|
default: 'json',
|
|
choices: ['json', 'md', 'remark', 'html']
|
|
},
|
|
watch: {
|
|
describe: 'watch input files and rebuild documentation when they change',
|
|
alias: 'w',
|
|
type: 'boolean'
|
|
},
|
|
'markdown-toc': {
|
|
describe: 'include a table of contents in markdown output',
|
|
default: true,
|
|
type: 'boolean'
|
|
}
|
|
};
|