Skip to content

Commit

Permalink
🐛 FIX: Correct source dir for relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
sumezulike committed Mar 11, 2024
1 parent 6c69c83 commit 4f4624d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion myst_parser/mocking.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,10 @@ def run(self) -> list[nodes.Element]:
if self.renderer.sphinx_env is not None:
# Emit the "include-read" event
arg = [file_content]
relative_path = path.relative_to(source_dir)
relative_path = path.relative_to(
self.renderer.sphinx_env.srcdir,
walk_up=True,
)
parent_docname = Path(self.renderer.document["source"]).stem
self.renderer.sphinx_env.app.events.emit(
"include-read",
Expand Down

0 comments on commit 4f4624d

Please sign in to comment.