-
Notifications
You must be signed in to change notification settings - Fork 1
/
docs.jade
194 lines (193 loc) · 9.18 KB
/
docs.jade
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
doctype html
html
head
meta(charset='utf-8')
title #{title}
body
link(href='https://fonts.googleapis.com/css?family=Inconsolata:400,700', rel='stylesheet', type='text/css')
link(href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css', rel='stylesheet', integrity='sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7', crossorigin='anonymous')
style.
body {
font-family: 'Inconsolata', sans-serif;
font-size: 16px;
}
ul {
width: 300px;
margin: 20px;
}
code {
color: #{code.color};
background-color: #{code.backgroundColor};
}
.table-static {
margin-bottom:10px;
}
thead th {
color: #{thead.th.color};
background-color: #{thead.th.backgroundColor};
}
th {
background-color: #91A0AC;
}
td {
background-color: #C3C6C8;
}
.nav-sidebar {
position: fixed;
height: 100%;
padding-bottom: 40px;
border-right: 1px solid #ddd;
overflow: auto;
overflow-x: hidden;
}
.side-nav.nav > li.nav-header > a {
cursor: default;
font-size: 12px;
font-weight: bold;
text-transform: uppercase;
}
.side-nav > ul.nav > li > a:hover {
width: 250px;
}
ul.nav.nav-tabs.nav-justified {
margin-left: 0px;
}
.json-markup {
padding: 1em 2em;
white-space: pre;
color: #{jsonMarkup.color};
background-color: #{jsonMarkup.backgroundColor};
}
.json-markup-key {
font-weight: bold;
}
.json-markup-bool {
color: #{jsonMarkup.boolean.color};
}
.json-markup-string {
color: #{jsonMarkup.string.color};
}
.json-markup-null {
color: #{jsonMarkup.null.color};
}
.json-markup-number {
color: #{jsonMarkup.number.color};
}
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
display: none !important;
}
.loading {
position: fixed;
top: 40%;
left: 45%;
}
div(ng-app='app')
h1(ng-show, class="loading") Loading...
.container-fluid(ng-cloak='', ng-controller='controller', ng-init='init({"schema": #{schema}})')
.row
nav.col-sm-3.col-md-2.nav-sidebar
.container
ul.side-nav.nav.nav-pills.nav-stacked
li.nav-header
a(href='#top') Top of Page
span(ng-repeat='item in sidebarItems')
ul.side-nav.nav.nav-pills.nav-stacked
li.nav-header {{item.name}}
li(ng-repeat='subResource in item.subResources')
a(href='#{{subResource.method}}{{subResource.uri}}') {{subResource.name}}
.row
.col-sm-9.col-sm-offset-3.col-md-10.col-md-offset-2(id='/top')
br
h1 #{title}
br
.row(ng-repeat='resource in resources track by $index')
.col-xs-12
h2 {{resource.resource}}
h4(ng-if='resource.description') {{resource.description}}
div(ng-repeat='item in resource', ng-if='item.properties || item.anyOf')
hr(id='/{{item.method}}{{item.uri}}')
h4 {{item.name}}
p
strong
| {{item.method}}
strong
code {{item.uri}}
span(ng-if='item.headers', ng-init='item=item.headers')
br
h4 Headers
span(ng-include='', src="'table.tpl'")
br
h4 Parameters
span(ng-if="item.anyOf")  => Any Of The Formats Below Are Permitted
span(ng-if="item.anyOf")
span(ng-repeat="i in item.anyOf" ng-init="item=i" ng-include='', src="'table.tpl'")
span(ng-if="!item.anyOf" ng-include='', src="'table.tpl'")
span(ng-if='item.response', ng-init='item=item.response')
br
h4 Response Success Format
span(ng-include='', src="'table.tpl'")
.row(ng-if='item.examples')
.col-xs-12
h4 Examples
uib-tabset(justified='true')
uib-tab(ng-repeat='example in item.examples', heading=' {{example.status.type}} : {{example.status.code}}')
div(ng-bind-html='htmlifyJSON(example.properties)')
hr
script(type='text/ng-template', id='table.tpl').
<table ng-if="item.type === 'object' && item.properties" class="table table-bordered table-static">
<thead>
<tr>
<th>Field</th>
<th>Type</th>
<th>Meta</th>
<th>Description</th>
</tr>
</thead>
<tr ng-if="item.properties" ng-repeat="(prop, spec) in item.properties">
<th>{{prop}} <span ng-if="spec.required" class="small">(required)</span></th>
<td ng-bind-html="formatType(spec)"></td>
<td><span ng-include src="'meta.tpl'"></span></td>
<td>{{spec.description}}</td>
</tr>
</table>
<table ng-if="item.type !== 'object'" class="table table-bordered table-static">
<thead>
<tr>
<th>Type</th>
<th>Meta</th>
<th>Description</th>
</tr>
</thead>
<tr>
<td ng-bind-html="formatType(item)"></td>
<td ng-bind-html="formatNonObjSpecMeta(item)"></td>
<td>{{item.description}}</td>
</tr>
</table>
script(type='text/ng-template', id='meta.tpl').
<span ng-if="spec.anyOf" ng-repeat="item in spec.anyOf">
<span ng-if="item.properties" ng-include='', src="'table.tpl'"></span>
<span ng-if="!item.properties" ng-include='', ng-init="spec=item" src="'meta.tpl'"></span>
</span>
<span ng-if="spec.type === 'array' && spec.items.length">
<p ng-bind-html="formatSpecMeta(spec)"></p>
<p>Allowed Formats</p>
<span ng-repeat="item in spec.items" ng-include src="'table.tpl'"></span>
</span>
<span ng-if="spec.type === 'array' && !spec.items.length">
<p ng-bind-html="formatSpecMeta(spec)"></p>
<p>Allowed Format</p>
<span ng-include src="'table.tpl'" ng-init="item=spec.items"></span>
</span>
<span ng-if="spec.type === 'object'" ng-include src="'table.tpl'" ng-init="item=spec"></span>
<span ng-if="spec.type !== 'array' && spec.type !== 'object' && !spec.anyOf" ng-bind-html="formatSpecMeta(spec)"></span>
</span>
br
script(src='https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.3/angular.js')
script(src='https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.3/angular-sanitize.min.js')
script(src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.9.0/lodash.min.js')
script(src='https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js')
script(src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js', integrity='sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS', crossorigin='anonymous')
script(src='https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/1.3.1/ui-bootstrap.js')
script(src='https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/1.3.2/ui-bootstrap-tpls.min.js')
script(src='bundle.js')</script></body></html>