UNPKG

2.13 kBJavaScriptView Raw
1'use strict'
2var jsdocParse = require('jsdoc-parse')
3var dmd = require('dmd')
4
5/* generation options */
6var definitions = [
7 {
8 name: 'verbose', description: 'More verbose error reporting',
9 alias: 'v', type: Boolean, group: 'jsdoc2md'
10 },
11 {
12 name: 'help', description: 'Print usage information',
13 alias: 'h', type: Boolean, group: 'jsdoc2md'
14 },
15 {
16 name: 'json', description: 'Output the jsdoc-parse json only',
17 alias: 'j', type: Boolean, group: 'jsdoc2md'
18 },
19 {
20 name: 'config', description: 'Print the stored config and exit',
21 type: Boolean, group: 'jsdoc2md'
22 }
23]
24
25/* mix in the jsdoc-parse and dmd options */
26definitions = definitions
27 .concat(jsdocParse.cliOptions.map(function (def) {
28 def.group = 'jsdocParse'
29 return def
30 }))
31 .concat(dmd.cliOptions.map(function (def) {
32 def.group = 'dmd'
33 return def
34 }))
35
36var usageSections = [
37 {
38 header: 'jsdoc-to-markdown',
39 content: 'Markdown API Documentation generator.'
40 },
41 {
42 header: 'Synopsis',
43 content: [
44 '$ jsdoc2md [options] [bold]{--src} [underline]{file} ...',
45 '$ jsdoc2md [bold]{--help}',
46 '$ jsdoc2md [bold]{--config}',
47 '$ jsdoc2md [bold]{--stats} [underline]{file} ...',
48 '$ jsdoc2md [bold]{--json} [underline]{file} ...'
49 ]
50 },
51 {
52 header: 'General options',
53 optionList: definitions,
54 group: 'jsdoc2md'
55 },
56 {
57 header: 'jsdoc-parse options',
58 content: 'These options affect how the javascript source is parsed.'
59 },
60 {
61 optionList: definitions,
62 group: 'jsdocParse',
63 },
64 {
65 header: 'dmd options',
66 content: 'These options affect how the markdown output looks.'
67 },
68 {
69 optionList: definitions,
70 group: 'dmd'
71 },
72 {
73 content: [
74 {
75 one: 'Project repositories:',
76 two: '[underline]{https://github.com/jsdoc2md/jsdoc-to-markdown}'
77 }, {
78 one: '',
79 two: '[underline]{https://github.com/jsdoc2md/jsdoc-parse}'
80 }, {
81 one: '',
82 two: '[underline]{https://github.com/jsdoc2md/dmd}'
83 }
84 ]
85 }
86]
87
88exports.definitions = definitions
89exports.usage = usageSections