executablebooks / sphinx-book-theme

A clean book theme for scientific explanations and documentation with Sphinx
https://sphinx-book-theme.readthedocs.io
BSD 3-Clause "New" or "Revised" License
431 stars 197 forks source link

Launch buttons cannot use git submodules #679

Open adamgayoso opened 1 year ago

adamgayoso commented 1 year ago

Describe the bug

context We keep ipynbs in a submodule that's cloned recursively for docs builds on readthedocs. I cannot set the html theme options properly to allow using a git submodule url for launching e.g., colab notebooks

expectation I expect to be able to customize the launch url.

Reproduce the bug

html_theme_options = {
    "repository_url": repository_url,
    "use_repository_button": True,
    "logo_only": True,
    "show_toc_level": 4,
    "launch_buttons": {"colab_url": "https://colab.research.google.com"},
    "path_to_docs": "docs/",
    "repository_branch": version,
}

Will provide a url like

https://colab.research.google.com/github/scverse/scvi-tools/blob/0.20.0/docs/tutorials/notebooks/api_overview.ipynb

but docs/tutorials/notebooks/ is a submodule to https://github.com/scverse/scvi-tutorials and github/colab do not properly resolve this URL.

List your environment

No response

adamgayoso commented 1 year ago

I see that #462 is related and would be a great fix for this!