-
Notifications
You must be signed in to change notification settings - Fork 1
/
make-output.py
71 lines (62 loc) · 1.04 KB
/
make-output.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
MAX_CHAPTERS = 500
print """
<html>
<head></head>
<style>
@font-face {
font-family: serif;
font-style: normal;
font-weight: normal;
src: url("/Library/Fonts/Baskerville.ttc")
}
@page {
size: 8in 5in;
margin: .5in 0 0 0;
}
.left {
float: left;
width: 3.5in;
margin-left: .4in;
border-right: 1px solid rgb(220,220,220);
}
.right {
float: right;
width: 3.5in;
margin-right: .4in;
}
div {
clear: both;
width: 8in;
margin: auto;
page-break-before: always;
font-style: roman;
text-align: center;
}
</style>
<body>
<div>
Page one
</div>
<div>
<br/>
<br/>
<br/>
<br/>
<h1>A Physical Book</h1>
<h2>By Liza Daly (@liza) for NaNoGenMo 2017</h2>
<p>
Based on 400 Ways to Make a Sandwich (1909) by Eva Green Fuller
</p>
</div>
"""
for i in range(0, MAX_CHAPTERS):
cls = "left" if i % 2 == 0 else "right"
if cls == "left":
print "<div>"
print """<img class="{}" src="images/{}.png">""".format(cls, i)
if cls == "right":
print "</div>"
print """
</body>
</html>
"""