This commit is contained in:
Will McGugan 2021-01-09 20:39:03 +00:00
parent 400671dac6
commit 6b0fd05c92

View File

@ -264,7 +264,7 @@ The above command generate the following output in the terminal:
## Tree
Rich can render tree views with guide lines. A tree view is ideal for displaying a file structure, or any other hierarchical data.
Rich can render a [tree](https://rich.readthedocs.io/en/latest/tree.html) with guide lines. A tree is ideal for displaying a file structure, or any other hierarchical data.
The labels of the tree can be simple text or anything else Rich can render. Run the following for a demonstration:
@ -276,6 +276,8 @@ This generates the following output:
![markdown](https://github.com/willmcgugan/rich/raw/master/imgs/tree.png)
See the [tree.py](https://github.com/willmcgugan/rich/blob/master/examples/tree.py) example for a script that displays a tree view of any directory, similar to the linux `tree` command.
## Columns
Rich can render content in neat [columns](https://rich.readthedocs.io/en/latest/columns.html) with equal or optimal width. Here's a very basic clone of the (MacOS / Linux) `ls` command which displays a directory listing in columns: