generated from peter-evans/swagger-github-pages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
119 lines (99 loc) · 3.2 KB
/
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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Blockscout Service Swaggers</title>
<!-- Bootstrap CSS -->
<link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet"
/>
<!-- Google Font -->
<link
href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap"
rel="stylesheet"
/>
<style>
body {
font-family: 'Roboto', sans-serif;
background-color: #f8f9fa;
margin: 0;
padding: 2rem;
}
h1 {
text-align: center;
margin-bottom: 3rem; /* Increased margin for better spacing */
color: #343a40;
}
ol {
background: #ffffff;
padding: 1rem 2rem;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
max-width: 600px;
margin: 0 auto; /* Center the list */
}
li {
margin: 0.5rem 1rem;
display: flex;
align-items: center;
}
a {
text-decoration: none;
color: #007bff;
font-weight: 500;
margin-left: 0.5rem;
}
a:hover {
text-decoration: underline;
color: #0056b3;
}
.emoji {
font-size: 1.5rem;
}
</style>
<script>
// Function to fetch the CSV file and parse the services with emojis
async function loadServiceList() {
try {
const response = await fetch('https://raw.githubusercontent.com/blockscout/swaggers/master/hosted_services.csv'); // Fetch the CSV file
if (!response.ok) {
throw new Error('Failed to load hosted_services.csv');
}
const text = await response.text(); // Get the file content as text
// Parse CSV data (split by newlines and commas)
const rows = text.split('\n').slice(1); // Remove the header line
const services = rows.map(row => row.split(',')); // Split each row by commas
const serviceList = document.getElementById('service-list');
services.forEach(([service, emoji]) => {
if (!service || !emoji) return; // Skip invalid rows
const li = document.createElement('li');
const span = document.createElement('span');
const a = document.createElement('a');
span.textContent = emoji;
span.classList.add('emoji');
a.href = `services/${service.trim()}/index.html`;
a.textContent = service.trim();
li.appendChild(span); // Add emoji span
li.appendChild(a); // Add service link
serviceList.appendChild(li);
});
} catch (error) {
console.error('Error loading service list:', error);
}
}
window.onload = loadServiceList; // Load the service list when the page is loaded
</script>
</head>
<body>
<h1>Blockscout Service Swaggers</h1>
<div class="container">
<ol id="service-list" class="list-group list-group-numbered">
<!-- Services with emojis will be dynamically added here -->
</ol>
</div>
<!-- Bootstrap JS and dependencies (optional) -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>