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

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

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

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

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

Errors

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

Params

\ \ \ \ <% _.each(api.params, function(val) { %> \ \ \ <% }) %> \ \
Param nameDescription
<%= val.name %>
\ <%= val.required ? 'required' : 'optional' %>
<%= val.description %>
\ <% if(val.validator != ''){ %> Value: <%= val.validator %><% } %> \
\ <% } %> \
\
\ <% }) %>
"); Restapi.Templates.Method = _.template( " \ \
\ <%= 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 %><% } %> \
\ <% } %> \
");