You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Right now bokeh.embed.file_html fails silently if given invalid input (e.g. file string "./template.html") as input parameter and generates with the default bokeh.core.template.FILE template. This leads mostly to confusion.
Describe the solution you'd like
Throw an exception when the parameter for template cannot be used, instead of silently deleting it.
Describe alternatives you've considered
Possibly print a warning message stating that template was swapped to default, or at least support creation of Jinja2 Templates from file name strings
The text was updated successfully, but these errors were encountered:
and here base=FILE. The intended capability here is to allow users to extend the FILE template, not replace it. The FILE template looks like this:
{%frommacrosimportembed%}
<!DOCTYPE html>
<htmllang="en">
{%blockhead%}
<head>
{%blockinner_head%}
<metacharset="utf-8">
<title>{%blocktitle%}{{ title | e if title else "Bokeh Plot" }}{%endblock%}</title>
{%blockpreamble%}{%endblock%}{%blockresources%}{%blockcss_resources%}
{{ bokeh_css | indent(8) if bokeh_css }}
{%endblock%}{%blockjs_resources%}
{{ bokeh_js | indent(8) if bokeh_js }}
{%endblock%}{%endblock%}{%blockpostamble%}{%endblock%}{%endblock%}
</head>
{%endblock%}{%blockbody%}
<body>
{%blockinner_body%}{%blockcontents%}{%fordocindocs%}
{{ embed(doc) if doc.elementid }}
{%forrootindoc.roots%}{%blockrootscoped%}
{{ embed(root) | indent(10) }}
{%endblock%}{%endfor%}{%endfor%}{%endblock%}
{{ plot_script | indent(8) }}
{%endblock%}
</body>
{%endblock%}
</html>
So the way to use this is to supply template text that override, e.g. the "contents" block. I agree this is not well documented, so I will leave this issue open for that task.
I am not sure what else can be done, though. There's not 100% reliable way to judge if the string that is passed is a filename or not, which risks raising errors or warnings in cases where there should not be one.
Is your feature request related to a problem? Please describe.
Right now bokeh.embed.file_html fails silently if given invalid input (e.g. file string "./template.html") as input parameter and generates with the default bokeh.core.template.FILE template. This leads mostly to confusion.
Describe the solution you'd like
Throw an exception when the parameter for template cannot be used, instead of silently deleting it.
Describe alternatives you've considered
Possibly print a warning message stating that template was swapped to default, or at least support creation of Jinja2 Templates from file name strings
The text was updated successfully, but these errors were encountered: