Skip to content
Snippets Groups Projects
Verified Commit 62b3a7f1 authored by Lars Bilke's avatar Lars Bilke
Browse files

[nb] testrunner also symlinks figures folder into web path.

Used for images defined in noteboob web metadata.
parent d699b656
No related branches found
No related tags found
No related merge requests found
...@@ -44,6 +44,22 @@ def save_to_website(exec_notebook_file, web_path): ...@@ -44,6 +44,22 @@ def save_to_website(exec_notebook_file, web_path):
"nbconvert_templates/collapsed.md.j2", "nbconvert_templates/collapsed.md.j2",
), ),
) )
for subfolder in ["figures", "images"]:
figures_path = os.path.abspath(
os.path.join(os.path.dirname(notebook_file_path), subfolder)
)
symlink_figures_path = os.path.join(
web_path,
"content",
output_path,
os.path.splitext(os.path.basename(exec_notebook_file))[0],
subfolder,
)
if os.path.exists(figures_path) and not os.path.exists(symlink_figures_path):
print(
f"{subfolder} folder detected, symlink {figures_path} to {symlink_figures_path}"
)
os.symlink(figures_path, symlink_figures_path)
# Script arguments # Script arguments
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment