Work on table rendering and integrate it.

This commit is contained in:
Dominik Pantůček 2023-03-22 17:00:14 +01:00
parent 6d9c5b8d31
commit 6eeea2f1f3
2 changed files with 33 additions and 9 deletions

View file

@ -35,6 +35,7 @@
(chicken base)
(chicken string)
(chicken format)
(chicken keyword)
ansi
testing)
@ -153,8 +154,25 @@
(table-stringify
(table-rectangularize tbl))))))
;; Table border styles in visual form
(define table-borders-lookup-source
'((ascii "/~,\\"
"| ||"
">-+<"
"'~^`")))
;; Compiled table borders for rendering
(define table-borders-lookup
(map (lambda (src)
(cons (car src) (apply string-join (cdr src))))
table-borders-lookup-source))
(define (table->string tbl . args)
"")
(let ((table-border (get-keyword #:table-border args (lambda () #f)))
(cell-border (get-keyword #:cell-border args (lambda () #f)))
(border-style (get-keyword #:border-style args (lambda () 'ascii)))
(table (table-prepare tbl)))
""))
;; Performs module self-tests
(define (table-tests!)