Commit f9ced97a authored by Phil Hughes's avatar Phil Hughes

Started iPython notebook viewer

Using NotebookLab library

[ci skip]
parent 51d11190
import Vue from 'vue';
import NotebookLab from 'vendor/notebooklab';
Vue.use(NotebookLab);
$(() => {
new Vue({
el: '#js-notebook-viewer',
data() {
return {
json: {},
};
},
template: `
<div>
<notebook-lab :notebook="json" />
</div>
`,
});
});
......@@ -46,6 +46,10 @@ class Blob < SimpleDelegator
text? && language && language.name == 'SVG'
end
def ipython_notebook?
text? && language && language.name == 'Jupyter Notebook'
end
def size_within_svg_limits?
size <= MAXIMUM_SVG_SIZE
end
......@@ -63,6 +67,8 @@ class Blob < SimpleDelegator
end
elsif image? || svg?
'image'
elsif ipython_notebook?
'notebook'
elsif text?
'text'
else
......
- content_for :page_specific_javascripts do
= page_specific_javascript_bundle_tag('common_vue')
= page_specific_javascript_bundle_tag('notebook_viewer')
.file-content#js-notebook-viewer
......@@ -37,6 +37,7 @@ var config = {
merge_request_widget: './merge_request_widget/ci_bundle.js',
monitoring: './monitoring/monitoring_bundle.js',
network: './network/network_bundle.js',
notebook_viewer: './blob/notebook_viewer.js',
profile: './profile/profile_bundle.js',
protected_branches: './protected_branches/protected_branches_bundle.js',
snippet: './snippet/snippet_bundle.js',
......@@ -105,6 +106,7 @@ var config = {
'environments_folder',
'issuable',
'merge_conflicts',
'notebook_viewer',
'vue_pipelines',
],
minChunks: function(module, count) {
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment