title: Is possible to lay out plots and widgets on Bokeh with Bootstrap, Jiinja or similar?
body: <p>I have an application with Bokeh library using it as a web server application. I have used tabs, widgetdboxes, gridplots to lay out all the elements. I have read <a href="http://bokeh.pydata.org/en/latest/docs/user_guide/layout.html" rel="nofollow noreferrer">this</a> on the documentation page, but I see many limitation laying out this way.</p>
  
  <p>Is there an easy way to lay out all this elements with a template? Maybe using Jinja and Bootstrap? Is this possible?</p>
  
  <p>An easy example would help me a lot.</p>
  
  <h2>Update (July, 11th 2018)</h2>
  
  <p>Templates functionality was released with the <a href="https://bokeh.pydata.org/en/latest/docs/user_guide/embed.html#standard-template" rel="nofollow noreferrer"><strong>0.13.0 Version of Bokeh</strong></a></p>
  
  <blockquote>
    <p>Below is a minimal example. Assuming that the application creates two
    roots with names properties set:</p>
  </blockquote>
  
  <pre><code>p1 = figure(..., name="scatter")
  
  p2 = figure(..., name="line")
  
  curdoc().add_root(p1)
  curdoc().add_root(p2)
  </code></pre>
  
  <blockquote>
    <p>Then these roots can be referred to by name in the template, and
    passed to the embed macro to place them wherever desired:</p>
  </blockquote>
  
  <pre><code>{% extends base %}
  
  &lt;!-- goes in head --&gt;
  {% block preamble %}
      &lt;link href="app/static/css/custom.min.css" rel="stylesheet"&gt;
  {% endblock %}
  
  &lt;!-- goes in body --&gt;
  {% block contents %}
      &lt;div&gt; {{ embed(roots.scatter) }} &lt;/div&gt;
      &lt;div&gt; {{ embed(roots.line) }} &lt;/div&gt;
  {% endblock %}
  </code></pre>