Skip to content

Conversation

@pgierz
Copy link
Member

@pgierz pgierz commented Jan 14, 2026

Summary

  • Use relative paths for logo, figures, and notebooks in generated HTML
  • Compute paths dynamically based on configured output directories

Changes

tripyview/sub_tripyrun.py:

  • Copy fesom2_logo.png to output directory instead of referencing it from the package location
  • Use relative path ./fesom2_logo.png instead of absolute path

tripyview/sub_tripyrundriver.py:

  • Replace hardcoded ./figures/ and ./notebooks/ paths with dynamically computed relative paths using os.path.relpath()
  • Paths are now computed relative from save_path (HTML location) to tripyrun_spath_fig and tripyrun_spath_nb

Why

The generated HTML previously used absolute paths for the logo and assumed figures/notebooks were always in ./figures/ and ./notebooks/ subdirectories. This broke when:

  1. Opening the HTML in a browser (absolute paths don't resolve)
  2. Using custom figure_dir or notebook_dir settings in the YAML config

Backward Compatibility

Fully backward-compatible. When using default settings (no custom figure_dir/notebook_dir), the computed relative paths produce the same ./figures/ and ./notebooks/ paths as before.

@pgierz pgierz requested a review from patrickscholz January 14, 2026 10:20
@patrickscholz patrickscholz merged commit e3772c9 into main Jan 15, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants