APIDoc-MD
Generate API documentation for your README from comments in your source-code. Uses apiDoc.
Usage
- add comments of the following format to routes in your codebase:
/** * @api * @apiName GetCustomer * @apiGroup Stripe * * @apiParam * * @apiSuccess * @apiSuccess * @apiSuccess * @apiSuccess * @apiSuccess * @apiSuccess * * @apiError CustomerNotFound a customer for this npm user does not yet exist. */ {}
- rename your README.md to README.md.mustache
- add the following template code to README.md.mustache
{{#each api}}## {{@key}} {{#each this}}### {{type}} {{url}} {{title}} {{#each parameters}}{{#if @first}}**Parameters** {{/if}}* **`{{{type}}}` {{field}}:** {{{description}}}{{#if @last}} {{/if}}{{/each}}{{#each success}}{{#if @first}}**Response** {{/if}}* **`{{{type}}}` {{field}}:** {{{description}}}{{#if @last}} {{/if}}{{/each}}{{#each error}}{{#if @first}}**Error** {{/if}}* **{{field}}:** {{{description}}}{{#if @last}} {{/if}}{{/each}}{{/each}}{{/each}}
- add a script to your package.json that looks something like this.