def METHOD_NAME(
    fname: Path,
    basepath: Path,
    directives: List[str],
    encoding: str,
    dstpath: Optional[Path] = None,
) -> None:
    """Adjust included content paths.
    Args:
        fname: File to be processed.
        basepath: Base path to be used to resolve content location.
        directives: Directives to be parsed and adjusted.
        encoding: Sources encoding.
        dstpath: Destination path for fname if its path is not the actual destination.
    """
    if fname.suffix != ".rst":
        return
    dstpath = dstpath or fname.parent
    def _adjust(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}"
    with open(fname, "r+", encoding=encoding) as f:
        content = f.read()
        content_adj, modified = re.subn(
            r"\.\. (" + "|".join(directives) + r")::\s*([^`\n]+)", _adjust, content
        )
        if modified:
            f.seek(0)
            f.write(content_adj)
            f.truncate()