-
Notifications
You must be signed in to change notification settings - Fork 151
How to document ES2017 features
Lloyd Brookes edited this page Jan 22, 2018
·
2 revisions
IMPORTANT: This page is only relevant if you use an old version of jsdoc2md. Beginning in jsdoc2md v4, ES2017 is supported natively.
To document code using async
and await
you will need these modules:
- https://github.com/ctumolosus/jsdoc-babel
- http://babeljs.io/docs/plugins/preset-es2015/
- http://babeljs.io/docs/plugins/transform-async-to-generator/
1. Install them:
`$ npm i jsdoc-babel babel-preset-es2015 babel-plugin-transform-async-to-generator --save-dev`
2. Create this jsdoc config file:
{
"plugins": ["node_modules/jsdoc-babel"],
"babel": {
"presets": [ "es2015" ],
"plugins": [ "transform-async-to-generator" ]
}
}
3. Run jsdoc2md like this: (use --conf
for jsdoc2md@^1)
$ jsdoc2md --configure jsdoc.json lib/your-code.js
- Home
- How jsdoc2md works
- Additional jsdoc tags supported
- Cherry picking which documentation appears in output
- Showcase ...
- Create ...
- How To ...
- How to use with npm run
- How to use with gulp
- How to create one output file per class
- How to document a AMD module
- How to document a CommonJS module (exports)
- How to document a CommonJS module (module.exports)
- How to document an ES2015 module (multiple named exports)
- How to document an ES2015 module (single default export)
- How to document Promises (using custom tags)
- How to document a ToDo list
- How to document ES2017 features
- How to document TypeScript
- The @typicalname tag
- Linking to external resources
- Param list format options
- Listing namepaths
- Troubleshooting