1
0
mirror of https://github.com/nsnail/spectre.console.git synced 2025-04-25 04:32:51 +08:00

Rename tree to root so the example compiles.

The 'root' variable does not exist in current context. Either should call Render(tree) or have it renamed to root. I've chosen root as it's more consistent with the examples later on.
This commit is contained in:
MB 2021-04-02 23:18:45 +02:00 committed by Patrik Svensson
parent 9204671b27
commit 6121203fee

@ -10,10 +10,10 @@ The `Tree` widget can be used to render hierarchical data.
```csharp ```csharp
// Create the tree // Create the tree
var tree = new Tree("Root"); var root = new Tree("Root");
// Add some nodes // Add some nodes
var foo = tree.AddNode("[yellow]Foo[/]"); var foo = root.AddNode("[yellow]Foo[/]");
var table = foo.AddNode(new Table() var table = foo.AddNode(new Table()
.RoundedBorder() .RoundedBorder()
.AddColumn("First") .AddColumn("First")
@ -25,7 +25,7 @@ var table = foo.AddNode(new Table()
table.AddNode("[blue]Baz[/]"); table.AddNode("[blue]Baz[/]");
foo.AddNode("Qux"); foo.AddNode("Qux");
var bar = tree.AddNode("[yellow]Bar[/]"); var bar = root.AddNode("[yellow]Bar[/]");
bar.AddNode(new Calendar(2020, 12) bar.AddNode(new Calendar(2020, 12)
.AddCalendarEvent(2020, 12, 12) .AddCalendarEvent(2020, 12, 12)
.HideHeader()); .HideHeader());
@ -67,4 +67,4 @@ var root = new Tree("Root")
// Bold guide lines // Bold guide lines
var root = new Tree("Root") var root = new Tree("Root")
.Guide(TreeGuide.BoldLine); .Guide(TreeGuide.BoldLine);
``` ```