v1.0.0-alpha.3
Pre-release
Pre-release
What's New
- This release contains breaking changes to the API. This should hopefully be the last major breaking change to the API for a long time.
TextTable<T>
construction closure now takes an instance ofT
instead of aConfig<T>
.Config<T>
has been removed completely. Instead of callingcolumn(...)
on aConfig<T>
in the closure, you now return an array ofColumn
instances. See example transition below for details.- Fixed: Missing/broken tests.
- Fixed: Latex
tabular
environment contains incorrect alignments. - Fixed: Handle optional values in mapping.
- Fixed:
FancyGrid
using pipe symbol instead of unicode drawing character for header separator. - All columns are now left-aligned by default (instead of right-aligning the first column by default).
TextTableFormatter
has been renamed toTextTableStyle
to avoid confusion with the Foundation Formatters class. All references to the word "format" when referring to the type of table rendered have bee changed to "style".- The
TextTableStyle
protocol (formerlyTextTableFormatter
) is now simplified. All methods inTextTableStyle
are now static, no state is maintained inTextTableStyle
. The methods have also been consolidated (row
instead ofbeginRow
,endRow
,content
,beginColumn
, etc...). TextTable<T>
and all the internal types are now value types instead of classes.- All built-in styles are case-less
enums
so they cannot be accidentally instantiated.
Known Issues
- Very little effort has but put into performance optimizations. String utilities in particular.
- It should be possible to create columns without headers, but this hasn't been tested and likely doesn't work yet.
Transitioning
Before:
let table = TextTable<Person> { t in
t.column("Name") { $0.name }
t.column("Age") { $0.age }
t.column("Birthday") { $0.birhtday }
}
After:
let table = TextTable<Person> {
[Column("Name" <- $0.name),
Column("Age" <- $0.age),
Column("Birthday" <- $0.birhtday)]
}
SPM Dependency Snippet
.Package(url: "https://github.com/cfilipov/TextTable", Version(1, 0, 0, prereleaseIdentifiers: ["alpha", "3"]))