Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve / Refactor table format customization API #9

Closed
16 of 18 tasks
phsym opened this issue Dec 14, 2015 · 3 comments
Closed
16 of 18 tasks

Improve / Refactor table format customization API #9

phsym opened this issue Dec 14, 2015 · 3 comments
Assignees
Milestone

Comments

@phsym
Copy link
Owner

phsym commented Dec 14, 2015

Table format customization API is a bit weird and not clean. Some refactoring should be done on it.
Builder Pattern may be use in a type named for example FormatBuilder.

What should be customizable :

  • Padding
    • Right
    • Left
  • Vertical separators
    • Right
    • Left
    • Intern
  • Horizontal separators
    • Top
    • Bottom
    • Intern
  • Junction characters
  • Colspan (delayed to a next release)
  • Default style (alignment, colors , ...) (delayed to a next release)
  • Implement builder pattern for API
  • Change default format constants to functions or lazy_static constants
  • Add a section about formatting in README
  • Add an example file
@phsym phsym added this to the v0.6.0 milestone Dec 14, 2015
@hoodie
Copy link
Contributor

hoodie commented Dec 14, 2015

Hi, just since you're openly thinking about it. It would be awesome if the api could allow different kinds of symbols for Top, Bottom and Intermittent separators, or colspans.
What do you think?

This could allow rendering something like this:

┌───────────────────────────────────────┐
│              test table               │
├───────────────────────────────────────┤
│         one  two  three   four   five │
├───────────────────────────────────────┤
│         one  two  three               │
│                3    4     5           │
│           2    3    4     5           │
│           3    3    5     605.0       │
│ hello world                           │
│          27                           │
│           1  two  three               │
└───────────────────────────────────────┘

@phsym
Copy link
Owner Author

phsym commented Dec 17, 2015

👍 I'll take a look at this

@phsym phsym self-assigned this Jan 17, 2016
@phsym
Copy link
Owner Author

phsym commented Jan 19, 2016

Colspans and Default styles will be done later and added to a minor release. I want to release v0.6.0 quickly to fix the Type Ascription issue in nightly rust.

@phsym phsym closed this as completed in #19 Jan 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants