-
Notifications
You must be signed in to change notification settings - Fork 122
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
Make _repr_html_
look like _repr_json_
output
#1142
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1142 +/- ##
==========================================
+ Coverage 90.94% 91.17% +0.23%
==========================================
Files 49 49
Lines 6645 6626 -19
Branches 982 978 -4
==========================================
- Hits 6043 6041 -2
+ Misses 422 410 -12
+ Partials 180 175 -5
☔ View full report in Codecov by Sentry. |
There is a minor issue with indentation and then I need to add a few tests, so I'm switching this to WIP |
Ok here is some deeper nesting after a0eaf55 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this a lot, and added bonus that it's a code-removing PR 🎉!
I just noticed that the notebook size got kind of big with this change. Taking a look now to see if I can improve that experience |
Ok I did some mild simplification. The sections are still expanded by default when rendered in github, but they are in the old repr as well. And they both look fine on nbviewer: https://nbviewer.org/github/jsignell/pystac/blob/html-like-json/docs/quickstart.ipynb |
Related Issue(s):
_repr_html_
causes GETs #1097, HTML rendering should show asset keys #1124Description:
This is similar to #1130 but it adds an html template that looks like the one that jlab uses for
_repr_json_
. There seemed to be agreement on #1130 that the json repr was a nice repr for stac objects but the lack of support in vscode (and in classic notebook) was a big deterrent.I mimicked the style of the repr_json output in jupyter lab, but am not depending on any classes since those don't seem to exist in vscode. I think the colors look pretty ok in light and dark mode, but if people disagree there is probably some tweaks we can do.
vscode:
jupyter notebook:
jupyterlab light:
juptyerlab dark:
PR Checklist:
pre-commit
hooks pass locallyscripts/test
)