golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123k stars 17.54k forks source link

x/website,x/pkgsite: add support for syntax highlighting #56081

Open hyangah opened 1 year ago

hyangah commented 1 year ago

This is an umbrella issue for syntax highlighting support in various web properties owned and maintained by the Go project

danawoodman commented 1 year ago

II did a brief experiment to add syntax highlighting via https://github.com/yuin/goldmark-highlighting and it seems fairly easy to accomplish. Is this something the team is open to?

Screenshot 2023-09-02 at 4 26 01 PM

All that I think is required is a bit of configuration of goldmark-highlight and changing a given code block to have the language prefixed with language like you do in Github:

image image

I think it would be pretty easy to progressively add this to pages in an incremental fashion until all properties have syntax highlighting. Is a PR welcome for this?