From 54c351f585a3695d441bc44e14d6b3e68e58da79 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Wed, 13 Sep 2023 11:16:59 -0500 Subject: wip --- web/view/markdown.scm | 28 +++++++++++++++++++++++++++- web/view/view.scm | 14 ++++++++------ 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/web/view/markdown.scm b/web/view/markdown.scm index b63e48d..a147231 100644 --- a/web/view/markdown.scm +++ b/web/view/markdown.scm @@ -7,11 +7,37 @@ #:use-module (ice-9 string-fun) #:use-module (ice-9 textual-ports) #:use-module (sxml simple) + #:use-module (web client) + #:use-module (web uri) + #:use-module (web request) #:use-module (web sxml) #:use-module (commonmark) - #:export (markdown-file->sxml)) + + #:export (markdown-file->sxml + markdown-github->sxml) + ) + (define (markdown-file->sxml fn) + "Parse a local file" (commonmark->sxml (call-with-input-file fn get-string-all))) + +;; --- fetch github style URLs +;; +;; https://github.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) + (bytevector->string (receive (response-status response-body) + (http-request "https://github.com/genenetwork/gn-docs/master/general/brand/aging/home.md") + response-body) "UTF-8")) + + +(define (markdown-github->sxml fn) + "Parse a github file" + (commonmark->sxml + (call-with-input-file (pk fn) + get-string-all))) + diff --git a/web/view/view.scm b/web/view/view.scm index 7ba7979..669cc9f 100644 --- a/web/view/view.scm +++ b/web/view/view.scm @@ -13,18 +13,20 @@ #:export (view-brand)) + (define (view-aging) (aging-html #:info `( - (p "New aging portal! This is initial work for providing a full community webservice for aging.") - ,(markdown-file->sxml "test.md") - (h2 "Explore GeneNetwork for aging (GN4AGING)") - (p "Find all " (mark "genes") " that have a hit for") + ,(markdown-github->sxml "genenetwork/gn-docs/general/brand/aging/home.md") + (h2 "Explore GeneNetwork2 for aging (GN4AGING)") + (p "Find all " (strong "genes") " that have a hit for") (ul - (li (a (@ (href "https://genenetwork.org/gsearch?type=gene&terms=aging")) "aging"))) - (p "Find all " (mark "phenotypes") " that have a hit for") + (li (a (@ (href "https://genenetwork.org/gsearch?type=gene&terms=aging")) "aging")) + (li (a (@ (href "https://genenetwork.org/gsearch?type=gene&terms=alzheimer")) "alzheimer's"))) + (p "Find all " (strong "phenotypes") " that have a hit for") (ul (li (a (@ (href "https://genenetwork.org/gsearch?type=phenotype&terms=aging")) "aging")) + (li (a (@ (href "https://genenetwork.org/gsearch?type=phenotype&terms=alzheimer")) "alzheimer's")) ) (p "Note that you can use the powerful search at the top of the results page! Search terms can be " -- cgit v1.2.3