-
Notifications
You must be signed in to change notification settings - Fork 152
Create a README template
Lloyd Brookes edited this page Oct 9, 2016
·
1 revision
jsdoc2md currently uses handlebars to generate the output. The partials and helpers involved in creating the output are managed by the dmd project.
The default template content is simply '{{>main}}'
, which renders the output of this handlebars partial. So, a README template could be created by dropping {{>main}}
into your standard README structure. Step by step tutorial:
1. Create a file name README.hbs with this content.
[![view on npm](http://img.shields.io/npm/v/example.svg)](https://www.npmjs.org/package/example)
{{>main}}
* * *
© 1942-2016 Muhammad Ali
2. Write some documented source code, e.g.
/**
* A module for adding two values.
* @module add-two-values
*/
/**
* Add two values.
* @alias module:add-two-values
*/
function add (a, b) {
return a + b
}
module.exports = add
3. Use the custom template by passing its filename to the --template
option:
$ jsdoc2md --template README.hbs --files example.js
4. Output:
A module for adding two values.
Add two values.
Kind: Exported function
© 1942-2016 Muhammad Ali
- 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