forked from fmiopensource/rapi_doc
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathREADME
45 lines (35 loc) · 1.41 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Based on RAPI Doc by Jaap van der Meer found here: http://code.google.com/p/rapidoc/
Rails Api Doc Generator
Original Author: JPM van der Meer
Modified By: Chelsea Robb
=======================
With API DOC one can generate code for a Restful Rails API.
It generates a set of HTML views in the public directory. Parses the desired controllers and generates appropriate views.
Currently does not read routes.rb and requires manual entry of routes
=INSTALL
script/plugin install git://github.com/fmiopensource/rapi_doc
==Templates
Templates can be used for tuning your method generation and index.html.erb.
==Structure
In the structure folder one can setup some additional views to be used for the apidoc controller generator.
==Usage
Create a documentation.yml inside your config directory. In this config file specify the controllers you wish to
generate documentation for in the following format:
users:
location: "/users"
controller_name: "users_controller.rb"
Then invoke the generation by calling:
rake rapi_doc
==Documentation Example
=begin apidoc
url:: /users
method:: GET
access:: FREE
return:: [JSON|XML] - list of user objects
param:: page:int - the page, default is 1
param:: per_page:int - max items per page, default is 10
Get a list of all users in the system with pagination. Defaults to 10 per page
=end
=======================
TODO - Make class documentation work
- Write tests and make them work