exercism / chapel

Exercism exercises in Chapel.
https://exercism.org/tracks/chapel
MIT License
3 stars 4 forks source link

fix syntax highlight #52

Closed lucaferranti closed 6 months ago

lucaferranti commented 2 years ago

I was looking at the track homepage (atm only visible to maintainers at the moment) and I noticed a couple of issues

image

any pointers on how to debug / fix this are very welcome

kytrinyx commented 2 years ago

There's a step in the new track checklist called Prepare for launch. The first item there is to request a track icon. Once that's done, the logo will show up on the track about page.

I'm not sure about the snippet. The value is set correctly in the config.json from what I can tell (https://github.com/exercism/chapel/blob/main/config.json#L16).

I submitted Hello, World, and there's no syntax highlighting on the code there, either.

Screen Shot 2022-10-27 at 10 50 32 AM

@ErikSchierboom do you know if there's an extra step to get the highlighting working?

lucaferranti commented 2 years ago

mmm, I don't see chapel in highlightjs demo: https://highlightjs.org/static/demo/

but it is listed in the list of supported languages: https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md

when I used it in a web page a few years ago, I vaguely remember that I had to choose what languages to download, maybe the website needs to reinstall it with chapel included? Don't know, just a wild guess

kytrinyx commented 2 years ago

That's a good guess, @lucaferranti. We'll try that, unless @ErikSchierboom knows something different!

ErikSchierboom commented 2 years ago

but it is listed in the list of supported languages: https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md

Well yes, but only via a plugin: highlightjs-chapel Looking at that page, it doesn't seem to have an NPM package (confirmed by https://www.npmjs.com/search?q=chapel). We need that in order to have the syntax highlighting work on the website, so either we:

kytrinyx commented 2 years ago

Get the people writing that plugin to publish to NPM

That would be ideal. @lucaferranti Would you see if you're able to get in touch with them?

lucaferranti commented 2 years ago

Would you see if you're able to get in touch with them?

yes, I will do that.

lucaferranti commented 8 months ago

fwi, the syntax highlight plugin should get registered soon https://github.com/chapel-lang/highlightjs-chapel/pull/11

lucaferranti commented 7 months ago

@ErikSchierboom the highlightjs-chapel repo is now registered as npm plugin: https://www.npmjs.com/package/highlightjs-chapel

can we support syntax highlight for chapel now? Let me know if anything else is needed from my side

ErikSchierboom commented 7 months ago

Thanks, we'll look into it!

lucaferranti commented 6 months ago

@ErikSchierboom, @iHiD it seems the syntax highlight works partially.

The code snippet in the about page is correctly highlighted

Screenshot from 2024-05-04 16-12-50

and when solving exercises the tests on the right side are also correctly highlighted

Screenshot from 2024-05-04 16-09-57

However, it seems that syntax highlight does not work in the text editor itself

Screenshot from 2024-05-04 16-12-04

could you take a look?

ErikSchierboom commented 6 months ago

That's because the online editor uses CodeMirror, so you'd have to create a CodeMirror language plugin for the syntax highlighting to work in the online editor.

lucaferranti commented 6 months ago

Oh maan, I didn't know that.

Do all other tracks have a CodeMirror plugin? If not, how do people find usability of the track without syntax highlight in the editor? Do you have any feedback on that?

ErikSchierboom commented 6 months ago

Many tracks have a CodeMirror plugin, yes, but not all. We don't have any feedback on how students perceive their learning experience without syntax highlighting.

lucaferranti commented 6 months ago

I'll close this and make a new issue to track the codemirror integration