-
-
Notifications
You must be signed in to change notification settings - Fork 471
/
js_resources.html
37 lines (29 loc) · 970 Bytes
/
js_resources.html
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
{#
Renders HTML that loads BokehJS JavaScript code and CSS according to the
configuration in a Resources object.
:param hashes: a map of filenames for to SRI hashes
:type hashes: dict[str, str]
:param js_files: a list of URIs for JS files to include
:type js_files: list[str]
:param js_modules: a list of URIs for JS modules to include
:type js_files: list[str]
:param js_raw: a list of raw JS snippets to put between ``<script>`` tags
:type js_raw: list[str]
#}
{% for file in js_files %}
<script type="text/javascript" src="{{ file }}"></script>
{% endfor %}
{% for file in js_modules %}
<script type="module" src="{{ file }}"></script>
{% endfor %}
{%- for name, file in js_module_exports.items() %}
<script type="module">
import {{ name }} from "{% if not file.startswith('http') %}./{% endif %}{{ file }}";
window.{{ name }} = {{ name }}
</script>
{%- endfor %}
{%- for js in js_raw %}
<script type="text/javascript">
{{ js }}
</script>
{%- endfor %}