'Build and return context to pass to template.'

def _get_context(self, src, path):

    c = {'title': '', 'prev_url': '', 'prev_title': '', 'next_url': '', 'next_title': '', 'crumb': '', 'version': version}
    c['body'] = self.md.convert(src)
    c['toc'] = self.md.toc
    for (k, v) in self.md.Meta.items():
        c[k] = '    '.join(v)
    self.md.reset()
    path = path[len(os.path.join(self.build_base, 'docs/')):]
    (dir, file) = os.path.split(path)
    (name, ext) = os.path.splitext(file)
    parts = [x for x in dir.split(os.sep) if x]
    c['source'] = ('%s.txt' % name)
    c['base'] = ('../' * len(parts))
    if ((name.lower() != 'index') or parts):
        c['page_title'] = ('%s    &#8212;    Python    Markdown' % c['title'])
    else:
        c['page_title'] = 'Python    Markdown'
    crumbs = []
    ctemp = '<li><a    href="%s">%s</a>    &raquo;</li>'
    for (n, part) in enumerate(parts):
        href = (('../' * n) + 'index.html')
        label = part.replace('_', '    ').capitalize()
        crumbs.append((ctemp % (href, label)))
    if (c['title'] and (name.lower() != 'index')):
        crumbs.append((ctemp % (file, c['title'])))
    c['crumb'] = '\n'.join(crumbs)
    return c
