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

Docstring not rendering properly inside table #6

Open
theabhirath opened this issue May 14, 2022 · 2 comments
Open

Docstring not rendering properly inside table #6

theabhirath opened this issue May 14, 2022 · 2 comments

Comments

@theabhirath
Copy link

I've been trying to get FeatureRegistries.jl up for Metalhead.jl and I've hit a bit of a snag. While trying to get the docstring to display, it gets cropped out of the table:

Screenshot 2022-05-14 at 7 43 11 AM

Is there a way to format this by toggling an option in the table so that the newlines render at the appropriate places and the entire docstring is visible? Or is this something I will have to tweak in the markdown for the docstring manually?

@lorenzoh
Copy link
Owner

Cool to see you try this out!

The text rendering is by default limited to 40 characters per column:

function Base.show(io::IO, registry::Registry)
tabledata, kwargs = registrytable(registry)
pretty_table(
io,
map(c -> AnsiTextCell(string(RichCell(c))), tabledata);
backend = Val(:text),
tf=PrettyTables.tf_borderless,
hlines=:all,
vlines=[:begin, :end],
maximum_columns_width=40,
vcrop_mode=:middle,
title_same_width_as_table=true,
kwargs...)
end

I should make that configurable and allow passing kwargs for pretty_table to Registry 👍

As an aside, while I love the way the docstring looks inside the table, I wonder if cropping it vertically to allow more rows to display (at least in text display) may make it easier to find entries. You can always see all of a row's attributes using registry[id]. I think this would also require making the text display more configurable on my side, though. I'm keeping this open until I get to that :)

@theabhirath
Copy link
Author

Yeah, it's a great package, the display looks very pretty! The kwargs for pretty_table via Registry should definitely help. I did think about having more rows to display, but I noticed that show(::Registry) shows all the rows. Seeing more rows would definitely not hurt though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants