aboutsummaryrefslogtreecommitdiff
path: root/web/view
diff options
context:
space:
mode:
authorPjotr Prins2023-08-10 13:43:46 +0200
committerPjotr Prins2023-08-10 13:43:46 +0200
commit7851b6408e4954e7b2ebce500de8734b246ee439 (patch)
treea2fd0e28c0707798b478365d50392023030483dd /web/view
parentff21db13b3243c31a52462aad4e0faaefc55a239 (diff)
downloadgn-guile-7851b6408e4954e7b2ebce500de8734b246ee439.tar.gz
Render HTML on species
Diffstat (limited to 'web/view')
-rw-r--r--web/view/doc.scm20
1 files changed, 15 insertions, 5 deletions
diff --git a/web/view/doc.scm b/web/view/doc.scm
index 1125147..71112eb 100644
--- a/web/view/doc.scm
+++ b/web/view/doc.scm
@@ -15,7 +15,12 @@
(define* (layout #:key
(head '())
(body '())
- (title "GeneNetwork.org API"))
+ (title "GeneNetwork.org API")
+ (info "")
+ (meta "")
+ (data "")
+ (back "")
+ )
`((doctype "html")
(html (@ (lang "en"))
(head
@@ -30,8 +35,13 @@
(type "text/css")
(href "./css/gn-doc.css")))
,@head)
- (body (h1 ,body)
- ; ,body
+ (body (h1 ,title)
+ (p ,info)
+ (p "JSON API: " (a (@ (href ,meta)) "meta") " | "
+ (a (@ (href ,data)) "data") " | "
+ (a (@ (href ,back)) "back"))
+ (pre
+ ,(scm->json-string body #:pretty #t))
; (p ,(parse-html "<b>some raw really <i>text</i> here</b>"))
(footer
(p "Copyright © 2005—2023 by the GeneNetwork community with a touch of " (span (@ (class "lambda")) "λ") "!")
@@ -40,5 +50,5 @@
"source code") "."))
))))
-(define (view-doc path page)
- (layout #:body page))
+(define* (view-doc path page #:optional rec)
+ (layout #:title page #:info (assoc-ref rec "info") #:meta (assoc-ref rec "meta") #:data (assoc-ref rec "data") #:back (assoc-ref rec "up") #:body rec))