Skip to content

Commit

Permalink
docs(examples): update tree examples to (mostly) match readme
Browse files Browse the repository at this point in the history
  • Loading branch information
meowgorithm committed Aug 22, 2024
1 parent cc6556e commit 4a47e67
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
17 changes: 11 additions & 6 deletions examples/tree/makeup/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,27 @@ import (
)

func main() {
enumeratorStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("99")).MarginRight(1)
itemStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("212")).MarginRight(1)
enumeratorStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("63")).MarginRight(1)
rootStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("35"))
itemStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("212"))

t := tree.
Root("Makeup").
Root("Makeup").
Child(
"Glossier",
"Claire’s Boutique",
"Fenty Beauty",
tree.New().Child(
"Gloss Bomb Universal Lip Luminizer",
"Hot Cheeks Velour Blushlighter",
),
"Nyx",
"Mac",
"Milk",
).
Enumerator(tree.RoundedEnumerator).
EnumeratorStyle(enumeratorStyle).
ItemStyle(itemStyle).
RootStyle(lipgloss.NewStyle().Foreground(lipgloss.Color("#04B575")))
RootStyle(rootStyle).
ItemStyle(itemStyle)

fmt.Println(t)
}
16 changes: 8 additions & 8 deletions examples/tree/simple/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ import (

func main() {
t := tree.Root(".").
Child("Item 1").
Child("macOS").
Child(
tree.New().
Root("Item 2").
Child("Item 2.1").
Child("Item 2.2").
Child("Item 2.3"),
Root("Linux").
Child("NixOS").
Child("Arch Linux (btw)").
Child("Void Linux"),
).
Child(
tree.New().
Root("Item 3").
Child("Item 3.1").
Child("Item 3.2"),
Root("BSD").
Child("FreeBSD").
Child("OpenBSD"),
)

fmt.Println(t)
Expand Down
2 changes: 1 addition & 1 deletion examples/tree/toggle/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (s file) String() string {
func main() {
s := defaultStyles()

t := tree.Root(dir{"~", true, s}).
t := tree.Root(dir{"~/charm", true, s}).
Enumerator(tree.RoundedEnumerator).
EnumeratorStyle(s.enumerator).
Child(
Expand Down

0 comments on commit 4a47e67

Please sign in to comment.