exercism / roc

Exercism exercises in Roc.
https://exercism.org/tracks/roc
MIT License
10 stars 7 forks source link

Create syntax highlighting for Roc #74

Closed isaacvando closed 1 month ago

isaacvando commented 2 months ago

Right now the track uses Elm syntax highlighting. It would be great to have Roc specific highlighting at some point.

ageron commented 2 months ago

💯 agree. I've already started looking into this, but it was trickier than I expected. I'm trying to get a bit of help from the Roc community because it's not something I'm very familiar with. I was hoping to just adapt Elm's CodeMirror syntax highlighter, but it was designed for CodeMirror 5, and Exercism.org uses CodeMirror 6 if I'm not mistaken. Perhaps that not a problem though, since Elm's syntax highlighter seems to work fine in CodeMirror 6. If you have some advice on this, I'd appreciate it.

isaacvando commented 2 months ago

Unfortunately I don't have any advice, just thought it would be worth creating an issue to track it!

nicklatch commented 2 months ago

@Anton-4 might be able to help or point you to someone who can

Anton-4 commented 2 months ago

I would open a topic on zulip in the contributing channel, several people have set up Roc syntax highlighting for all kinds of editors

ageron commented 2 months ago

I posted a message on Roc's Zulip chat .

isaacvando commented 2 months ago

I've published a package for this on npm: highlightjs-roc. There may be some more adjustments that need to be made, but we should be able to integrate this with Exercism following the pattern of this PR.

ageron commented 2 months ago

Thanks @isaacvando , this is really cool! I've just submitted a PR inspired by the PR you suggested. 👍

isaacvando commented 2 months ago

Sweet! Were you able to run the website locally to test it? I’m wondering if some things will look weird without having the roc specific css file included.

I’m also not very familiar with JS packages, so I’m not sure if I need to do something differently with webpack to export a function called setupRoc like is used in the PR.

isaacvando commented 1 month ago

I created a new issue to track Codemirror syntax highlighting specifically, and will close this one now that the highlight js highlighting has been integrated 🎉