Merged
requested to merge github/fork/julien-deramond/main-jd-fix-chroma-syntax-highlighter into main
This PR proposes to fix the typo of the class for the line highlight: .hl
→ .hll
(I've checked the other classes and they seem OK).
hugo gen chromastyles > chroma.css ; cat chroma.css
The following examples can be reproduced by integrating the following code in one of our Markdown pages:
{{< highlight go "linenos=table,hl_lines=8 15-17,linenostart=199" >}}
// 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)
}
}
{{< / highlight >}}
Before
(Nothing is highlighted)
With the modification
IMO white highlight is very difficult to see, so I tried in this PR --base02: #c8c8fa
. Here is the rendering:
I'm not sure about the contrast and the color but that seemed the best choice regarding the available color palette.
If not we could introduce in the color palette of this file a light yellow