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

kernel_javascript writes kernel.js to kernelspec #194

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

brainysmurf
Copy link

This way you can write kernel.js the same way we write the kernel.json, for say, a syntax highlighter:

class MyKernel(Metakernel):
    kernel_javascript = """
define(
['codemirror/lib/codemirror', 'codemirror/addon/mode/simple'],
function(CodeMirror, _) {
  return {
    onload: function(){
        CodeMirror.defineSimpleMode('language_name', {
            start: [
                // defs here
            ]
        });
    }
  };
});
"""

    kernel_json = {
        'argv': [
            sys.executable, '-m', 'module_name', '-f', '{connection_file}'],
        'display_name': 'Name of Kernel',
        'language': 'language_name',
        'name': 'name_of_kernel'
    }

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.08%) to 75.867% when pulling 00d1eb4 on brainysmurf:javascript into f16faf5 on Calysto:master.

@dsblank
Copy link
Member

dsblank commented Aug 18, 2020

Thanks! This makes sense. Could you document this in the README or other place in the instructions where people might find it?

@ohAitch
Copy link

ohAitch commented Jun 1, 2023

hah nice, I was in the process of writing up an essentially identical PR!
Re: documentation, where is "here's how you configure kernel_json" currently located? Seems like it would be the right place for it.

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

Successfully merging this pull request may close these issues.

None yet

4 participants