mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
Merge pull request #826 from rdmolony/patch-1
docs: reference nbgitpullers docs to fix outdated tljh docs
This commit is contained in:
@@ -24,7 +24,7 @@ Instructors should be able to:
|
|||||||
1. Use modern collaborative version control tools to author & store their
|
1. Use modern collaborative version control tools to author & store their
|
||||||
materials. This currently means using Git.
|
materials. This currently means using Git.
|
||||||
|
|
||||||
**nbgitpuller** is a Jupyter Notebook extension that helps achieve these goals.
|
**nbgitpuller** is a Jupyter server extension that helps achieve these goals.
|
||||||
This tutorial will walk you through the process of creating a magic
|
This tutorial will walk you through the process of creating a magic
|
||||||
nbgitpuller link that users of your JupyterHub can click to fetch the latest
|
nbgitpuller link that users of your JupyterHub can click to fetch the latest
|
||||||
version of materials from a git repo.
|
version of materials from a git repo.
|
||||||
@@ -38,76 +38,10 @@ Pre-requisites
|
|||||||
Step 1: Generate nbgitpuller link
|
Step 1: Generate nbgitpuller link
|
||||||
=================================
|
=================================
|
||||||
|
|
||||||
**Generate the link with a Binder app**.
|
The quickest way to generate a link is to use `nbgitpuller.link
|
||||||
|
<https://jupyterhub.github.io/nbgitpuller/link.html>`_, but other options exist as described in the
|
||||||
#. The easiest way to generate an nbgitpuller link is to use the
|
`nbgitpuller project's documentation
|
||||||
`mybinder.org based application <https://mybinder.org/v2/gh/jupyterhub/nbgitpuller/HEAD?urlpath=apps/binder%2Flink_generator.ipynb>`_.
|
<https://jupyterhub.github.io/nbgitpuller/use.html>`_.
|
||||||
Open it, and wait for it to load.
|
|
||||||
|
|
||||||
.. image:: ../../images/nbgitpuller/binder-progress.png
|
|
||||||
:alt: Progress bar as the binder application loads
|
|
||||||
|
|
||||||
#. A blank form with some help text will open up.
|
|
||||||
|
|
||||||
.. image:: ../../images/nbgitpuller/blank-application.png
|
|
||||||
:alt: Blank application to make nbgitpuller links
|
|
||||||
|
|
||||||
#. Enter the IP address or URL to your JupyterHub under ``hub_url``.
|
|
||||||
Include ``http://`` or ``https://`` as appropriate.
|
|
||||||
|
|
||||||
.. image:: ../../images/nbgitpuller/hub-url-application.png
|
|
||||||
:alt: Application with hub_url filled out
|
|
||||||
|
|
||||||
#. Enter the URL to your Git repository. This could be from GitHub,
|
|
||||||
GitLab or any other git provider - including the disk of the
|
|
||||||
server The Littlest JupyterHub is installed on. As you start
|
|
||||||
typing the URL here, you'll notice that the link is already
|
|
||||||
being printed below!
|
|
||||||
|
|
||||||
.. image:: ../../images/nbgitpuller/git-url-application.png
|
|
||||||
:alt: Application with git_url filled out
|
|
||||||
|
|
||||||
#. If your git repository is using a non-default branch name,
|
|
||||||
you can specify that under ``branch``. Most people do not
|
|
||||||
need to customize this.
|
|
||||||
|
|
||||||
#. If you want to open a specific notebook when the user clicks
|
|
||||||
on the link, specify the path to the notebook under ``filepath``.
|
|
||||||
Make sure this file exists, otherwise users will get a 'File not found'
|
|
||||||
error.
|
|
||||||
|
|
||||||
.. image:: ../../images/nbgitpuller/filepath-application.png
|
|
||||||
:alt: Application with filepath filled out
|
|
||||||
|
|
||||||
If you do not specify a file path, the user will be shown the
|
|
||||||
directory listing for the repository.
|
|
||||||
|
|
||||||
#. By default, notebooks will be opened in the classic Jupyter Notebook
|
|
||||||
interface. You can select ``lab`` under ``application`` to open it in the
|
|
||||||
`JupyterLab <https://github.com/jupyterlab/jupyterlab>`_ instead.
|
|
||||||
|
|
||||||
The link printed at the bottom of the form can be distributed to students
|
|
||||||
now! You can also click it to test that it is working as intended,
|
|
||||||
and adjust the form values until you get something you are happy with.
|
|
||||||
|
|
||||||
**Hand-craft your nbgitpuller link**
|
|
||||||
|
|
||||||
If you'd prefer to hand-craft your ``nbgitpuller`` link (e.g. if the Binder
|
|
||||||
link above doesn't work), you can use the following pattern::
|
|
||||||
|
|
||||||
http://<my-jhub-address>/hub/user-redirect/git-pull?repo=<your-repo-url>&branch=<your-branch-name>&subPath=<subPath>&app=<notebook | lab>
|
|
||||||
|
|
||||||
- **repo** is the URL of the git repository you want to clone. This parameter is required.
|
|
||||||
- **branch** is the branch name to use when cloning from the repository.
|
|
||||||
This parameter is optional and defaults to ``master``.
|
|
||||||
- **subPath** is the path of the directory / notebook inside the repo to launch after cloning.
|
|
||||||
This parameter is optional, and defaults to opening the base directory of the linked Git repository.
|
|
||||||
- **app** This parameter is optional and defaults to either the environment variable
|
|
||||||
`NBGITPULLER_APP`'s value or `notebook` if it is undefined. The allowed values
|
|
||||||
are `lab` and `notebook`, the value will determine in what application view
|
|
||||||
you end up in.
|
|
||||||
- **urlPath** will, if specified, override `app` and `subPath` and redirect
|
|
||||||
blindly to the specified path.
|
|
||||||
|
|
||||||
Step 2: Users click on the nbgitpuller link
|
Step 2: Users click on the nbgitpuller link
|
||||||
===========================================
|
===========================================
|
||||||
@@ -130,9 +64,3 @@ Step 2: Users click on the nbgitpuller link
|
|||||||
|
|
||||||
This workflow lets users land directly in the notebook you specified
|
This workflow lets users land directly in the notebook you specified
|
||||||
without having to understand much about git or the JupyterHub interface.
|
without having to understand much about git or the JupyterHub interface.
|
||||||
|
|
||||||
Advanced: hand-crafting an nbgitpuller link
|
|
||||||
===========================================
|
|
||||||
|
|
||||||
For information on hand-crafting an ``nbgitpuller`` link, see
|
|
||||||
`the nbgitpuller README <https://github.com/jupyterhub/nbgitpuller#constructing-the-nbgitpuller-url>`_.
|
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 30 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 54 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 43 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 30 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 8.9 KiB |
Reference in New Issue
Block a user