Skip to content


Subversion checkout URL

You can clone with
Download ZIP
100644 18 lines (14 sloc) 1.28 KB
09515bb @zzen Added LICENSE and README files
zzen authored
1 This repository lists language templates used to power code samples in Apiary's API Documentations. Please feel free to contribute your own languages or improve the existing ones.
3 ## Interface
ec7f9d9 @zzen A bit more README
zzen authored
5 The HTML templates are written in [Eco](, which places data between `<%=` and `%>` tags and control structures between `<%` and `%>`. The following are variables and helper methods you can use when rendering the code for a request:
09515bb @zzen Added LICENSE and README files
zzen authored
7 - **@headers** - HTTP headers to be sent
8 - **@body** - HTTP body to be sent
9 - **@method** - HTTP method used in the request
10 - **@url** - URL of the request, relative to the root of the server (starting with '/')
11 - **@apiUrl** - Hostname of the API mock/proxy server (including http/https, not including trailing '/')
12 - **@contentType** - A shorthand for `@headers['content-type']`
13 - **@helpers.escape** - escape `"` (double-quote) characters
14 - **@helpers.rubyKey** - helper that produces `content_type` out of `Content-Type`
15 - **@helpers.getContentType(headers)** - same as `@contentType` but in form of a function you can pass any array of headers
16 - **@helpers.getContentTypeBrush(headers)** - produces a CSS class that enabled syntax-highlighting for this language
17 - **@helpers.isNotEmpty** (obj) - same like `[].length != 0` for objects (hash maps)
Something went wrong with that request. Please try again.