File tree Expand file tree Collapse file tree 2 files changed +23
-12
lines changed
share/jupyter/voila/templates Expand file tree Collapse file tree 2 files changed +23
-12
lines changed Original file line number Diff line number Diff line change 1
- {% - macro voila_setup (base_url , nbextensions ) -%}
1
+ {# Macro for loading the notebook extensions #}
2
+ {% - macro voila_setup_nbextensions (base_url , nbextensions ) -%}
2
3
<script >
3
4
requirejs .config ({ baseUrl: ' {{base_url}}voila/' , waitSeconds: 30 });
4
5
window .voila_js_url = " {{ static_url('voila.js')}}" ;
17
18
{% endfor % }
18
19
</script >
19
20
{% - endmacro %}
21
+
22
+ {# For backward compatibility #}
23
+ {% - macro voila_setup (base_url , nbextensions ) -%}
24
+ {{ voila_setup_nbextensions(base_url, nbextensions) }}
25
+ {% - endmacro %}
26
+
27
+ {# Helper functions for updating the loading text #}
28
+ {% - macro voila_setup_helper_functions () -%}
29
+ <script >
30
+ var voila_process = function (cell_index , cell_count ) {
31
+ var el = document .getElementById (" loading_text" );
32
+ el .innerHTML = ` Executing ${ cell_index} of ${ cell_count} ` ;
33
+ }
34
+ var voila_heartbeat = function () {
35
+ console .log (' Ok, voila is still executing...' );
36
+ }
37
+ </script >
38
+ {% - endmacro %}
Original file line number Diff line number Diff line change 1
1
{% - extends 'nbconvert/templates/lab/index.html.j2' -%}
2
2
{% import "spinner.macro.html.j2" as spinner %}
3
3
{% import "log.macro.html.j2" as log %}
4
- {% from 'voila_setup.macro.html.j2' import voila_setup with context %}
4
+ {% from 'voila_setup.macro.html.j2' import voila_setup_helper_functions , voila_setup_nbextensions with context %}
5
5
6
6
{% - block html_head_js -%}
7
7
{% - block html_head_js_requirejs -%}
40
40
<body class =" jp-Notebook theme-light" data-base-url =" {{resources.base_url}}voila/" data-jp-theme-light =" true" data-jp-theme-name =" JupyterLab Light" >
41
41
{% endif %}
42
42
{{ spinner.html() }}
43
- <script >
44
- var voila_process = function (cell_index , cell_count ) {
45
- var el = document .getElementById (" loading_text" )
46
- el .innerHTML = ` Executing ${ cell_index} of ${ cell_count} `
47
- }
48
- var voila_heartbeat = function () {
49
- console .log (' Ok, voila is still executing...' )
50
- }
51
- </script >
43
+ {{ voila_setup_helper_functions() }}
52
44
<div id =" rendered_cells" style =" display : none " >
53
45
{% - endblock body_header -%}
54
46
@@ -92,7 +84,7 @@ var voila_heartbeat = function() {
92
84
el .style .display = ' unset'
93
85
})();
94
86
</script >
95
- {{ voila_setup (resources.base_url, resources.nbextensions) }}
87
+ {{ voila_setup_nbextensions (resources.base_url, resources.nbextensions) }}
96
88
{{ super() }}
97
89
{% - endblock body_footer -%}
98
90
You can’t perform that action at this time.
0 commit comments