Skip to content

Commit

Permalink
docs: autoupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinJWendt committed Jan 22, 2023
1 parent 8da601f commit c0cd74f
Show file tree
Hide file tree
Showing 46 changed files with 254 additions and 68 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<a name="unreleased"></a>
## [Unreleased]

### Bug Fixes
- **tree:** print top node [#443](https://github.com/pterm/pterm/issues/443)


<a name="v0.12.53"></a>
## [v0.12.53] - 2023-01-05
Expand Down
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1663,6 +1663,41 @@ func main() {
```go
package main

import (
"github.com/pterm/pterm"
)

func main() {
tree := pterm.TreeNode{
Text: "Top node",
Children: []pterm.TreeNode{{
Text: "Child node",
Children: []pterm.TreeNode{
{Text: "Grandchild node"},
{Text: "Grandchild node"},
{Text: "Grandchild node"},
},
}},
}

pterm.DefaultTree.WithRoot(tree).Render()
}

```

</details>

### tree/from-leveled-list

![Animation](https://raw.githubusercontent.com/pterm/pterm/master/_examples/tree/from-leveled-list/animation.svg)

<details>

<summary>SHOW SOURCE</summary>

```go
package main

import (
"github.com/pterm/pterm"
"github.com/pterm/pterm/putils"
Expand Down Expand Up @@ -1697,6 +1732,7 @@ func main() {

// Generate tree from LeveledList.
root := putils.TreeFromLeveledList(leveledList)
root.Text = "Computer"

// Render TreePrinter
pterm.DefaultTree.WithRoot(root).Render()
Expand Down
36 changes: 36 additions & 0 deletions _examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1535,6 +1535,41 @@ func main() {
```go
package main

import (
"github.com/pterm/pterm"
)

func main() {
tree := pterm.TreeNode{
Text: "Top node",
Children: []pterm.TreeNode{{
Text: "Child node",
Children: []pterm.TreeNode{
{Text: "Grandchild node"},
{Text: "Grandchild node"},
{Text: "Grandchild node"},
},
}},
}

pterm.DefaultTree.WithRoot(tree).Render()
}

```

</details>

### tree/from-leveled-list

![Animation](https://raw.githubusercontent.com/pterm/pterm/master/_examples/tree/from-leveled-list/animation.svg)

<details>

<summary>SHOW SOURCE</summary>

```go
package main

import (
"github.com/pterm/pterm"
"github.com/pterm/pterm/putils"
Expand Down Expand Up @@ -1569,6 +1604,7 @@ func main() {

// Generate tree from LeveledList.
root := putils.TreeFromLeveledList(leveledList)
root.Text = "Computer"

// Render TreePrinter
pterm.DefaultTree.WithRoot(root).Render()
Expand Down
2 changes: 1 addition & 1 deletion _examples/area/demo/animation.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion _examples/barchart/demo/animation.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c0cd74f

Please sign in to comment.