From d394b9657cacfaa1b1c01a51a7d17d3e665a6be7 Mon Sep 17 00:00:00 2001 From: Alvaro Bartolome <36760800+alvarobartt@users.noreply.github.com> Date: Wed, 18 Sep 2024 12:42:22 +0200 Subject: [PATCH] Update `docs/scripts/auto-generate-examples.py` Remove Jupyter Markdown comment to hide the metadata after its converted from `.ipynb` to `.mdx` --- docs/scripts/auto-generate-examples.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/scripts/auto-generate-examples.py b/docs/scripts/auto-generate-examples.py index 6c2d0ffb..c8519753 100644 --- a/docs/scripts/auto-generate-examples.py +++ b/docs/scripts/auto-generate-examples.py @@ -29,6 +29,9 @@ def process_file(root, file, dir): with open(file_path, "r") as f: content = f.read() + # For Juypter Notebooks, remove the comment i.e. `` but keep the metadata + content = re.sub(r"", r"\1", content, flags=re.DOTALL) + # Replace image and link paths content = re.sub( r"\(\./(imgs|assets)/([^)]*\.png)\)",