Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

apidoc-md

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apidoc-md

generate API documentation for your README from comments in your source-code

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by50%
Maintainers
1
Weekly downloads
 
Created
Source

APIDoc-MD

Generate API documentation for your README from comments in your source-code. Uses apiDoc.

Usage

  1. add comments of the following format to routes in your codebase:
/**
 * @api {get} /stripe/:id fetch stripe customer
 * @apiName GetCustomer
 * @apiGroup Stripe
 *
 * @apiParam {String} id a username.
 *
 * @apiSuccess {String} status of paid stripe subscription.
 * @apiSuccess {Boolean} expired is the user's license expired.
 * @apiSuccess {String} email email associated with stripe subscription.
 * @apiSuccess {Integer} next_billing_date when will we next charge the card.
 * @apiSuccess {Integer} next_billing_amount how much will we next charge you.
 * @apiSuccess {Object} card object representing the user's credit-card
 *
 * @apiError CustomerNotFound a customer for this npm user does not yet exist.
 */
 function myAwesomeHandler() {}
  1. rename your README.md to README.md.mustache
  2. 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}}
  1. add a script to your package.json that looks something like this.
{
  "scripts": {
    "build-docs": "apidoc-md generate"
  }
}

Keywords

FAQs

Package last updated on 28 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc