Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Avatar for KuCalc : devops.
Download
50654 views
1
// IPython mode is just a slightly altered Python Mode with `?` beeing a extra
2
// single operator. Here we define `ipython` mode in the require `python`
3
// callback to auto-load python mode, which is more likely not the best things
4
// to do, but at least the simple one for now.
5
6
CodeMirror.requireMode('python',function(){
7
"use strict";
8
9
CodeMirror.defineMode("ipython", function(conf, parserConf) {
10
11
parserConf.singleOperators = new RegExp("^[\\+\\-\\*/%&|\\^~<>!\\?]");
12
parserConf.name = 'python'
13
return CodeMirror.getMode(conf, parserConf);
14
}, 'python');
15
16
CodeMirror.defineMIME("text/x-ipython", "ipython");
17
})
18
19