title: jinja2 basename or dirname from builtin filters?
body: <p>Is there any way of doing a <code>basename</code> or <code>dirname</code> in jinja2 using only builtin filters? E.g. something like:</p>
  
  <pre><code>#!/usr/bin/python
  import jinja2
  
  mybin = '/my/favorite/full/path/foo'
  t = jinja2.Template("my binary is {{ mybin }}")
  print t.render()
  t = jinja2.Template("my basename is {{ mybin|basename() }}")
  print t.render()
  t = jinja2.Template("my dirname is {{ mybin|dirname() }}")
  print t.render()
  
  1
  </code></pre>
  
  <p>Any ideas?</p>