Work on table rendering and integrate it.
This commit is contained in:
parent
6d9c5b8d31
commit
6eeea2f1f3
2 changed files with 33 additions and 9 deletions
22
Makefile
22
Makefile
|
@ -37,27 +37,27 @@ all: imports shared static
|
||||||
|
|
||||||
CSC=csc
|
CSC=csc
|
||||||
|
|
||||||
BBSTOOL-DEPS=bbstool.scm testing.import.scm listing.import.scm \
|
BBSTOOL-DEPS=bbstool.scm testing.import.scm listing.import.scm \
|
||||||
dictionary.import.scm month.import.scm period.import.scm \
|
dictionary.import.scm month.import.scm period.import.scm \
|
||||||
ansi.import.scm member-file.import.scm \
|
ansi.import.scm member-file.import.scm \
|
||||||
command-line.import.scm members-base.import.scm \
|
command-line.import.scm members-base.import.scm \
|
||||||
utils.import.scm primes.import.scm member-record.import.scm \
|
utils.import.scm primes.import.scm member-record.import.scm \
|
||||||
configuration.import.scm progress.import.scm
|
configuration.import.scm progress.import.scm table.import.scm
|
||||||
|
|
||||||
BBSTOOL-SOURCES=bbstool.scm testing.scm listing.scm \
|
BBSTOOL-SOURCES=bbstool.scm testing.scm listing.scm dictionary.scm \
|
||||||
dictionary.scm month.scm period.scm ansi.scm member-file.scm \
|
month.scm period.scm ansi.scm member-file.scm \
|
||||||
command-line.scm members-base.scm utils.scm primes.scm \
|
command-line.scm members-base.scm utils.scm primes.scm \
|
||||||
member-record.scm configuration.scm progress.scm
|
member-record.scm configuration.scm progress.scm table.scm
|
||||||
|
|
||||||
BBSTOOL-OBJS=testing.o listing.o month.o period.o ansi.o \
|
BBSTOOL-OBJS=testing.o listing.o month.o period.o ansi.o \
|
||||||
member-file.o dictionary.o command-line.o \
|
member-file.o dictionary.o command-line.o \
|
||||||
members-base.o utils.o primes.o member-record.o \
|
members-base.o utils.o primes.o member-record.o \
|
||||||
configuration.o progress.o
|
configuration.o progress.o table.o
|
||||||
|
|
||||||
BBSTOOL-SHARED=testing.so listing.so month.so period.so ansi.so \
|
BBSTOOL-SHARED=testing.so listing.so month.so period.so ansi.so \
|
||||||
member-file.so dictionary.so command-line.so \
|
member-file.so dictionary.so command-line.so \
|
||||||
members-base.so utils.so primes.so member-record.so \
|
members-base.so utils.so primes.so member-record.so \
|
||||||
configuration.so progress.so
|
configuration.so progress.so table.so
|
||||||
|
|
||||||
.PHONY: imports
|
.PHONY: imports
|
||||||
imports: $(BBSTOOL-DEPS)
|
imports: $(BBSTOOL-DEPS)
|
||||||
|
@ -181,3 +181,9 @@ PROGRESS-SOURCES=progress.scm
|
||||||
progress.so: progress.o
|
progress.so: progress.o
|
||||||
progress.o: progress.import.scm
|
progress.o: progress.import.scm
|
||||||
progress.import.scm: $(PROGRESS-SOURCES)
|
progress.import.scm: $(PROGRESS-SOURCES)
|
||||||
|
|
||||||
|
TABLE-SOURCES=table.scm ansi.import.scm testing.import.scm
|
||||||
|
|
||||||
|
table.so: table.o
|
||||||
|
table.o: table.import.scm
|
||||||
|
table.import.scm: $(TABLE-SOURCES)
|
||||||
|
|
20
table.scm
20
table.scm
|
@ -35,6 +35,7 @@
|
||||||
(chicken base)
|
(chicken base)
|
||||||
(chicken string)
|
(chicken string)
|
||||||
(chicken format)
|
(chicken format)
|
||||||
|
(chicken keyword)
|
||||||
ansi
|
ansi
|
||||||
testing)
|
testing)
|
||||||
|
|
||||||
|
@ -153,8 +154,25 @@
|
||||||
(table-stringify
|
(table-stringify
|
||||||
(table-rectangularize tbl))))))
|
(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)
|
(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
|
;; Performs module self-tests
|
||||||
(define (table-tests!)
|
(define (table-tests!)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue