-
Notifications
You must be signed in to change notification settings - Fork 97
Using customized lexer. #35
Comments
You need to register your lexer as an entrypoint, then it should work with the alias you have registered it with, as long as your package with the custom lexer is installed. If this does not work, then it might be a bug. |
Thank you very much for your suggestion. I use the entrypoint to register my language and I can confirm that the language is registered and can be used from pygments. However, my lexer is never called by jupyter when I select the language (I put some logging message in the constructor of the Lexer). I do not know if I have missed anything obvious and I am still checking. If you are interested in trying my code, you can clone
The |
Ah, but the |
I knew I must have missed something obvious! Ok, I do not know javascript at all so I have set Please let me know if you know some magic (entry point?) to install a customized codemirror mode. I will install a Python.js clone and modify it later. Thanks, |
Well there are plenty of language supported by codemirror, and the codemirror simplemode which is basically regex/tokentype should be plenty easy to start. Feel free to ask if you get stuck. Welcome to the party though, and looking forward to see an announce for your kernel ! |
I spent another few hours on this issue and I think I can implement a codemirror mode for sos. However, before sos becomes official for codemirror/jupyter, what would be the easiest method for users to install the mode so that codemirror and Jupyter can recognize it? I looked through the Jupyter documentation and could not find any information about it. The maxima kernel seems to require users to copy a file to some platform-dependent location which I would like to avoid. |
You can make it an nbextension and enable it. how will depend on which minimal version of notebook you require. Technically I guess you can drop a |
I am afraid that I am still too new to javascript to get it working. I have my spec file installed
and I put a python clone of
I then fire up
Because jupyter is looking for So it looks like jupyter does not load |
BTW, I also tried to follow the direction in https://carreau.gitbooks.io/jupyter-book/content/kerneljs.html and have
and I could not see any
|
Oh, you need to look at the the JS/developer console in your browser to see the messages. |
Again, many thanks for your quick response. I can see the error message now and should be able to start from there. |
I'm going to assume this has been solved.thanks! |
Hi,
I believe kernel.js is loaded and functioning. So why notebook is looking for sos.js when opening an existing ipynb file? Does this have something to do with the order of js files being loaded? I am using python 3.5.2 installed in virtualenv, jupyter core 4.2.1, jupyter-client 4.4.0 on MAC OS X. |
@jma7 please state your os and python environment. I am using anaconda Python 3.5.2, jupyter core 4.2.1, jupyter-client 4.4.0, on Mac OS X and I do not have this problem. |
It might be a race condition - if Codemirror tries to use the |
- Using Elixir CodeMirror https://www.npmjs.com/package/codemirror-mode-elixir for syntax highlight - Thanks to the way both Jupyter and the CodeMirror mode handle dependencies, this has to be embedded and modified and not just include the mode file - The recommended way to include custom highlight in a shipped kernel in Jupyter is to include it as part of the kernel.js file, see ticket jupyter/help#35
I am developing a kernel for a language that is not available on pygments. It would be nice if Jupyter could accept a
Lexer
directly from the language definition, such asThe text was updated successfully, but these errors were encountered: