We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e1b5120 commit 6587c08Copy full SHA for 6587c08
jupyterlite_sphinx/jupyterlite_sphinx.py
@@ -816,6 +816,13 @@ def run(self):
816
817
if notebook_unique_name is None:
818
nb = examples_to_notebook(self.content, warning_text=warning_text)
819
+ preamble_path = Path("try_examples_preamble.py")
820
+ if preamble_path.is_file():
821
+ preamble = preamble_path.read_text()
822
+ # or raise an error if `preamble` is empty
823
+ if preamble:
824
+ # insert after the "experimental" warning
825
+ nb.cells.insert(1, new_code_cell(preamble))
826
self.content = None
827
notebooks_dir = Path(self.env.app.srcdir) / CONTENT_DIR
828
notebook_unique_name = f"{uuid4()}.ipynb".replace("-", "_")
0 commit comments