Skip to content

Commit

Permalink
Merge branch 'master' into issue-644-Interractive_confirm_with_confir…
Browse files Browse the repository at this point in the history
…mation
  • Loading branch information
KarolosLykos authored Nov 9, 2024
2 parents d4a611c + a694856 commit 6aad08b
Show file tree
Hide file tree
Showing 109 changed files with 498 additions and 220 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ type TemplatePrinter struct{

// Srender renders the Template as a string.
func (p TemplatePrinter) Srender() (string, error) {
var ret string
var ret strings.Builder

return ret, nil
return ret.String(), nil
}

// Render prints the Template to the terminal.
Expand Down
41 changes: 39 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ go get github.com/pterm/pterm
| Interactive confirm <br/> [(Examples)](https://github.com/pterm/pterm/tree/master/_examples/interactive_confirm) |Interactive continue <br/> [(Examples)](https://github.com/pterm/pterm/tree/master/_examples/interactive_continue) |Interactive multiselect <br/> [(Examples)](https://github.com/pterm/pterm/tree/master/_examples/interactive_multiselect) |Interactive select <br/> [(Examples)](https://github.com/pterm/pterm/tree/master/_examples/interactive_select) |Interactive textinput <br/> [(Examples)](https://github.com/pterm/pterm/tree/master/_examples/interactive_textinput) |
| Logger <br/> [(Examples)](https://github.com/pterm/pterm/tree/master/_examples/logger) |Multiple-live-printers <br/> [(Examples)](https://github.com/pterm/pterm/tree/master/_examples/multiple-live-printers) |Panel <br/> [(Examples)](https://github.com/pterm/pterm/tree/master/_examples/panel) |Paragraph <br/> [(Examples)](https://github.com/pterm/pterm/tree/master/_examples/paragraph) |Prefix <br/> [(Examples)](https://github.com/pterm/pterm/tree/master/_examples/prefix) |
| Progressbar <br/> [(Examples)](https://github.com/pterm/pterm/tree/master/_examples/progressbar) |Section <br/> [(Examples)](https://github.com/pterm/pterm/tree/master/_examples/section) |Slog <br/> [(Examples)](https://github.com/pterm/pterm/tree/master/_examples/slog) |Spinner <br/> [(Examples)](https://github.com/pterm/pterm/tree/master/_examples/spinner) |Style <br/> [(Examples)](https://github.com/pterm/pterm/tree/master/_examples/style) |
| Table <br/> [(Examples)](https://github.com/pterm/pterm/tree/master/_examples/table) |Theme <br/> [(Examples)](https://github.com/pterm/pterm/tree/master/_examples/theme) |Tree <br/> [(Examples)](https://github.com/pterm/pterm/tree/master/_examples/tree) | | |
| Table <br/> [(Examples)](https://github.com/pterm/pterm/tree/master/_examples/table) |Test.sh <br/> [(Examples)](https://github.com/pterm/pterm/tree/master/_examples/test.sh) |Theme <br/> [(Examples)](https://github.com/pterm/pterm/tree/master/_examples/theme) |Tree <br/> [(Examples)](https://github.com/pterm/pterm/tree/master/_examples/tree) | |
<!-- printers:end -->

</div>
Expand Down Expand Up @@ -3204,7 +3204,7 @@ func main() {
// Create and start a fork of the default spinner.
spinnerInfo, _ := pterm.DefaultSpinner.Start("Some informational action...")
time.Sleep(time.Second * 2) // Simulate 3 seconds of processing something.
spinnerInfo.Info() // Resolve spinner with error message.
spinnerInfo.Info() // Resolve spinner with information message.

// Create and start a fork of the default spinner.
spinnerSuccess, _ := pterm.DefaultSpinner.Start("Doing something important... (will succeed)")
Expand Down Expand Up @@ -3386,6 +3386,43 @@ func main() {

</details>

### table/alternate-row-style

![Animation](https://raw.githubusercontent.com/pterm/pterm/master/_examples/table/alternate-row-style/animation.svg)

<details>

<summary>SHOW SOURCE</summary>

```go
package main

import "github.com/pterm/pterm"

func main() {
// Define the data for the table.
// Each inner slice represents a row in the table.
// The first row is considered as the header of the table.
alternateStyle := pterm.NewStyle(pterm.BgDarkGray)

tableData := pterm.TableData{
{"Firstname", "Lastname", "Email", "Note"},
{"Paul", "Dean", "[email protected]", ""},
{"Callie", "Mckay", "[email protected]", "这是一个测试, haha!"},
{"Libby", "Camacho", "[email protected]", "just a test, hey!"},
{"", "小宝", "[email protected]", ""},
}

// Create a table with the defined data.
// The table has a header and is boxed.
// Finally, render the table to print it.
pterm.DefaultTable.WithHasHeader().WithBoxed().WithData(tableData).WithAlternateRowStyle(alternateStyle).Render()
}

```

</details>

### table/boxed

![Animation](https://raw.githubusercontent.com/pterm/pterm/master/_examples/table/boxed/animation.svg)
Expand Down
39 changes: 38 additions & 1 deletion _examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3072,7 +3072,7 @@ func main() {
// Create and start a fork of the default spinner.
spinnerInfo, _ := pterm.DefaultSpinner.Start("Some informational action...")
time.Sleep(time.Second * 2) // Simulate 3 seconds of processing something.
spinnerInfo.Info() // Resolve spinner with error message.
spinnerInfo.Info() // Resolve spinner with information message.

// Create and start a fork of the default spinner.
spinnerSuccess, _ := pterm.DefaultSpinner.Start("Doing something important... (will succeed)")
Expand Down Expand Up @@ -3254,6 +3254,43 @@ func main() {

</details>

### table/alternate-row-style

![Animation](https://raw.githubusercontent.com/pterm/pterm/master/_examples/table/alternate-row-style/animation.svg)

<details>

<summary>SHOW SOURCE</summary>

```go
package main

import "github.com/pterm/pterm"

func main() {
// Define the data for the table.
// Each inner slice represents a row in the table.
// The first row is considered as the header of the table.
alternateStyle := pterm.NewStyle(pterm.BgDarkGray)

tableData := pterm.TableData{
{"Firstname", "Lastname", "Email", "Note"},
{"Paul", "Dean", "[email protected]", ""},
{"Callie", "Mckay", "[email protected]", "这是一个测试, haha!"},
{"Libby", "Camacho", "[email protected]", "just a test, hey!"},
{"", "小宝", "[email protected]", ""},
}

// Create a table with the defined data.
// The table has a header and is boxed.
// Finally, render the table to print it.
pterm.DefaultTable.WithHasHeader().WithBoxed().WithData(tableData).WithAlternateRowStyle(alternateStyle).Render()
}

```

</details>

### table/boxed

![Animation](https://raw.githubusercontent.com/pterm/pterm/master/_examples/table/boxed/animation.svg)
Expand Down
2 changes: 1 addition & 1 deletion _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.
2 changes: 1 addition & 1 deletion _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.
2 changes: 1 addition & 1 deletion _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.
Loading

0 comments on commit 6aad08b

Please sign in to comment.