diff options
author | Pjotr Prins | 2023-09-13 11:31:03 -0500 |
---|---|---|
committer | Pjotr Prins | 2023-09-13 11:31:03 -0500 |
commit | 6b9a3e075c598069625a074e74475fa5a0655aca (patch) | |
tree | 3988c8d60ceb8059405b92bc5c271d97eea6a831 /web/view | |
parent | 54c351f585a3695d441bc44e14d6b3e68e58da79 (diff) | |
download | gn-guile-6b9a3e075c598069625a074e74475fa5a0655aca.tar.gz |
Fetch from github
Diffstat (limited to 'web/view')
-rw-r--r-- | web/view/markdown.scm | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/web/view/markdown.scm b/web/view/markdown.scm index a147231..beabb3d 100644 --- a/web/view/markdown.scm +++ b/web/view/markdown.scm @@ -14,7 +14,8 @@ #:use-module (commonmark) #:export (markdown-file->sxml - markdown-github->sxml) + markdown-github->sxml + fetch-raw-file) ) @@ -27,17 +28,18 @@ ;; --- 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) - (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")) + (receive (response-status response-body) + (http-request "https://raw.githubusercontent.com/genenetwork/gn-docs/master/general/brand/aging/home.md") + response-body) + ) (define (markdown-github->sxml fn) - "Parse a github file" + "Parse a github markdown file" (commonmark->sxml - (call-with-input-file (pk fn) - get-string-all))) + (pk (fetch-raw-file fn)))) |