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
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
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)
});
}
});