From 7851b6408e4954e7b2ebce500de8734b246ee439 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Thu, 10 Aug 2023 13:43:46 +0200 Subject: Render HTML on species --- web/view/doc.scm | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'web/view') 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 "some raw really text here")) (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)) -- cgit v1.2.3