TextTable v1.0.0-alpha.3 Release Notes

Release Date: 2016-08-17 // almost 8 years ago
  • 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 of T instead of a Config<T>. Config<T> has been removed completely. Instead of calling column(...) on a Config<T> in the closure, you now return an array of Column 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.
    • 0๏ธโƒฃ All columns are now left-aligned by default (instead of right-aligning the first column by default).
    • ๐Ÿ’… TextTableFormatter has been renamed to TextTableStyle 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 (formerly TextTableFormatter) is now simplified. All methods in TextTableStyle are now static, no state is maintained in TextTableStyle. The methods have also been consolidated (row instead of beginRow, 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.



    let table = TextTable<Person> { t in
        t.column("Name") { $0.name }
        t.column("Age") { $0.age }
        t.column("Birthday") { $0.birhtday }


    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"]))