Extending Syntax Highlighting in Editor

I’d like to be able to use Syntax highlighting for “R” code, so I added it to the Code.vue file, as follows:

{ id: "python", label: "Python" },
{ id: "r", label: "R" },
{ id: "ruby", label: "Ruby" },

but it’s not showing up in the panel to select.

I’ve cleared the browser cache and done everything I could think of, but no luck. Here is what I see … no R in the list. Generally syntax highlighting using prism.js is working fine though.


Using Kirby 3.3.2 and newest Editor version (downloaded today).

Well, if you change the component code of the source, you have to compile the code again, otherwise it doesn’t end up in the final index.js. In general, it’s not a good idea to change the source code, as your changes will be overwritten with the next update. It’s probably better to extend the existing code block in a custom block.

1 Like

Aha, of course - light bulb goes on :wink:
Thanks for the tip Sonja, I’ll look into that.

You might want to create a feature request issue on GitHub if you haven’t already.

1 Like

Yep, will do, as R code is used by a lot of academics, who hopefully will use Kirby more and more :slight_smile: