aboutsummaryrefslogtreecommitdiff
path: root/web/view/doc.scm
diff options
context:
space:
mode:
Diffstat (limited to 'web/view/doc.scm')
-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))