-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.xslt
242 lines (226 loc) · 7.67 KB
/
index.xslt
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- This file renders the contents of index.xml as a nicely-formatted HTML page. -->
<xsl:output method="html" version="5.0" encoding="UTF-8" doctype-system="about:legacy-compat"/>
<!-- The main template, which renders the page body. -->
<xsl:template match="/proposals">
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>CAF Evolution</title>
<xsl:call-template name="css"/>
</head>
<body>
<h1>List of Proposals for Changes to CAF, the C++ Actor Framework</h1>
<xsl:call-template name="section">
<xsl:with-param name="title">Awaiting Review</xsl:with-param>
<xsl:with-param name="proposals" select="proposal[@status='awaiting']"/>
</xsl:call-template>
<xsl:call-template name="section">
<xsl:with-param name="title">Under Active Review</xsl:with-param>
<xsl:with-param name="proposals" select="proposal[@status='active']"/>
</xsl:call-template>
<xsl:call-template name="section">
<xsl:with-param name="title">Accepted</xsl:with-param>
<xsl:with-param name="proposals" select="proposal[@status='accepted']"/>
</xsl:call-template>
<xsl:call-template name="section">
<xsl:with-param name="title">Implementation in Progress</xsl:with-param>
<xsl:with-param name="proposals" select="proposal[@status='implementing']"/>
</xsl:call-template>
<xsl:call-template name="section">
<xsl:with-param name="title">Implemented</xsl:with-param>
<xsl:with-param name="proposals" select="proposal[@status='implemented']"/>
</xsl:call-template>
<xsl:call-template name="section">
<xsl:with-param name="title">Rejected</xsl:with-param>
<xsl:with-param name="proposals" select="proposal[@status='rejected']"/>
</xsl:call-template>
<xsl:call-template name="section">
<xsl:with-param name="title">Withdrawn</xsl:with-param>
<xsl:with-param name="proposals" select="proposal[@status='withdrawn']"/>
</xsl:call-template>
</body>
</html>
</xsl:template>
<!-- Renders a section header and a table of proposals. -->
<xsl:template name="section">
<xsl:param name="title"/>
<xsl:param name="description"/>
<xsl:param name="proposals"/>
<section>
<h2><xsl:value-of select="$title"/></h2>
<xsl:if test="$description"><p><xsl:value-of select="$description"/></p></xsl:if>
<xsl:choose>
<xsl:when test="count($proposals) = 0">
<p>(none)</p>
</xsl:when>
<xsl:otherwise>
<table>
<xsl:apply-templates select="$proposals">
<xsl:sort select="@id" order="ascending"/>
</xsl:apply-templates>
</table>
</xsl:otherwise>
</xsl:choose>
</section>
</xsl:template>
<!-- Renders a single proposal. -->
<xsl:template match="proposal">
<tr class="proposal">
<td><a class="number status-{@status}" href="#{@id}">CE-<xsl:value-of select="@id"/></a></td>
<td>
<a class="title" href="https://github.com/actor-framework/evolution/tree/master/proposals/{@filename}">
<xsl:call-template name="format-proposal-name">
<xsl:with-param name="name" select="@name"/>
</xsl:call-template>
</a>
</td>
</tr>
</xsl:template>
<!-- Converts inline `code` in a proposal name to <code></code> elements. -->
<xsl:template name="format-proposal-name">
<xsl:param name="name"/>
<xsl:choose>
<xsl:when test="contains($name, '`')">
<xsl:variable name="before-open-tick" select="substring-before($name, '`')"/>
<xsl:variable name="after-open-tick" select="substring-after($name, '`')"/>
<xsl:variable name="between-ticks" select="substring-before($after-open-tick, '`')"/>
<xsl:variable name="after-close-tick" select="substring-after($after-open-tick, '`')"/>
<!-- Render up to and including the first occurrence of `code` -->
<xsl:value-of select="$before-open-tick"/>
<code><xsl:value-of select="$between-ticks"/></code>
<!-- Recursively format the rest of the string -->
<xsl:call-template name="format-proposal-name">
<xsl:with-param name="name" select="$after-close-tick"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$name"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="css">
<style type="text/css">
* {
margin: 0;
padding: 0;
}
body {
font-family: -apple-system, HelveticaNeue, Helvetica, Arial, sans-serif;
-webkit-text-size-adjust: none;
word-break: break-word;
}
body > h1, body > p, section > table, section > p {
margin-left: 1rem;
margin-right: 1rem;
}
p {
margin-top: 1em;
margin-bottom: 1em;
line-height: 1.5em;
}
code {
font-family: "SFMono-Regular", Menlo, Consolas, monospace;
font-size: 90%;
padding: 0.2em 0.3em;
background-color: #f7f7f7;
border-radius: 3px;
}
h1 {
margin-top: 0.6em;
margin-bottom: 0.6em;
}
h2 {
margin: 0.5em 0em 0em;
padding: 0.3em 1rem 0.4em;
position: -webkit-sticky;
position: -moz-sticky;
position: -ms-sticky;
position: -o-sticky;
position: sticky;
top: 0px;
background-color: #fff;
}
@supports (backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px)) {
h2 {
background-color: rgba(255, 255, 255, 0.5);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
}
}
h2 + p {
margin-top: 0;
}
a {
color: #4078c0;
text-decoration: none;
}
a:hover, a:visited:hover {
text-decoration: underline;
}
.proposal a.title {
color: #666;
}
.proposal a.title:visited {
color: #888;
}
.proposal a.title:hover, .proposal a.title:visited:hover {
color: #222;
}
table {
margin-bottom: 1rem;
border-spacing: 0.5em;
}
table, tr, td {
padding: 0;
}
.proposal {
font-size: 1.1em;
}
.proposal td {
vertical-align: top;
}
.number {
text-align: center;
border-radius: 5px;
font-size: 0.7em;
font-weight: bold;
padding: 0.2em 0.5em;
display: block;
white-space: nowrap;
color: #fff;
}
.proposal a.number {
color: #fff;
text-decoration: none;
}
a.number.status-implemented {
background-color: #319021;
}
a.number.status-accepted {
background-color: #5abc4e;
}
a.number.status-implementing {
background-color: #5abc4e;
background: repeating-linear-gradient(135deg, #5abc4e, #5abc4e 14.29%, #319021 14.29%, #319021 28.57%);
}
a.number.status-active {
background-color: #297de4;
}
a.number.status-scheduled {
background-color: #78b8fb;
}
a.number.status-awaiting, a.number.status-deferred {
background-color: #dddddd;
color: #000;
}
a.number.status-returned {
background-color: #f1b6b7;
}
a.number.status-rejected, a.number.status-withdrawn {
background-color: #de5b60;
}
</style>
</xsl:template>
</xsl:stylesheet>