Add unicode border style.

This commit is contained in:
Dominik Pantůček 2023-03-22 17:07:07 +01:00
parent a26773f9da
commit 595b26ac50

View file

@ -28,6 +28,8 @@
(module (module
table table
( (
*table-border-style*
table->string
table-tests! table-tests!
) )
@ -39,6 +41,9 @@
ansi ansi
testing) testing)
;; Default table border style to use if not explicitly specified.
(define *table-border-style* (make-parameter 'ascii))
;; Returns a list of strings representing the rows in the original ;; Returns a list of strings representing the rows in the original
;; string. ;; string.
(define (string->rows str) (define (string->rows str)
@ -156,10 +161,16 @@
;; Table border styles in visual form ;; Table border styles in visual form
(define table-borders-lookup-source (define table-borders-lookup-source
'((ascii "/~,\\" '((ascii
"| ||" "/~,\\"
">-+<" "| ||"
"'~^`"))) ">-+<"
"'~^`")
(unicode
"┌─┬┐"
"│ ││"
"├─┼┤"
"└─┴┘")))
;; Compiled table borders for rendering ;; Compiled table borders for rendering
(define table-borders-lookup (define table-borders-lookup