summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-04-06 17:15:43 +0530
committerArun Isaac2022-04-06 17:15:43 +0530
commit4a0dc15d6a784cc9818a27cd6dea8efec61876a2 (patch)
tree0e7d0ea14a09db26a6870bc00faf7c5d0d9d3b10
parent6e7c6c2fc67c3022e0313f53b2e3ce714bec92d8 (diff)
downloadgn-gemtext-4a0dc15d6a784cc9818a27cd6dea8efec61876a2.tar.gz
tissue: Add edit and blame links to issue pages.
* tissue.scm (%github-repo-uri, %repo-branch): New variables. (genenetwork-gemtext-reader): New function. (#:web-files): Use genenetwork-gemtext-reader instead of gemtext-reader.
-rw-r--r--tissue.scm21
1 files changed, 20 insertions, 1 deletions
diff --git a/tissue.scm b/tissue.scm
index 25fc2dc..08abe0b 100644
--- a/tissue.scm
+++ b/tissue.scm
@@ -1,5 +1,24 @@
(import (tissue tissue))
+(define %github-repo-uri
+ "https://github.com/genenetwork/gn-gemtext-threads")
+
+(define %repo-branch
+ "main")
+
+(define (genenetwork-gemtext-reader file)
+ (lambda (port)
+ (match ((gemtext-reader) port)
+ ((? eof-object? eof) eof)
+ (('document body ...)
+ `(document
+ (ref #:url ,(string-append %github-repo-uri "/edit/" %repo-branch "/" file)
+ #:text "Edit this page")
+ " | "
+ (ref #:url ,(string-append %github-repo-uri "/blame/" %repo-branch "/" file)
+ #:text "Blame")
+ ,@body)))))
+
(tissue-configuration
#:project "GeneNetwork issue tracker"
#:aliases '(("Alexander Kabui" "alex")
@@ -27,5 +46,5 @@
"README.gmi"))
(file (replace-extension filename "html")
(gemtext-exporter filename
- (gemtext-reader)))))
+ (genenetwork-gemtext-reader filename)))))
(git-tracked-files)))))