Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new example structure #349

Merged
merged 7 commits into from Apr 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3,188 changes: 2,868 additions & 320 deletions README.md

Large diffs are not rendered by default.

4,075 changes: 4,075 additions & 0 deletions _examples/README.md

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions _examples/area/README.md
@@ -1,6 +1,10 @@
# area
### area/demo

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

<details>

<summary>SHOW SOURCE</summary>

```go
package main
Expand All @@ -25,3 +29,6 @@ func main() {
}

```

</details>

10 changes: 0 additions & 10 deletions _examples/area/animation.svg

This file was deleted.

27 changes: 27 additions & 0 deletions _examples/area/demo/README.md
@@ -0,0 +1,27 @@
# area/demo

![Animation](animation.svg)

```go
package main

import (
"time"

"github.com/pterm/pterm"
)

func main() {
pterm.Info.Println("The previous text will stay in place, while the area updates.")
pterm.Print("\n\n") // Add two new lines as spacer.

area, _ := pterm.DefaultArea.WithCenter().Start() // Start the Area printer, with the Center option.
for i := 0; i < 10; i++ {
str, _ := pterm.DefaultBigText.WithLetters(pterm.NewLettersFromString(time.Now().Format("15:04:05"))).Srender() // Save current time in str.
area.Update(str) // Update Area contents.
time.Sleep(time.Second)
}
area.Stop()
}

```
10 changes: 10 additions & 0 deletions _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.
File renamed without changes.
10 changes: 0 additions & 10 deletions _examples/barchart-mixed-values/animation.svg

This file was deleted.

10 changes: 0 additions & 10 deletions _examples/barchart-negative-values/animation.svg

This file was deleted.