Skip to content

Commit

Permalink
Update docs/scripts/auto-generate-examples.py
Browse files Browse the repository at this point in the history
Remove Jupyter Markdown comment to hide the metadata after its converted
from `.ipynb` to `.mdx`
  • Loading branch information
alvarobartt committed Sep 18, 2024
1 parent 0fc35ea commit d394b96
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/scripts/auto-generate-examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -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. `<!--` and the `--!>` 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)\)",
Expand Down

0 comments on commit d394b96

Please sign in to comment.