☰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

output_file: using another template

Community Support
Bryan
Bryan

Thomas,

Are you using 0.4.4? If so I will suggest trying a dev build (recently announced on the list, let me know if you more information on how to install) or waiting for 0.5 to be released in a few weeks at SciPy, if you can. (If this is not an option, let me know and I will help you with the old API.) Embedding bokeh plots has been made *much* simpler and easier and better documented. If you want to try out a dev build or wait for 0.5, there is a new bokeh.embed module, and it has a "file_html" function that will do what you want:

def file_html(plot_object, resources, title, template=FILE):
    ''' Return an HTML document that embeds a Bokeh plot.

    The data for the plot is stored directly in the returned HTML.

    Args:
        plot_object (PlotObject) : Bokeh object to render
            typically a Plot or PlotContext
        resources (Resources) : a resource configuration for BokehJS assets
        title (str) : a title for the HTML document ``<title>`` tags
        template (Template, optional) : HTML document template (default: FILE)
            A Jinja2 Template, see bokeh.templates.FILE for the required
            template parameters

    Returns:
        html : standalone HTML document with embedded plot

    '''

Additionally there are other ways to embed bokeh plots simply now:

  * embed.components: returns a script tag to load bokehjs and plot div you can put in your own templates however you want

  * embed.autoload_static: returns a single div you put in your doc/template wherever you want the plot to go, data is in sidecar js file, loads bokehjs automatically (from server, CDN, or filesystem) if necessary

  * embed.autoload_server: returns a single div you put in your doc/template wherever you want the plot to go, data is on bokeh-server, loads bokehjs automatically (from server, CDN, or filesystem) if necessary

There are some new examples that show how to use these in the latest GH, as well as sphinx documentation, and we will be adding even more examples and docs leading up to the release.

Let us know if we can help more!

Bryan

···

On Jun 22, 2014, at 2:23 AM, Thomas Lecocq <thlecocq@gmail.com> wrote:

Hey guys,

I'm producing some static html files for our volcano monitoring stuff, but I'd like to define some other template than file.html. How do I do that ?

Cheers,

Tom

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/113bd92a-d735-4a67-8e29-88306d329b36%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

⌁   Link to post
Damian_Avila
Damian_Avila

About the new examples, you can see it here: https://github.com/ContinuumIO/bokeh/tree/master/examples/embed

Any questions, let us know…

Cheers.

···

On Sun, Jun 22, 2014 at 2:28 PM, Bryan Van de Ven bryan@bokeh.org wrote:

Thomas,

Are you using 0.4.4? If so I will suggest trying a dev build (recently announced on the list, let me know if you more information on how to install) or waiting for 0.5 to be released in a few weeks at SciPy, if you can. (If this is not an option, let me know and I will help you with the old API.) Embedding bokeh plots has been made much simpler and easier and better documented. If you want to try out a dev build or wait for 0.5, there is a new bokeh.embed module, and it has a “file_html” function that will do what you want:

def file_html(plot_object, resources, title, template=FILE):

''' Return an HTML document that embeds a Bokeh plot.



The data for the plot is stored directly in the returned HTML.



Args:

    plot_object (PlotObject) : Bokeh object to render

        typically a Plot or PlotContext

    resources (Resources) : a resource configuration for BokehJS assets

    title (str) : a title for the HTML document ``<title>`` tags

    template (Template, optional) : HTML document template (default: FILE)

        A Jinja2 Template, see bokeh.templates.FILE for the required

        template parameters



Returns:

    html : standalone HTML document with embedded plot



'''

Additionally there are other ways to embed bokeh plots simply now:

    * embed.components: returns a script tag to load bokehjs and plot div you can put in your own templates however you want



    * embed.autoload_static: returns a single div you put in your doc/template wherever you want the plot to go, data is in sidecar js file, loads bokehjs automatically (from server, CDN, or filesystem) if necessary




    * embed.autoload_server: returns a single div you put in your doc/template wherever you want the plot to go, data is on bokeh-server, loads bokehjs automatically (from server, CDN, or filesystem) if necessary

