Blob
1 #!/bin/sh3 exec >releases/changes.html5 cat <<EOF6 <!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 Changes21 </h2>22 <hr>24 <p>25 See the26 <a href="https://got.gameoftrees.org/?action=summary&path=got.git">git repository</a>27 history for per-change authorship information.28 </p>30 EOF32 awk '33 // {34 sub("^ +", "")35 sub(" +$", "")36 }37 /^\*/ {38 if (change != "") {39 emit()40 doclose = 141 }42 if (insublist) {43 insublist = 044 print("</ul></li>")45 }46 if (doclose == 1) {47 doclose = 048 print("</ul>")49 }50 sub(";", "", $3)51 version = $352 date = $453 printf("<h3 id=\"%s\"><a href=\"#%s\">Game of Trees %s - %s</a></h3>\n", date, date, version, date)54 print("<ul>")55 next56 }57 /^$/ { next }58 /see git repository history for per-change authorship/ { next }59 /^-/ {60 emit()61 if (insublist) {62 insublist = 063 print("</ul></li>")64 }65 sub("^- *", "", $0)66 change = $067 next68 }69 /^o / {70 emit()71 if (!insublist) {72 insublist = 173 print("<li><ul>")74 }75 sub("^o +", "", $0)76 change = $077 next78 }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("&", "\\&", s)88 gsub("<", "\\<", s)89 gsub(">", "\\>", s)90 return s91 }92 function emit() {93 if (change == "")94 return95 print("<li>")96 print(san(change))97 print("</li>")98 change = ""99 }100 ' < releases/CHANGES102 cat <<EOF103 </body>104 </html>105 EOF