How do Notebooks highlight Python syntax?

I’ve been trying to replicate syntax highlighting in a JS application I’m working on, but I haven’t found any libraries or projects to build off of and Jupyter is by far the best example of Python syntax highlighting that I’ve ever seen. How does Jupyter accomplish syntax highlighting like it does?

You’ll want to look at CodeMirror. According to here, Jupyter uses that.

1 Like