yuin / goldmark-highlighting

A Syntax highlighting extension for the goldmark markdown parser.
MIT License
100 stars 14 forks source link

[Feature request] Use `class` instead `style` #36

Open zyxkad opened 1 year ago

zyxkad commented 1 year ago

Why should we use class, not hard code style:

Yuelioi commented 6 months ago

hI, you can use cutom configuration, goldmark-highlighting is base on https://github.com/alecthomas/chroma, so you can

goldmark.New(
  goldmark.WithExtensions(
    highlighting.NewHighlighting(
      highlighting.WithStyle("base16-snazzy"),
        highlighting.WithFormatOptions(
                    chromahtml.ClassPrefix("highlight-"),
                    chromahtml.WithClasses(true),
                    chromahtml.LineNumbersInTable(true),
                    chromahtml.WithAllClasses(true),
                    chromahtml.WithLineNumbers(true),
                ),
            ),
        ),
    )
rcarmo commented 1 month ago

This should be in the README, I don't think anyone wants hard-coded colors anymore.