Blob


1 #!/bin/sh
3 exec >releases/changes.html
5 cat <<EOF
6 <!doctype html>
7 <html lang="en">
8 <head>
9 <meta charset=utf-8>
10 <title>Game of Trees Changes</title>
11 <meta name="description" content="Game of Trees Changelog">
12 <meta name="viewport" content="width=device-width, initial-scale=1">
13 <link rel="stylesheet" type="text/css" href="/openbsd.css">
14 <link rel="canonical" href="https://gameoftrees.org/releases/changes.html">
15 </head>
16 <body>
18 <h2>
19 <a href="/"><i>Game of Trees</i></a>
20 Changes
21 </h2>
22 <hr>
24 <p>
25 See the
26 <a href="https://got.gameoftrees.org/?action=summary&path=got.git">git repository</a>
27 history for per-change authorship information.
28 </p>
30 EOF
32 awk '
33 // {
34 sub("^ +", "")
35 sub(" +$", "")
36 }
37 /^\*/ {
38 if (change != "") {
39 emit()
40 doclose = 1
41 }
42 if (insublist) {
43 insublist = 0
44 print("</ul></li>")
45 }
46 if (doclose == 1) {
47 doclose = 0
48 print("</ul>")
49 }
50 sub(";", "", $3)
51 version = $3
52 date = $4
53 printf("<h3 id=\"%s\"><a href=\"#%s\">Game of Trees %s - %s</a></h3>\n", date, date, version, date)
54 print("<ul>")
55 next
56 }
57 /^$/ { next }
58 /see git repository history for per-change authorship/ { next }
59 /^-/ {
60 emit()
61 if (insublist) {
62 insublist = 0
63 print("</ul></li>")
64 }
65 sub("^- *", "", $0)
66 change = $0
67 next
68 }
69 /^o / {
70 emit()
71 if (!insublist) {
72 insublist = 1
73 print("<li><ul>")
74 }
75 sub("^o +", "", $0)
76 change = $0
77 next
78 }
79 // { change = change " " $0 }
80 END {
81 emit()
82 if (insublist)
83 print("</ul></li>")
84 print("</ul>")
85 }
86 function san(s) {
87 gsub("&", "\\&amp;", s)
88 gsub("<", "\\&lt;", s)
89 gsub(">", "\\&gt;", s)
90 return s
91 }
92 function emit() {
93 if (change == "")
94 return
95 print("<li>")
96 print(san(change))
97 print("</li>")
98 change = ""
99 }
100 ' < releases/CHANGES
102 cat <<EOF
103 </body>
104 </html>
105 EOF