Open choldgraf opened 4 years ago
I like this approach, maybe with defaults that inherit from the current environment.
Sounds sensible! Are you thinking an importable module/function plus a entrypoint console_script in this repo?
yeah I was just thinking from nbgitpuller import link
and something like
def link(hub_url, repo_url, file_to_open, ..., kind="jupyterhub") -> str:
"""Generate an nbgitpuller link for a given hub and repository configuration."""
magic-happens-here
We did something like this for an older version of our course management workflow (we're now taking a different approach) for generating an nbgitpuller launch url from Canvas. If anything is useful, please feel free to borrow (credit to a very talented past student of mine @samhinshaw): https://github.com/UBC-DSCI/rudaux/blob/834b396146934b6c048851a911db82337c5219a3/rudaux-archive/rudaux/assignment.py#L115
I think another common way folks might want to be able to generate a link is via Python instead of via a UI (for example, if they want to generate a bunch of links programmatically, or if they are more comfortable calling a library than a UI). What do folks think about adding a
generate_link
function that takes arguments that match the fields innbgitpuller.link
and generates the proper link?