We're using prismjs to do colorization. This isn't as robust as textmate
Case in point,
On the left textmate is identifying import as keyword.control. On the right prism doesn't even have that in its grammar.
The solution would probably be:
Use https://www.npmjs.com/package/vscode-textmate to tokenize the source before we send it to react
Use our current solution to load the json files with the colors and turn them into a css
Expand this css to have colors for every token
Change the react code to turn the code into tokenized html.
We're using prismjs to do colorization. This isn't as robust as textmate
Case in point,
On the left textmate is identifying import as keyword.control. On the right prism doesn't even have that in its grammar.
The solution would probably be: Use https://www.npmjs.com/package/vscode-textmate to tokenize the source before we send it to react Use our current solution to load the json files with the colors and turn them into a css Expand this css to have colors for every token Change the react code to turn the code into tokenized html.
Alternatively might use this: https://www.npmjs.com/package/@uiw/react-codemirror
Then just give it the appropriate css files. That's what Jupyter uses.