zacharyvoase/markdoc — pull request #25 by ojacobson (2013-01-17 15:46:27+00:00)
Title: Include the canonical path to the current document when rendering.

Given a document in WIKI_ROOT/foo/bar.md, it's tricky to reconsruct "foo/bar" or "foo/bar.html" or "foo/bar.md" from the breadcrumbs. A similar bit of context (named "directory") is already passed to directory templates; now markdoc passes the document path to the document template too.

I'm using this in my own markdoc instance to generate "page history" links (to github) for each page.

I'm not sure my implementation is entirely correct; while my experiments only show that `path` is a wiki-root-relative path (given `~/bliki/wiki/git/survival.md`, `path` was always `git/survival.md`) other code makes me suspect that it's possible for `path` to be absolute. Needs the opinion of someone with more experience with this code than I have.