diff --git a/doc/source/_static/css/examples.css b/doc/source/_static/css/examples.css index b5ba94ee44e2e..37e78bdf69ec4 100644 --- a/doc/source/_static/css/examples.css +++ b/doc/source/_static/css/examples.css @@ -22,6 +22,14 @@ text-transform: uppercase; } +/* Hide the default sidebar content */ +#site-navigation > div.bd-sidebar__content { + display: none; +} +#site-navigation > div.rtd-footer-container { + display: none; +} + .searchDiv { margin-bottom: 2em; } @@ -160,7 +168,7 @@ div.sd-card-body > p.sd-card-text > a > span { justify-content: center; } -#noMatches.hidden,.gallery-item.hidden,.footer-article.hidden,div.header-article.row.sticky-top.noprint { +#noMatches.hidden,.gallery-item.hidden { display: none !important; } @@ -197,3 +205,13 @@ button.try-anyscale > span { .top-nav-content { justify-content: initial; } + +/* Hide nav bar that has github, fullscreen, and print icons */ +div.header-article.row.sticky-top.noprint { + display: none !important; +} + +/* Hide the footer with 'prev article' and 'next article' buttons */ +.footer-article.hidden { + display: none !important; +} diff --git a/doc/source/_static/js/tags.js b/doc/source/_static/js/tags.js index 1de3663f7d24c..991d78d4fc08c 100644 --- a/doc/source/_static/js/tags.js +++ b/doc/source/_static/js/tags.js @@ -245,16 +245,6 @@ window.addEventListener('load', () => { const isGallery = window.location.href.endsWith("ray-overview/examples.html") if (isGallery) { - // Hide the nav bar that has sandwich, fullscreen, github, and download buttons. - document.querySelector("div.header-article.row.sticky-top.noprint").classList.add("hidden"); - - let navBar = document.getElementById("site-navigation"); - - // Recursively remove all children of the navbar. - while (navBar.firstChild) { - navBar.firstChild.remove(); - } - const tags = { useCaseTags: [ { @@ -366,16 +356,9 @@ window.addEventListener('load', () => { const tempDiv = document.createElement('div'); tempDiv.innerHTML = tagString; const newNav = tempDiv.firstChild; - navBar.appendChild(newNav); - - // Hide "previous" and "next" footer on the gallery page - document.querySelector("footer.footer-article.noprint").classList.add("hidden"); - // Apply custom css rules for - document.getElementsByTagName('head')[0].insertAdjacentHTML( - 'beforeend', - '' - ); + // Populate the sidebar with buttons that filter for different example tags + document.getElementById("site-navigation").appendChild(newNav); document.querySelectorAll('.tag').forEach(tag => { tag.addEventListener('click', generateTagClickHandler(tag, tags)); diff --git a/doc/source/conf.py b/doc/source/conf.py index e5531b0f441e5..6335e58773fb8 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -import json +from datetime import datetime from pathlib import Path from importlib import import_module import os @@ -7,8 +7,13 @@ from jinja2.filters import FILTERS sys.path.insert(0, os.path.abspath(".")) -from custom_directives import * -from datetime import datetime +from custom_directives import ( + DownloadAndPreprocessEcosystemDocs, + mock_modules, + update_context, + LinkcheckSummarizer, + build_gallery, +) # Mocking modules allows Sphinx to work without installing Ray. diff --git a/doc/source/ray-overview/examples.rst b/doc/source/ray-overview/examples.rst index 1ab70176df2be..dbe5aac8907a7 100644 --- a/doc/source/ray-overview/examples.rst +++ b/doc/source/ray-overview/examples.rst @@ -5,6 +5,8 @@ Ray Examples .. raw:: html + +