Out of the box Jupyterlab is providing a rich set of supported languages for Syntax Highlighting. Unfortunately OpenSCAD is not one of them.

So I tried to research this topic: Internally Jupyterlab is using the CodeMirror editor and Codemirror allows to extend the syntax highlighting by defining custom modes. The easiest way is to use a Simple Mode.

Jupyterlab as well supports the functionality of Extensions. So the challenge is to provide a Jupyterlab Extension which implements a SimpleMode.

On Github I found that ‘Huygens ING’ provides an implementation for TAGML, so I took this as a template to provide my implementation for OpenSCAD.

You can add this extension into Jupyterlab using the built in Extension Manager. Just search for OpenSCAD, select the extension and hit the install button. After Jupyterlab has re-built, the functionality is available


Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *