Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easily clone existing style configs to make small adjustments? #294

Open
gamebox opened this issue Apr 18, 2024 · 0 comments
Open

Easily clone existing style configs to make small adjustments? #294

gamebox opened this issue Apr 18, 2024 · 0 comments

Comments

@gamebox
Copy link

gamebox commented Apr 18, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant