-
Notifications
You must be signed in to change notification settings - Fork 4
/
make_wa_html.py
62 lines (48 loc) · 1.76 KB
/
make_wa_html.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
import datetime
with open('html_temp/deaths_wa.js', 'r') as read_obj:
states1_js = ''.join(read_obj.readlines())
with open('html_temp/deaths_wa.div', 'r') as read_obj:
states1_div = ''.join(read_obj.readlines())
html_raw = """
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Covid 19 Deaths in Washington State</title>
<link rel="stylesheet" href="/styles/site.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/bokeh/2.0.2/bokeh.min.js"></script>
<!-- COPY/PASTE SCRIPT HERE -->
{states1_js}
</head>
<body>
<header>
<div class="siteName">Covid 19 Data: Cases, Deaths, and Changes by State</div>
<h1>Covid 19 Deaths in Washington State</h1>
<p>updated: {date}</p>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="states_cases_rt.html">Infection Rate Growth</a></li>
<li><a href="states_deaths.html">Deaths</a></li>
<li><a href="states_deaths_rt.html">Death Rate Growth</a></li>
<li><a href="wa.html">Deaths In Washington State</a></li>
</ul>
</nav>
</header>
<main>
{states1_div}
</main>
<footer>
<address>
<p>created by <a href="https://github.com/paulhtremblay">Henry Tremblay</a></p>
<p><a href="https://github.com/paulhtremblay/covid19">contributions welcome</a></p>
</address>
</footer>
</body>
</html>
""".format(
states1_js = states1_js,
states1_div = states1_div
)
with open('html_temp/wa.html', 'w') as write_obj:
write_obj.write(html_raw)