Skip to content

Repository files navigation

remark-openapi

NPMTravis CIMIT License

A remark plugin that converts a link to a local or remote open api spec into a table with summary of all paths.

This project is inspired by remark-swagger. It borrows some code in table generation from remark-swagger.

Installation

$ npm install remark-openapi

Usage

This plugin is to be used with remark, e.g.

varvfile=require('to-vfile');varremark=require('remark');varopenapi=require('remark-openapi');varexample=vfile.readSync('example.md');remark().use(openapi).process(example,function(err,file){if(err)throwerr;console.log(String(file));});

This plugin does a conversion when the markdown file contains a link to a local open api spec file

[API Reference](../assets/petstore-open-api.json"openapi:")

or a remote open api spec file

[API Reference](https://temando.github.io/open-api-renderer/petstore-open-api-v3.0.0-RC2.json"openapi:")

The above will be converted to the following table:

# swagger link| Path | Method | Summary || ----- | ------ | -------------------------- || /pet | POST | Add a new pet to the store || /pet | PUT | Update an existing pet || /user | POST | Create user |

About

Remark plugin that converts a link to a local or remote OpenAPI spec into a table with summary of all paths

Topics

Resources

Stars

2 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages