Skip to content

Commit

Permalink
docs: autoupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinJWendt committed Mar 4, 2023
1 parent a84ebfe commit 2038db5
Show file tree
Hide file tree
Showing 52 changed files with 501 additions and 71 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
<a name="unreleased"></a>
## [Unreleased]

### Features
- **table:** multiline support for table printer
- **table:** multiline support for table printer

### Code Refactoring
- **table:** fixed linting


<a name="v0.12.54"></a>
## [v0.12.54] - 2023-01-22
### Bug Fixes
- **tree:** print top node [#443](https://github.com/pterm/pterm/issues/443)

Expand Down Expand Up @@ -1112,7 +1122,8 @@ removed `Header` and put it's content directly into `HeaderPrinter`
- initial commit


[Unreleased]: https://github.com/pterm/pterm/compare/v0.12.53...HEAD
[Unreleased]: https://github.com/pterm/pterm/compare/v0.12.54...HEAD
[v0.12.54]: https://github.com/pterm/pterm/compare/v0.12.53...v0.12.54
[v0.12.53]: https://github.com/pterm/pterm/compare/v0.12.52...v0.12.53
[v0.12.52]: https://github.com/pterm/pterm/compare/v0.12.51...v0.12.52
[v0.12.51]: https://github.com/pterm/pterm/compare/v0.12.50...v0.12.51
Expand Down
92 changes: 88 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1569,6 +1569,34 @@ func main() {

</details>

### table/boxed

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

<details>

<summary>SHOW SOURCE</summary>

```go
package main

import "github.com/pterm/pterm"

func main() {
// Create a fork of the default table, fill it with data and print it.
// Data can also be generated and inserted later.
pterm.DefaultTable.WithHasHeader().WithBoxed().WithData(pterm.TableData{
{"Firstname", "Lastname", "Email", "Note"},
{"Paul", "Dean", "nisi.dictum.augue@velitAliquam.co.uk", ""},
{"Callie", "Mckay", "egestas.nunc.sed@est.com", "这是一个测试, haha!"},
{"Libby", "Camacho", "aliquet.lobortis@semper.com", "just a test, hey!"},
}).Render()
}

```

</details>

### table/demo

![Animation](https://raw.githubusercontent.com/pterm/pterm/master/_examples/table/demo/animation.svg)
Expand All @@ -1594,14 +1622,70 @@ func main() {

pterm.Println() // Blank line

// Create a table with right alignment.
// Create a table with multiple lines in a row.
pterm.DefaultTable.WithHasHeader().WithData(pterm.TableData{
{"Firstname", "Lastname", "Email"},
{"Paul", "Dean", "nisi.dictum.augue@velitAliquam.co.uk"},
{"Callie", "Mckay", "egestas.nunc.sed@est.com"},
{"Paul\n\nNewline", "Dean", "nisi.dictum.augue@velitAliquam.co.uk"},
{"Callie", "Mckay", "egestas.nunc.sed@est.com\nNewline"},
{"Libby", "Camacho", "aliquet.lobortis@semper.com"},
{"", "小宝", "zhang@example.com"},
}).WithRightAlignment().Render()
}).Render()
}

```

</details>

### table/multiple-lines

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

<details>

<summary>SHOW SOURCE</summary>

```go
package main

import "github.com/pterm/pterm"

func main() {
// Create a table with multiple lines in a row and set a row separator.
pterm.DefaultTable.WithHasHeader().WithRowSeparator("-").WithHeaderRowSeparator("-").WithData(pterm.TableData{
{"Firstname", "Lastname", "Email"},
{"Paul\n\nNewline", "Dean", "nisi.dictum.augue@velitAliquam.co.uk"},
{"Callie", "Mckay", "egestas.nunc.sed@est.com\nNewline"},
{"Libby", "Camacho", "aliquet.lobortis@semper.com"},
{"", "小宝", "zhang@example.com"},
}).Render()
}

```

</details>

### table/right-alignment

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

<details>

<summary>SHOW SOURCE</summary>

```go
package main

import "github.com/pterm/pterm"

func main() {
// Create a fork of the default table, fill it with data and print it.
// Data can also be generated and inserted later.
pterm.DefaultTable.WithHasHeader().WithRightAlignment().WithData(pterm.TableData{
{"Firstname", "Lastname", "Email", "Note"},
{"Paul", "Dean", "nisi.dictum.augue@velitAliquam.co.uk", ""},
{"Callie", "Mckay", "egestas.nunc.sed@est.com", "这是一个测试, haha!"},
{"Libby", "Camacho", "aliquet.lobortis@semper.com", "just a test, hey!"},
}).Render()
}

```
Expand Down
92 changes: 88 additions & 4 deletions _examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1441,6 +1441,34 @@ func main() {

</details>

### table/boxed

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

<details>

<summary>SHOW SOURCE</summary>

```go
package main

import "github.com/pterm/pterm"

func main() {
// Create a fork of the default table, fill it with data and print it.
// Data can also be generated and inserted later.
pterm.DefaultTable.WithHasHeader().WithBoxed().WithData(pterm.TableData{
{"Firstname", "Lastname", "Email", "Note"},
{"Paul", "Dean", "nisi.dictum.augue@velitAliquam.co.uk", ""},
{"Callie", "Mckay", "egestas.nunc.sed@est.com", "这是一个测试, haha!"},
{"Libby", "Camacho", "aliquet.lobortis@semper.com", "just a test, hey!"},
}).Render()
}

```

</details>

### table/demo

![Animation](https://raw.githubusercontent.com/pterm/pterm/master/_examples/table/demo/animation.svg)
Expand All @@ -1466,14 +1494,70 @@ func main() {

pterm.Println() // Blank line

// Create a table with right alignment.
// Create a table with multiple lines in a row.
pterm.DefaultTable.WithHasHeader().WithData(pterm.TableData{
{"Firstname", "Lastname", "Email"},
{"Paul", "Dean", "nisi.dictum.augue@velitAliquam.co.uk"},
{"Callie", "Mckay", "egestas.nunc.sed@est.com"},
{"Paul\n\nNewline", "Dean", "nisi.dictum.augue@velitAliquam.co.uk"},
{"Callie", "Mckay", "egestas.nunc.sed@est.com\nNewline"},
{"Libby", "Camacho", "aliquet.lobortis@semper.com"},
{"", "小宝", "zhang@example.com"},
}).WithRightAlignment().Render()
}).Render()
}

```

</details>

### table/multiple-lines

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

<details>

<summary>SHOW SOURCE</summary>

```go
package main

import "github.com/pterm/pterm"

func main() {
// Create a table with multiple lines in a row and set a row separator.
pterm.DefaultTable.WithHasHeader().WithRowSeparator("-").WithHeaderRowSeparator("-").WithData(pterm.TableData{
{"Firstname", "Lastname", "Email"},
{"Paul\n\nNewline", "Dean", "nisi.dictum.augue@velitAliquam.co.uk"},
{"Callie", "Mckay", "egestas.nunc.sed@est.com\nNewline"},
{"Libby", "Camacho", "aliquet.lobortis@semper.com"},
{"", "小宝", "zhang@example.com"},
}).Render()
}

```

</details>

### table/right-alignment

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

<details>

<summary>SHOW SOURCE</summary>

```go
package main

import "github.com/pterm/pterm"

func main() {
// Create a fork of the default table, fill it with data and print it.
// Data can also be generated and inserted later.
pterm.DefaultTable.WithHasHeader().WithRightAlignment().WithData(pterm.TableData{
{"Firstname", "Lastname", "Email", "Note"},
{"Paul", "Dean", "nisi.dictum.augue@velitAliquam.co.uk", ""},
{"Callie", "Mckay", "egestas.nunc.sed@est.com", "这是一个测试, haha!"},
{"Libby", "Camacho", "aliquet.lobortis@semper.com", "just a test, hey!"},
}).Render()
}

```
Expand Down
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.
Loading

0 comments on commit 2038db5

Please sign in to comment.