From 4255e63269f10ce13cff4b74cd9f8d23d6cf55d5 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 17 Jun 2025 09:34:23 -0400 Subject: [PATCH 01/11] work on new theme --- docs/changelog.md | 2 +- docs/index.md | 8 ++- docs/stylesheets/extra.css | 113 +++++++++++++++++++++++++++++++- docs/theme/partials/header.html | 67 +++++++++++++++++++ mkdocs.yml | 33 ++++------ 5 files changed, 198 insertions(+), 25 deletions(-) create mode 100644 docs/theme/partials/header.html diff --git a/docs/changelog.md b/docs/changelog.md index d845e6e9..3cfb3b69 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,4 +1,4 @@ -# CHANGELOG +# Changelog ### 0.25.0 Nov 12, 2024 diff --git a/docs/index.md b/docs/index.md index 08fdb240..4ad0f9a4 100644 --- a/docs/index.md +++ b/docs/index.md @@ -10,13 +10,19 @@ hide:

-
- + + {% if page.meta and page.meta.title %} {{ page.meta.title }} {% else %} @@ -48,13 +58,72 @@
+ + {% if "material/search" in config.plugins %} + {% set search = config.plugins["material/search"] | attr("config") %} + + + {% if search.enabled %} + + + + {% include "partials/search.html" %} + {% endif %} + {% endif %} + From 463a54fb58a85906aa578eee40c25975069b5b44 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 17 Jun 2025 16:08:45 -0400 Subject: [PATCH 03/11] work on mobile styles --- docs/stylesheets/extra.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css index 9dd3d6ea..814dcf9d 100644 --- a/docs/stylesheets/extra.css +++ b/docs/stylesheets/extra.css @@ -174,7 +174,7 @@ body { .md-main__inner, .md-header__inner, .md-grid { max-width: 100%; } -@media (max-width: 768px) { +@media (max-width: 1000px) { .md-header__inner { display: flex; } From 568a94c0e1c73056043acb55ec922241cd01915b Mon Sep 17 00:00:00 2001 From: James Date: Tue, 17 Jun 2025 17:10:07 -0400 Subject: [PATCH 04/11] fix kapa --- mkdocs.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index 444abb48..4a156857 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -119,11 +119,11 @@ theme: plugins: - search - # - mkdocs-jupyter: - # kernel_name: python3 - # execute: false - # include_source: True - # include_requirejs: true + - mkdocs-jupyter: + kernel_name: python3 + execute: false + include_source: True + include_requirejs: true - mkdocstrings: default_handler: python handlers: @@ -166,7 +166,6 @@ markdown_extensions: anchor_linenums: true extra_javascript: - - "https://widget.kapa.ai/kapa-widget.bundle.js" - "javascripts/init_kapa_widget.js" - "javascripts/cookbooks-card.js" - "https://cdnjs.cloudflare.com/ajax/libs/dompurify/3.0.8/purify.min.js" From 5313f479a45af6202052a574690c88f03ce9158f Mon Sep 17 00:00:00 2001 From: James Date: Tue, 17 Jun 2025 17:12:24 -0400 Subject: [PATCH 05/11] fix kapa widget --- docs/javascripts/init_kapa_widget.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/javascripts/init_kapa_widget.js b/docs/javascripts/init_kapa_widget.js index ffa121ac..f1919479 100644 --- a/docs/javascripts/init_kapa_widget.js +++ b/docs/javascripts/init_kapa_widget.js @@ -7,4 +7,4 @@ document.addEventListener("DOMContentLoaded", function () { script.setAttribute("data-project-logo", "https://media.roboflow.com/chat.png"); script.async = true; document.head.appendChild(script); -}); +}); \ No newline at end of file From c2d0ed23658c03e86cc86935e38bbd7d0a4146fe Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 18 Jun 2025 21:22:58 +0000 Subject: [PATCH 06/11] =?UTF-8?q?fix(pre=5Fcommit):=20=F0=9F=8E=A8=20auto?= =?UTF-8?q?=20format=20pre-commit=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/javascripts/init_kapa_widget.js | 2 +- docs/stylesheets/extra.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/javascripts/init_kapa_widget.js b/docs/javascripts/init_kapa_widget.js index f1919479..ffa121ac 100644 --- a/docs/javascripts/init_kapa_widget.js +++ b/docs/javascripts/init_kapa_widget.js @@ -7,4 +7,4 @@ document.addEventListener("DOMContentLoaded", function () { script.setAttribute("data-project-logo", "https://media.roboflow.com/chat.png"); script.async = true; document.head.appendChild(script); -}); \ No newline at end of file +}); diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css index 814dcf9d..ae41a3e0 100644 --- a/docs/stylesheets/extra.css +++ b/docs/stylesheets/extra.css @@ -115,7 +115,7 @@ body { } /* .md-nav__link:has([tabindex=""]) { - text-transform: uppercase; + text-transform: uppercase; } */ .header-list { From 0a7bf58905f2d00bc6bc0e23d92c32efe5f587ff Mon Sep 17 00:00:00 2001 From: James Date: Tue, 8 Jul 2025 12:25:35 +0100 Subject: [PATCH 07/11] respond to feedback --- docs/stylesheets/cookbooks-card.css | 2 +- docs/stylesheets/extra.css | 31 +++++++++++++++------ docs/theme/partials/header.html | 42 ++++++++++++++++++++++++++--- 3 files changed, 63 insertions(+), 12 deletions(-) diff --git a/docs/stylesheets/cookbooks-card.css b/docs/stylesheets/cookbooks-card.css index 51b24299..3509f20b 100644 --- a/docs/stylesheets/cookbooks-card.css +++ b/docs/stylesheets/cookbooks-card.css @@ -15,7 +15,7 @@ /* Large screens (1024px and up) */ @media (min-width: 1024px) { .custom-grid { - grid-template-columns: repeat(3, minmax(0, 1fr)); + grid-template-columns: repeat(4, minmax(0, 1fr)); } } diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css index ae41a3e0..775d4351 100644 --- a/docs/stylesheets/extra.css +++ b/docs/stylesheets/extra.css @@ -1,7 +1,9 @@ -:root { +:root, body { /* Default to light theme */ --md-primary-fg-color: #8315F9; + --md-code-hl-color: #8315F9 !important; --md-accent-fg-color: #8315F9 !important; + --md-code-hl-color--light: #e8d2ff89 !important; --md-footer-fg-color--light: rgb(111, 108, 121) !important; } @@ -36,9 +38,17 @@ body.light { #products-list *:hover .products-sublist { display: block; } -#resources-list * { +#resources-list *, #products-list * { cursor: pointer; } +.products-sublist, .resources-sublist { + padding: 0.25rem; +} +.products-sublist li:hover, .resources-sublist li:hover, .md-nav__link[href]:hover { + background: rgb(242, 241, 247) !important; + border-radius: 6px; + color: initial !important; +} .md-search { flex-grow: 2; } @@ -75,11 +85,6 @@ body.light { background-color: transparent; color: rgb(111, 108, 121); } -.md-nav__link:hover { - background: rgb(243, 238, 255); - border-radius: 6px; - color: #8315F9 !important; -} .md-typeset .tabbed-set > input:first-child:checked ~ .tabbed-labels > :first-child, .md-typeset .tabbed-set > input:nth-child(10):checked ~ .tabbed-labels > :nth-child(10), .md-typeset .tabbed-set > input:nth-child(11):checked ~ .tabbed-labels > :nth-child(11), .md-typeset .tabbed-set > input:nth-child(12):checked ~ .tabbed-labels > :nth-child(12), .md-typeset .tabbed-set > input:nth-child(13):checked ~ .tabbed-labels > :nth-child(13), .md-typeset .tabbed-set > input:nth-child(14):checked ~ .tabbed-labels > :nth-child(14), .md-typeset .tabbed-set > input:nth-child(15):checked ~ .tabbed-labels > :nth-child(15), .md-typeset .tabbed-set > input:nth-child(16):checked ~ .tabbed-labels > :nth-child(16), .md-typeset .tabbed-set > input:nth-child(17):checked ~ .tabbed-labels > :nth-child(17), .md-typeset .tabbed-set > input:nth-child(18):checked ~ .tabbed-labels > :nth-child(18), .md-typeset .tabbed-set > input:nth-child(19):checked ~ .tabbed-labels > :nth-child(19), .md-typeset .tabbed-set > input:nth-child(2):checked ~ .tabbed-labels > :nth-child(2), .md-typeset .tabbed-set > input:nth-child(20):checked ~ .tabbed-labels > :nth-child(20), .md-typeset .tabbed-set > input:nth-child(3):checked ~ .tabbed-labels > :nth-child(3), .md-typeset .tabbed-set > input:nth-child(4):checked ~ .tabbed-labels > :nth-child(4), .md-typeset .tabbed-set > input:nth-child(5):checked ~ .tabbed-labels > :nth-child(5), .md-typeset .tabbed-set > input:nth-child(6):checked ~ .tabbed-labels > :nth-child(6), .md-typeset .tabbed-set > input:nth-child(7):checked ~ .tabbed-labels > :nth-child(7), .md-typeset .tabbed-set > input:nth-child(8):checked ~ .tabbed-labels > :nth-child(8), .md-typeset .tabbed-set > input:nth-child(9):checked ~ .tabbed-labels > :nth-child(9) { color: #8315F9; border-bottom: 1px solid #8315F9; @@ -186,9 +191,13 @@ body { } } .md-content { - max-width: 800px; + max-width: 40rem; margin: auto; } +/* // if no md-sidebar--primary, make .md-content full width */ +.md-main__inner:has(.md-sidebar--primary[hidden]) .md-content { + max-width: 100%; +} .md-sidebar--primary { flex: 0 20%; } @@ -219,3 +228,9 @@ body[data-md-url$="/cookbooks/"] .md-content { margin-left: 0; width: 100%; } + +.md-main, nav .md-grid, .md-header__inner { + max-width: 1600px; + width: 100%; + margin: auto; +} \ No newline at end of file diff --git a/docs/theme/partials/header.html b/docs/theme/partials/header.html index c8fdf4a8..a6d37ec6 100644 --- a/docs/theme/partials/header.html +++ b/docs/theme/partials/header.html @@ -83,16 +83,17 @@
  • Blog
  • Community Forum
  • Contact Sales
  • +
  • Universe
  • - +
  • -
  • Go to Roboflow
  • +
  • Go to GitHub
  • From e99fc921df5dbba8965e4d742a5a593c7e0f25e0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 8 Jul 2025 11:25:53 +0000 Subject: [PATCH 08/11] =?UTF-8?q?fix(pre=5Fcommit):=20=F0=9F=8E=A8=20auto?= =?UTF-8?q?=20format=20pre-commit=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/stylesheets/extra.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css index 775d4351..885bc575 100644 --- a/docs/stylesheets/extra.css +++ b/docs/stylesheets/extra.css @@ -233,4 +233,4 @@ body[data-md-url$="/cookbooks/"] .md-content { max-width: 1600px; width: 100%; margin: auto; -} \ No newline at end of file +} From 8373a38b351af53392d686ea6e736ec9c2d95c8b Mon Sep 17 00:00:00 2001 From: James Date: Wed, 9 Jul 2025 17:12:13 +0100 Subject: [PATCH 09/11] fix conflict --- docs/javascripts/cookbooks-card.js | 14 +++++++++----- docs/stylesheets/extra.css | 6 ++++++ docs/theme/partials/header.html | 20 ++++++++++++++------ 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/docs/javascripts/cookbooks-card.js b/docs/javascripts/cookbooks-card.js index f2f244ff..8ceb0c32 100644 --- a/docs/javascripts/cookbooks-card.js +++ b/docs/javascripts/cookbooks-card.js @@ -59,7 +59,7 @@ document.addEventListener("DOMContentLoaded", function () {
    +
    ${authorAvatarsHTML}
    ${authorNamesHTML}
    `; element.innerText = ` -
    @@ -105,13 +108,14 @@ document.addEventListener("DOMContentLoaded", function () {
    ${authorsHTML} -
    +
      ${version}
    -
    +
    ${labelHTML}
    diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css index 885bc575..d82db135 100644 --- a/docs/stylesheets/extra.css +++ b/docs/stylesheets/extra.css @@ -234,3 +234,9 @@ body[data-md-url$="/cookbooks/"] .md-content { width: 100%; margin: auto; } +.md-search__scrollwrap { + width: 100% !important; +} +.md-nav--secondary .md-nav__title { + position: initial !important; +} diff --git a/docs/theme/partials/header.html b/docs/theme/partials/header.html index a6d37ec6..3d760057 100644 --- a/docs/theme/partials/header.html +++ b/docs/theme/partials/header.html @@ -119,30 +119,38 @@ }); // on mouse out document.getElementById('resources-list').addEventListener('mouseout', function() { - // if not hovering over the sublist, uncheck the dropdown + // if not hovering over the sublist or the label, uncheck the dropdown // wait 1 sec setTimeout(function() { - if (!document.querySelector('.resources-sublist:hover')) { + if (!document.querySelector('.resources-sublist:hover') && !document.querySelector('#resources-list:hover')) { document.getElementById('dropdown-resources').checked = false; } - }, 500); + }, 350); }); // if mouseout of sublist, uncheck immediately document.querySelector('.resources-sublist').addEventListener('mouseout', function() { - document.getElementById('dropdown-resources').checked = false; + setTimeout(function() { + if (!document.querySelector('.resources-sublist:hover') && !document.querySelector('#resources-list:hover')) { + document.getElementById('dropdown-resources').checked = false; + } + }, 450); }); document.getElementById('products-list').addEventListener('mouseout', function() { // if not hovering over the sublist, uncheck the dropdown // wait 1 sec setTimeout(function() { - if (!document.querySelector('.products-sublist:hover')) { + if (!document.querySelector('.products-sublist:hover') && !document.querySelector('#products-list:hover')) { document.getElementById('dropdown-products').checked = false; } }, 500); }); // if mouseout of sublist, uncheck immediately document.querySelector('.products-sublist').addEventListener('mouseout', function() { - document.getElementById('dropdown-products').checked = false; + setTimeout(function() { + if (!document.querySelector('.products-sublist:hover') && !document.querySelector('#products-list:hover')) { + document.getElementById('dropdown-products').checked = false; + } + }, 500); }); From 796cc26fb99eca2bac01d3b953e85ca5c32afaa0 Mon Sep 17 00:00:00 2001 From: James Date: Wed, 9 Jul 2025 17:25:17 +0100 Subject: [PATCH 10/11] fix version card alignment --- docs/javascripts/cookbooks-card.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/javascripts/cookbooks-card.js b/docs/javascripts/cookbooks-card.js index 8ceb0c32..a909d233 100644 --- a/docs/javascripts/cookbooks-card.js +++ b/docs/javascripts/cookbooks-card.js @@ -108,7 +108,7 @@ document.addEventListener("DOMContentLoaded", function () {
    ${authorsHTML} -