Skip to content

Put longer type into th title argument in HTML show#2774

Merged
bkamins merged 9 commits intoJuliaData:mainfrom
mortenpi:mp/html-show-title
May 26, 2021
Merged

Put longer type into th title argument in HTML show#2774
bkamins merged 9 commits intoJuliaData:mainfrom
mortenpi:mp/html-show-title

Conversation

@mortenpi
Copy link
Copy Markdown
Contributor

Adds a title argument to the types in the HTML output, so that we would get the full type (up to 256 characters) when hovering over the shortened type with a mouse:

Screenshot from 2021-05-24 14-15-24

@mortenpi
Copy link
Copy Markdown
Contributor Author

The test failures are coming from the string comparisons of the show output. Will happily fix them if the implementation looks good to you.

write(io, "<tr>")
write(io, "<th></th>")
ct = batch_compacttype(Any[eltype(df[!, idx]) for idx in 1:mxcol])
# We put a longer string for the type into the title argument of the <th> element,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is OK

@bkamins bkamins added this to the patch milestone May 24, 2021
@bkamins
Copy link
Copy Markdown
Member

bkamins commented May 24, 2021

Looks very good. Thank you!

@ronisbr - it would be good to have it in PrettyTables.jl also.

CC @nalimilan

@ronisbr
Copy link
Copy Markdown
Member

ronisbr commented May 24, 2021

@ronisbr - it would be good to have it in PrettyTables.jl also.

This feature is awesome! I will add an option into PrettyTables.jl to create comments for each HTML cell. Thus, the packages can use it as they like.

@mortenpi
Copy link
Copy Markdown
Contributor Author

After a bit of whack-a-mole, I think I got all the tests fixed 🙂

@bkamins
Copy link
Copy Markdown
Member

bkamins commented May 25, 2021

@nalimilan - can you please have a quick look before I merge (there is a small code layout fix that I asked but it does not affect the solution). Thank you!

Copy link
Copy Markdown
Member

@nalimilan nalimilan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! That's especially useful to explain that T? means Union{T, Missing}.

@bkamins
Copy link
Copy Markdown
Member

bkamins commented May 26, 2021

@mortenpi - I have pushed a NEWS.md entry for your PR. Please let me know if it is OK. Then I will merge. Thank you!

@mortenpi
Copy link
Copy Markdown
Contributor Author

LGTM!

@bkamins bkamins merged commit d5bb28d into JuliaData:main May 26, 2021
@bkamins
Copy link
Copy Markdown
Member

bkamins commented May 26, 2021

Thank you!

@mortenpi mortenpi deleted the mp/html-show-title branch May 26, 2021 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants