1
1
/* @flow */
2
2
3
- var fs = require ( 'fs' ) ;
4
- var remark = require ( 'remark' ) ;
5
- var path = require ( 'path' ) ;
6
- var documentation = require ( '../' ) ;
7
- var inject = require ( 'mdast-util-inject' ) ;
8
- var chalk = require ( 'chalk' ) ;
9
- var disparity = require ( 'disparity' ) ;
3
+ var path = require ( 'path' ) ,
4
+ fs = require ( 'fs' ) ,
5
+ remark = require ( 'remark' ) ,
6
+ inject = require ( 'mdast-util-inject' ) ,
7
+ chalk = require ( 'chalk' ) ,
8
+ disparity = require ( 'disparity' ) ,
9
+ documentation = require ( '../' ) ,
10
+ _ = require ( 'lodash' ) ;
10
11
11
12
module . exports . command = 'readme [input..]' ;
12
13
module . exports . description = 'inject documentation into your README.md' ;
@@ -16,34 +17,53 @@ module.exports.description = 'inject documentation into your README.md';
16
17
* @returns {Object } yargs with options
17
18
* @private
18
19
*/
19
- module . exports . builder = {
20
- usage :
21
- 'Usage: documentation readme [--readme-file=README.md] --section "API"' +
22
- ' [--compare-only] [other documentationjs options]' ,
23
- example : 'documentation readme index.js -s "API Docs" --github' ,
24
- 'readme-file' : {
25
- describe : 'The markdown file into which to inject documentation' ,
26
- default : 'README.md'
27
- } ,
28
- section : {
29
- alias : 's' ,
30
- describe :
31
- 'The section heading after which to inject generated documentation' ,
32
- required : true
33
- } ,
34
- 'diff-only' : {
35
- alias : 'd' ,
36
- describe :
37
- 'Instead of updating the given README with the generated documentation,' +
38
- ' just check if its contents match, exiting nonzero if not.' ,
39
- default : false
40
- } ,
41
- quiet : {
42
- alias : 'q' ,
43
- describe : 'Quiet mode: do not print messages or README diff to stdout.' ,
44
- default : false
20
+ module . exports . builder = _ . assign (
21
+ { } ,
22
+ {
23
+ usage :
24
+ 'Usage: documentation readme [--readme-file=README.md] --section "API"' +
25
+ ' [--compare-only] [other documentationjs options]' ,
26
+ example : 'documentation readme index.js -s "API Docs" --github' ,
27
+ 'readme-file' : {
28
+ describe : 'The markdown file into which to inject documentation' ,
29
+ default : 'README.md' ,
30
+ type : 'string'
31
+ } ,
32
+ section : {
33
+ alias : 's' ,
34
+ describe :
35
+ 'The section heading after which to inject generated documentation' ,
36
+ required : true ,
37
+ type : 'string'
38
+ } ,
39
+ 'diff-only' : {
40
+ alias : 'd' ,
41
+ describe :
42
+ 'Instead of updating the given README with the generated documentation,' +
43
+ ' just check if its contents match, exiting nonzero if not.' ,
44
+ default : false ,
45
+ type : 'boolean'
46
+ } ,
47
+ quiet : {
48
+ alias : 'q' ,
49
+ describe : 'Quiet mode: do not print messages or README diff to stdout.' ,
50
+ default : false ,
51
+ type : 'boolean'
52
+ } ,
53
+ shallow : {
54
+ describe :
55
+ 'shallow mode turns off dependency resolution, ' +
56
+ 'only processing the specified files (or the main script specified in package.json)' ,
57
+ default : false ,
58
+ type : 'boolean'
59
+ } ,
60
+ 'sort-order' : {
61
+ describe : 'The order to sort the documentation' ,
62
+ choices : [ 'source' , 'alpha' ] ,
63
+ default : 'source'
64
+ }
45
65
}
46
- } ;
66
+ ) ;
47
67
48
68
/**
49
69
* Insert API documentation into a Markdown readme
0 commit comments