☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Jupyter notebook show template

Community Supportserver
kaprisonne
kaprisonne

Thanks for the quick reply.
I tried the following (setting the template by path and by loading a jinja2.Template directly but to no avail.
I do not get any feedback (nor does the template show up) even if I put some garbage into doc.template, I just get the standard plot.
Any ideas?

from bokeh.io import show
from bokeh.plotting import figure
import jinja2

def show_stuff():
    def mod_doc(doc):
        fig = figure(width=500, height=500)
        doc.template = "path/to/my/template/index.html"


        #templateLoader = jinja2.FileSystemLoader(searchpath="path/to/my/template")
        #templateEnv = jinja2.Environment(loader=templateLoader)
        #TEMPLATE_FILE = "index.html"
        #template = templateEnv.get_template(TEMPLATE_FILE)
        #doc.template = template
        doc.add_root(fig)
    show(mod_doc)
⌁   Link to post
kaprisonne
kaprisonne

I understand, thanks; I might create a FeatureRequest soon™.

Can you maybe suggest a way of embedding local js/css files into a jupyter notebook from within my bokehapp (much like bokeh’s output_notebook), as a bandaid?

⌁   Link to post

End of archived discussion · Replies are disabled