From d4583fa090a3ca7542a962e078546104102cba63 Mon Sep 17 00:00:00 2001 From: Sinan Bekar Date: Wed, 6 Dec 2023 20:45:48 +0300 Subject: [PATCH 1/2] fix custom css url pathname --- packages/application/src/plugins/rise.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/application/src/plugins/rise.ts b/packages/application/src/plugins/rise.ts index d284bdc..82f0241 100644 --- a/packages/application/src/plugins/rise.ts +++ b/packages/application/src/plugins/rise.ts @@ -901,19 +901,20 @@ namespace Rise { // https://github.com/jupyterlab-contrib/rise/issues/509 // Attempt to load rise.css const curdir = PathExt.dirname(panel.sessionContext.path); + const riseCssUrl = new URL(PathExt.join("files", curdir, "rise.css"), PageConfig.getBaseUrl()); document.head.insertAdjacentHTML( 'beforeend', - `` + `` ); const name = PathExt.basename(panel.sessionContext.path); const dot_index = name.lastIndexOf('.'); const stem = dot_index === -1 ? name : name.substr(0, dot_index); // associated css - const name_css = `${curdir}/${stem}.css`; + const nameCssUrl = new URL(PathExt.join("files", curdir, `${stem}.css`), PageConfig.getBaseUrl()); // Attempt to load css with the same path as notebook document.head.insertAdjacentHTML( 'beforeend', - `` + `` ); // Asynchronously import reveal From 2309bf817d66da0d681165b2eb3fda887687c517 Mon Sep 17 00:00:00 2001 From: Sinan Bekar Date: Wed, 6 Dec 2023 22:08:39 +0300 Subject: [PATCH 2/2] fix formatting --- packages/application/src/plugins/rise.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/application/src/plugins/rise.ts b/packages/application/src/plugins/rise.ts index 82f0241..89f3545 100644 --- a/packages/application/src/plugins/rise.ts +++ b/packages/application/src/plugins/rise.ts @@ -901,7 +901,10 @@ namespace Rise { // https://github.com/jupyterlab-contrib/rise/issues/509 // Attempt to load rise.css const curdir = PathExt.dirname(panel.sessionContext.path); - const riseCssUrl = new URL(PathExt.join("files", curdir, "rise.css"), PageConfig.getBaseUrl()); + const riseCssUrl = new URL( + PathExt.join('files', curdir, 'rise.css'), + PageConfig.getBaseUrl() + ); document.head.insertAdjacentHTML( 'beforeend', `` @@ -910,7 +913,10 @@ namespace Rise { const dot_index = name.lastIndexOf('.'); const stem = dot_index === -1 ? name : name.substr(0, dot_index); // associated css - const nameCssUrl = new URL(PathExt.join("files", curdir, `${stem}.css`), PageConfig.getBaseUrl()); + const nameCssUrl = new URL( + PathExt.join('files', curdir, `${stem}.css`), + PageConfig.getBaseUrl() + ); // Attempt to load css with the same path as notebook document.head.insertAdjacentHTML( 'beforeend',