diff --git a/rfc/Makefile b/rfc/Makefile index 017578e..354c56e 100644 --- a/rfc/Makefile +++ b/rfc/Makefile @@ -7,4 +7,4 @@ link: go run -tags link link.go -- ../*.go ../*/*.go xr: - go run xr.go -- xr-dev $$(git rev-parse --short HEAD) $$(git tag | tail -n1) ../*.go ../*/*.go + go run xr.go -- xr-dev $$(git rev-parse --short HEAD) $$(git log -1 --date=format:"%Y-%m-%d" --format="%ad") $$(git tag | tail -n1) ../*.go ../*/*.go diff --git a/rfc/xr.go b/rfc/xr.go index 52195a3..6088b11 100644 --- a/rfc/xr.go +++ b/rfc/xr.go @@ -42,20 +42,21 @@ func main() { var release bool flag.BoolVar(&release, "release", false, "generate cross-references for a release, highlighting the release version as active page") flag.Usage = func() { - log.Println("usage: go run xr.go destdir revision latestrelease ../*.go ../*/*.go") + log.Println("usage: go run xr.go destdir revision date latestrelease ../*.go ../*/*.go") flag.PrintDefaults() os.Exit(2) } flag.Parse() args := flag.Args() - if len(args) < 3 { + if len(args) < 4 { flag.Usage() } destdir = args[0] revision := args[1] - latestRelease := args[2] - srcfiles := args[3:] + date := args[2] + latestRelease := args[3] + srcfiles := args[4:] // Generate code.html index. srcdirs := map[string][]string{} @@ -278,6 +279,7 @@ for (const a of document.querySelectorAll('a')) { index = strings.ReplaceAll(index, "REVISIONWEIGHT", "bold") } index = strings.ReplaceAll(index, "REVISION", revision) + index = strings.ReplaceAll(index, "DATE", date) index = strings.ReplaceAll(index, "RELEASE", latestRelease) xwritefile("index.html", []byte(index)) } @@ -294,7 +296,7 @@ body { margin: 0; padding: 0; font-family: 'ubuntu', 'lato', sans-serif; }