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

Allow notebooks to be downloaded from an alternative location #1511

Open
joelostblom opened this issue Oct 15, 2021 · 2 comments
Open

Allow notebooks to be downloaded from an alternative location #1511

joelostblom opened this issue Oct 15, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@joelostblom
Copy link
Contributor

joelostblom commented Oct 15, 2021

Description / Summary

In #1444 there was a suggestion to start a new issue for the discussion of download/launch buttons that pointed to notebooks hosted elsewhere, but I could not find the new issue so creating this one. I really like this suggestion from @mmcky here:

I guess this would essentially boil down to adding notebook_repository option to the config that can be used generally by sphinx/themes etc:

# Information about where the book exists on the web
repository:
 url                       : https://github.com/yourusername/yourbookrepo  # Online location of your book
 path_to_book              : path/to/book  # Optional path to your book, relative to the repository root
 branch                    : master  # Which branch of the repository should be used when creating links (optional)

# Information about where companion notebooks exist on the web
notebook_repository:
 url                       : https://github.com/yourusername/younotebookskrepo  # Online location of your book
 path_to_notebooks             : path/to/notebooks  # Optional path to your notebooks, relative to the repository root
 branch                    : master  # Which branch of the repository should be used when creating links (optional)

and then setting up standard for any html theme that wants to support notebook execution to check this general configuration.

Value / benefit

As an instructor, I have one repo that contains material that students can't view, such as solutions etc, and one repo with the version of this material that is distributed to students stripped of the solutions. The jupyter book is created from the instructor repo, and therefore students do not have access to the notebooks of the lecture material via the download button. It would be great to be able to point the buttons to the material in the student repo.

An alternative solution to this might be to host the entire rendered book in the student repo (so just the build/html directory. I have not explored how easy this is to setup with GitHub actions in the instructor repo yet, but it is possible to make it work easily with ghp-import at least using the -r flag to specify the public repo URL. I am currently testing this out and will update if there are caveats.

Implementation details

No response

Tasks to complete

No response

@joelostblom joelostblom added the enhancement New feature or request label Oct 15, 2021
@firasm
Copy link
Contributor

firasm commented Oct 24, 2021

Hi @joelostblom - I run my JB from the student repo if you need a hand to set up the Jupyterbook via GitHub actions, let me know - I can probably help you get whatever you need going! Here's an example.

Perhaps the system you want is to set up is a GH action that “pulls” the notebooks from the instructor version of the repo automatically every N hours (or on a manual trigger) and 5 minutes before class starts ;-)

@joelostblom
Copy link
Contributor Author

Thanks @firasm , unfortunately we don't have GH actions on our enterprise cloud yet, otherwise I would probably do something like what you suggested. For now ghp-import is actually doing the job quite well, I run something like this from the instructor's repo to push only the built book to the gh-pages branch of the student repo: ghp-import -n -p -f ./_build/html -r git@github.enterprise.url:repo-name.git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants