@@ -12,7 +12,7 @@ any other notebook. You can also attach a kernel to text files and run those.
1212Basically, you should be able to open any file in a repository that JupyterLab can handle.
1313
1414Here is a screenshot of the plugin opening this very file on GitHub:
15- ![ gitception] ( gitception.png ' Gitception ')
15+ ![ gitception] ( https://raw.githubusercontent.com/jupyterlab/jupyterlab-github/master/ gitception.png ' Gitception ')
1616
1717### What this extension is not
1818
@@ -23,9 +23,9 @@ which represents a huge increase in complexity for the extension.
2323
2424### A note on rate-limiting
2525
26- This extension has both a client-side component (that is, Javascript that is bundled
26+ This extension has both a client-side component (that is, JavaScript that is bundled
2727with JupyterLab), and a server-side component (that is, Python code that is added
28- to the Jupyter notebook server). This extension _ will_ work with out the server extension,
28+ to the Jupyter server). This extension _ will_ work with out the server extension,
2929with a major caveat: when making unauthenticated requests to GitHub
3030(as we must do to get repository data), GitHub imposes fairly strict rate-limits
3131on how many requests we can make. As such, you are likely to hit that limit
@@ -37,26 +37,32 @@ This process is described in the [installation](#Installation) section.
3737
3838## Prerequisites
3939
40- - JupyterLab 1 .0
41- - A GitHub account for the serverextension
40+ - JupyterLab 3 .0
41+ - A GitHub account for the server extension
4242
4343## Installation
4444
45- As discussed above, this extension has both a serverextension and a labextension.
46- We recommend installing both so as to not be rate-limited.
47- The purpose of the serverextension is to add GitHub credentials that you will need to acquire
45+ As discussed above, this extension has both a server extension and a lab extension.
46+ Both extensions will be installed by default when installing from PyPI, but you may
47+ have only lab extension installed if you used the Extension Manager in JupyterLab 3.x.
48+
49+ We recommend completing the steps described below as to not be rate-limited.
50+ The purpose of the server extension is to add GitHub credentials that you will need to acquire
4851from https://github.com/settings/developers , and then to proxy your request to GitHub.
4952
50- ### 1. Installing the labextension
53+ For JupyterLab version older than 3 please see the instructions on the
54+ [ 2.x branch] ( https://github.com/jupyterlab/jupyterlab-github/tree/2.x ) .
55+
56+ ### 1. Installing both server and prebuilt lab extension
5157
52- To install the labextension , enter the following in your terminal:
58+ To install the both the server extension and (prebuilt) lab extension , enter the following in your terminal:
5359
5460``` bash
55- jupyter labextension install @ jupyterlab/ github
61+ pip install jupyterlab- github
5662```
5763
58- With only this installed , the extension should work, and you can experience the joys of
59- being rate-limited first-hand!
64+ After restarting JupyterLab , the extension should work, and you can experience
65+ the joys of being rate-limited first-hand!
6066
6167### 2. Getting your credentials from GitHub
6268
@@ -100,23 +106,48 @@ You can register an OAuth application with GitHub by following these steps:
100106It is important to note that the "Client Secret" string is, as the name suggests, a secret.
101107_ Do not_ share this value online, as people may be able to use it to impersonate you on GitHub.
102108
103- ### 3. Installing the serverextension
109+ ### 3. Enabling and configuring the server extension
110+
111+ The server extension will be enabled by default on new JupyterLab installations
112+ if you installed it with pip. If you used Extension Manager in JupyterLab 3.x,
113+ please uninstall the extension and install it again with the instructions from point (1).
114+
115+ Confirm that the server extension is installed and enabled with:
116+
117+ ``` bash
118+ jupyter server extension list
119+ ```
120+
121+ you should see the following:
122+
123+ ```
124+ - Validating jupyterlab_github...
125+ jupyterlab_github 3.0.0 OK
126+ ```
127+
128+ On some older installations (e.g. old JupyterHub versions) which use jupyter
129+ ` notebook ` server instead of the new ` jupyter-server ` , the extension needs to
130+ show up on the legacy ` serverextensions ` list (note: no space between _ server_ and _ extension_ ):
131+
132+ ``` bash
133+ jupyter serverextension list
134+ ```
104135
105- Install the serverextension using pip, and then enable it :
136+ If the extension is not enabled run :
106137
107138``` bash
108- pip install jupyterlab_github
139+ jupyter server extension enable jupyterlab_github
109140```
110141
111- If you are running Notebook 5.2 or earlier, enable the server extension by running
142+ or if using the legacy ` notebook ` server:
112143
113144``` bash
114- jupyter serverextension enable --sys-prefix jupyterlab_github
145+ jupyter serverextension enable jupyterlab_github
115146```
116147
117148You now need to add the credentials you got from GitHub
118- to your notebook configuration file. Instructions for generating a configuration
119- file can be found [ here] ( http ://jupyter-notebook .readthedocs.io/en/stable/config_overview .html#configure-nbserver ) .
149+ to your server configuration file. Instructions for generating a configuration
150+ file can be found [ here] ( https ://jupyter-server .readthedocs.io/en/stable/users/configuration .html#configuring-a-jupyter-server ) .
120151Once you have identified this file, add the following lines to it:
121152
122153``` python
0 commit comments