Project

grape-docs

0.0
No commit activity in last 3 years
No release in over 3 years
grape-docs automagically generates documentation for your Grape API in various formats.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.10
~> 0.49

Runtime

< 6.0, >= 4.0
< 2.0, >= 1.3.0
~> 0.2
~> 1.0
 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 and 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:

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 <api_name> <export_path>

Arguments:
  <api_name>                 # Constant name of your Grape API, e.g. MyApp::Api
  <export_path>              # 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 <api_name> to <export_path> directory

Result

Template default Template gitbook
default gitbook

License

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