Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.
/ redoc-rails Public archive

Rails wrapper gem for the awesome ReDoc Swagger documentation project https://github.com/Rebilly/ReDoc

License

Notifications You must be signed in to change notification settings

krsyoung/redoc-rails

Repository files navigation

ReDoc-Rails

A Ruby Gem wrapper for the ReDoc OpenAPI Specification dynamic documentation project: https://github.com/Rebilly/ReDoc/.

Gem Version

Installation

Add this line to your application's Gemfile:

gem 'redoc-rails'

And then execute:

$ bundle

Or install it yourself as:

$ gem install redoc-rails

Usage

Add this line to your application's assets/javascripts/application.js:

//= require ...
//= require redoc.min
//= require ...

Add the following to a web page:

  <redoc></redoc>

Add the following to the appropriate js/coffee file:

# Turbolinks 5
$(document).on 'turbolinks:load', ->
  Redoc.init('/swagger.yml', {})
  return

# vanilla JS
ready = ->
  Redoc.init('/swagger.yml', {})

$(document).ready(ready)
$(document).on('page:load', ready)

If you want detailed information on it usage, you can refer to original documentation.

https://github.com/Rebilly/ReDoc

Changelog

  • v1.22.2: bump, latest stable redoc plus update gems
  • v1.21.2: bump
  • v1.19.0: bump, stop shipping the unminified version to save space
  • v1.3.3 : bump
  • v1.3.2 : bump
  • v1.3.0 : initial version

Contributing

  1. Fork it ( https://github.com/[my-github-username]/redoc-rails/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

About

Rails wrapper gem for the awesome ReDoc Swagger documentation project https://github.com/Rebilly/ReDoc

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages