agencyenterprise / neurotechdevkit

Neurotech Development Kit (NDK)
https://agencyenterprise.github.io/neurotechdevkit/
Apache License 2.0
115 stars 10 forks source link

Include gallery images in CircleCI-generated docs #154

Closed charlesbmi closed 11 months ago

charlesbmi commented 11 months ago

https://github.com/agencyenterprise/neurotechdevkit/issues/141

Introduction

We use CircleCI to generate docs webpages for every pull request. This is particularly helpful to view for pull requests that add or edit docs/examplesscripts.

Unfortunately, our current PR/CircleCI docs do not include figures, showing them only as broken links, e.g.: image

The root cause appears to be an issue with the paths, as a local build (which shows images correctly) puts, e.g. the plot_time_reverse page at http://127.0.0.1:8000/neurotechdevkit/generated/gallery/plot_time_reverse/ but then on CI, it shows up not in its own folder but as: https://output.circle-artifacts.com/output/job/a9676679-2d73-455d-a473-c666c02fa461/artifacts/0/html/generated/gallery/plot_time_reverse.html

This appears to be the result of a slight difference in build_docs_pr vs local doc builds or build_docs_no_cache for the main website. Specifically, the PR build_docs use https://squidfunk.github.io/mkdocs-material/setup/building-for-offline-usage/ , which changes whether pages are directory URLs or .html files:

Changes

Design decisions

Behavior

View figure images in the generated CI docs, e.g. (from https://output.circle-artifacts.com/output/job/8e437392-4580-4896-9d68-8d87b5fbcb4d/artifacts/0/html/generated/gallery/plot_customized_center_frequency/index.html)

image
Not solved

https://output.circle-artifacts.com/output/job/8e437392-4580-4896-9d68-8d87b5fbcb4d/artifacts/0/html/generated/gallery/index.html still links the examples using the directory naming, e.g. https://output.circle-artifacts.com/output/job/8e437392-4580-4896-9d68-8d87b5fbcb4d/artifacts/0/html/generated/gallery/plot_customized_center_frequency . We need to add /index.html to these links to make them work.

codecov-commenter commented 11 months ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

:loudspeaker: Thoughts on this report? Let us know!.

charlesbmi commented 11 months ago

Per discussion with @d-lucena, I have moved the plugin owner to https://github.com/agencyenterprise/mkdocs-offline-links-plugin; I have updated the pyproject.toml dependencies here.

charlesbmi commented 11 months ago

Thanks @NewtonSander ! Merging.