caret

[ACTIVE] a command line tool for browsing Lobsters in your terminal
git clone git://git.figbert.com/caret.git
Log | Files | Refs | README | LICENSE

commit 47a3a5ec69083d8fc4182f68f92ba4af1a6748e6
parent 9288c310ad115342e99a09a8aff791875d1b97f4
Author: FIGBERT <figbert@figbert.com>
Date:   Fri, 20 Oct 2023 11:22:26 -0700

Adopt new standardized CLX heading style

Diffstat:
Mui/glamour.go | 26+++++++++++---------------
1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/ui/glamour.go b/ui/glamour.go @@ -1,15 +1,19 @@ package ui import ( + "strings" + "github.com/charmbracelet/glamour/ansi" + gloss "github.com/charmbracelet/lipgloss" ) +const block = "█" + var GlamourConfig = ansi.StyleConfig{ Document: ansi.StyleBlock{ StylePrimitive: ansi.StylePrimitive{ BlockPrefix: "\n", BlockSuffix: "\n", - Color: stringPtr("252"), }, Margin: uintPtr(2), }, @@ -24,45 +28,37 @@ var GlamourConfig = ansi.StyleConfig{ Heading: ansi.StyleBlock{ StylePrimitive: ansi.StylePrimitive{ BlockSuffix: "\n", - Color: stringPtr("39"), Bold: boolPtr(true), }, }, H1: ansi.StyleBlock{ StylePrimitive: ansi.StylePrimitive{ - Prefix: " ", - Suffix: " ", - Color: stringPtr("228"), - BackgroundColor: stringPtr("63"), - Bold: boolPtr(true), + Prefix: gloss.NewStyle().Foreground(gloss.Color("15")).Render(block) + " ", }, }, H2: ansi.StyleBlock{ StylePrimitive: ansi.StylePrimitive{ - Color: stringPtr("252"), + Prefix: gloss.NewStyle().Foreground(gloss.Color("12")).Render(block) + " ", }, }, H3: ansi.StyleBlock{ StylePrimitive: ansi.StylePrimitive{ - Underline: boolPtr(true), + Prefix: gloss.NewStyle().Foreground(gloss.Color("9")).Render(strings.Repeat(block, 2)) + " ", }, }, H4: ansi.StyleBlock{ StylePrimitive: ansi.StylePrimitive{ - Color: stringPtr("220"), - Underline: boolPtr(true), + Prefix: gloss.NewStyle().Foreground(gloss.Color("13")).Render(strings.Repeat(block, 3)) + " ", }, }, H5: ansi.StyleBlock{ StylePrimitive: ansi.StylePrimitive{ - Prefix: "##### ", + Prefix: gloss.NewStyle().Foreground(gloss.Color("11")).Render(strings.Repeat(block, 4)) + " ", }, }, H6: ansi.StyleBlock{ StylePrimitive: ansi.StylePrimitive{ - Prefix: "###### ", - Color: stringPtr("35"), - Bold: boolPtr(false), + Prefix: gloss.NewStyle().Foreground(gloss.Color("10")).Render(strings.Repeat(block, 5)) + " ", }, }, Strikethrough: ansi.StylePrimitive{