From 534f05a2cc9a4a1d86c9462fb71f6404966b8574 Mon Sep 17 00:00:00 2001 From: silasprincipe <53846571+silasprincipe@users.noreply.github.com> Date: Wed, 9 Oct 2024 14:36:29 +0200 Subject: [PATCH] Update render code --- .github/scripts/render_and_screenshot.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/scripts/render_and_screenshot.py b/.github/scripts/render_and_screenshot.py index c9f9a9e..7eda33d 100644 --- a/.github/scripts/render_and_screenshot.py +++ b/.github/scripts/render_and_screenshot.py @@ -61,6 +61,7 @@ def capture_screenshot(html_content, output_path): # Function to update README.md def update_readme(section, file_name, file_path, screenshot_path): + print(f"Updating README...") readme_path = os.path.join(notebooks_dir, "README.md") title = file_name.split(".")[0] # Get title from file name title = title.replace("_", " ").title() # Replace underscores with spaces and capitalize @@ -79,9 +80,11 @@ def update_readme(section, file_name, file_path, screenshot_path): if pattern.search(content): # If the entry exists, update it with the new screenshot path + print(f"Entry already exists on {readme_path}") content = pattern.sub(new_entry, content) else: # If no entry exists, add a new one under the correct section + print(f"Adding new entry to {readme_path} on section {section}...") if section == "Python": content = re.sub(r"(# Python\n)", rf"\1{new_entry}\n", content) elif section == "R":