Skip to content

Commit 2baade0

Browse files
authored
šŸ› FIX: Image URI issue for latex build when source has subdirectories (#368)
* handling subdirectory in generating image * checking path in rtd * checking path in rtd * abspath instead
1 parent 5d31ac4 commit 2baade0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ā€Žmyst_nb/render_outputs.pyā€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,10 +470,10 @@ def _render_image(output: NotebookNode, index: int):
470470
# directory, so make a relative path, which Sphinx treats
471471
# as being relative to the current working directory.
472472
filename = os.path.basename(output.metadata["filenames"][mime_type])
473-
474473
# checks if file dir path is inside a subdir of dir
475474
filedir = os.path.dirname(output.metadata["filenames"][mime_type])
476-
subpaths = filedir.split(self.sphinx_dir)
475+
outbasedir = os.path.abspath(self.sphinx_dir)
476+
subpaths = filedir.split(outbasedir)
477477
final_dir = self.sphinx_dir
478478
if subpaths and len(subpaths) > 1:
479479
subpath = subpaths[1]

0 commit comments

Comments
Ā (0)
⚔