Skip to content

Commit

Permalink
docs: autoupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinJWendt committed Feb 9, 2024
1 parent 1a9d517 commit 1800c6e
Show file tree
Hide file tree
Showing 82 changed files with 175 additions and 100 deletions.
35 changes: 31 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2388,11 +2388,38 @@ import (
)

func main() {
// Create an interactive text input with single line input mode
textInput := pterm.DefaultInteractiveTextInput.WithMultiLine(false)
// Create an interactive text input with single line input mode and show it
result, _ := pterm.DefaultInteractiveTextInput.Show()

// Show the text input and get the result
result, _ := textInput.Show()
// Print a blank line for better readability
pterm.Println()

// Print the user's answer with an info prefix
pterm.Info.Printfln("You answered: %s", result)
}

```

</details>

### interactive_textinput/default-value

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

<details>

<summary>SHOW SOURCE</summary>

```go
package main

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

func main() {
// Create an interactive text input with single line input mode and show it
result, _ := pterm.DefaultInteractiveTextInput.WithDefaultValue("Some default value").Show()

// Print a blank line for better readability
pterm.Println()
Expand Down
35 changes: 31 additions & 4 deletions _examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2256,11 +2256,38 @@ import (
)

func main() {
// Create an interactive text input with single line input mode
textInput := pterm.DefaultInteractiveTextInput.WithMultiLine(false)
// Create an interactive text input with single line input mode and show it
result, _ := pterm.DefaultInteractiveTextInput.Show()

// Show the text input and get the result
result, _ := textInput.Show()
// Print a blank line for better readability
pterm.Println()

// Print the user's answer with an info prefix
pterm.Info.Printfln("You answered: %s", result)
}

```

</details>

### interactive_textinput/default-value

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

<details>

<summary>SHOW SOURCE</summary>

```go
package main

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

func main() {
// Create an interactive text input with single line input mode and show it
result, _ := pterm.DefaultInteractiveTextInput.WithDefaultValue("Some default value").Show()

// Print a blank line for better readability
pterm.Println()
Expand Down
2 changes: 1 addition & 1 deletion _examples/area/center/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/area/default/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/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/area/dynamic-chart/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 1800c6e

Please sign in to comment.