hpc-carpentry / hpc-chapel

HPC Chapel lesson materials
https://hpc-carpentry.github.io/hpc-chapel/
Other
12 stars 11 forks source link

Add syntax highlighting to examples #3

Open ben-albrecht opened 6 years ago

ben-albrecht commented 6 years ago

Chapel syntax highlighting should work in Jekyll using pygments, as described here.

We should be able to enable syntax highlighting with:

{% highlight chapel %}
// chapel code here
{% endhighlight %}
jstaf commented 6 years ago

That sounds great, let's add it in! (I'll admit I didn't realize Chapel syntax highlighting was supported yet)

tkphd commented 6 years ago

Invoking pygment directly should work, but it's not how syntax highlighting is handled in the rest of the Carpentries. The more consistent approach would be to modify syntax.css to define a chapel style, then append {: .language-chapel} to the Chapel code blocks.

ben-albrecht commented 6 years ago

Here is the list of highlighting tools supported by Chapel today:

https://github.com/chapel-lang/chapel/tree/master/highlight

Maybe one of the formats could be easily ported to the format HPC Carpentry uses.

ben-albrecht commented 6 years ago

Additionally, there are a few highlighting formats that are managed outside of the repository, which are listed in this issue about improving maintenance of syntax highlighting tools for Chapel:

https://github.com/chapel-lang/chapel/issues/5908