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))))
(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))