title: Jinja load template from string - and extend from file
body: <p>I have the following code:</p>
  
  <pre><code>from jinja2 import Template
  templ_str = "lots of garbly html" # Compiled by external logic
  templ_context = ast.literal_eval(context_dir)  # Compiled by external logic
  template = Template(templ_str)
  template.render(**context)
  </code></pre>
  
  <p>The body of the template is compiled on the fly and passed to the template engine. However, I would like to extend that template with a basic wrapper, from a file. I know this can be done with FileSystemLoader, but I need to load my main template from memory, not from a file.</p>
  
  <p>From the API documentation, it seems like this is not doable. Any workarounds?</p>