def METHOD_NAME(rawtext, text, options={}, content=[]):
    """Handle the doc role."""
    # split link's text and post's slug in role content
    has_explicit_title, title, slug = split_explicit_title(text)
    if '#' in slug:
        slug, fragment = slug.split('#', 1)
    else:
        fragment = None
    # Look for the unslugified input first, then try to slugify (Issue #3450)
    post, twin_slugs = _find_post(slug)
    if post is None:
        slug = slugify(slug)
        post, twin_slugs = _find_post(slug)
    try:
        if post is None:
            raise ValueError("No post with matching slug found.")
    except ValueError:
        return False, False, None, None, slug
    if not has_explicit_title:
        # use post's title as link's text
        title = post.title()
    permalink = post.permalink()
    if fragment:
        permalink += '#' + fragment
    return True, twin_slugs, title, permalink, slug