remark-swagger
Insert a swagger specification into a markdown file.
Installation
$ npm install remark-swagger
Example output
path | method | summary |
/foo/bar | GET | get all bars in the area |
/bin/baz | PUT | add a new baz to the region |
Usage
const swagger = const remark = const fs = const spec = fsconst readme = fs const res = processstdout
CLI
Usage: remark-swagger [options] <markdown> [swagger] Options: -h, --help Output usage information -v, --version Output version number -y, --yaml Use swagger YAML instead of JSON -p, --position Heading position, defaults to 4 -t, --title Heading title, defaults to API -w, --write Persist changes to markdown file Examples: $ remark-swagger README.md swagger.json # Inject swagger into markdown $ remark-swagger README.md < swagger.json # Inject swagger into markdown Docs: https://github.com/yoshuawuyts/remark-swaggerBugs: https://github.com/yoshuawuyts/remark-swagger/issues
API
remarkSwagger
- opts.yaml: parse a yaml string
- opts.json: parse a JSON string
- opts.position: header position to insert the table. Defaults to 3
- opts.title: header title for the table. Defaults to
'API'
.