Skip to content

Commit

Permalink
docs: autoupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinJWendt committed Mar 31, 2023
1 parent f80d040 commit 817790f
Show file tree
Hide file tree
Showing 82 changed files with 2,555 additions and 52 deletions.
495 changes: 493 additions & 2 deletions README.md

Large diffs are not rendered by default.

495 changes: 493 additions & 2 deletions _examples/README.md

Large diffs are not rendered by default.

170 changes: 170 additions & 0 deletions _examples/area/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,67 @@
### area/center

![Animation](https://raw.githubusercontent.com/pterm/pterm/master/_examples/area/center/animation.svg)

<details>

<summary>SHOW SOURCE</summary>

```go
package main

import (
"time"

"github.com/pterm/pterm"
)

func main() {
area, _ := pterm.DefaultArea.WithCenter().Start()

for i := 0; i < 5; i++ {
area.Update(pterm.Sprintf("Current count: %d\nAreas can update their content dynamically!", i))
time.Sleep(time.Second)
}

area.Stop()
}

```

</details>

### area/default

![Animation](https://raw.githubusercontent.com/pterm/pterm/master/_examples/area/default/animation.svg)

<details>

<summary>SHOW SOURCE</summary>

```go
package main

import (
"time"

"github.com/pterm/pterm"
)

func main() {
area, _ := pterm.DefaultArea.Start()

for i := 0; i < 5; i++ {
area.Update(pterm.Sprintf("Current count: %d\nAreas can update their content dynamically!", i))
time.Sleep(time.Second)
}

area.Stop()
}

```

</details>

### area/demo

![Animation](https://raw.githubusercontent.com/pterm/pterm/master/_examples/area/demo/animation.svg)
Expand Down Expand Up @@ -32,3 +96,109 @@ func main() {

</details>

### area/dynamic-chart

![Animation](https://raw.githubusercontent.com/pterm/pterm/master/_examples/area/dynamic-chart/animation.svg)

<details>

<summary>SHOW SOURCE</summary>

```go
package main

import (
"time"

"github.com/pterm/pterm"
)

func main() {
area, _ := pterm.DefaultArea.WithFullscreen().WithCenter().Start()
defer area.Stop()

for i := 0; i < 10; i++ {
barchart := pterm.DefaultBarChart.WithBars(dynamicBars(i))
content, _ := barchart.Srender()
area.Update(content)
time.Sleep(500 * time.Millisecond)
}
}

func dynamicBars(i int) pterm.Bars {
return pterm.Bars{
{Label: "A", Value: 10},
{Label: "B", Value: 20 * i},
{Label: "C", Value: 30},
{Label: "D", Value: 40 + i},
}
}

```

</details>

### area/fullscreen

![Animation](https://raw.githubusercontent.com/pterm/pterm/master/_examples/area/fullscreen/animation.svg)

<details>

<summary>SHOW SOURCE</summary>

```go
package main

import (
"time"

"github.com/pterm/pterm"
)

func main() {
area, _ := pterm.DefaultArea.WithFullscreen().Start()

for i := 0; i < 5; i++ {
area.Update(pterm.Sprintf("Current count: %d\nAreas can update their content dynamically!", i))
time.Sleep(time.Second)
}

area.Stop()
}

```

</details>

### area/fullscreen-center

![Animation](https://raw.githubusercontent.com/pterm/pterm/master/_examples/area/fullscreen-center/animation.svg)

<details>

<summary>SHOW SOURCE</summary>

```go
package main

import (
"time"

"github.com/pterm/pterm"
)

func main() {
area, _ := pterm.DefaultArea.WithFullscreen().WithCenter().Start()

for i := 0; i < 5; i++ {
area.Update(pterm.Sprintf("Current count: %d\nAreas can update their content dynamically!", i))
time.Sleep(time.Second)
}

area.Stop()
}

```

</details>

25 changes: 25 additions & 0 deletions _examples/area/center/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# area/center

![Animation](animation.svg)

```go
package main

import (
"time"

"github.com/pterm/pterm"
)

func main() {
area, _ := pterm.DefaultArea.WithCenter().Start()

for i := 0; i < 5; i++ {
area.Update(pterm.Sprintf("Current count: %d\nAreas can update their content dynamically!", i))
time.Sleep(time.Second)
}

area.Stop()
}

```
10 changes: 10 additions & 0 deletions _examples/area/center/animation.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions _examples/area/default/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# area/default

![Animation](animation.svg)

```go
package main

import (
"time"

"github.com/pterm/pterm"
)

func main() {
area, _ := pterm.DefaultArea.Start()

for i := 0; i < 5; i++ {
area.Update(pterm.Sprintf("Current count: %d\nAreas can update their content dynamically!", i))
time.Sleep(time.Second)
}

area.Stop()
}

```
10 changes: 10 additions & 0 deletions _examples/area/default/animation.svg
Loading
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/area/demo/animation.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions _examples/area/dynamic-chart/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# area/dynamic-chart

![Animation](animation.svg)

```go
package main

import (
"time"

"github.com/pterm/pterm"
)

func main() {
area, _ := pterm.DefaultArea.WithFullscreen().WithCenter().Start()
defer area.Stop()

for i := 0; i < 10; i++ {
barchart := pterm.DefaultBarChart.WithBars(dynamicBars(i))
content, _ := barchart.Srender()
area.Update(content)
time.Sleep(500 * time.Millisecond)
}
}

func dynamicBars(i int) pterm.Bars {
return pterm.Bars{
{Label: "A", Value: 10},
{Label: "B", Value: 20 * i},
{Label: "C", Value: 30},
{Label: "D", Value: 40 + i},
}
}

```
10 changes: 10 additions & 0 deletions _examples/area/dynamic-chart/animation.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions _examples/area/fullscreen-center/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# area/fullscreen-center

![Animation](animation.svg)

```go
package main

import (
"time"

"github.com/pterm/pterm"
)

func main() {
area, _ := pterm.DefaultArea.WithFullscreen().WithCenter().Start()

for i := 0; i < 5; i++ {
area.Update(pterm.Sprintf("Current count: %d\nAreas can update their content dynamically!", i))
time.Sleep(time.Second)
}

area.Stop()
}

```
Loading

0 comments on commit 817790f

Please sign in to comment.