jupyter
This commit is contained in:
parent
24d895d100
commit
5ea47853ac
2
C/text.c
2
C/text.c
@ -845,7 +845,7 @@ bool Yap_CVT_Text(seq_tv_t *inp, seq_tv_t *out USES_REGS) {
|
||||
// cnt++;
|
||||
int l = push_text_stack();
|
||||
buf = Yap_readText(inp PASS_REGS);
|
||||
if (!buf) {
|
||||
if (!buf || buf[0] == '\0') {
|
||||
pop_text_stack(l);
|
||||
return 0L;
|
||||
}
|
||||
|
@ -1,18 +1,27 @@
|
||||
requirejs.config({
|
||||
map: {
|
||||
'*' : {
|
||||
'codemirror/mode/prolog/prolog':'/kernelspecs/yap_kernel/prolog.js'
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
define([
|
||||
"/kernelspecs/yap_kernel/prolog.js"],function(CodeMirror){
|
||||
|
||||
'codemirror/lib/codemirror',
|
||||
'base/js/namespace',
|
||||
'base/js/events',
|
||||
],function(Jupyter,events,CodeMirror){
|
||||
var onload = function(){
|
||||
console.log("I am being loaded");
|
||||
var cell = Jupyter.notebook.get_selected_cell();
|
||||
var cm = cell.config;
|
||||
var patch = {
|
||||
CodeCell:{
|
||||
cm_config:{mode: "prolog"} // only change here.
|
||||
}
|
||||
var mode = {
|
||||
mime: "text/x-prolog",
|
||||
name: "Prolog",
|
||||
mode: "prolog",
|
||||
ext: ["pl", "yap", "yss", "P"]
|
||||
};
|
||||
config.update(patch);
|
||||
//console.log("I am being loaded");
|
||||
CodeMirror.requireMode("prolog", mode);
|
||||
CodeMirror.setOption("mode",mode);
|
||||
|
||||
return {onload:onload};
|
||||
}
|
||||
}
|
||||
);
|
||||
}});
|
||||
|
@ -61,7 +61,7 @@ blankc('\n').
|
||||
blankc('\t').
|
||||
|
||||
enter_cell(_Self) :-
|
||||
%open('//python/sys.stdin', read, _Input, []),
|
||||
open('//python/input', read, _Input, []),
|
||||
open('//python/sys.stdout', append, _Output, []),
|
||||
open('//python/sys.stdout', append, _Error, []),
|
||||
%set_prolog_flag(user_input, _Input),
|
||||
|
Reference in New Issue
Block a user