|
1 | 1 | # litegitpuller |
2 | 2 |
|
3 | | -A Jupyterlab/jupyterlite extension to fetch github repositories. |
| 3 | +A Jupyterlab/jupyterlite extension to fetch git repository (Github or Gitlab). |
4 | 4 |
|
5 | | -As for [nbgitpuller](https://github.com/jupyterhub/nbgitpuller), information about the repository to fetch has to be set in the URL. |
| 5 | +As for [nbgitpuller](https://github.com/jupyterhub/nbgitpuller), information about the |
| 6 | +repository to fetch has to be set in the URL. |
6 | 7 |
|
7 | 8 | ```{eval-rst} |
8 | 9 | .. jupyterlite:: |
9 | 10 | :width: 100% |
10 | 11 | :height: 600px |
11 | 12 | :prompt: Try JupyterLite! |
12 | 13 | :prompt_color: #00aa42 |
13 | | - :search_params: ["branch", "repo", "urlpath"] |
| 14 | + :search_params: ["branch", "repo", "urlpath", "provider"] |
14 | 15 | ``` |
15 | 16 |
|
16 | 17 | ## Parameters |
17 | 18 |
|
18 | 19 | The parameters to provide must be formatted as in `nbgitpuller`.\ |
19 | | -They can be generated with [nbgitpuller link generator](https://nbgitpuller.readthedocs.io/en/latest/link.html). |
| 20 | +They can be (partially) generated with [nbgitpuller link generator] |
| 21 | +(https://nbgitpuller.readthedocs.io/en/latest/link.html). |
20 | 22 |
|
21 | 23 | Currently the allowed parameters are: |
22 | 24 |
|
23 | | -- `repo`: the github repository to fetch |
24 | | -- `branch`: the branch of the repository to fetch |
| 25 | +- `repo`: (**required**) the github repository to fetch. |
| 26 | +- `branch`: the branch of the repository to fetch (default to _main_). |
25 | 27 | - `urlpath`: the path to a notebook file to open (relative to the root of the repository). |
| 28 | +- `provider`: The provider of the API. Currently it supports _Github_ and _Gitlab_ API. |
26 | 29 |
|
27 | 30 | ## Limitations |
28 | 31 |
|
29 | | -Fetching a repository uses the unauthenticated Github API to fetch each file, with a capacity of 60 files per hour |
| 32 | +Fetching a Github repository uses the unauthenticated Github API to fetch each file, with a |
| 33 | +capacity of 60 files per hour, |
30 | 34 | see [github API](https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#rate-limits-for-requests-from-personal-accounts). |
31 | 35 |
|
32 | 36 | Do not expect to fetch a large repository with it. |
33 | 37 |
|
34 | 38 | ## Try it |
35 | 39 |
|
36 | | -It can be tried with the current documentation, by providing parameters in the current URL of the documentation. |
| 40 | +It can be tried with the current documentation, by providing parameters in the current |
| 41 | +URL of the documentation. These parameters will be used to fetch a repository in the |
| 42 | +Jupyterlite embedded in the page. |
37 | 43 |
|
38 | | -As an example the following URL will reload the current page with some repo parameters:\ |
| 44 | +- Fetching a Github repository: |
39 | 45 |
|
40 | | -<a href="https://litegitpuller.readthedocs.io/en/latest/index.html?repo=https%3A%2F%2Fgithub.com%2Fbrichet%2Ftesting-repo&urlpath=tree%2Ftesting-repo%2Fnotebooks%2Fsimple.ipynb&branch=main"> |
41 | | - https://litegitpuller.readthedocs.io/en/latest/index.html?repo=https%3A%2F%2Fgithub.com%2Fbrichet%2Ftesting-repo&urlpath=tree%2Ftesting-repo%2Fnotebooks%2Fsimple.ipynb&branch=main |
42 | | -</a> |
| 46 | + <a href="https://litegitpuller.readthedocs.io/en/latest/index.html?repo=https%3A%2F%2Fgithub.com%2Fbrichet%2Ftesting-repo&urlpath=tree%2Ftesting-repo%2Fnotebooks%2Fsimple.ipynb&branch=main"> |
| 47 | + https://litegitpuller.readthedocs.io/en/latest/index.html?repo=https%3A%2F%2Fgithub.com%2Fbrichet%2Ftesting-repo&urlpath=tree%2Ftesting-repo%2Fnotebooks%2Fsimple.ipynb&branch=main |
| 48 | + </a> |
| 49 | + |
| 50 | +- Fetching a Gitlab repository: |
| 51 | + |
| 52 | + <a href="https://litegitpuller.readthedocs.io/en/latest/index.html?repo=https%3A%2F%2Fgitlab.com%2Fbrichet1%2Ftesting-repo&urlpath=tree%2Ftesting-repo%2Fnotebooks%2Fsimple.ipynb&branch=main& |
| 53 | + provider=gitlab"> |
| 54 | + https://litegitpuller.readthedocs.io/en/latest/index.html?repo=https%3A%2F%2Fgitlab.com%2Fbrichet1%2Ftesting-repo&urlpath=tree%2Ftesting-repo%2Fnotebooks%2Fsimple.ipynb& |
| 55 | + branch=main&provider=gitlab |
| 56 | + </a> |
0 commit comments