Restapi.Templates.Index = _.template( " \
<%= docs.info %>
\ <% _.each(docs.resources, function(api) { %> \

<%= api.name %>
<%= api.short_description %>

\ \ \ \ <% _.each(api.methods, function(m) { %> \ <% _.each(m.apis, function(api) { %> \ \ \ \ \ <% }) %>\ <% }) %> \ \
ResourceDescription
<%= api.http_method %> <%= api.api_url %><%= api.short_description %>
\ <% }) %>"); Restapi.Templates.Resource = _.template( " \ \ <% if(resource.full_description != '') { %> \
<%= resource.full_description %>
\ <% } %> \
\ <% _.each(resource.methods, function(m) { %> \
\ \
\ <% _.each(m.apis, function(api) { %> \

\ \ <%= api.http_method %> <%= api.api_url %> \
\ <%= api.short_description %> \

\ <% }) %> \
\
\ <%= m.full_description %> \ <% if(m.errors != '') { %> \

Errors

\ <% _.each(m.errors, function(err) { %> \ <%= err.code %> \ <%= err.description %> \
\ <% }) %> \ <% } %> \ <% if(m.params != ''){ %> \

Params

\ \ \ \ <% _.each(m.params, function(val) { %> \ \ \ <% }) %> \ \
Param nameDescription
<%= val.name %>
\ <%= val.required ? 'required' : 'optional' %>
<%= val.description %>
\ <% if(val.validator != ''){ %> Value: <%= val.validator %><% } %> \
\ <% } %> \
\
\ <% }) %>
"); Restapi.Templates.Method = _.template( " \ <% _.each(method.apis, function(api) { %> \ \ <% }) %> \
\ <%= method.full_description %> \ <% if(method.errors != '') { %> \

Errors

\ <% _.each(method.errors, function(err) { %> \ <%= err.code %> \ <%= err.description %> \
\ <% }) %> \ <% } %> \ <% if(method.params != ''){ %> \

Params

\ \ \ \ <% _.each(method.params, function(val) { %> \ \ \ \ \ <% }) %> \ \
Param nameDescription
\ <%= val.name %>
\ <%= val.required ? 'required' : 'optional' %> \
\ <%= val.description %>
\ <% if(val.validator != ''){ %> Value: <%= val.validator %><% } %> \
\ <% } %> \
");