Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
f9ced97a
Commit
f9ced97a
authored
Mar 16, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Started iPython notebook viewer
Using NotebookLab library [ci skip]
parent
51d11190
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
2076 additions
and
0 deletions
+2076
-0
app/assets/javascripts/blob/notebook_viewer.js
app/assets/javascripts/blob/notebook_viewer.js
+20
-0
app/models/blob.rb
app/models/blob.rb
+6
-0
app/views/projects/blob/_notebook.html.haml
app/views/projects/blob/_notebook.html.haml
+5
-0
config/webpack.config.js
config/webpack.config.js
+2
-0
vendor/assets/javascripts/notebooklab.js
vendor/assets/javascripts/notebooklab.js
+2043
-0
No files found.
app/assets/javascripts/blob/notebook_viewer.js
0 → 100644
View file @
f9ced97a
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>
`
,
});
});
app/models/blob.rb
View file @
f9ced97a
...
...
@@ -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
...
...
app/views/projects/blob/_notebook.html.haml
0 → 100644
View file @
f9ced97a
-
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
config/webpack.config.js
View file @
f9ced97a
...
...
@@ -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
)
{
...
...
vendor/assets/javascripts/notebooklab.js
0 → 100644
View file @
f9ced97a
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment