How to get the markup string of rich object instead of printing them on the console? #3355
-
For example, we may have a RichTree object root = Tree("🌲 [b green]Rich Tree", highlight=True, hide_root=True)
node = root.add(":file_folder: Renderables", guide_style="red")
simple_node = node.add(":file_folder: [bold yellow]Atomic", guide_style="uu green")
simple_node.add(Group("📄 Syntax", syntax))
simple_node.add(Group("📄 Markdown", Panel(markdown, border_style="green"))) Now, it is certained that we can print the object on the console by |
Beta Was this translation helpful? Give feedback.
Answered by
willmcgugan
May 4, 2024
Replies: 1 comment 1 reply
-
https://rich.readthedocs.io/en/latest/console.html#capturing-output |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
2catycm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://rich.readthedocs.io/en/latest/console.html#capturing-output