Apitome

Gem Version Dependency Status Build Status Code Climate Test Coverage License

Apitome is a API documentation tool for Rails built on top of the great rspec DSL included in rspec_api_documentation (RAD). It's designed to display the documentation generated by RAD in either a single page (with scrollspy), or on individual pages, and uses Bootstrap3 for most of the basic styling and highlight.js for code highlighting.

You can provide a markdown file that will be displayed as the README page, and by taking advantage of its modular view structure you can override any number of views and partials to customize the output. You can also specify custom css and javascript if you want to do fancier things or change how it looks.

Installation

Add it to your Gemfile.

gem "apitome"

Optionally run the install generator to get the initializer and an initial readme file (doc/api.md).

rails generate apitome:install

Update your spec_helper.rb to adjust how RAD outputs its results -- Apitome reads these JSON files to generate the documentation.

RspecApiDocumentation.configure do |config|
  config.format = :json
end

Usage

You can view your documentation at the default api/docs route.

Configuration

When you install Apitime an initializer file (app/config/initializers/apitome.rb) is generated that contains good documentation for each configuration directive. Otherwise you can get a refresher by checking the Apitome Configuration article.

Customization

You can put custom views and partials in your own views/apitome/docs -- check the repo here for examples. You can put any partial in your own path and they will be overridden.

Additional customization can come in the form of providing custom css and javascript. You can do this by creating the files you want (that often times require the default assets in the gem), and then configure Apitome to use those instead of the defaults.

License

Licensed under the MIT License

Copyright 2013 Mode Set

Make Code Not War

crest