dashboard / erock/git-pr / docs proposal #60 rss

closed · opened on 2025-04-07T22:44:49Z by jolheiser
Help
checkout latest patchset:
ssh pr.pico.sh print pr-60 | git am -3
checkout any patchset in a patch request:
ssh pr.pico.sh print ps-X | git am -3
add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh pr add 60
add review to patch request:
git format-patch main --stdout | ssh pr.pico.sh pr add --review 60
accept PR:
ssh pr.pico.sh pr accept 60
close PR:
ssh pr.pico.sh pr close 60

Logs

jolheiser created pr with ps-125 on 2025-04-07T22:44:49Z
erock added ps-142 on 2025-08-10T19:03:50Z
erock changed status on 2025-08-10T19:03:50Z {"status":"closed"}

Patchsets

ps-125 by jolheiser on 2025-04-07T22:44:49Z
Range Diff ↕ rd-142
-: ------- > 1: 867f3be Closing for now
1: 6a52e9e ! 2: 867f3be docs proposal
ps-142 by erock on 2025-08-10T19:03:50Z

Range-diff rd-142

title
Closing for now
description
Patch added
old #0
(none)
new #1
867f3be
title
docs proposal
description
Patch changed
old #1
6a52e9e
new #2
867f3be
Back to top
-: ------- > 1: 867f3be Closing for now
1: 6a52e9e ! 2: 867f3be docs proposal
web.go web.go
 	}
 }
 
+func docsHandler(w http.ResponseWriter, r *http.Request) {
+	web, err := getWebCtx(r)
+	if err != nil {
+		w.WriteHeader(http.StatusInternalServerError)
+		return
+	}
+
+	w.Header().Set("content-type", "text/html")
+	tmpl := getTemplate("docs.html")
+	err = tmpl.ExecuteTemplate(w, "docs.html", nil)
+	if err != nil {
+		web.Backend.Logger.Error("cannot execute template", "err", err)
+	}
+}
+
 type UserData struct {
 	UserID    int64
 	Name      string
 	http.HandleFunc("GET /r/{user}", ctxMdw(ctx, userDetailHandler))
 	http.HandleFunc("GET /rss/{user}", ctxMdw(ctx, rssHandler))
 	http.HandleFunc("GET /rss", ctxMdw(ctx, rssHandler))
+	http.HandleFunc("GET /docs", ctxMdw(ctx, docsHandler))
 	http.HandleFunc("GET /", ctxMdw(ctx, indexHandler))
 	http.HandleFunc("GET /syntax.css", ctxMdw(ctx, chromaStyleHandler))
 	embedFS, err := getEmbedFS(embedStaticFS, "static")
web.go web.go
 	}
 }
 
+func docsHandler(w http.ResponseWriter, r *http.Request) {
+	web, err := getWebCtx(r)
+	if err != nil {
+		w.WriteHeader(http.StatusInternalServerError)
+		return
+	}
+
+	w.Header().Set("content-type", "text/html")
+	tmpl := getTemplate("docs.html")
+	err = tmpl.ExecuteTemplate(w, "docs.html", nil)
+	if err != nil {
+		web.Backend.Logger.Error("cannot execute template", "err", err)
+	}
+}
+
 type UserData struct {
 	UserID    int64
 	Name      string
 	mux.HandleFunc("GET /r/{user}", ctxMdw(ctx, userDetailHandler))
 	mux.HandleFunc("GET /rss/{user}", ctxMdw(ctx, rssHandler))
 	mux.HandleFunc("GET /rss", ctxMdw(ctx, rssHandler))
+	mux.HandleFunc("GET /docs", ctxMdw(ctx, docsHandler))
 	mux.HandleFunc("GET /", ctxMdw(ctx, indexHandler))
 	mux.HandleFunc("GET /syntax.css", ctxMdw(ctx, chromaStyleHandler))
 	embedFS, err := getEmbedFS(embedStaticFS, "static")