This repo is a fork of https://github.com/esdoc/esdoc.
The main feature add is providing a Plugin-hook to extend/change ast-parsing for various doc types.
Example:
class Plugin {
onHandleDocClass(ev) {
const {type, Clazz, ParamParser} = ev.data;
if (ev.data.type === 'Class') {
ev.data.Clazz = class extends ev.data.Clazz {
/**
* change the parsing of @emits from:
* @emits <identifier> [description]
* to:
* @emits <type> <name> [-] [description]
*/
_$emits() {
const values = this._findAllTagValues(['@emits']);
if (!values) return;
this._value.emits = [];
for (const value of values) {
const {typeText, paramName, paramDesc} = ParamParser.parseParamValue(value);
const result = ParamParser.parseParam(typeText, paramName, paramDesc);
this._value.emits.push(result);
}
}
}
}
}
}
Installation
npm install --save-dev @proddi/esdoc
ESDoc is a documentation generator for JavaScript.
Please try it out!
- Generates good documentation.
- Measures documentation coverage.
- Integrate test codes into documentation.
- Integrate manual into documentation.
- Parse ECMAScript proposals.
- ESDoc Hosting Service
- ESDoc (self-hosting 😄)
- RxJS
- Sketch API
And more.
# Move to a your project directory.
cd your-project/
# Install ESDoc and standard plugin.
npm install --save-dev esdoc esdoc-standard-plugin
# Create a configuration file.
echo '{
"source": "./src",
"destination": "./docs",
"plugins": [{"name": "esdoc-standard-plugin"}]
}' > .esdoc.json
# Run ESDoc.
./node_modules/.bin/esdoc
# View a documentation
open ./docs/index.html
please visit esdoc.org to see more documentation.
MIT