From febdca718035f186ea6d1d6b48cf8ef5ab0fc431 Mon Sep 17 00:00:00 2001 From: w6vvn Date: Wed, 3 Sep 2025 20:15:21 -0700 Subject: [PATCH] clean up formatting on gmi:render procedure and document --- gmi.rkt | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/gmi.rkt b/gmi.rkt index 9a1d6b4..c6773ec 100644 --- a/gmi.rkt +++ b/gmi.rkt @@ -125,16 +125,20 @@ (map string-join (outer-iter (list) (string-split paragraph)))) (newline))) +;; given a document, which is a list of structs, render it out into +;; the current output port exactly as it will be shown to the user (define (render document) - (for-each (λ (line) - (cond [(text? line) - (render-paragraph (text-str line))] + (for-each + (λ (line) + (cond + [(text? line) + (render-paragraph (text-str line))] - [(pre? line) - (for-each (λ (line) - (displayln line)) - (pre-str line))] + [(pre? line) + (for-each (λ (line) + (displayln line)) + (pre-str line))] - [(link? line) - (printf "[~a] ~a\n" (link-ord line) (link-str line))])) - document)) + [(link? line) + (printf "[~a] ~a\n" (link-ord line) (link-str line))])) + document))