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.
- Host: GitHub
- URL: https://github.com/magloft/grape-docs
- Owner: magloft
- Created: 2018-01-23T03:36:35.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-11T04:06:43.000Z (over 7 years ago)
- Last Synced: 2025-10-01T12:44:52.812Z (3 months ago)
- Topics: documentation, grape, grape-api, grape-swagger, markdown
- Language: Ruby
- Size: 13.7 KB
- Stars: 4
- Watchers: 0
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
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` |
| :----------------------------------------------------------------------: | :----------------------------------------------------------------------: |
|  |  |
## License
grape-docs is available under an MIT-style license.