/
index.html.j2
149 lines (120 loc) · 3.26 KB
/
index.html.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
{%- extends 'base.html.j2' -%}
{% from 'mathjax.html.j2' import mathjax %}
{% from 'jupyter_widgets.html.j2' import jupyter_widgets %}
{%- block header -%}
<!DOCTYPE html>
<html>
<head>
{%- block html_head -%}
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% set nb_title = nb.metadata.get('title', '') or resources['metadata']['name'] %}
<title>{{nb_title}}</title>
{%- block html_head_js -%}
{%- block html_head_js_requirejs -%}
<script src="{{ resources.require_js_url }}"></script>
{%- endblock html_head_js_requirejs -%}
{%- endblock html_head_js -%}
{% block jupyter_widgets %}
{%- if "widgets" in nb.metadata -%}
{{ jupyter_widgets(resources.jupyter_widgets_base_url, resources.html_manager_semver_range, resources.widget_renderer_url) }}
{%- endif -%}
{% endblock jupyter_widgets %}
{% block extra_css %}
{% endblock extra_css %}
{% for css in resources.inlining.css -%}
<style type="text/css">
{{ css }}
</style>
{% endfor %}
{% block notebook_css %}
{{ resources.include_css("static/index.css") }}
{% if resources.theme == 'dark' %}
{{ resources.include_css("static/theme-dark.css") }}
{% else %}
{{ resources.include_css("static/theme-light.css") }}
{% endif %}
<style type="text/css">
/* Misc */
a.anchor-link {
display: none;
}
.highlight {
margin: 0.4em;
}
/* Input area styling */
.jp-InputArea {
overflow: hidden;
}
.jp-InputArea-editor {
overflow: hidden;
}
/* Output area styling: using table instead of flexbox so that we can use break-inside property */
.jp-CodeCell.jp-mod-outputsScrolled .jp-OutputArea-prompt {
min-width: calc(
var(--jp-cell-prompt-width) - var(--jp-private-cell-scrolling-output-offset)
);
}
.jp-OutputArea-child {
display: table;
width: 100%;
}
.jp-OutputPrompt {
display: table-cell;
vertical-align: top;
min-width: var(--jp-cell-prompt-width);
}
body[data-format='mobile'] .jp-OutputPrompt {
display: table-row;
}
.jp-OutputArea-output {
display: table-cell;
width: 100%;
}
body[data-format='mobile'] .jp-OutputArea-child .jp-OutputArea-output {
display: table-row;
}
.jp-OutputArea-output.jp-OutputArea-executeResult {
width: 100%;
}
/* block wrapper: using block instead of flexbox so that we can use break-inside property
note: in the case of JupyterLab, wrappers also include collapsers, hence the flexbox.
*/
.jp-Cell-inputWrapper, .jp-Cell-outputWrapper {
display: block;
}
/* Media print rules */
@media print {
body {
margin: 0;
}
.jp-OutputArea-child {
break-inside: avoid-page;
}
}
</style>
{% endblock notebook_css %}
{%- block html_head_js_mathjax -%}
{{ mathjax(resources.mathjax_url) }}
{%- endblock html_head_js_mathjax -%}
{%- block html_head_css -%}
{%- endblock html_head_css -%}
{%- endblock html_head -%}
</head>
{%- endblock header -%}
{%- block body_header -%}
{% if resources.theme == 'dark' %}
<body class="jp-Notebook" data-jp-theme-light="false" data-jp-theme-name="JupyterLab Dark">
{% else %}
<body class="jp-Notebook" data-jp-theme-light="true" data-jp-theme-name="JupyterLab Light">
{% endif %}
{%- endblock body_header -%}
{% block body_footer %}
</body>
{% endblock body_footer %}
{% block footer %}
{% block footer_js %}
{% endblock footer_js %}
{{ super() }}
</html>
{% endblock footer %}