'Return a Document path for the given <a href="url">.
If the href doesn\'t look like a wiki document, then return None.'

def doc_path_for_href(self, href):

    href = self.decode_href(href)
    path = urlparse(href).path
    if path.endswith(u'/'):
        path = path[:(-1)]
    if (not path.startswith(u'/')):
        return
    if (u'$' in path):
        return
    if (not path.startswith(((u'/' + self.locale) + u'/'))):
        return
    slug = path.split(u'/', 2)[2]
    if any([slug.startswith(ignore) for ignore in self.ignored_slugs]):
        return
    return path
