File tree Expand file tree Collapse file tree 1 file changed +25
-26
lines changed
Expand file tree Collapse file tree 1 file changed +25
-26
lines changed Original file line number Diff line number Diff line change @@ -574,7 +574,7 @@ Define a new tree.
574574
575575``` go
576576t := tree.Root (" ." ).
577- Child (" A" , " B" , " C" )
577+ Child (" A" , " B" , " C" )
578578```
579579
580580Print the tree.
@@ -592,18 +592,18 @@ Trees have the ability to nest.
592592
593593``` go
594594t := tree.Root (" ." ).
595- Child (" Item 1" ).
596- Child (
597- tree.Root (" Item 2" ).
598- Child (" Item 2.1" ).
599- Child (" Item 2.2" ).
600- Child (" Item 2.3" ),
601- ).
602- Child (
603- tree.Root (" Item 3" ).
604- Child (" Item 3.1" ).
605- Child (" Item 3.2" ),
606- )
595+ Child (" Item 1" ).
596+ Child (
597+ tree.Root (" Item 2" ).
598+ Child (" Item 2.1" ).
599+ Child (" Item 2.2" ).
600+ Child (" Item 2.3" ),
601+ ).
602+ Child (
603+ tree.Root (" Item 3" ).
604+ Child (" Item 3.1" ).
605+ Child (" Item 3.2" ),
606+ )
607607```
608608
609609Print the tree.
@@ -623,19 +623,18 @@ Trees can be customized via their enumeration function as well as using
623623enumeratorStyle := lipgloss.NewStyle ().Foreground (lipgloss.Color (" 99" )).MarginRight (1 )
624624itemStyle := lipgloss.NewStyle ().Foreground (lipgloss.Color (" 212" )).MarginRight (1 )
625625
626- t := tree.
627- Root (" Makeup" ).
628- Child (
629- " Glossier" ,
630- " Claire’s Boutique" ,
631- " Nyx" ,
632- " Mac" ,
633- " Milk" ,
634- ).
635- Enumerator (tree.RoundedEnumerator ).
636- EnumeratorStyle (enumeratorStyle).
637- ItemStyle (itemStyle).
638- RootStyle (lipgloss.NewStyle ().Foreground (lipgloss.Color (" #04B575" )))
626+ t := tree.Root (" Makeup" ).
627+ Child (
628+ " Glossier" ,
629+ " Claire’s Boutique" ,
630+ " Nyx" ,
631+ " Mac" ,
632+ " Milk" ,
633+ ).
634+ Enumerator (tree.RoundedEnumerator ).
635+ EnumeratorStyle (enumeratorStyle).
636+ ItemStyle (itemStyle).
637+ RootStyle (lipgloss.NewStyle ().Foreground (lipgloss.Color (" #04B575" )))
639638```
640639
641640Print the tree.
You can’t perform that action at this time.
0 commit comments