charmbracelet / glamour

Stylesheet-based markdown rendering for your CLI apps 💇🏻‍♀️

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lists formatting

cpkio opened this issue · comments

commented

Hi, thanks for your great library. I started using slides and noticed this lists formatting. Can they be formatted nicer way via NewTermRenderer call?

2023-04-12_213800

@muesli please let me know if there's a better way here, but I know you can adjust the style config for the list items as follows:

	config := glamour.DarkStyleConfig
	config.Item = ansi.StylePrimitive{
		BlockPrefix: "      • ",
	}
	renderer, err := glamour.NewTermRenderer(
		glamour.WithStyles(config),
		glamour.WithWordWrap(width),
	)

Then again, that takes away the option for auto-detecting the terminal theme your user might prefer (light vs dark)