Add a new dev language to code samples in the KB.

JB SuW
Tera Contributor

Is there a way to add a new developing language to the code samples in KB articles, e.g., to highlight the syntax for PowerShell?

1 ACCEPTED SOLUTION

Kieran Anson
Kilo Patron

Hi - There isn't a simple config option within SN to do this. However the editor, TinyMCE, does support additional languages. You'll have to take on technical debt to do this as it'll require bringing in js and css from Prism (that powers syntax highlighting) and then re-initialised TinyMCE. It's potentially a lot of effort, and a big customisation which could fail.

 

https://www.tiny.cloud/docs/tinymce/6/codesample/ is the plugin for the TinyMCE editor that enables syntax highlighting. https://prismjs.com/ is what TinyMCE uses for code syntax highlighting 

 

As an example

KieranAnson_0-1737298678368.png

 

View solution in original post

1 REPLY 1

Kieran Anson
Kilo Patron

Hi - There isn't a simple config option within SN to do this. However the editor, TinyMCE, does support additional languages. You'll have to take on technical debt to do this as it'll require bringing in js and css from Prism (that powers syntax highlighting) and then re-initialised TinyMCE. It's potentially a lot of effort, and a big customisation which could fail.

 

https://www.tiny.cloud/docs/tinymce/6/codesample/ is the plugin for the TinyMCE editor that enables syntax highlighting. https://prismjs.com/ is what TinyMCE uses for code syntax highlighting 

 

As an example

KieranAnson_0-1737298678368.png