-
Notifications
You must be signed in to change notification settings - Fork 16
/
docs-index.html
52 lines (47 loc) · 1.62 KB
/
docs-index.html
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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Lime Elements Documentation</title>
<script src="versions.js"></script>
</head>
<body>
<h1>Lime Elements Documentation</h1>
<p>
<a href="https://github.com/Lundalogik/lime-elements/blob/main/CHANGELOG.md">CHANGELOG</a>
</p>
<section id="versions"></section>
<script>
var body = document.getElementById('versions');
window.versions.sort(function(a, b) {
a = a.split('.');
b = b.split('.');
if (a[0] !== b[0]) {
return +b[0] - +a[0];
}
if (a[1] !== b[1]) {
return +b[1] - +a[1];
}
if (a[2] !== b[2]) {
if (a[2].substring(0, 1) !== b[2].substring(0,1)) {
return +b[2].substring(0, 1) - +a[2].substring(0, 1);
}
return b[2].substring(0, 1) > a[2].substring(0, 1) ? 1 : -1;
}
});
createLink(`versions/latest/`, 'Latest Release');
window.versions.forEach(function(version, index) {
createLink(`versions/${version}/`, version);
});
function createLink(href, text) {
var link = document.createElement('a');
link.href = href;
link.appendChild(document.createTextNode(text));
body.appendChild(link);
body.appendChild(document.createElement('br'));
}
</script>
</body>
</html>