An open API service indexing awesome lists of open source software.

https://github.com/magloft/grape-docs

grape-docs automagically generates documentation for your Grape API in various formats.
https://github.com/magloft/grape-docs

documentation grape grape-api grape-swagger markdown

Last synced: 3 months ago
JSON representation

grape-docs automagically generates documentation for your Grape API in various formats.

Awesome Lists containing this project

README

          

# grape-docs

> Automatically generate markdown documentation from your grape API

## Description

grape-docs automagically generates documentation for your Grape API in various formats.

The Gem will automatically analyze your Grape API structure, mounts, namespaces and routes, and will build a markdown documentation in separate files.

It's best used combined with [GitBook](https://www.gitbook.com) and [gitbook-plugin-api](https://github.com/MagLoft/gitbook-plugin-api) to transform your markdown documentation into a good-looking and browsable API navigation.

## Installation

Install globally using `gem install grape-docs` or include it in your project Gemfile:

```ruby
source 'http://rubygems.org'

gem 'grape-docs'
```

## Usage

Run the `grape-docs export` command to export your documentation from within your Grape API project directory:

```
Usage:
grape-docs export

Arguments:
# Constant name of your Grape API, e.g. MyApp::Api
# Directory / path where the markdown documentation will be generated in

Options:
-h, [--host=HOST] # API Host
# Default: https://api.example.com/
-t, [--template=TEMPLATE] # Markdown template (default, gitbook) or custom (requires .md.erb extension)
# Default: default
-r, [--require=REQUIRE] # Ruby environment require path
# Default: config/environment.rb

Export documentation of API named to directory
```

## Result

| Template `default` | Template `gitbook` |
| :----------------------------------------------------------------------: | :----------------------------------------------------------------------: |
| ![default](http://cdn.magloft.com/marketing/gems/grape-docs/default.png) | ![gitbook](http://cdn.magloft.com/marketing/gems/grape-docs/gitbook.png) |

## License

grape-docs is available under an MIT-style license.