There are some new examples that show how to use these in the latest GH, as well as sphinx documentation, and we will be adding even more examples and docs leading up to the release.

Let us know if we can help more!

Bryan

On Jun 22, 2014, at 2:23 AM, Thomas Lecocq thlecocq@gmail.com wrote:

Hey guys,

I’m producing some static html files for our volcano monitoring stuff, but I’d like to define some other template than file.html. How do I do that ?

Cheers,

Tom

–

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+unsubscribe@continuum.io.

To post to this group, send email to bokeh@continuum.io.

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/113bd92a-d735-4a67-8e29-88306d329b36%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

–

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+unsubscribe@continuum.io.

To post to this group, send email to bokeh@continuum.io.

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/AFFBD100-40E2-41F4-9101-A5C5D30C29E5%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

⌁   Link to post
Thomas_Lecocq
Thomas_Lecocq

Hey,

Thanks ! I’ll try to get the dev build and get the embed working !

Thanks

Tom

···

Le dimanche 22 juin 2014 23:52:54 UTC+2, Damian Avila a écrit :

About the new examples, you can see it here: https://github.com/ContinuumIO/bokeh/tree/master/examples/embed

Any questions, let us know…

Cheers.

On Sun, Jun 22, 2014 at 2:28 PM, Bryan Van de Ven bry...@continuum.io wrote:

Thomas,

Are you using 0.4.4? If so I will suggest trying a dev build (recently announced on the list, let me know if you more information on how to install) or waiting for 0.5 to be released in a few weeks at SciPy, if you can. (If this is not an option, let me know and I will help you with the old API.) Embedding bokeh plots has been made much simpler and easier and better documented. If you want to try out a dev build or wait for 0.5, there is a new bokeh.embed module, and it has a “file_html” function that will do what you want:

def file_html(plot_object, resources, title, template=FILE):

''' Return an HTML document that embeds a Bokeh plot.



The data for the plot is stored directly in the returned HTML.



Args:

    plot_object (PlotObject) : Bokeh object to render

        typically a Plot or PlotContext

    resources (Resources) : a resource configuration for BokehJS assets

    title (str) : a title for the HTML document ``<title>`` tags

    template (Template, optional) : HTML document template (default: FILE)

        A Jinja2 Template, see bokeh.templates.FILE for the required

        template parameters



Returns:

    html : standalone HTML document with embedded plot



'''

Additionally there are other ways to embed bokeh plots simply now:

    * embed.components: returns a script tag to load bokehjs and plot div you can put in your own templates however you want



    * embed.autoload_static: returns a single div you put in your doc/template wherever you want the plot to go, data is in sidecar js file, loads bokehjs automatically (from server, CDN, or filesystem) if necessary




    * embed.autoload_server: returns a single div you put in your doc/template wherever you want the plot to go, data is on bokeh-server, loads bokehjs automatically (from server, CDN, or filesystem) if necessary

There are some new examples that show how to use these in the latest GH, as well as sphinx documentation, and we will be adding even more examples and docs leading up to the release.

Let us know if we can help more!

Bryan

On Jun 22, 2014, at 2:23 AM, Thomas Lecocq thle...@gmail.com wrote:

Hey guys,

I’m producing some static html files for our volcano monitoring stuff, but I’d like to define some other template than file.html. How do I do that ?

Cheers,

Tom

–

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+un...@continuum.io.

To post to this group, send email to bo...@continuum.io.

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/113bd92a-d735-4a67-8e29-88306d329b36%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

–

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+un...@continuum.io.

To post to this group, send email to bo...@continuum.io.

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/AFFBD100-40E2-41F4-9101-A5C5D30C29E5%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

⌁   Link to post

End of archived discussion · Replies are disabled