@@ -162,14 +162,14 @@ class JupyterLiteIframe(_LiteIframe):
162162 notebooks_path = ""
163163
164164
165- class RetroLiteIframe (_LiteIframe ):
166- """Appended to the doctree by the RetroliteDirective directive
165+ class NotebookLiteIframe (_LiteIframe ):
166+ """Appended to the doctree by the NotebookliteDirective directive
167167
168- Renders an iframe that shows a Notebook with RetroLite .
168+ Renders an iframe that shows a Notebook with NotebookLite .
169169 """
170170
171- lite_app = "retro /"
172- notebooks_path = "notebooks/"
171+ lite_app = "tree /"
172+ notebooks_path = "../ notebooks/"
173173
174174
175175class VoiciIframe (_PromptedIframe ):
@@ -287,7 +287,7 @@ def run(self):
287287
288288 notebooks_dir = Path (self .env .app .srcdir ) / CONTENT_DIR / notebook_name
289289
290- # Copy the Notebook for RetroLite to find
290+ # Copy the Notebook for NotebookLite to find
291291 os .makedirs (os .path .dirname (notebooks_dir ), exist_ok = True )
292292 try :
293293 shutil .copyfile (notebook , str (notebooks_dir ))
@@ -319,13 +319,13 @@ class JupyterLiteDirective(_LiteDirective):
319319 iframe_cls = JupyterLiteIframe
320320
321321
322- class RetroLiteDirective (_LiteDirective ):
323- """The ``.. retrolite ::`` directive.
322+ class NotebookLiteDirective (_LiteDirective ):
323+ """The ``.. notebooklite ::`` directive.
324324
325- Renders a Notebook with RetroLite in the docs.
325+ Renders a Notebook with NotebookLite in the docs.
326326 """
327327
328- iframe_cls = RetroLiteIframe
328+ iframe_cls = NotebookLiteIframe
329329
330330
331331class VoiciDirective (_LiteDirective ):
@@ -345,10 +345,10 @@ def run(self):
345345 return super ().run ()
346346
347347
348- class RetroLiteParser (RSTParser ):
348+ class NotebookLiteParser (RSTParser ):
349349 """Sphinx source parser for Jupyter notebooks.
350350
351- Shows the Notebook using retrolite ."""
351+ Shows the Notebook using notebooklite ."""
352352
353353 supported = ("jupyterlite_notebook" ,)
354354
@@ -357,7 +357,7 @@ def parse(self, inputstring, document):
357357 # Make the "absolute" filename relative to the source root
358358 filename = "/" + os .path .relpath (document .current_source , self .env .app .srcdir )
359359 super ().parse (
360- f"{ title } \n { '=' * len (title )} \n .. retrolite :: { filename } " ,
360+ f"{ title } \n { '=' * len (title )} \n .. notebooklite :: { filename } " ,
361361 document ,
362362 )
363363
@@ -388,7 +388,7 @@ def run(self):
388388 relative_path_to_root = "/" .join ([".." ] * depth )
389389 prefix = os .path .join (relative_path_to_root , JUPYTERLITE_DIR )
390390
391- lite_app = "retro /"
391+ lite_app = "tree /"
392392 notebooks_path = "notebooks/"
393393
394394 content_container_node = nodes .container (
@@ -410,7 +410,7 @@ def run(self):
410410 self .env .temp_data ["generated_notebooks" ][
411411 directive_key
412412 ] = notebook_unique_name
413- # Copy the Notebook for RetroLite to find
413+ # Copy the Notebook for NotebookLite to find
414414 os .makedirs (notebooks_dir , exist_ok = True )
415415 with open (notebooks_dir / Path (notebook_unique_name ), "w" ) as f :
416416 # nbf.write incorrectly formats multiline arrays in output.
@@ -547,7 +547,11 @@ def jupyterlite_build(app: Sphinx, error):
547547 for content in jupyterlite_contents :
548548 contents .extend (["--contents" , content ])
549549
550- voici_option = [] if voici is None else ["--apps" , "voici" ]
550+ apps_option = []
551+ for liteapp in ["notebooks" , "edit" , "lab" , "repl" , "tree" , "consoles" ]:
552+ apps_option .extend (["--apps" , liteapp ])
553+ if voici is not None :
554+ apps_option .extend (["--apps" , "voici" ])
551555
552556 command = [
553557 "jupyter" ,
@@ -560,13 +564,7 @@ def jupyterlite_build(app: Sphinx, error):
560564 os .path .join (app .srcdir , CONTENT_DIR ),
561565 "--output-dir" ,
562566 os .path .join (app .outdir , JUPYTERLITE_DIR ),
563- "--apps" ,
564- "lab" ,
565- "--apps" ,
566- "retro" ,
567- "--apps" ,
568- "repl" ,
569- * voici_option ,
567+ * apps_option ,
570568 "--lite-dir" ,
571569 jupyterlite_dir ,
572570 ]
@@ -584,8 +582,8 @@ def jupyterlite_build(app: Sphinx, error):
584582
585583
586584def setup (app ):
587- # Initialize RetroLite parser
588- app .add_source_parser (RetroLiteParser )
585+ # Initialize NotebookLite parser
586+ app .add_source_parser (NotebookLiteParser )
589587
590588 app .connect ("config-inited" , inited )
591589 # We need to build JupyterLite at the end, when all the content was created
@@ -603,16 +601,18 @@ def setup(app):
603601 app .add_config_value ("try_examples_global_toolbar" , default = None , rebuild = True )
604602 app .add_config_value ("try_examples_global_theme" , default = None , rebuild = True )
605603
606- # Initialize RetroLite and JupyterLite directives
604+ # Initialize NotebookLite and JupyterLite directives
607605 app .add_node (
608- RetroLiteIframe ,
606+ NotebookLiteIframe ,
609607 html = (visit_element_html , None ),
610608 latex = (skip , None ),
611609 textinfo = (skip , None ),
612610 text = (skip , None ),
613611 man = (skip , None ),
614612 )
615- app .add_directive ("retrolite" , RetroLiteDirective )
613+ app .add_directive ("notebooklite" , NotebookLiteDirective )
614+ # For backward compatibility
615+ app .add_directive ("retrolite" , NotebookLiteDirective )
616616 app .add_node (
617617 JupyterLiteIframe ,
618618 html = (visit_element_html , None ),
0 commit comments