From 94e09b39348869927c81a57d3a88d8c276415dea Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Tue, 20 Jan 2026 19:29:07 -0500 Subject: [PATCH] Update readthedocs.js to latest zensical example Also: - Remove use of readthedocs.css since that isn't included in the Zensical example --- docs/javascripts/readthedocs.js | 29 ++--------------------------- docs/stylesheets/readthedocs.css | 11 ----------- mkdocs.yml | 3 +-- 3 files changed, 3 insertions(+), 40 deletions(-) delete mode 100644 docs/stylesheets/readthedocs.css diff --git a/docs/javascripts/readthedocs.js b/docs/javascripts/readthedocs.js index b32788054..1ded0274b 100644 --- a/docs/javascripts/readthedocs.js +++ b/docs/javascripts/readthedocs.js @@ -1,33 +1,8 @@ document.addEventListener("DOMContentLoaded", function (event) { // Trigger Read the Docs' search addon instead of Zensical default - document.querySelector(".md-search__input").addEventListener("focus", (e) => { + document.querySelector(".md-search").addEventListener("click", (e) => { + e.preventDefault(); const event = new CustomEvent("readthedocs-search-show"); document.dispatchEvent(event); }); }); - -// Use CustomEvent to generate the version selector -document.addEventListener("readthedocs-addons-data-ready", function (event) { - const config = event.detail.data(); - const versioning = ` -
- - - -
`; - - document.querySelector(".md-header__topic").insertAdjacentHTML("beforeend", versioning); -}); diff --git a/docs/stylesheets/readthedocs.css b/docs/stylesheets/readthedocs.css deleted file mode 100644 index 0f9478490..000000000 --- a/docs/stylesheets/readthedocs.css +++ /dev/null @@ -1,11 +0,0 @@ -:root { - /* Reduce Read the Docs' flyout font a little bit */ - --readthedocs-flyout-font-size: 0.7rem; - - /* Reduce Read the Docs' notification font a little bit */ - --readthedocs-notification-font-size: 0.8rem; - - /* This customization is not yet perfect because we can't change the `line-height` yet. */ - /* See https://github.com/readthedocs/addons/issues/197 */ - --readthedocs-search-font-size: 0.7rem; -} diff --git a/mkdocs.yml b/mkdocs.yml index 12d951a92..8d8507e84 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -217,10 +217,9 @@ nav: - Meta: - doc_conventions.md -# Include extra CSS to make some style adjustments for ReadTheDocs +# Include extra CSS to make some style adjustments for visible width extra_css: - stylesheets/cmd2.css - - stylesheets/readthedocs.css # Include extra JS to setup Read the Docs addons integrations extra_javascript: