9
$\begingroup$

Following the meta post Can we get prettier code markup? syntax highlighting has been activated for our site. For example, if you want the code in your post to show up with C++ syntax highlighting, you simply include the following in your post:

<!-- language-all: lang-cplusplus -->

If you only want it to apply to the next code block (if you have more than one code block and want to use more than one language), just omit the -all:

<!-- language: lang-cplusplus -->

This works for a wide range of languages, but not all, and notably not GLSL or HLSL, which are likely to be in frequent use on our site.

Looking at the language extension files for prettify.js (which Stack Exchange uses for syntax highlighting), most seem to be between 30 and 100 lines of code including extensive commenting, so writing one for GLSL or HLSL seems like it would be a reasonable task for someone familiar with the languages.

Would anyone be interested in doing this?

If so, indicating here will allow collaboration if we have more than one person interested, and we can link to work in progress.

$\endgroup$
  • 1
    $\begingroup$ Currently I don't have the time to do that, but after having a quick look into the files it looks a bit similar to the GeSHi config files. And GeSHi already has GLSL support, so the GeSHi GLSL config file (on GitHub) could maybe help when addressing this. $\endgroup$ – Nero Aug 16 '15 at 17:19
  • 1
    $\begingroup$ I also have a GeSHi syntax file for HLSL (originally by Nick Darnell, though it's apparently not on his site anymore). $\endgroup$ – Nathan Reed Aug 16 '15 at 17:32
  • 1
    $\begingroup$ Well, in the mean time, C/C++ highlighting should do the job. It should only miss the vec3s/float3s... $\endgroup$ – glampert Aug 17 '15 at 1:19
  • 1
    $\begingroup$ I've added answers for voting on different languages so anyone considering writing an extension can see which languages are most in demand here. $\endgroup$ – trichoplax Aug 17 '15 at 11:12
  • $\begingroup$ I've since discovered that simply providing a list of options to vote on is not the best way to have a discussion. Feel free to add answers that express opinions rather than simply giving options. $\endgroup$ – trichoplax Aug 18 '15 at 21:49
12
$\begingroup$

Upvotes indicate demand for GLSL syntax highlighting

Feel free to edit in any reasons / examples.

Example questions and answers:

$\endgroup$
11
$\begingroup$

Upvotes indicate demand for HLSL syntax highlighting

Feel free to edit in any reasons / examples.

$\endgroup$
2
$\begingroup$

Upvotes indicate demand for OpenCL syntax highlighting

Feel free to edit in any reasons / examples.

$\endgroup$
2
$\begingroup$

Upvotes indicate demand for CUDA syntax highlighting

Feel free to edit in any reasons / examples.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .