Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to dynamically configure git branch in the binder URL #40

Open
akhmerov opened this issue Aug 28, 2021 · 2 comments
Open
Labels
documentation Improvements or additions to documentation

Comments

@akhmerov
Copy link
Contributor

akhmerov commented Aug 28, 2021

Link to the documentation you'd like to improve

https://sphinx-thebe.readthedocs.io/en/latest/configure.html

What to improve

After #17 is merged, we should document how to make sphinx provide the current git branch in generating the binder link.

Implementation

See #40 (comment) for some ides from @akhmerov

@akhmerov akhmerov added the documentation Improvements or additions to documentation label Aug 28, 2021
@choldgraf
Copy link
Member

Thanks! If you could, can you add a short description of what the change would actually be? I'm still not quite sure what it means to "make sphinx use the current git branch".

@akhmerov akhmerov changed the title Document how to dynamically configure git branch Document how to dynamically configure git branch in the binder URL Aug 28, 2021
@akhmerov
Copy link
Contributor Author

The scenario I consider is as follows:

  1. The user makes a PR introducing an API change to the library
  2. The CI builds preview documentation for the PR. Because the docs are built in the checked out repo, everything works ✔️
  3. The docs use sphinx-thebe thebe, which in turn is configured to use a binder URL.

State of the art:

Binder URL points to the default branch, and thebe fails in preview docs.

Possible improvement:

The binder URL is automatically determined during build, and the branch parameter of the binder URL is computed using something like git rev-parse --abbrev-ref HEAD. This ensures that the correct binder branch is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants