Skip to content

Commit 23b10dd

Browse files
committed
Added new flag for swapping out the parser.
1 parent 334c673 commit 23b10dd

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ Options:
141141
-n, --name Sets name of project.
142142
-d, --description Sets description of project.
143143
-i, --ignore Comma separated list of paths to ignore.
144+
-l, --parser Parser used to parse the source files with. Defaults to jsdoc.
144145
-r, --renderer Renderer to generate the documentation with. Defaults to Markdown.
145146
-o, --output File to save documentation to. Defaults to stdout.
146147
-p, --package Sets location of package.json file.

packages/doxdox-cli/src/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Options:
3535
-n, --name Sets name of project.
3636
-d, --description Sets description of project.
3737
-i, --ignore Comma separated list of paths to ignore.
38+
-l, --parser Parser used to parse the source files with. Defaults to jsdoc.
3839
-r, --renderer Renderer to generate the documentation with. Defaults to Markdown.
3940
-o, --output File to save documentation to. Defaults to stdout.
4041
-p, --package Sets location of package.json file.
@@ -61,6 +62,9 @@ const overrideDescription = String(
6162
args.flags['-d'] || args.flags['--description'] || ''
6263
);
6364
const overrideIgnore = String(args.flags['-i'] || args.flags['--ignore'] || '');
65+
const overrideParser = String(
66+
args.flags['-l'] || args.flags['--parser'] || 'jsdoc'
67+
);
6468
const overrideRenderer = String(
6569
args.flags['-r'] || args.flags['--renderer'] || 'markdown'
6670
);
@@ -115,7 +119,7 @@ const overridePackage = String(
115119

116120
const loadedParser = await loadPlugin<
117121
(cwd: string, path: string) => Promise<File>
118-
>(nodeModulesDir, 'doxdox-parser-', 'jsdoc');
122+
>(nodeModulesDir, 'doxdox-parser-', overrideParser.toLowerCase());
119123

120124
const loadedRenderer = await loadPlugin<(doc: Doc) => Promise<string>>(
121125
nodeModulesDir,

0 commit comments

Comments
 (0)