Skip to content

Commit 8673c6f

Browse files
authored
Merge pull request #14 from martinRenou/fix_notebook_search
Fix notebook search
2 parents c93f802 + d2b2a68 commit 8673c6f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/jupyterlite_sphinx.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,13 @@ class RetroliteDirective(SphinxDirective):
127127

128128
def run(self):
129129
notebook = self.arguments[0]
130+
131+
# If we didn't get an absolute path,
132+
# try to find the Notebook relatively to the source
133+
if not os.path.isabs(notebook):
134+
source_location = os.path.dirname(self.get_source_info()[0])
135+
notebook = os.path.join(source_location, notebook)
136+
130137
notebook_name = os.path.basename(notebook)
131138

132139
width = self.options.get("width", "100%")

0 commit comments

Comments
 (0)