You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I've started to play around with using penzai to render objects to HTML, which I think embed in my documentation via markdown-exec.
From this experience, I've found a few features (specific to the HTML rendering, I believe) which might be useful to consider. Alternatively, perhaps these are already options! I just haven't determined how to use them!
By default, when folded, hide nested fields
When rendering now, the whole structure is sort of splatted into the HTML. I think replacing the nested innards with ... (or something equivalent) would be quite helpful here. Here's a picture to indicate what I mean:
In this image, the thing I mean is that each structure would not print any of its inside fields until unfolded -- hidden with e.g. ...
Remove selector and path renderings
Outside of an interactive environment, it's not useful to see what the selectors will be for inner fields. Additionally, it's not useful to see where things are defined. I'm wondering if it is possible to turn these off (as part of render_to_html).
The text was updated successfully, but these errors were encountered:
For the ... rendering, I've so far avoided doing that in order to preserve round-trippability (similar to ordinary repr or pprint). It's also sometimes useful to see many nesting levels at once, especially if you have a lot of small objects (e.g. a list of lists of integers), so it seems like just "always replace nested objects with ..." might be less useful in some cases. I'll have to think about what an appropriate summarization strategy should be, and when to enable it.
In the long run maybe there should be configuration options for these that you can use when setting up treescope. (The render_to_html function is currently used internally for some interactive rendering, so I don't think it would make sense to change its default behavior.)
Re — I was able to turn off the buttons and path renderings by writing my own handler (the handler overloading was quite easy to get the hang of! Neat system). I wasn’t able to figure out the folded (…) idea, but may try again if I have time tomorrow.
Hi! I've started to play around with using
penzai
to render objects to HTML, which I think embed in my documentation viamarkdown-exec
.From this experience, I've found a few features (specific to the HTML rendering, I believe) which might be useful to consider. Alternatively, perhaps these are already options! I just haven't determined how to use them!
By default, when folded, hide nested fields
When rendering now, the whole structure is sort of splatted into the HTML. I think replacing the nested innards with
...
(or something equivalent) would be quite helpful here. Here's a picture to indicate what I mean:In this image, the thing I mean is that each structure would not print any of its inside fields until unfolded -- hidden with e.g.
...
Remove selector and path renderings
Outside of an interactive environment, it's not useful to see what the selectors will be for inner fields. Additionally, it's not useful to see where things are defined. I'm wondering if it is possible to turn these off (as part of
render_to_html
).The text was updated successfully, but these errors were encountered: