From 86b854c24186f5ff3d4e91b91a07c4d50b884d3d Mon Sep 17 00:00:00 2001 From: bashbunni Date: Tue, 18 Jun 2024 13:56:38 -0700 Subject: [PATCH] fix(example): remove deprecated NewRenderer --- examples/table/chess/main.go | 4 +--- examples/table/languages/main.go | 7 ++----- examples/table/mindy/main.go | 6 ++---- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/examples/table/chess/main.go b/examples/table/chess/main.go index a69a9bc4..67a741ea 100644 --- a/examples/table/chess/main.go +++ b/examples/table/chess/main.go @@ -2,7 +2,6 @@ package main import ( "fmt" - "os" "strings" "github.com/charmbracelet/lipgloss" @@ -10,8 +9,7 @@ import ( ) func main() { - re := lipgloss.NewRenderer(os.Stdout) - labelStyle := re.NewStyle().Foreground(lipgloss.Color("241")) + labelStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("241")) board := [][]string{ {"♜", "♞", "♝", "♛", "♚", "♝", "♞", "♜"}, diff --git a/examples/table/languages/main.go b/examples/table/languages/main.go index b0e94d82..71a022bd 100644 --- a/examples/table/languages/main.go +++ b/examples/table/languages/main.go @@ -2,7 +2,6 @@ package main import ( "fmt" - "os" "github.com/charmbracelet/lipgloss" "github.com/charmbracelet/lipgloss/table" @@ -15,13 +14,11 @@ const ( ) func main() { - re := lipgloss.NewRenderer(os.Stdout) - var ( // HeaderStyle is the lipgloss style used for the table headers. - HeaderStyle = re.NewStyle().Foreground(purple).Bold(true).Align(lipgloss.Center) + HeaderStyle = lipgloss.NewStyle().Foreground(purple).Bold(true).Align(lipgloss.Center) // CellStyle is the base lipgloss style used for the table rows. - CellStyle = re.NewStyle().Padding(0, 1).Width(14) + CellStyle = lipgloss.NewStyle().Padding(0, 1).Width(14) // OddRowStyle is the lipgloss style used for odd-numbered table rows. OddRowStyle = CellStyle.Foreground(gray) // EvenRowStyle is the lipgloss style used for even-numbered table rows. diff --git a/examples/table/mindy/main.go b/examples/table/mindy/main.go index f58fff38..78863230 100644 --- a/examples/table/mindy/main.go +++ b/examples/table/mindy/main.go @@ -2,16 +2,14 @@ package main import ( "fmt" - "os" "github.com/charmbracelet/lipgloss" "github.com/charmbracelet/lipgloss/table" ) func main() { - re := lipgloss.NewRenderer(os.Stdout) - labelStyle := re.NewStyle().Width(3).Align(lipgloss.Right) - swatchStyle := re.NewStyle().Width(6) + labelStyle := lipgloss.NewStyle().Width(3).Align(lipgloss.Right) + swatchStyle := lipgloss.NewStyle().Width(6) data := [][]string{} for i := 0; i < 13; i += 8 {