Pipe multiple files into dox at once.
The original dox
CLI tool reads a single source from stdin:
$ dox < utils.js
...JSON...
This simple idea gets complicated in a multi-file project. Here are your options:
- Concat files before piping them to
dox
:
$ cat source/*.js | dox
...LINE NUMBERS LOST...
- Concat
dox
output:
$ for file in source/*.js; do dox $file; done
...NOT VALID JSON...
- Wild hacks.
But worry no more! Now you have polydox
:
$ polydox source/*.js
[
{
// …usual dox output, plus one property:
"sourceFile": "source/a.js"
},
{
// …
"sourceFile": "source/b.js"
}
]
$ npm install --global polydox
SYNOPSIS
Usage: polydox [options] <file>...
OPTIONS
-h --help Print a short synopsis (-h) or this usage info (--help)
-r --raw Don’t preprocess stuff with markdown
EXAMPLES
$ polydox a.js
$ polydox --raw a.js b.js c.js > dox-output.json
$ polydox source/*.js | doxie --render --inject into Readme.md