From e0a42614b733f02e19a4d3fb3975be2de624760a Mon Sep 17 00:00:00 2001 From: Juniper Tyree <50025784+juntyr@users.noreply.github.com> Date: Sun, 10 Nov 2024 10:03:36 +0100 Subject: [PATCH 1/3] Open filepath relative to repo root --- src/index.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index 88de44e..d08f508 100644 --- a/src/index.ts +++ b/src/index.ts @@ -64,7 +64,7 @@ const gitPullerExtension: JupyterFrontEndPlugin = { const basePath = PathExt.basename(repo); const branch = urlParams.get('branch') || 'main'; const provider = urlParams.get('provider') || 'github'; - let filePath = urlParams.get('urlpath'); + const filePath = urlParams.get('urlpath'); const repoUrl = new URL(repo); if (provider === 'github') { @@ -97,10 +97,8 @@ const gitPullerExtension: JupyterFrontEndPlugin = { puller.clone(repoUrl.href, branch, basePath).then(async basePath => { if (filePath) { - // TODO: delete the following line as soon as a dedicated url generator is available. - filePath = PathExt.relative('tree/', filePath); app.commands.execute('filebrowser:open-path', { - path: filePath + path: PathExt.join(basePath, filePath) }); } }); From d37606953bab215a946b8413c4c45af902cbc783 Mon Sep 17 00:00:00 2001 From: Juniper Tyree <50025784+juntyr@users.noreply.github.com> Date: Sun, 10 Nov 2024 10:05:24 +0100 Subject: [PATCH 2/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 954ef28..62961be 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ A jupyterlite extension to automate cloning of a github repository. ## Docs -See [https://litegitpuller.readthedocs.io/en/latest/index.html](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) +See [https://litegitpuller.readthedocs.io/en/latest/index.html](https://litegitpuller.readthedocs.io/en/latest/index.html?repo=https%3A%2F%2Fgithub.com%2Fbrichet%2Ftesting-repo&urlpath=notebooks%2Fsimple.ipynb&branch=main) ## Requirements From 3711f93ee73257204843e113caed27cb4e3cc122 Mon Sep 17 00:00:00 2001 From: Juniper Tyree <50025784+juntyr@users.noreply.github.com> Date: Sun, 10 Nov 2024 10:06:58 +0100 Subject: [PATCH 3/3] Update docs/index.md --- docs/index.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/index.md b/docs/index.md index 22bbde8..440500a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -43,14 +43,14 @@ Jupyterlite embedded in the page. - Fetching a Github repository: - - 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 + + https://litegitpuller.readthedocs.io/en/latest/index.html?repo=https%3A%2F%2Fgithub.com%2Fbrichet%2Ftesting-repo&urlpath=notebooks%2Fsimple.ipynb&branch=main - Fetching a Gitlab repository: - - https://litegitpuller.readthedocs.io/en/latest/index.html?repo=https%3A%2F%2Fgitlab.com%2Fbrichet1%2Ftesting-repo&urlpath=tree%2Ftesting-repo%2Fnotebooks%2Fsimple.ipynb& + https://litegitpuller.readthedocs.io/en/latest/index.html?repo=https%3A%2F%2Fgitlab.com%2Fbrichet1%2Ftesting-repo&urlpath=notebooks%2Fsimple.ipynb& branch=main&provider=gitlab