forked from pterm/pterm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into issue-644-Interractive_confirm_with_confir…
…mation
- Loading branch information
Showing
109 changed files
with
498 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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> | ||
|
@@ -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)") | ||
|
@@ -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) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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)") | ||
|
@@ -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) | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.