Skip to content

Commit 2a67670

Browse files
authored
Drop Tree (#330)
* fix: move tree to internal * feat: tree indenter on lists * fix: sublist example * fix: remove tree
1 parent 9564423 commit 2a67670

File tree

15 files changed

+96
-187
lines changed

15 files changed

+96
-187
lines changed

β€Žexamples/go.modβ€Ž

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ go 1.19
44

55
replace github.com/charmbracelet/lipgloss => ../
66

7-
replace github.com/charmbracelet/lipgloss/tree => ../tree
8-
97
replace github.com/charmbracelet/lipgloss/list => ../list
108

119
require (

β€Žexamples/list/sublist/main.goβ€Ž

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"github.com/charmbracelet/lipgloss"
77
"github.com/charmbracelet/lipgloss/list"
88
"github.com/charmbracelet/lipgloss/table"
9-
"github.com/charmbracelet/lipgloss/tree"
109
"github.com/lucasb-eyer/go-colorful"
1110
)
1211

@@ -119,16 +118,16 @@ func main() {
119118
Item("Lip Gloss").
120119
Item("Lip Gloss").
121120
Item(
122-
tree.New().
121+
list.New().
123122
EnumeratorStyle(lipgloss.NewStyle().Foreground(lipgloss.Color(colors[4][0])).MarginRight(1)).
124-
Child("\nStyle Definitions for Nice Terminal Layouts\n─────").
125-
Child("From Charm").
126-
Child("https://github.com/charmbracelet/lipgloss").
127-
Child(
128-
tree.New().
123+
Item("\nStyle Definitions for Nice Terminal Layouts\n─────").
124+
Item("From Charm").
125+
Item("https://github.com/charmbracelet/lipgloss").
126+
Item(
127+
list.New().
129128
EnumeratorStyle(lipgloss.NewStyle().Foreground(lipgloss.Color(colors[3][0])).MarginRight(1)).
130-
Child("Emperors: Julio-Claudian dynasty").
131-
Child(
129+
Item("Emperors: Julio-Claudian dynasty").
130+
Item(
132131
lipgloss.NewStyle().Padding(1).Render(
133132
list.New(
134133
"Augustus",
@@ -139,7 +138,7 @@ func main() {
139138
).Enumerator(list.Roman).String(),
140139
),
141140
).
142-
Child(
141+
Item(
143142
lipgloss.NewStyle().
144143
Bold(true).
145144
Foreground(lipgloss.Color("#FAFAFA")).
@@ -151,7 +150,7 @@ func main() {
151150
Width(40).
152151
Render(history),
153152
).
154-
Child(
153+
Item(
155154
table.New().
156155
Width(30).
157156
BorderStyle(purple.MarginRight(0)).
@@ -174,8 +173,8 @@ func main() {
174173
Row("Orange", "2").
175174
Row("Strawberry", "12"),
176175
).
177-
Child("Documents").
178-
Child(
176+
Item("Documents").
177+
Item(
179178
list.New().
180179
Enumerator(func(_ list.Items, i int) string {
181180
if i == 1 {
@@ -200,9 +199,9 @@ func main() {
200199
Item("Baz Document\n" + faint.Render("10 minutes ago")).
201200
Item("Qux Document\n" + faint.Render("1 month ago")),
202201
).
203-
Child("EOF"),
202+
Item("EOF"),
204203
).
205-
Child("go get github.com/charmbracelet/lipgloss/list\n"),
204+
Item("go get github.com/charmbracelet/lipgloss/list\n"),
206205
).
207206
Item("See ya later"),
208207
),

β€Žexamples/tree/background/main.goβ€Ž

Lines changed: 0 additions & 41 deletions
This file was deleted.

β€Žexamples/tree/files/main.goβ€Ž

Lines changed: 0 additions & 28 deletions
This file was deleted.

β€Žexamples/tree/rounded/main.goβ€Ž

Lines changed: 0 additions & 41 deletions
This file was deleted.

β€Žexamples/tree/simple/main.goβ€Ž

Lines changed: 0 additions & 28 deletions
This file was deleted.

β€Žexamples/tree/styles/main.goβ€Ž

Lines changed: 0 additions & 27 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
Β (0)