Skip to content

Commit ef363d2

Browse files
authored
Merge pull request #16 from brichet/gitlab
Support for Gitlab repositories
2 parents 4a88cf7 + 01b0b39 commit ef363d2

File tree

4 files changed

+387
-186
lines changed

4 files changed

+387
-186
lines changed

docs/index.md

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,56 @@
11
# litegitpuller
22

3-
A Jupyterlab/jupyterlite extension to fetch github repositories.
3+
A Jupyterlab/jupyterlite extension to fetch git repository (Github or Gitlab).
44

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.
67

78
```{eval-rst}
89
.. jupyterlite::
910
:width: 100%
1011
:height: 600px
1112
:prompt: Try JupyterLite!
1213
:prompt_color: #00aa42
13-
:search_params: ["branch", "repo", "urlpath"]
14+
:search_params: ["branch", "repo", "urlpath", "provider"]
1415
```
1516

1617
## Parameters
1718

1819
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).
2022

2123
Currently the allowed parameters are:
2224

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_).
2527
- `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.
2629

2730
## Limitations
2831

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,
3034
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).
3135

3236
Do not expect to fetch a large repository with it.
3337

3438
## Try it
3539

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.
3743

38-
As an example the following URL will reload the current page with some repo parameters:\
44+
- Fetching a Github repository:
3945

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>

src/githubpuller.ts

Lines changed: 0 additions & 159 deletions
This file was deleted.

0 commit comments

Comments
 (0)