glamour
glamour copied to clipboard
Easily clone existing style configs to make small adjustments?
I am using Glamour to format the message bodies of messages in a MatterMost client TUI. The presentation is pretty awesome(thank you for the emoji renderer!), but I'd like to just remove the default margin, as it is not needed here. It would be nice to write something like this:
var mdr *glamour.TermRenderer
func init() {
myDarkStyleConfig := glamour.DarkStyleConfig.Clone()
docStyles := &myDarkStyleConfig.document
var margin uint = 0
docStyles.Margin = &margin
mdr, err := glamour.NewTermRenderer(glamour.WithStyles(myDarkStyleConfig))
if err != nil {
// handle err
}
}
Without affecting the default DarkStyle. Maybe this is a niche usecase, but would like to hear what you think. I wouldn't mind creating a PR for it if you'd like to support it.
I also don't need the default document margin, but would like to continue using the AutoStyle that detects the terminal background. Haven't found an easy way.