thesofakillers / iclingo

🔴🟢🔵 clingo kernel for Jupyter
https://pypi.org/project/iclingo/
GNU General Public License v3.0
6 stars 1 forks source link

Add syntax highlighting #2

Open thesofakillers opened 2 years ago

thesofakillers commented 2 years ago

Jupyter uses Codemirror for syntax highlighting. Unfortunately, clingo is not supported by Codemirror. I thought, that's fine, prolog will do since the syntax is quite similar. Nope, not supported either. So we need to provide our own codemirror file, somehow.

Based on this, from what i understand you just plop a kernel.js file with the custom codemirror code in the same folder where the extension is installed.

I found swish's implementation of a prolog codemirror, but this for some reason does not work (I get 404 errors).

I think what we can do is try to develop our own codemirror file, perhaps based on a template from this repository.

thesofakillers commented 2 years ago

I've provided a skeleton for this in the syntax branch. Now we just need to flesh out an actual codemirror mode. Perhaps simplemode is a good idea