clean up formatting on gmi:render procedure and document

This commit is contained in:
2025-09-03 20:15:21 -07:00
parent 41e092975d
commit febdca7180

24
gmi.rkt
View File

@@ -125,16 +125,20 @@
(map string-join (outer-iter (list) (string-split paragraph)))) (map string-join (outer-iter (list) (string-split paragraph))))
(newline))) (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) (define (render document)
(for-each (λ (line) (for-each
(cond [(text? line) (λ (line)
(render-paragraph (text-str line))] (cond
[(text? line)
(render-paragraph (text-str line))]
[(pre? line) [(pre? line)
(for-each (λ (line) (for-each (λ (line)
(displayln line)) (displayln line))
(pre-str line))] (pre-str line))]
[(link? line) [(link? line)
(printf "[~a] ~a\n" (link-ord line) (link-str line))])) (printf "[~a] ~a\n" (link-ord line) (link-str line))]))
document)) document))