-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent-template.ejs
67 lines (66 loc) · 3.07 KB
/
content-template.ejs
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<% var curGroup; %>
<% apiData.forEach(function(data) { %>
<% if (curGroup !== data.group) { curGroup = data.group; %><h5 class="clear-fix" id="<%= curGroup.toLowerCase() %>"><%= curGroup %></h5> <% } %>
<h6 class="clear-fix" id="<%= data.name.toLowerCase() %>"><%= data.group %> - <%= data.title %> <pre class="code-block <%= data.type.toLowerCase() %>"><%= data.type %></pre><a class="back-to-top" href="#top"><i class="fa fa-arrow-up"> <span>Back to Top</span></i></a></h6>
<p><%= data.description.replace('</p>', '').replace('<p>', '').trim() %></p>
<% if (data.permission) { %>
<p><strong>Permissions:</strong> <%= data.permission[0].name %></p>
<% } %>
<pre class="code-block padded-alt twelve columns">/api<%= data.url %></pre>
<% if (data.parameter) { var keys = Object.keys(data.parameter.fields); %>
<% keys.forEach(function(paramKey) { %>
<strong><%= paramKey %></strong>
<table>
<tr>
<th>Field</th>
<th>Type</th>
<th>Description</th>
</tr>
<% data.parameter.fields[paramKey].forEach(function(row) { %>
<tr>
<td><%= row.field %><% if (row.optional) { %> <pre class="code-block">optional</pre><% } %></td>
<td><%= row.type.replace('</p>', '').replace('<p>', '').trim() %></td>
<td><%= row.description.replace('</p>', '').replace('<p>', '').trim() %></td>
</tr>
<% }) %>
</table>
<% }) %>
<% } %>
<% if (data.success) { var keys = Object.keys(data.success.fields); %>
<% keys.forEach(function(paramKey) { %>
<strong><%= paramKey %></strong>
<table>
<tr>
<th>Field</th>
<th>Type</th>
<th>Description</th>
</tr>
<% data.success.fields[paramKey].forEach(function(row) { %>
<tr>
<td><%= row.field %><% if (row.optional) { %> <pre class="code-block">optional</pre><% } %></td>
<td><%= row.type.replace('</p>', '').replace('<p>', '').trim() %></td>
<td><%= row.description.replace('</p>', '').replace('<p>', '').trim() %></td>
</tr>
<% }) %>
</table>
<% }) %>
<% } %>
<% if (data.error) { var keys = Object.keys(data.error.fields); %>
<% keys.forEach(function(paramKey) { %>
<strong><%= paramKey %></strong>
<table>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
<% data.error.fields[paramKey].forEach(function(row) { %>
<tr>
<td><%= row.field %><% if (row.optional) { %> <pre class="code-block">optional</pre><% } %></td>
<td><%= row.description.replace('</p>', '').replace('<p>', '').trim() %></td>
</tr>
<% }) %>
</table>
<% }) %>
<% } %>
<br /><br />
<% }) %>