This repository was archived by the owner on Sep 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdoc_many.html
More file actions
89 lines (82 loc) · 2.63 KB
/
doc_many.html
File metadata and controls
89 lines (82 loc) · 2.63 KB
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
<!DOCTYPE html>
<html>
<head>
<title>ReDoc Demo: Multiple apis</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet">
<style>
body {
margin: 0;
padding-top: 40px;
font-family: Montserrat, sans-serif;
}
nav {
position: fixed;
top: 0;
width: 100%;
z-index: 100;
}
#links_container {
margin: 0;
padding: 0;
background-color: #0033a0;
}
#links_container li {
display: inline-block;
padding: 10px;
color: white;
cursor: pointer;
}
</style>
</head>
<body>
<!-- Top navigation placeholder -->
<nav>
<ul id="links_container">
</ul>
</nav>
<redoc scroll-y-offset="body > nav"></redoc>
<script src="src/redocpro-standalone.min.js"></script>
<script>
// list of APIS
var apis = [
{
name: 'Users',
url: 'users/1-0.yaml'
},
{
name: 'Valuations',
url: 'valuations/1-2.yaml'
},
{
name: 'Domain (Shared)',
url: 'domain.yaml'
},
{
name: 'Full',
url: 'immoweb.yaml'
}
];
// initially render first API
RedocPro.init(apis[0].url);
function onClick() {
var url = this.getAttribute('data-link');
RedocPro.init(url);
}
// dynamically building navigation items
var $list = document.getElementById('links_container');
apis.forEach(function(api) {
var $listitem = document.createElement('li');
$listitem.setAttribute('data-link', api.url);
$listitem.innerText = api.name;
$listitem.addEventListener('click', onClick);
$list.appendChild($listitem);
});
RedocPro.init(
'users/1.0.yaml',
{"showConsole":true,"layout":{"scope":"section"},"theme":{"colors":{"text":{"primary":"#333333"}},"typography":{"headings":{"fontFamily":"Roboto"},"fontFamily":"Roboto, Verdana, Geneva, sans-serif","fontSize":"14px","code":{"fontFamily":"\"Courier New\",monospace","tokens":{"token.property":{"color":"#aofbaa"},"string":{"color":"#aofbaa"}}},"rightPanelHeading":{"color":"white"}},"rightPanel":{"backgroundColor":"#263238"},"links":{"color":"#6CC496"}},"redocURL":"src/redocpro-standalone.min.js","redocExport":"RedocPro","unstable_externalDescription":"description.md"},
document.getElementById("redoc_container")
);
</script>
</body>
</html>