Add Syntax Highlighting with Prism.js to TYPO3 / ckeditor
Enable syntax highlighting for code snippets inserted in CKeditor by using the "codesnippet" plugin and prism.js.
In the Backend
We need to make the code snippet button / functionality available in ckeditor. The plugin itself is part of ckeditor already and does not need to be installed, just configured. Add the following part to your yaml configuration for ckeditor. If you do not have a configuration yet, see https://typo3worx.eu/2017/02/configure-ckeditor-in-typo3/
With that configuration you enable the source code button in ckeditor, define the available languages and the theme (see https://prismjs.com/ for available themes and options)
In the frontend