Stream: beginners

Topic: github syntax highlighting


view this post on Zulip dank (Feb 25 2023 at 13:42):

anybody asked gh for highlighting?
think we need to pr https://github.com/github/linguist for it
maybe some amount of known .roc files is needed before they allow it

view this post on Zulip dank (Feb 25 2023 at 13:43):

image.png kinda ugly but a tampermonkey script works too lol

view this post on Zulip dank (Feb 25 2023 at 13:44):

stole the script from bqn folks haha

view this post on Zulip Folkert de Vries (Feb 25 2023 at 13:45):

I believe we need roc to be used in 200 gh repositories

view this post on Zulip Folkert de Vries (Feb 25 2023 at 13:45):

before it can be officially included

view this post on Zulip dank (Feb 25 2023 at 13:46):

challenge accepted

view this post on Zulip Richard Feldman (Feb 25 2023 at 14:15):

I think there's a way you can enable highlighting on a per-repo basis even if GH itself doesn't know how to highlight them

view this post on Zulip Richard Feldman (Feb 25 2023 at 14:15):

but I don't remember how to do it - I looked it up at some point

view this post on Zulip Nick Hallstrom (Feb 25 2023 at 18:33):

From what I can tell you can’t do custom syntax highlighting per-repo (and a lot of people have been upset about it for a while)
https://github.com/github/linguist/issues/2598
https://github.com/github/markup/issues/1440

But it does look like you can override the syntax highlighting language on a per file basis. So we could use the coffeescript syntax trick
https://github.com/github/linguist/blob/master/docs/overrides.md#using-gitattributes

view this post on Zulip Nick Hallstrom (Feb 25 2023 at 19:33):

Seems to work:
https://github.com/Billzabob/roc-clock/blob/main/examples/clock.roc
It also shows up as CoffeeScript under languages now though...
languages


Last updated: Jul 05 2025 at 12:14 UTC