Skip to content

Commit

Permalink
Merge pull request #176 from SylvainCorlay/fixup-nbextension
Browse files Browse the repository at this point in the history
Fixup nbextension
  • Loading branch information
SylvainCorlay committed Jun 4, 2019
2 parents 36ff5de + af730ab commit 2bed7b3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion etc/jupyter/nbconfig/notebook.d/voila.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"load_extensions": {
"voila/nbextension": true
"voila/extension": true
}
}
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,9 @@ def run(self):

data_files = [
('etc/jupyter/jupyter_server_config.d', ['etc/jupyter/jupyter_server_config.d/voila.json']),
('etc/jupyter/jupyter_notebook_config.d', ['etc/jupyter/jupyter_notebook_config.d/voila.json'])
('etc/jupyter/jupyter_notebook_config.d', ['etc/jupyter/jupyter_notebook_config.d/voila.json']),
('etc/jupyter/nbconfig/notebook.d', ['etc/jupyter/nbconfig/notebook.d/voila.json']),
('share/jupyter/nbextensions/voila', ['voila/static/extension.js'])
]

# Add all the templates
Expand Down
2 changes: 1 addition & 1 deletion voila/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ def _jupyter_nbextension_paths():
section="notebook",
src="static",
dest="voila",
require="voila/nbextension")]
require="voila/extension")]
4 changes: 1 addition & 3 deletions voila/static/nbextension.js → voila/static/extension.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
define(['jquery', 'base/js/namespace'], function($, Jupyter) {
"use strict";
var open_voila = function() {
let notebook_path = Jupyter.notebook.notebook_path;
let voila_path = notebook_path.slice(0, notebook_path.length-6); // without .ipynb
let voila_url = Jupyter.notebook.base_url + "voila/render/" + voila_path;
let voila_url = Jupyter.notebook.base_url + "voila/render/" + Jupyter.notebook.notebook_path;
window.open(voila_url)

}
Expand Down

0 comments on commit 2bed7b3

Please sign in to comment.