Skip to content

Commit d035b9e

Browse files
Fix the opening of notebooks in a new tab when using the JupyterLite and Voici directives (#220)
1 parent 72a30fe commit d035b9e

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

docs/full.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ You can access the JupyterLite deployment that `jupyterlite-sphinx` made for you
1414
1515
```
1616

17-
If you want to open a specific notebook in fullscreen JupyterLab/Notebook, you can use the `path` URL parameter, e.g. `./lite/lab/?path=my_noteboook.ipynb`.
17+
If you want to open a specific notebook in fullscreen JupyterLab/Notebook, you can use the `path` URL parameter, e.g. `./lite/lab/index.html?path=my_noteboook.ipynb`.

jupyterlite_sphinx/jupyterlite_sphinx.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ def __init__(
129129
options = "&".join(
130130
[f"{key}={quote(value)}" for key, value in lite_options.items()]
131131
)
132-
self.lab_src = f'{prefix}/{app_path}{f"?{options}" if options else ""}'
132+
self.lab_src = (
133+
f'{prefix}/{app_path}{f"index.html?{options}" if options else ""}'
134+
)
133135

134136
super().__init__(
135137
rawsource,
@@ -170,7 +172,7 @@ def __init__(
170172
[f"{key}={quote(value)}" for key, value in lite_options.items()]
171173
)
172174

173-
iframe_src = f'{prefix}/{app_path}{f"?{options}" if options else ""}'
175+
iframe_src = f'{prefix}/{app_path}{f"index.html?{options}" if options else ""}'
174176

175177
if "iframe_src" in attributes:
176178
if attributes["iframe_src"] != iframe_src:
@@ -246,7 +248,7 @@ def __init__(
246248
[f"{key}={quote(value)}" for key, value in lite_options.items()]
247249
)
248250

249-
iframe_src = f'{prefix}/{app_path}{f"?{options}" if options else ""}'
251+
iframe_src = f'{prefix}/{app_path}{f"index.html?{options}" if options else ""}'
250252

251253
super().__init__(rawsource, *children, iframe_src=iframe_src, **attributes)
252254

0 commit comments

Comments
 (0)