def METHOD_NAME(m):
    directive, fpath = m.groups()
    # ignore absolute paths
    if fpath.startswith("/"):
        fpath_adj = fpath
    else:
        fpath_adj = Path(os.path.relpath(basepath / fpath, dstpath)).as_posix()
    return f".. {directive}:: {fpath_adj}"