summaryrefslogtreecommitdiff
path: root/gemini.go
diff options
context:
space:
mode:
Diffstat (limited to 'gemini.go')
-rw-r--r--gemini.go43
1 files changed, 23 insertions, 20 deletions
diff --git a/gemini.go b/gemini.go
index 91de5aa..878b2b8 100644
--- a/gemini.go
+++ b/gemini.go
@@ -22,32 +22,35 @@ const (
// GeminiRouter builds a router that will handle requests into a directory of git repositories.
//
// The routes it defines are:
-// / gemtext listing of the repositories in the directory
-// /:repository/ gemtext overview of the repository
-// /:repository/branches gemtext list of branches/heads
-// /:repository/tags gemtext listing of tags
-// /:repository/refs/:ref/ gemtext overview of a ref
-// /:repository/refs/:ref/tree/*path gemtext listing of directories, raw files
-// /:repository/diffstat/:fromref/:toref text/plain diffstat between two refs
-// /:repository/diff/:fromref/:toref text/x-diff between two refs
+//
+// / gemtext listing of the repositories in the directory
+// /:repository/ gemtext overview of the repository
+// /:repository/branches gemtext list of branches/heads
+// /:repository/tags gemtext listing of tags
+// /:repository/refs/:ref/ gemtext overview of a ref
+// /:repository/refs/:ref/tree/*path gemtext listing of directories, raw files
+// /:repository/diffstat/:fromref/:toref text/plain diffstat between two refs
+// /:repository/diff/:fromref/:toref text/x-diff between two refs
//
// The overrides argument can provide templates to define the behavior of nearly all of the above
// routes. All of them have default implementations so the argument can even be nil, but otherwise
// the template names used are:
-// repo_root.gmi gemtext at /
-// repo_home.gmi gemtext at /:repository/
-// branch_list.gmi gemtext at /:repository/branches
-// tag_list.gmi gemtext at /:repository/tags
-// ref.gmi gemtext at /:repository/refs/:ref/
-// tree.gmi gemtext for directories requested under /:repository/refs/:ref/tree/*path
-// (file paths return the raw files without any template involved)
-// diffstat.gmi.txt the plaintext diffstat at /:repository/diffstat/:fromref/:toref
-// diff.gmi.txt the text/x-diff at /:repository/diff/:fromref/:toref
+//
+// repo_root.gmi gemtext at /
+// repo_home.gmi gemtext at /:repository/
+// branch_list.gmi gemtext at /:repository/branches
+// tag_list.gmi gemtext at /:repository/tags
+// ref.gmi gemtext at /:repository/refs/:ref/
+// tree.gmi gemtext for directories requested under /:repository/refs/:ref/tree/*path
+// (file paths return the raw files without any template involved)
+// diffstat.gmi.txt the plaintext diffstat at /:repository/diffstat/:fromref/:toref
+// diff.gmi.txt the text/x-diff at /:repository/diff/:fromref/:toref
//
// Most of the templates above are rendered with an object with 3 fields:
-// Ctx: the context.Context from the request
-// Repo: a *syw.Repository object corresponding to <repodir>/:repository
-// Params: a map[string]string of the route parameters
+//
+// Ctx: the context.Context from the request
+// Repo: a *syw.Repository object corresponding to <repodir>/:repository
+// Params: a map[string]string of the route parameters
//
// The only exception is repo_root.gmi, which is rendered with a slice of the repo names instead.
func GeminiRouter(repodir string, overrides *template.Template) *sliderule.Router {