Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/smartlogic/raddocs
Rspec Api Documentation Browser
https://github.com/smartlogic/raddocs
api documentation rspec ruby
Last synced: 2 months ago
JSON representation
Rspec Api Documentation Browser
- Host: GitHub
- URL: https://github.com/smartlogic/raddocs
- Owner: smartlogic
- License: mit
- Created: 2012-04-23T22:20:38.000Z (over 12 years ago)
- Default Branch: main
- Last Pushed: 2023-03-23T06:32:18.000Z (almost 2 years ago)
- Last Synced: 2024-10-31T09:36:51.863Z (3 months ago)
- Topics: api, documentation, rspec, ruby
- Language: JavaScript
- Size: 235 KB
- Stars: 72
- Watchers: 9
- Forks: 50
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - smartlogic/raddocs - Rspec Api Documentation Browser (ruby)
README
[![Travis status](https://secure.travis-ci.org/smartlogic/raddocs.svg)](https://secure.travis-ci.org/smartlogic/raddocs)
[![Inline Docs](http://inch-ci.org/github/smartlogic/raddocs.png)](http://inch-ci.org/github/smartlogic/raddocs)# Raddocs
Raddocs is a browser for JSON outputted by the [rspec_api_documentation](http://github.com/zipmark/rspec_api_documentation) gem.
## Install
`Gemfile`
```ruby
gem 'raddocs'
````config/routes.rb`
```ruby
mount Raddocs::App => "/docs"
```Make sure RspecApiDocumentation is generating JSON:
`spec/spec_helper.rb`
```ruby
RspecApiDocumentation.configure do |config|
config.format = :json
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```ruby
Raddocs.configure do |config|
config.docs_dir = "doc/api"
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.