From 3c04f76508ae42260edf47bb65d4bbc7c9949a02 Mon Sep 17 00:00:00 2001 From: Vivianne Langdon Date: Wed, 13 Dec 2023 02:38:49 -0500 Subject: [PATCH] Hacks for not having modules yet, so lazy.lol --- guile-docs/docs.scm | 4 +--- public/index.scm | 2 +- public/module.scm | 18 ++++++++++++++++++ public/overall-wrapper.scm | 2 +- 4 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 public/module.scm diff --git a/guile-docs/docs.scm b/guile-docs/docs.scm index 2d5c267..cfef0de 100644 --- a/guile-docs/docs.scm +++ b/guile-docs/docs.scm @@ -1,6 +1,4 @@ -(define-module (guile-docs docs) - #:use-module (srfi srfi-9) - #:export (docs-in-module)) +(use-modules (srfi srfi-9)) (define-record-type (make-doc module symbol documentation) diff --git a/public/index.scm b/public/index.scm index b69f5b6..ec5001a 100644 --- a/public/index.scm +++ b/public/index.scm @@ -1,5 +1,5 @@ ;; TODO: move to modules - need to set up pre-inst-env or w/e -(define overall-wrapper (load "overall-wrapper.scm")) +(load "overall-wrapper.scm") (overall-wrapper '(main diff --git a/public/module.scm b/public/module.scm new file mode 100644 index 0000000..1adc54d --- /dev/null +++ b/public/module.scm @@ -0,0 +1,18 @@ +(load "overall-wrapper.scm") + +(load "../guile-docs/docs.scm") + +(define (render-module module) + (let ((docs (docs-in-module module))) + (overall-wrapper + `(main ,(map render-doc docs))))) + + +(define (render-doc doc) + `((hgroup + (h1 ,(doc-symbol doc)) + (p "In " ,(doc-module doc))) + (p ,(or (doc-documentation doc) "")))) + + +(render-module (resolve-interface '(srfi srfi-19))) diff --git a/public/overall-wrapper.scm b/public/overall-wrapper.scm index 49a48b8..2ed01c1 100644 --- a/public/overall-wrapper.scm +++ b/public/overall-wrapper.scm @@ -1,5 +1,5 @@ ;; todo: module -(lambda (content) +(define (overall-wrapper content) `(html (link (@ (rel "stylesheet") (type "text/css")