Replies: 2 comments 8 replies
-
I'll need a little more information on what the output you want, and what you've tried so far... |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Rich is really great. I love the way things look with it!
I'm having some trouble figuring out how to customize the rendering of a deeply nested tree data structure. The data structure represents a schema of highly nested but uniform JSON data.
It looks like this:
The one I'm dealing with is much bigger and more complex and showing the entire schema is undesirable.
I don't want to print this using
__rich_repr__
because this is a user-facing display, and showing the guts of the underlying objects is undesirable.Ideally I can somehow hook into rich with this custom tree data structure and have rich automatically truncate the depth of of the structure for me.
Is there a way to do this? Can I somehow leverage the existing sequence printing code that automatically truncate by bringing my own sequence? How would I do that?
I've tried implementing the following things to no avail:
__rich_repr__
, this is too verbose and not what I want stylistically__rich_console__
, this doesn't appear to automatically handle indentation for nesting and doesn't automatically truncate.Beta Was this translation helpful? Give feedback.
All reactions