aboutsummaryrefslogtreecommitdiff
path: root/web/view
diff options
context:
space:
mode:
authorPjotr Prins2023-09-13 16:47:30 -0500
committerPjotr Prins2023-09-13 16:47:30 -0500
commit29c5964ad6a7d7f01a9b8d08c5db4893bd905f7c (patch)
tree51d7c5f04c128c1463c4b418d32c8a28cca6f7fb /web/view
parent6b9a3e075c598069625a074e74475fa5a0655aca (diff)
downloadgn-guile-29c5964ad6a7d7f01a9b8d08c5db4893bd905f7c.tar.gz
Added github resolving and MSK home
Diffstat (limited to 'web/view')
-rw-r--r--web/view/brand/msk.scm1
-rw-r--r--web/view/markdown.scm18
-rw-r--r--web/view/view.scm4
3 files changed, 12 insertions, 11 deletions
diff --git a/web/view/brand/msk.scm b/web/view/brand/msk.scm
index a274a80..c20d8d9 100644
--- a/web/view/brand/msk.scm
+++ b/web/view/brand/msk.scm
@@ -42,7 +42,6 @@
(main (@ (class "container"))
(article
(img (@ (src "/static/images/GN4MSK.png")))
- (h1 ,title)
(p ,info)
(footer
(hr)
diff --git a/web/view/markdown.scm b/web/view/markdown.scm
index beabb3d..b7c8a58 100644
--- a/web/view/markdown.scm
+++ b/web/view/markdown.scm
@@ -26,10 +26,6 @@
get-string-all)))
;; --- fetch github style URLs
-;;
-;; 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
(define (fetch-raw-file url)
(receive (response-status response-body)
@@ -37,9 +33,15 @@
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
-(define (markdown-github->sxml fn)
- "Parse a github markdown file"
- (commonmark->sxml
- (pk (fetch-raw-file fn))))
+(define (form-github-raw-url project repo page)
+ (string-append "https://raw.githubusercontent.com/" project "/" repo "/master/" (string-join page "/")))
+(define (markdown-github->sxml path)
+ "Parse a github markdown file that is formed like genenetwork/gn-docs/general/brand/aging/home.md"
+ (match-let (((project repo page ...) (string-split path #\/)))
+ (commonmark->sxml
+ (fetch-raw-file (form-github-raw-url project repo page)))))
diff --git a/web/view/view.scm b/web/view/view.scm
index 669cc9f..27e4dd9 100644
--- a/web/view/view.scm
+++ b/web/view/view.scm
@@ -46,8 +46,8 @@ data to benefit from the power of integrated datasets, please contact:")
(match path
("aging" (view-aging))
( _ (msk-html #:info
- '((h2 "Introduction")
- (p "New start page for MSK! This is initial work for providing a full community webservice for musculoskeletal disease.")
+ '(
+ ,(markdown-github->sxml "genenetwork/gn-docs/general/brand/msk/home.md")
(h2 "Explore GeneNetwork for MSK (GN4MSK)")
(p "Find all genes that have a hit for")
(ul