项目作者: smartlogic

项目描述 :
Rspec Api Documentation Browser
高级语言: JavaScript
项目地址: git://github.com/smartlogic/raddocs.git
创建时间: 2012-04-23T22:20:38Z
项目社区:https://github.com/smartlogic/raddocs

开源协议:MIT License

下载


Travis status
Inline Docs

Raddocs

Raddocs is a browser for JSON outputted by the rspec_api_documentation gem.

Install

Gemfile

  1. gem 'raddocs'

config/routes.rb

  1. mount Raddocs::App => "/docs"

Make sure RspecApiDocumentation is generating JSON:

spec/spec_helper.rb

  1. RspecApiDocumentation.configure do |config|
  2. config.format = :json
  3. end

Configuration

config/initializers/raddocs.rb

  • api_name - Name of the API on the example index page
  • docs_dir - where the JSON output from rspec_api_documentation is located
  • docs_mime_type - if you use the middleware, what mime type are you serving your docs as, must be a regex. eg: /text\/vnd.org.oestrich.raddocs\+plain/
  • include_bootstrap - Boolean to disable including bootstrap if you are using your own css
  • external_css - Array of css files to include, with a full URL to them
  • url_prefix - Optional prefix to insert before URLs generated by Raddocs
  1. Raddocs.configure do |config|
  2. config.docs_dir = "doc/api"
  3. end

Custom CSS

You can include extra css by the config option external_css or add a directory to the docs dir named styles. Every css file in the styles dir will be included as a link element on all pages.