Skip to content

Instantly share code, notes, and snippets.

@mandaris
Last active August 31, 2023 21:48
Show Gist options
  • Save mandaris/ceee8b847743a6404d731e64dcb9720a to your computer and use it in GitHub Desktop.
Save mandaris/ceee8b847743a6404d731e64dcb9720a to your computer and use it in GitHub Desktop.
Goldmark example of highlighting
```go {linenos=table,hl_lines=[8,"15-17"],linenostart=199, lineanchors=big } // GetTitleFunc returns a func that can be used to transform a string to // title case. // // The supported styles are // // - "Go" (strings.Title) // - "AP" (see https://www.apstylebook.com/) // - "Chicago" (see https://www.chicagomanualofstyle.org/home.html) // // If an unknown or empty style is provided, AP style is what you get. func GetTitleFunc(style string) func(s string) string { switch strings.ToLower(style) { case "go": return strings.Title case "chicago": return transform.NewTitleConverter(transform.ChicagoStyle) default: return transform.NewTitleConverter(transform.APStyle) } } ```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment