def METHOD_NAME(name, rawtext, text, lineno, inliner, options={}, content=[]):
    config = get_config(inliner)
    explicit_title, title, target = process_title_target(text)
    # Seperate path and possible URL fragment
    m = ghfile_arg_re.match(target)
    if not m:
        return rst_error(rawtext, text, lineno, inliner,
            '{} is an invalid target', repr(target))
    path = m.group(1)
    fragment = m.group(2) if m.group(2) is not None else ''
    # Check if the path exists locally
    local_path = Path(config.github_links_root_path) / path
    if not local_path.exists():
        return rst_error(rawtext, text, lineno, inliner,
            '"{}" doesn\'t exist. Checked for existence of "{}"',
                path, str(local_path)),
    # Create the main link
    kind = 'tree' if local_path.is_dir() else 'blob'
    url = '/'.join([gh_url_base, config.github_links_repo, kind, get_commitish(config), path]) + fragment
    rv = []
    main_link = link_node(rawtext, lineno, inliner,
        title if explicit_title else '', explicit_title, url, options)
    if not explicit_title:
        main_link[0][0].append(nodes.literal(rawtext, text, **options))
    append(rv, main_link)
    # Create a secondary link to preview HTML files
    if path.endswith('.html'):
        append(rv, text_node(rawtext, lineno, ' ', options))
        append(rv, link_node(rawtext, lineno, inliner,
            '(View as HTML)', False,
            'https://htmlpreview.github.io/?' + url,
            options))
    return rv