-
Notifications
You must be signed in to change notification settings - Fork 368
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
[propose] Allow better customization of individual chars #115
base: master
Are you sure you want to change the base?
Conversation
This change is inspired by node.js's https://github.com/Automattic/cli-table which allows to configure individual characters. By default it still render as before and still has the same 3 methods for customizing the characters. I am introducing a new method called `SetSeparators()` which receives an struct with all separators characters. I am also exposing Themes.Default, Themes.CliTable, Themes.CliTableDouble.
Looks nice. Could you please rebase master? |
ping @jfromaniello |
A lot of modification has happened since this PR, @mattn should this be closed? |
This is such an awesome PR, would love to see this land. The CLI theme looks much cleaner. Example:
vs
|
Wow. I do not remember anything about this PR. I haven’t written code in golang for a while. I might have just copied a lot of code from the cli-table project as I mentioned in the request. I am honestly not sure if I could be of any help. |
Thanks for putting this together all those years ago. Not sure how actively maintained this package is now, but if time permits I could offer to pick this up. There is definitely value in allowing this to make the final tables look sharper. |
This is a follow-up to olekukonko#207 and caters for one of the motivating examples of olekukonko#115, namely the example with double outer boundary but single inner lines. This change does *not* allow all the customization options of that latter pull request at this stage, but instead reserves the actual representation of the style as an implementation detail which can evolve as needed, while only exposing few selected combinations to the caller.
This is a follow-up to olekukonko#207 and caters for one of the motivating examples of olekukonko#115, namely the example with double outer boundary but single inner lines. This change does *not* allow all the customization options of that latter pull request at this stage, but instead reserves the actual representation of the style as an implementation detail which can evolve as needed, while only exposing few selected combinations to the caller.
This is a follow-up to olekukonko#207 and caters for one of the motivating examples of olekukonko#115, namely the example with double outer boundary but single inner lines. This change does *not* allow all the customization options of that latter pull request at this stage, but instead reserves the actual representation of the style as an implementation detail which can evolve as needed, while only exposing few selected combinations to the caller.
This change is inspired by node.js's https://github.com/Automattic/cli-table which allows to configure more separator characters to allow the user to use a wider scope of ascii characters.
By default it still render as before and still has the same 3 methods for customizing the characters.
I am introducing a new method called
SetSeparators()
which receives an struct with all separators characters.I am also exposing
Themes.Default
,Themes.CliTable
,Themes.CliTableDouble
.Example with Themes.Default (or by not setting the separators):
Example with Themes.CliTable
Example with Themes.CliTableDouble
Example with
table.SetSeparators(Themes.CliTable)
andtable.SetBorder(false)
: