Skip to content

Extracting formatting_html as a standalone library? #5022

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

Open
darikg opened this issue Mar 11, 2021 · 3 comments
Open

Extracting formatting_html as a standalone library? #5022

darikg opened this issue Mar 11, 2021 · 3 comments
Labels
topic-arrays related to flexible array support

Comments

@darikg
Copy link
Contributor

darikg commented Mar 11, 2021

Hi, xarray is a superb library but my favorite icing on the cake is the out-of-the-box rich HTML display in Jupyter. I've been finding myself wanting the same thing for every class I use in python that is fundamentally a hierachically structured numerical dataset.

Has there been any discussion of generalizing the whole thing? I'd be happy to give it a shot myself, but I was hoping to pick your collective brains first, especially @benbovy and @jsignell, (who based on my very preliminary github sleuthing were early heavy-lifters?)

@jsignell
Copy link
Contributor

I'm glad you like it! @benbovy really did all the work on writing it. I think there was some talk of extracting it to a separate library, but I'm not sure if it was obvious how to generalize it. It depends whether you would want it to be a standalone library (like pprint) or whether you'd want the libraries to integrate with it (probably using entrypoints).

I would start by thinking about one or two other classes that you'd like to see represented this way and try to see how well what currently exists generalizes.

@benbovy
Copy link
Member

benbovy commented Mar 11, 2021

I'm glad too that you like it. Without the work of @jsignell this would likely still be an open, unfinished PR!

Not sure either how we could generalize it. Also, note that the CSS code used for displaying this rich output is not super robust: it relies on some dirty hacks that required special care in some front-ends (e.g., pydata/pydata-sphinx-theme#274). It's still not displayed correctly when notebooks are rendered on GitHub (although in general GitHub's notebook rendering is not quite reliable anyway).

@darikg
Copy link
Contributor Author

darikg commented Mar 11, 2021

Thank you both! I'll report back if I get anywhere with it

@dcherian dcherian added the topic-arrays related to flexible array support label Jul 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-arrays related to flexible array support
Projects
None yet
Development

No branches or pull requests

4 participants