-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathchapter.html.p
148 lines (136 loc) · 4.79 KB
/
chapter.html.p
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
◊(local-require pollen/tag)
◊(define title (select-from-metas 'title here))
◊(define head-title
(if title
(string-append main-title ": " title)
(error (format "unknown title for ~v~n" here))))
◊(define (str->date-display text x)
(if x
(string-append text " " (~t (iso8601->date x) "MMMM d, y"))
""))
◊(define subtitle (select-from-metas 'subtitle here))
◊(define published-date (select-from-metas 'published here))
◊(define published (str->date-display "Published" published-date))
◊(define updated-date (select-from-metas 'updated here))
◊(define updated
(if (or (not updated-date) (string=? published-date updated-date))
#f
(str->date-display "Updated" (select-from-metas 'updated here))))
◊(define side-space? (not (select-from-metas 'no-side-space here)))
◊(define section-chapters-headers? (not (select-from-metas 'no-section-chapters-header here)))
◊(define article-class
(let ((extra (select-from-metas 'extra-article-class here)))
(if extra
(string-append "chapter " extra)
"chapter")))
◊(define prev-page
(let ((p (previous here)))
(if (equal? p 'index.html)
#f
p)))
◊(define prev-title
(if prev-page
(select-from-metas 'title prev-page)
#f))
◊(define next-page (next here))
◊(define next-title
(if next-page
(select-from-metas 'title next-page)
#f))
◊(define parent-page (parent here))
◊(define parent-title
(if parent-page
(select-from-metas 'title parent-page)
#f))
◊(define (ref page title txt)
(->html
(make-link #:title title (string-append "/" (symbol->string page)) txt)))
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>◊|head-title|</title>
<link rel="stylesheet" type="text/css" href="/css/main.css" />
<link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="/feed.xml" />
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0' />
<meta name="keywords" content="◊|keywords|" />
</head>
<body>
<article class="◊|article-class|">
<nav class="where">
<a href="/toc.html" tilte="Table of contents" class="home">Why Cryptocurrencies?</a>
◊when/splice[parent-page]{
<span class="divider">/</span>
◊(ref parent-page parent-title parent-title)
}
</nav>
<header>
<h1>◊|title|</h1>
<h2>◊|subtitle|</h2>
◊(when side-space? (->html
`(div ((class "date"))
(span ((class "published")) ,published)
,(if updated
`(span ((class "updated")) ,updated)
""))))
</div>
</header>
◊(->html doc #:splice? #t)
◊(->html (make-section-nav #:section-header? section-chapters-headers?
here))
</article>
◊(when side-space? (->html `(div ((class "side-space")))))
<nav class="edge-wrapper">
◊when/splice[prev-page]{
<a class="prev-pan" href="/◊(symbol->string prev-page)" title="◊|prev-title|">
<span class="content"> ‹ </span>
</a>
}
◊when/splice[next-page]{
<a class="next-pan" href="/◊(symbol->string next-page)" title="◊|next-title|">
<span class="content"> › </span>
</a>
}
</nav>
<footer>
<nav class="movenav">
◊when/splice[prev-page]{
<span class="prev">
◊(ref prev-page prev-title (string-append "← " prev-title))
◊;(ref prev-page "← Previous page")
</span>
}
<span class="middle">
◊when/splice[parent-page]{
<span class="parent">
◊;(ref parent-page "Chapter")
◊(ref parent-page parent-title "↑ Part")
</span>
}
<span class="home">
<a href="/toc.html" title="Table of contents">~ Home</a>
</span>
</span>
◊when/splice[next-page]{
<span class="next">
◊;(ref next-page "Next page →")
◊(ref next-page next-title (string-append next-title " →"))
</span>
}
</nav>
<div class="buy-wrapper">
<div class="buy">
<p>This is a book that tries to explain the utility of cryptocurrencies in a beginner-friendly manner.</p>
<p><a href="/" title="Print or ebook">Check out the print or ebook!</a></p>
</div>
</div>
<div class="follow-wrapper">
◊(->html follow-section)
</div>
</footer>
</body>
</html>
◊;←
◊;→
◊;↑
◊;↓