Crates.io | tree_decorator |
lib.rs | tree_decorator |
version | 0.1.2 |
source | src |
created_at | 2021-06-21 01:28:53.757104 |
updated_at | 2021-06-30 19:06:06.153636 |
description | An utility lib to render pleasing tree structures at terminal programs. |
homepage | |
repository | https://github.com/lucas-miranda/tree_decorator/ |
max_upload_size | |
id | 412651 |
size | 45,609 |
An utility rust lib to render pleasing tree structures at terminal programs.
It's goal is to simplify tree structure display while ensuring a good looking to it. So it just handle strings, returning the expected result (with current level and supplied styles) and nothing more.
Already comes with a standard visual implementation, so is ready to use, but a custom implementation is very easy to set.
As little as possible.
Please, check Documentation to see a detailed explanation.
use tree_decorator::tree_item;
tree_item!(block, "Items");
tree_item!("A");
tree_item!(block, "B");
tree_item!(last, "B.1");
tree_item!("C");
tree_item!(last, "D");
Items
├ A
├ B
│ └ B.1
├ C
└ D
use tree_decorator::tree_item;
tree_item!(block, "Items");
tree_item!("A");
tree_item!(block, "B");
tree_item!(block, "B.1");
tree_item!(last, "B.1.a");
tree_item!(block, "B.2");
tree_item!("B.2.a");
tree_item!(last, "B.2.b");
tree_item!(last, "B.3");
tree_item!("C");
tree_item!(last; block, "D");
tree_item!("D.1");
tree_item!("D.2");
tree_item!(last, "D.3");
close_tree_item!();
Items
├ A
├ B
│ ├ B.1
│ │ └ B.1.a
│ ├ B.2
│ │ ├ B.2.a
│ │ └ B.2.b
│ └ B.3
├ C
└ D
├ D.1
├ D.2
└ D.3
Everything is licensed under MIT License.