@@ -8,13 +8,17 @@ All submissions are welcome. To submit a change, fork this repo, commit your cha
88
99Ruby 1.9 is required to build the site.
1010
11- Get the nanoc gem, plus kramdown for markdown parsing:
11+ Get the nanoc gem, plus kramdown for Markdown parsing:
1212
13- bundle install
13+ ``` sh
14+ $ bundle install
15+ ```
1416
1517You can see the available commands with nanoc:
1618
17- nanoc -h
19+ ``` sh
20+ $ bundle exec nanoc -h
21+ ```
1822
1923Nanoc has [ some nice documentation] ( http://nanoc.ws/docs/tutorial/ ) to get you started. Though if you're mainly concerned with editing or adding content, you won't need to know much about nanoc.
2024
@@ -27,29 +31,35 @@ API docs should look like:
2731
2832 # API title
2933
34+ * TOC
35+ {:toc}
36+
3037 ## API endpoint title
3138
32- [VERB] /path/to/endpoint.json
39+ [VERB] /path/to/endpoint
3340
3441 ### Parameters
3542
36- name
37- : description
43+ Name | Type | Description
44+ -----|------|--------------
45+ `name`|`type` | Description.
3846
39- ### Input (request json body)
47+ ### Input (request JSON body)
4048
41- <%= json :field => "sample value" %>
49+ Name | Type | Description
50+ -----|------|--------------
51+ `name`|`type` | Description.
4252
4353 ### Response
4454
45- <%= headers 200, :pagination => true , 'X-Custom-Header' => "value" %>
55+ <%= headers 200, :pagination => default_pagination_rels , 'X-Custom-Header' => "value" %>
4656 <%= json :resource_name %>
4757
4858** Note** : We're using [ Kramdown Markdown extensions] ( http://kramdown.rubyforge.org/syntax.html ) , such as definition lists.
4959
5060### JSON Responses
5161
52- We specify the JSON responses in ruby so that we don't have to write
62+ We specify the JSON responses in Ruby so that we don't have to write
5363them by hand all over the docs. You can render the JSON for a resource
5464like this:
5565
@@ -67,57 +77,67 @@ Some actions return arrays. You can modify the JSON by passing a block:
6777
6878### Terminal blocks
6979
70- You can specify terminal blocks with ` pre.terminal ` elements. It'd be
71- nice if Markdown could do this more cleanly...
80+ You can specify terminal blocks with ` pre.terminal ` elements. ( It'd be
81+ nice if Markdown could do this more cleanly.)
7282
73- <pre class="terminal">
74- $ curl foobar
75- ....
76- </pre>
83+ ``` html
84+ <pre class =" terminal" >
85+ $ curl foobar
86+ ....
87+ </pre >
88+ ```
7789
78- This isn't a ` curl ` tutorial though, I'm not sure every API call needs
90+ This is not a ` curl ` tutorial though. Not every API call needs
7991to show how to access it with ` curl ` .
8092
8193## Development
8294
8395Nanoc compiles the site into static files living in ` ./output ` . It's
8496smart enough not to try to compile unchanged files:
8597
86- $ nanoc compile
87- Loading site data...
88- Compiling site...
89- identical [0.00s] output/css/960.css
90- identical [0.00s] output/css/pygments.css
91- identical [0.00s] output/css/reset.css
92- identical [0.00s] output/css/styles.css
93- identical [0.00s] output/css/uv_active4d.css
94- update [0.28s] output/index.html
95- update [1.31s] output/v3/gists/comments/index.html
96- update [1.92s] output/v3/gists/index.html
97- update [0.25s] output/v3/issues/comments/index.html
98- update [0.99s] output/v3/issues/labels/index.html
99- update [0.49s] output/v3/issues/milestones/index.html
100- update [0.50s] output/v3/issues/index.html
101- update [0.05s] output/v3/index.html
102-
103- Site compiled in 5.81s.
104-
105- You can setup whatever you want to view the files. If you have the adsf
106- gem, however (I hope so, it was in the Gemfile), you can start Webrick:
107-
108- $ nanoc view
109- $ open http://localhost:3000
98+ ``` sh
99+ $ bundle exec nanoc compile
100+ Loading site data...
101+ Compiling site...
102+ identical [0.00s] output/css/960.css
103+ identical [0.00s] output/css/pygments.css
104+ identical [0.00s] output/css/reset.css
105+ identical [0.00s] output/css/styles.css
106+ identical [0.00s] output/css/uv_active4d.css
107+ update [0.28s] output/index.html
108+ update [1.31s] output/v3/gists/comments/index.html
109+ update [1.92s] output/v3/gists/index.html
110+ update [0.25s] output/v3/issues/comments/index.html
111+ update [0.99s] output/v3/issues/labels/index.html
112+ update [0.49s] output/v3/issues/milestones/index.html
113+ update [0.50s] output/v3/issues/index.html
114+ update [0.05s] output/v3/index.html
115+
116+ Site compiled in 5.81s.
117+ ```
118+
119+ You can setup whatever you want to view the files. If using the adsf
120+ gem (as listed in the Gemfile), you can start Webrick:
121+
122+ ``` sh
123+ $ bundle exec nanoc view
124+ $ open http://localhost:3000
125+ ```
110126
111127Compilation times got you down? Use ` autocompile ` !
112128
113- $ nanoc autocompile
129+ ``` sh
130+ $ bundle exec nanoc autocompile
131+ ```
114132
115133This starts a web server too, so there's no need to run ` nanoc view ` .
116134One thing: remember to add trailing slashes to all nanoc links!
117135
118136## Deploy
119137
120- $ rake publish
138+ ``` sh
139+ $ bundle exec rake publish
140+ ```
121141
122142## TODO
123143
0 commit comments