This repository has been archived by the owner on May 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate_roadmap.py
78 lines (70 loc) · 2.25 KB
/
generate_roadmap.py
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
import json
data = json.loads(open('roadmap_data.json').read())
roadmap_items = []
for ind, obj in enumerate(data):
title = obj['title']
date = obj['date']
content= obj['content']
icon=obj['icon']
if ind % 2:
item = f'''
<div class="timeline-item">
<div class="timeline-img">
<img src="{icon}" width="100%"/>
</div>
<div class="timeline-content js--fadeInLeft">
<h2>{title}</h2>
<div class="date">{date}</div>
<p>{content}</p>
<!--<a class="bnt-more" href="javascript:void(0)">More</a>-->
</div>
</div>'''
else:
item = f'''
<div class="timeline-item">
<div class="timeline-img">
<img src="{icon}" width="100%"/>
</div>
<div class="timeline-content js--fadeInRight">
<h2>{title}</h2>
<div class="date">{date}</div>
<p>{content}</p>
<!--<a class="bnt-more" href="javascript:void(0)">More</a>-->
</div>
</div>'''
print(item)
roadmap_items.append(item)
newline = '\n'
roadmap = f'''<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>Roadmap Happy Hamster</title>
<link href="https://fonts.googleapis.com/css?family=Roboto:100i,300,400,500,700" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Allura" rel="stylesheet">
<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css'>
<link rel="stylesheet" href="./roadmap/style.css">
</head>
<body>
<header>
<div class="container text-center">
<h1>
<a href="index.html"><img src="img/logo.svg" class="logo" width="100px" height="auto"></a>
Roadmap
<a href="https://wirvsvirushackathon.org/"><img src="img/Logo_Projekt_01_alt.png" class="logo projekt" width="150px" height="auto"></a>
</h1>
</div>
</header>
<section class="timeline">
<div class="container">
{newline.join(roadmap_items)}
</div>
</section>
<!-- partial -->
<script src='https://code.jquery.com/jquery-2.2.4.min.js'></script>
<script src='https://cdn.jsdelivr.net/scrollreveal.js/3.3.1/scrollreveal.min.js'></script><script src="./roadmap/script.js"></script>
</body>
</html>'''
with open('roadmap.html', 'w') as fout:
fout.write(roadmap)
print(roadmap)