diff --git a/setup.py b/setup.py index 3064183..4627ec7 100644 --- a/setup.py +++ b/setup.py @@ -49,6 +49,7 @@ def user_dir(): class DevelopCmd(develop): prefix_targets = [ + ("nbconvert/templates", 'material'), ("voila/templates", 'material') ] def run(self): @@ -77,7 +78,7 @@ def run(self): # WARNING: all files generates during setup.py will not end up in the source distribution data_files = [] # Add all the templates -for (dirpath, dirnames, filenames) in os.walk('share/jupyter/voila/templates/'): +for (dirpath, dirnames, filenames) in os.walk('share/jupyter/'): if filenames: data_files.append((dirpath, [os.path.join(dirpath, filename) for filename in filenames])) @@ -96,7 +97,7 @@ def run(self): 'ipython', 'jupyter', 'widgets', - 'voila' + 'voila==0.2.0a1' ], cmdclass={ 'develop': DevelopCmd, diff --git a/share/jupyter/nbconvert/templates/material/conf.json b/share/jupyter/nbconvert/templates/material/conf.json new file mode 100644 index 0000000..ff4bfee --- /dev/null +++ b/share/jupyter/nbconvert/templates/material/conf.json @@ -0,0 +1 @@ +{"base_template": "lab"} \ No newline at end of file diff --git a/share/jupyter/nbconvert/templates/material/index.html.j2 b/share/jupyter/nbconvert/templates/material/index.html.j2 new file mode 100644 index 0000000..38bb8fc --- /dev/null +++ b/share/jupyter/nbconvert/templates/material/index.html.j2 @@ -0,0 +1,100 @@ +{%- extends 'lab/index.html.j2' -%} + +{# this overrides the default behavior of directly starting the kernel and executing the notebook #} +{% block notebook_execute %} +{% endblock notebook_execute %} + +{%- block html_head_css -%} +{{ super() }} +{% if resources.theme == 'dark' %} +{% set bar_color = '#555454' %} +{% else %} +{% set bar_color = '#5cbcaf' %} +{% endif %} +{{ resources.include_css("static/materialize.min.css") }} + + + + + +{%- endblock html_head_css -%} + +{%- block body -%} +{%- block body_header -%} + {{ super() }} +
+ +
+ +
+
+
+
+{%- endblock body_header -%} + +{%- block body_loop -%} + {% if resources.theme == 'dark' %} + +
+
+
+ {{ super() }} + {{ resources.include_js("static/materialize.min.js") }} + +{%- endblock body_footer -%} + +{%- endblock body -%} diff --git a/share/jupyter/voila/templates/material/static/icons_font.ttf b/share/jupyter/nbconvert/templates/material/static/icons_font.ttf similarity index 100% rename from share/jupyter/voila/templates/material/static/icons_font.ttf rename to share/jupyter/nbconvert/templates/material/static/icons_font.ttf diff --git a/share/jupyter/voila/templates/material/static/materialize.min.css b/share/jupyter/nbconvert/templates/material/static/materialize.min.css similarity index 100% rename from share/jupyter/voila/templates/material/static/materialize.min.css rename to share/jupyter/nbconvert/templates/material/static/materialize.min.css diff --git a/share/jupyter/voila/templates/material/static/materialize.min.js b/share/jupyter/nbconvert/templates/material/static/materialize.min.js similarity index 100% rename from share/jupyter/voila/templates/material/static/materialize.min.js rename to share/jupyter/nbconvert/templates/material/static/materialize.min.js diff --git a/share/jupyter/voila/templates/material/static/voila_logo.svg b/share/jupyter/nbconvert/templates/material/static/voila_logo.svg similarity index 100% rename from share/jupyter/voila/templates/material/static/voila_logo.svg rename to share/jupyter/nbconvert/templates/material/static/voila_logo.svg diff --git a/share/jupyter/voila/templates/material/static/voila_logo_bleu.svg b/share/jupyter/nbconvert/templates/material/static/voila_logo_bleu.svg similarity index 100% rename from share/jupyter/voila/templates/material/static/voila_logo_bleu.svg rename to share/jupyter/nbconvert/templates/material/static/voila_logo_bleu.svg diff --git a/share/jupyter/voila/templates/material/templates/404.html b/share/jupyter/voila/templates/material/404.html similarity index 100% rename from share/jupyter/voila/templates/material/templates/404.html rename to share/jupyter/voila/templates/material/404.html diff --git a/share/jupyter/voila/templates/material/templates/base.html b/share/jupyter/voila/templates/material/base.html similarity index 100% rename from share/jupyter/voila/templates/material/templates/base.html rename to share/jupyter/voila/templates/material/base.html diff --git a/share/jupyter/voila/templates/material/templates/browser-open.html b/share/jupyter/voila/templates/material/browser-open.html similarity index 100% rename from share/jupyter/voila/templates/material/templates/browser-open.html rename to share/jupyter/voila/templates/material/browser-open.html diff --git a/share/jupyter/voila/templates/material/templates/error.html b/share/jupyter/voila/templates/material/error.html similarity index 100% rename from share/jupyter/voila/templates/material/templates/error.html rename to share/jupyter/voila/templates/material/error.html diff --git a/share/jupyter/voila/templates/material/index.html.j2 b/share/jupyter/voila/templates/material/index.html.j2 new file mode 100644 index 0000000..5e2e98f --- /dev/null +++ b/share/jupyter/voila/templates/material/index.html.j2 @@ -0,0 +1,69 @@ +{%- extends 'nbconvert/templates/material/index.html.j2' -%} + +{%- block html_head_css -%} +{{ super() }} + + +{%- endblock html_head_css -%} + + +{% block footer_js %} + {{ super() }} + +{% endblock footer_js %} + diff --git a/share/jupyter/voila/templates/material/nbconvert_templates/voila.tpl b/share/jupyter/voila/templates/material/nbconvert_templates/voila.tpl deleted file mode 100644 index d1a16fa..0000000 --- a/share/jupyter/voila/templates/material/nbconvert_templates/voila.tpl +++ /dev/null @@ -1,228 +0,0 @@ -{%- extends 'base.tpl' -%} -{% from 'mathjax.tpl' import mathjax %} - -{# this overrides the default behavior of directly starting the kernel and executing the notebook #} -{% block notebook_execute %} -{% endblock notebook_execute %} - -{%- block html_head_css -%} - -{% if resources.theme == 'dark' %} -{% set bar_color = '#555454' %} - -{% else %} -{% set bar_color = '#5cbcaf' %} - -{% endif %} - - - - -{% for css in resources.inlining.css %} - -{% endfor %} - - - -{{ mathjax() }} -{%- endblock html_head_css -%} - -{%- block body -%} -{%- block body_header -%} - -
-
- image/svg+xmlvoilaspin -
-
Running {{nb_title}}...
-
- - -