Skip to content

Commit

Permalink
Expose theme option to cli as -t or --theme
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcw committed Jul 10, 2015
1 parent 058c431 commit ba5c0d6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
14 changes: 9 additions & 5 deletions bin/documentation.js
Expand Up @@ -19,7 +19,8 @@ var yargs = require('yargs')

.describe('lint', 'check output for common style and uniformity mistakes')

.describe('mdtemplate', 'markdown template: should be a file with Handlebars syntax')
.describe('t', 'specify a theme: this must be a valid theme module')
.alias('t', 'theme')

.boolean('p')
.describe('p', 'generate documentation tagged as private')
Expand All @@ -29,17 +30,20 @@ var yargs = require('yargs')
.describe('version', 'project version. by default, inferred from package.json')

.boolean('shallow')
.describe('shallow', 'shallow mode turns off dependency resolution, only processing the specified files (or the main script specified in package.json)')
.describe('shallow', 'shallow mode turns off dependency resolution, ' +
'only processing the specified files (or the main script specified in package.json)')
.default('shallow', false)

.boolean('polyglot')
.describe('polyglot', 'polyglot mode turns off dependency resolution and enables multi-language support. use this to document c++')
.describe('polyglot', 'polyglot mode turns off dependency resolution and ' +
'enables multi-language support. use this to document c++')

.boolean('g')
.describe('g', 'infer links to github in documentation')
.alias('g', 'github')

.describe('o', 'output location. omit for stdout, otherwise is a filename for single-file outputs and a directory name for multi-file outputs like html')
.describe('o', 'output location. omit for stdout, otherwise is a filename ' +
'for single-file outputs and a directory name for multi-file outputs like html')
.alias('o', 'output')
.default('o', 'stdout')

Expand Down Expand Up @@ -76,7 +80,7 @@ try {
var formatterOptions = {
name: name,
version: version,
mdtemplate: argv.mdtemplate
theme: argv.theme
};

var formatter = documentation.formats[argv.f](formatterOptions);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -67,6 +67,6 @@
},
"scripts": {
"cover": "istanbul cover prova test/*.js test/lib/*.js test/streams/*.js --dir $CIRCLE_ARTIFACTS && coveralls < $CIRCLE_ARTIFACTS/lcov.info",
"test": "eslint --no-eslintrc -c .eslintrc lib streams index.js test/*.js test/streams/*.js && prova test/*.js test/lib/*.js test/streams/*.js"
"test": "eslint --no-eslintrc -c .eslintrc bin lib streams index.js test/*.js test/streams/*.js && prova test/*.js test/lib/*.js test/streams/*.js"
}
}
3 changes: 2 additions & 1 deletion streams/output/index.js
Expand Up @@ -11,7 +11,7 @@ module.exports = {
md: function (options) {
options = options || {};
return markdown({
template: options.mdtemplate,
theme: options.theme,
name: options.name,
version: options.version
});
Expand All @@ -20,6 +20,7 @@ module.exports = {
options = options || {};
return htmlOutput({
name: options.name,
theme: options.theme,
version: options.version
});
}
Expand Down

0 comments on commit ba5c0d6

Please sign in to comment.