Skip to content

Commit e9ea9a2

Browse files
committed
Added insert of snippet cell
1 parent 0e408c6 commit e9ea9a2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

notebook-snippet-manager.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,13 @@ define(['base/js/namespace',
100100
var selected_snippets = $('.selected input:checked');
101101
var selected_content = selected_snippets.map(function() {
102102
var content = $(this).parent('td').parent('tr').children('.content');
103-
return $(content.get(0)).html();
103+
return $(content.get(0)).text();
104104
});
105-
console.log(selected_content);
105+
for (var index in selected_content) {
106+
var code_cell = Jupyter.notebook.insert_cell_at_index('code', selected_index + index);
107+
code_cell.set_text(selected_content[index]);
108+
code_cell.execute();
109+
}
106110
}
107111
}
108112
}

0 commit comments

Comments
 (0)