Are the plots using UnicodePlots? Very cool feature
See the footnote (another great PrettyTables feature )
Ahh I totally missed that footnote.
Yes! I used UnicodePlots.jl. This test was related to the AnsiTextCell
, a custom cell type that you can pass any string with decorations and it renders it correctly inside the cell.
Hi!
I need to design the name for some predefined table formats in PrettyTables.jl. I have already asked here, and @xlxs4 suggestion was to keep what we have now. However, it will not be possible.
For example, now we have tf_ascii_dots
to define a text table format that uses ASCII dots at borders. The name came from a far past when we only have a text back end. Now, I can rename to tf_text_ascii_dots
, but it is not good also. In the new design, we have a TextTableFormat
that stores all the variables related to table formatting (border style, where to draw vertical and horizontal lines, etc). The old tf_text_ascii_dots
relates only to the border style. Now, we have the structure TextTableBorder
for this purpose.
Hence, I have two options:
tf_text_border_ascii_dots
, which is not the way things are called in English; or- the very verbose
text_table_border__ascii_dots
.
The latter uses two underscores to separate a โnaming spaceโ and I use it a lot internally. What do you think?
tf_text_border_ascii_dots
text_table_border__ascii_dots
- Other (please, comment)
To be less verbose, maybe something like
txt_tborder_ascii_dots
In any case, I will have to read the syntax, unless I use them often I cannot remember such strings.
What about
abstract type TxtPredefinedBorderFmt end
struct TxtDotsBorderFmt <: TxtPredefinedBorderFmt end
struct TxtOtherBorderFmt <: TxtPredefinedBorderFmt end
function TextTableBorder(fmt::TxtPredefinedBorderFmt)
if isa(fmt, TxtDotsBorderFmt) # Or use dispatch
return ....
elseif isa(fmt, TxtOtherBorderFmt)
return ....
end
end
If TextTableBorder
is used across a lot of names, a simple ttb_ascii_dots
would help reduce the verbosity
Thanks for the suggestion @xlxs4 ! However, I realized that probably I will not be able to create good acronyms for PrettyTables.jl at this stage. For example, if we use ttb_
for the text back end, what would we use for the Typst back end when it is implemented ? The problem occurs because we do not have a final product yet.
My conclusion is to be verbose but clear. Afterward, maybe someone in the community can see the whole picture and create a PrettyTablesMeta.jl to make things easier like we have in DataFramesMeta.jl.