aboutsummaryrefslogtreecommitdiff
path: root/web/view
diff options
context:
space:
mode:
Diffstat (limited to 'web/view')
-rw-r--r--web/view/markdown.scm29
-rw-r--r--web/view/view.scm4
2 files changed, 18 insertions, 15 deletions
diff --git a/web/view/markdown.scm b/web/view/markdown.scm
index 653596f..6aa2935 100644
--- a/web/view/markdown.scm
+++ b/web/view/markdown.scm
@@ -15,9 +15,8 @@
#:use-module (web request)
#:use-module (web sxml)
#:use-module (commonmark)
-
#:export (markdown-file->sxml markdown-github->sxml fetch-file
- fetch-raw-file commit-file))
+ fetch-raw-file commit-file git-invoke))
(define (markdown-file->sxml fn)
"Parse a local file"
@@ -26,26 +25,26 @@
(define (fetch-raw-file url)
(receive (response-status response-body)
- (http-request url) response-body))
-
-;; https://github.com/genenetwork/gn-docs/master/general/brand/aging/home.md
-;; https://raw.githubusercontent.com/genenetwork/gn-docs/master/general/brand/aging/home.md
-;; https://github.com/genenetwork/gn-docs/edit/master/general/brand/aging/home.md
+ (http-request url) response-body))
-(define (form-github-raw-url project repo page)
+(define* (form-github-raw-url project repo page #:optional (branch "master"))
(string-append "https://raw.githubusercontent.com/"
project
"/"
repo
- "/master/"
+ "/"
+ branch
+ "/"
(string-join page "/")))
-(define (form-github-edit-url project repo page)
+(define* (form-github-edit-url project repo page #:optional (branch "master"))
(string-append "https://github.com/"
project
"/"
repo
- "/edit/master/"
+ "/edit/"
+ branch
+ "/"
(string-join page "/")))
(define (markdown-github->sxml path)
@@ -120,12 +119,12 @@
(if (zero? git-commit-file)
`(("status" . "201")
("message" . "committed file successfully")
- ("content" unquote content)
- ("commit_sha" unquote git-commit-sha)
- ("commit_message" unquote commit-message))
+ ("content" . ,content)
+ ("commit_sha" . ,git-commit-sha)
+ ("commit_message" . ,commit-message))
`(("status" . "200")
("message" . "Nothing to commit, working tree clean")
- ("commit_sha" unquote git-commit-sha)))))
+ ("commit_sha" . ,git-commit-sha)))))
(#f (throw 'system-error
(format #f "~a File does not exist error" file-path))))
(throw 'system-error
diff --git a/web/view/view.scm b/web/view/view.scm
index 4584cf8..4300863 100644
--- a/web/view/view.scm
+++ b/web/view/view.scm
@@ -10,6 +10,7 @@
#:use-module (web view markdown)
#:use-module (web view brand msk)
#:use-module (web view brand aging)
+ #:use-module (web templates genenetwork)
#:export (view-brand))
@@ -45,6 +46,9 @@ data to benefit from the power of integrated datasets, please contact:")
(define* (view-brand path)
(match path
("aging" (view-aging))
+ ("gnqa" (default-gn-template
+ "genenetwork/gn-docs/general/brand/gnqa/gnqa.md"
+ "GeneNetwork Question and Answer System"))
( _ (msk-html #:info
`(
,(markdown-github->sxml "genenetwork/gn-docs/general/brand/msk/home.md")