doc: extensions: external_content: only ignore absolute paths

When including other rst files (via .. include::) the existence of the
included file may depend on when the _adjust routine is called, so only
ignore absolute paths.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2021-05-25 19:45:10 +02:00 committed by Kumar Gala
parent f341466681
commit de3c086429

View file

@ -73,8 +73,8 @@ def adjust_includes(
def _adjust(m):
directive, fpath = m.groups()
# ignore absolute paths or existing files
if fpath.startswith("/") or (dstpath / fpath).exists():
# ignore absolute paths
if fpath.startswith("/"):
fpath_adj = fpath
else:
fpath_adj = Path(os.path.relpath(basepath / fpath, dstpath)).as_posix()