I have just tagged a new version of PrettyTables.jl (v0.5.0).
It turns out that the number of options we have now is huge and the commands to print the formatted tables as we want is sometimes very, very large. This was bothering me, because for most of my analysis I want a fix set of configurations while I am looking at the data. Hence, I came up with a mechanism that I think will help! It more or less like a global configuration.
First, we have the
@pt macro that will pretty print the tables after it. Like:
By default, it will use the default configurations as described in the documentation of the function
pretty_table. However, we can modify any of the configurations in the keywords of that function by using the other macro
tf parameter is not a keyword of
pretty_table, but can be used to change the table format.
All calls to
@pt will now use the configurations assigned by
@ptconf. If the user wants to go back to default, just call
Finally, if the user wants to add a header, then they must add an assignment to the “virtual” variable
:header just like in:
I think we can improve this, so, please, give me feedback about it (ah, I have just implemented it and did not have much time to test, so expect bugs…).
I also implemented two additional features:
highlighterskeyword can now receive just one highlighter without needing to add it to a
- There is now a keyword
nosubheaderto suppress the sub-header printing. This is useful if the user wants to print a
DataFramewithout the type (thanks @xgdgsc) :