mirror of
https://github.com/charmbracelet/lipgloss.git
synced 2024-08-17 01:40:36 +03:00
fix(tree): examples
This commit is contained in:
parent
878d31f064
commit
e54d9dd05a
@ -24,17 +24,17 @@ func main() {
|
||||
ItemStyle(itemStyle).
|
||||
EnumeratorStyle(enumeratorStyle).
|
||||
Root("# Table of Contents").
|
||||
Item(
|
||||
Child(
|
||||
tree.New().
|
||||
Root("## Chapter 1").
|
||||
Item("Chapter 1.1").
|
||||
Item("Chapter 1.2"),
|
||||
Child("Chapter 1.1").
|
||||
Child("Chapter 1.2"),
|
||||
).
|
||||
Item(
|
||||
Child(
|
||||
tree.New().
|
||||
Root("## Chapter 2").
|
||||
Item("Chapter 2.1").
|
||||
Item("Chapter 2.2"),
|
||||
Child("Chapter 2.1").
|
||||
Child("Chapter 2.2"),
|
||||
)
|
||||
|
||||
fmt.Println(t)
|
||||
|
@ -19,7 +19,7 @@ func main() {
|
||||
return err
|
||||
}
|
||||
if info.IsDir() {
|
||||
t.Item(tree.New().Root(path))
|
||||
t.Child(tree.New().Root(path))
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
@ -13,10 +13,10 @@ func main() {
|
||||
|
||||
t := tree.New().
|
||||
Root("Groceries").
|
||||
Items(
|
||||
Child(
|
||||
tree.New().
|
||||
Root("Fruits").
|
||||
Items(
|
||||
Child(
|
||||
"Blood Orange",
|
||||
"Papaya",
|
||||
"Dragonfruit",
|
||||
@ -24,14 +24,14 @@ func main() {
|
||||
),
|
||||
tree.New().
|
||||
Root("Items").
|
||||
Items(
|
||||
Child(
|
||||
"Cat Food",
|
||||
"Nutella",
|
||||
"Powdered Sugar",
|
||||
),
|
||||
tree.New().
|
||||
Root("Veggies").
|
||||
Items(
|
||||
Child(
|
||||
"Leek",
|
||||
"Artichoke",
|
||||
),
|
||||
|
@ -9,19 +9,19 @@ import (
|
||||
func main() {
|
||||
t := tree.New().
|
||||
Root(".").
|
||||
Item("Item 1").
|
||||
Item(
|
||||
Child("Item 1").
|
||||
Child(
|
||||
tree.New().
|
||||
Root("Item 2").
|
||||
Item("Item 2.1").
|
||||
Item("Item 2.2").
|
||||
Item("Item 2.3"),
|
||||
Child("Item 2.1").
|
||||
Child("Item 2.2").
|
||||
Child("Item 2.3"),
|
||||
).
|
||||
Item(
|
||||
Child(
|
||||
tree.New().
|
||||
Root("Item 3").
|
||||
Item("Item 3.1").
|
||||
Item("Item 3.2"),
|
||||
Child("Item 3.1").
|
||||
Child("Item 3.2"),
|
||||
)
|
||||
|
||||
fmt.Println(t)
|
||||
|
Loading…
Reference in New Issue
Block a user