executablebooks / sphinx-thebe

A Sphinx extension to convert static code into interactive code cells with Jupyter, Thebe, and Binder.
https://sphinx-thebe.readthedocs.io/en/latest/
MIT License
28 stars 15 forks source link

use a heuristic for determining the branch #4

Closed akhmerov closed 3 years ago

akhmerov commented 4 years ago

unlike thebelab, which has no access to anything but the html document, sphinx-thebelab has filesystem access since it is a part of sphinx, and it will often be run in a git repository. It may therefore use a reasonably high quality default heuristic for determining which branch should be used by binder. For example, it may execute git rev-parse --abbrev-ref HEAD and if the execution was successful use that as a branch name (unless configured otherwise).

choldgraf commented 3 years ago

I'm gonna suggest that we close this one in favor of https://github.com/executablebooks/sphinx-thebe/issues/17 and just ask people to manually specify the URL.

akhmerov commented 3 years ago

You are correct about the scope. With #17 in mind, I propose to repurpose this into a documentation issue. I imagine a short note for how to configure sphinx to determine the correct ref would be useful.

choldgraf commented 3 years ago

I think that's a good idea to track - could you open up a new issue for it though? That will encourage us to include the extra information needed to address it...it's a little unclear to me what exactly we'd be recommending others do, since I'm not sure what you mean by "configure Sphinx to determine the correct ref". This isn't something that Sphinx "does" at all is it?