From 4a0dc15d6a784cc9818a27cd6dea8efec61876a2 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Wed, 6 Apr 2022 17:15:43 +0530 Subject: 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. --- tissue.scm | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'tissue.scm') 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))))) -- cgit v1.2.3