Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] Add colors #12

Open
ThibTrip opened this issue May 29, 2020 · 2 comments
Open

[ENH] Add colors #12

ThibTrip opened this issue May 29, 2020 · 2 comments

Comments

@ThibTrip
Copy link

Hello, first of all I am very impressed by this kernel! Would it be possible to get the correct colors for each kernel? Or at least have colors only for IPython? The code is completely black/grey when I work with it and do a HTML export.

Current

no_colors

Expected

colors

@ThibTrip
Copy link
Author

ThibTrip commented May 29, 2020

I did a little bit of digging and was able to default the color to IPython (meaning the java syntax highlighting will be at least slightly false). So it seems the colors are done on the front end with CodeMirror.

Getting dynamical syntax highlighting will probably be tricky since we can only specify one language info. This is the change I made to default to Python:

class AllTheKernels(Kernel):
    """Kernel class for proxying ALL THE KERNELS YOU HAVE"""
    implementation = 'AllTheKernels'
    implementation_version = __version__
    language_info = {
        'name': 'all-of-them',
        'mimetype': 'text/python',
        'file_extension':'py'
    }

If you have an idea how this can be achieved I am willing to help :).

@minrk
Copy link
Owner

minrk commented May 29, 2020

This is tricky, since Jupyter assumes only one language per kernel and highlighting is implemented in javascript, not the kernel. I think multi-language kernels need to define and provide their own codemirror mode for the switching somehow. I think calico may have found a way to do this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants