From: Omar Polo Subject: Re: got-www: generate HTML page from CHANGES To: Stefan Sperling Cc: gameoftrees@openbsd.org Date: Mon, 28 Oct 2024 12:49:36 +0100 On 2024/10/28 07:43:15 +0100, Stefan Sperling wrote: > On Sun, Oct 27, 2024 at 06:21:10PM +0100, Omar Polo wrote: > > Just an idea. It's easier to read the changelog on a web browser this > > way, and we could even link the changes for a specific release? > > > > Here's a preview: https://tmp.omarpolo.com/changes.html > > > > If ok I'll commit the generated releases/changes.html as well. > > > > Thoughs? Do we need something similar for -portable too? =) > > I am not opposed. Fine with me. > I don't mind plaintext but HTML certainly looks better in a browser. Great, I'll do something similar for -portable changelog as well as a follow-up then. > > +

> > +See git repository history for per-change authorship information > > +

> > Might as well make "git repository" a clickable link? Yes, makes sense! Here's an updated diff with some feedback that I received off-list. - slightly better awk code - better html - updated the links in index.html - changed the format of the title I've also updated the preview at . Thanks, Omar Polo diff /home/op/w/got-www commit - 2fa5e3a8004ff7eea62475253244dec9567b245f path + /home/op/w/got-www blob - 9ff7cfc546813adf215ffaa0ef7f7b0344856d52 file + index.html --- index.html +++ index.html @@ -14,7 +14,7 @@

About Got

Resources

    @@ -62,7 +62,7 @@

    - Game of Trees 0.104 released October 22, 2024 + Game of Trees 0.104 released October 22, 2024
    Game of Trees -portable 0.104 released October 22, 2024 blob - /dev/null file + sync-changes.sh (mode 755) --- /dev/null +++ sync-changes.sh @@ -0,0 +1,105 @@ +#!/bin/sh + +exec >releases/changes.html + +cat < + + + + Game of Trees Changes + + + + + + + +

    +Game of Trees +Changes +

    +
    + +

    +See the +git repository +history for per-change authorship information. +

    + +EOF + +awk ' +// { + sub("^ +", "") + sub(" +$", "") +} +/^\*/ { + if (change != "") { + emit() + doclose = 1 + } + if (insublist) { + insublist = 0 + print("
") + } + if (doclose == 1) { + doclose = 0 + print("") + } + sub(";", "", $3) + version = $3 + date = $4 + printf("

GoT %s - %s

\n", date, date, version, date) + print("
    ") + next +} +/^$/ { next } +/see git repository history for per-change authorship/ { next } +/^-/ { + emit() + if (insublist) { + insublist = 0 + print("
") + } + sub("^- *", "", $0) + change = $0 + next +} +/^o / { + emit() + if (!insublist) { + insublist = 1 + print("
    • ") + } + sub("^o +", "", $0) + change = $0 + next +} +// { change = change " " $0 } +END { + emit() + if (insublist) + print("
  • ") + print("") +} +function san(s) { + gsub("&", "\\&", s) + gsub("<", "\\<", s) + gsub(">", "\\>", s) + return s +} +function emit() { + if (change == "") + return + print("
  • ") + print(san(change)) + print("
  • ") + change = "" +} +' < releases/CHANGES + +cat < + +EOF