From da6ca65ef7f4a4f7b9c3e6e5556032c9745d97ce Mon Sep 17 00:00:00 2001 From: Matt Fisher Date: Sat, 15 Feb 2025 13:01:15 -0700 Subject: [PATCH 1/7] Fix lite button in user guide --- docs/user_guide/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user_guide/index.md b/docs/user_guide/index.md index 295de60b9..fc3210a22 100644 --- a/docs/user_guide/index.md +++ b/docs/user_guide/index.md @@ -4,7 +4,7 @@ Thanks for trying out JupyterGIS! ```{cssclass} try-in-jupyterlite-button -[Try it with JupyterLite!](lite/) +[Try it with JupyterLite!](/lite) ``` JupyterGIS offers: From d0bdd0ec7ff97b02ab907b78864e6f4ba44a1ade Mon Sep 17 00:00:00 2001 From: Matt Fisher Date: Sat, 15 Feb 2025 17:56:42 -0700 Subject: [PATCH 2/7] Use jupyterlite-sphinx directive to render buttons --- docs/assets/css/custom.css | 17 ----------------- docs/index.rst | 6 +++--- docs/user_guide/index.md | 6 +++--- 3 files changed, 6 insertions(+), 23 deletions(-) delete mode 100644 docs/assets/css/custom.css diff --git a/docs/assets/css/custom.css b/docs/assets/css/custom.css deleted file mode 100644 index c570c2e8b..000000000 --- a/docs/assets/css/custom.css +++ /dev/null @@ -1,17 +0,0 @@ -.try-in-jupyterlite-button a { - background-color: #f7dc1e; - color: black; - text-decoration: none; - - border: none; - padding: 5px 10px; - border-radius: 15px; - font-family: vibur; - font-size: larger; - box-shadow: 0 2px 5px rgba(108, 108, 108, 0.2); -} - -.try-in-jupyterlite-button a:hover { - color: white; - box-shadow: 0 2px 5px #f7dc1e; -} diff --git a/docs/index.rst b/docs/index.rst index bc017ec1f..9498c683d 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -2,9 +2,9 @@ JupyterGIS ========== -.. cssclass:: try-in-jupyterlite-button - - `Try it with JupyterLite! `_ +.. jupyterlite:: + :new_tab: True + :new_tab_button_text: Try it with JupyterLite! JupyterGIS is a JupyterLab extension for collaborative GIS (Geographical Information System). It is designed to allow multiple people to work on the same geospatial project simultaneously, facilitating discussion and collaboration diff --git a/docs/user_guide/index.md b/docs/user_guide/index.md index fc3210a22..4f21468e7 100644 --- a/docs/user_guide/index.md +++ b/docs/user_guide/index.md @@ -2,9 +2,9 @@ Thanks for trying out JupyterGIS! -```{cssclass} try-in-jupyterlite-button - -[Try it with JupyterLite!](/lite) +```{jupyterlite} +:new_tab: True +:new_tab_button_text: Try it with JupyterLite! ``` JupyterGIS offers: From b95e1f6dfc3f58379e4e9eae49ccad6a24828946 Mon Sep 17 00:00:00 2001 From: Matt Fisher Date: Sat, 15 Feb 2025 18:13:13 -0700 Subject: [PATCH 3/7] Re-add custom CSS to style JupyterLite button It's unclear why, but out-of-the-box, the jupyterlite-sphinx "jupyterlite" directive produces an unstyled button. --- docs/assets/css/cusom.css | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 docs/assets/css/cusom.css diff --git a/docs/assets/css/cusom.css b/docs/assets/css/cusom.css new file mode 100644 index 000000000..aac927e68 --- /dev/null +++ b/docs/assets/css/cusom.css @@ -0,0 +1,18 @@ +.try_examples_button { + background-color: var(--jupyter-light-primary); + border: none; + padding: 5px 10px; + border-radius: 15px; + font-family: vibur; + font-size: larger; + box-shadow: 0 2px 5px rgba(108, 108, 108, 0.2); + color: black; +} + +.try_examples_button:hover { + background-color: var(--jupyter-light-primary-muted); + transform: scale(1.02); + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); + cursor: pointer; + color: white; +} From 4e67d3e60482e4e40e0d0b75772b7c497cb7e39f Mon Sep 17 00:00:00 2001 From: Matt Fisher Date: Sat, 15 Feb 2025 18:16:34 -0700 Subject: [PATCH 4/7] Fix filename typo --- docs/assets/css/{cusom.css => custom.css} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/assets/css/{cusom.css => custom.css} (100%) diff --git a/docs/assets/css/cusom.css b/docs/assets/css/custom.css similarity index 100% rename from docs/assets/css/cusom.css rename to docs/assets/css/custom.css From 569e0c9e72bb6f9266c1311d1914e5e5ceadb0c0 Mon Sep 17 00:00:00 2001 From: Matt Fisher Date: Sat, 15 Feb 2025 18:20:49 -0700 Subject: [PATCH 5/7] Fix pre-commit failure --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e3dc8a543..9508c4246 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,4 +37,4 @@ repos: rev: v6.2.4 hooks: - id: rstcheck - args: ['--ignore-directives=tabs,toctree,autoclass,cssclass,include', '--report-level=warning'] + args: ['--ignore-directives=jupyterlite,tabs,toctree,autoclass,cssclass,include', '--report-level=warning'] From 6097d74eedb1d97a1ba95f9d7aa15d53e7bd02a9 Mon Sep 17 00:00:00 2001 From: Matt Fisher Date: Sat, 15 Feb 2025 18:25:20 -0700 Subject: [PATCH 6/7] Replace CSS variables in docs CSS where they are not defined --- docs/assets/css/custom.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/assets/css/custom.css b/docs/assets/css/custom.css index aac927e68..7e2698abf 100644 --- a/docs/assets/css/custom.css +++ b/docs/assets/css/custom.css @@ -1,5 +1,5 @@ .try_examples_button { - background-color: var(--jupyter-light-primary); + background-color: #f7dc1e; border: none; padding: 5px 10px; border-radius: 15px; @@ -10,7 +10,6 @@ } .try_examples_button:hover { - background-color: var(--jupyter-light-primary-muted); transform: scale(1.02); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); cursor: pointer; From 3c119038e652daa592ec2bbee2ad1b2e503835de Mon Sep 17 00:00:00 2001 From: Matt Fisher Date: Sat, 15 Feb 2025 18:32:24 -0700 Subject: [PATCH 7/7] Lint :bell: --- docs/assets/css/custom.css | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/assets/css/custom.css b/docs/assets/css/custom.css index 7e2698abf..a894f8c27 100644 --- a/docs/assets/css/custom.css +++ b/docs/assets/css/custom.css @@ -1,17 +1,17 @@ .try_examples_button { - background-color: #f7dc1e; - border: none; - padding: 5px 10px; - border-radius: 15px; - font-family: vibur; - font-size: larger; - box-shadow: 0 2px 5px rgba(108, 108, 108, 0.2); - color: black; + background-color: #f7dc1e; + border: none; + padding: 5px 10px; + border-radius: 15px; + font-family: vibur; + font-size: larger; + box-shadow: 0 2px 5px rgba(108, 108, 108, 0.2); + color: black; } .try_examples_button:hover { - transform: scale(1.02); - box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); - cursor: pointer; - color: white; + transform: scale(1.02); + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); + cursor: pointer; + color: white; }