This is an automated email from the ASF dual-hosted git repository. liyuanjian pushed a commit to branch branch-3.5 in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-3.5 by this push: new bbe12e148eb Revert "[SPARK-44742][PYTHON][DOCS] Add Spark version drop down to the PySpark doc site" bbe12e148eb is described below commit bbe12e148eb1f289cfb1f4412525f4c4381c10a9 Author: Yuanjian Li <yuanjian...@databricks.com> AuthorDate: Mon Aug 28 22:43:50 2023 -0700 Revert "[SPARK-44742][PYTHON][DOCS] Add Spark version drop down to the PySpark doc site" This reverts commit 319dff11c373cc872aab4e7d55745561ee5d7b0e. --- python/docs/source/_static/css/pyspark.css | 13 ---- python/docs/source/_static/versions.json | 22 ------- .../docs/source/_templates/version-switcher.html | 77 ---------------------- python/docs/source/conf.py | 9 +-- 4 files changed, 1 insertion(+), 120 deletions(-) diff --git a/python/docs/source/_static/css/pyspark.css b/python/docs/source/_static/css/pyspark.css index ccfe60f2bca..89b7c65f27a 100644 --- a/python/docs/source/_static/css/pyspark.css +++ b/python/docs/source/_static/css/pyspark.css @@ -95,16 +95,3 @@ u.bd-sidebar .nav>li>ul>.active:hover>a,.bd-sidebar .nav>li>ul>.active>a { .spec_table tr, td, th { border-top: none!important; } - -/* Styling to the version dropdown */ -#version-button { - padding-left: 0.2rem; - padding-right: 3.2rem; -} - -#version_switcher { - height: auto; - max-height: 300px; - width: 165px; - overflow-y: auto; -} diff --git a/python/docs/source/_static/versions.json b/python/docs/source/_static/versions.json deleted file mode 100644 index 3d0bd148180..00000000000 --- a/python/docs/source/_static/versions.json +++ /dev/null @@ -1,22 +0,0 @@ -[ - { - "name": "3.4.1", - "version": "3.4.1" - }, - { - "name": "3.4.0", - "version": "3.4.0" - }, - { - "name": "3.3.2", - "version": "3.3.2" - }, - { - "name": "3.3.1", - "version": "3.3.1" - }, - { - "name": "3.3.0", - "version": "3.3.0" - } -] diff --git a/python/docs/source/_templates/version-switcher.html b/python/docs/source/_templates/version-switcher.html deleted file mode 100644 index 16c443229f4..00000000000 --- a/python/docs/source/_templates/version-switcher.html +++ /dev/null @@ -1,77 +0,0 @@ -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> - -<div id="version-button" class="dropdown"> - <button type="button" class="btn btn-secondary btn-sm navbar-btn dropdown-toggle" id="version_switcher_button" data-toggle="dropdown"> - {{ release }} - <span class="caret"></span> - </button> - <div id="version_switcher" class="dropdown-menu list-group-flush py-0" aria-labelledby="version_switcher_button"> - <!-- dropdown will be populated by javascript on page load --> - </div> -</div> - -<script type="text/javascript"> -// Function to construct the target URL from the JSON components -function buildURL(entry) { - var template = "{{ switcher_template_url }}"; // supplied by jinja - template = template.replace("{version}", entry.version); - return template; -} - -// Function to check if corresponding page path exists in other version of docs -// and, if so, go there instead of the homepage of the other docs version -function checkPageExistsAndRedirect(event) { - const currentFilePath = "{{ pagename }}.html", - otherDocsHomepage = event.target.getAttribute("href"); - let tryUrl = `${otherDocsHomepage}${currentFilePath}`; - $.ajax({ - type: 'HEAD', - url: tryUrl, - // if the page exists, go there - success: function() { - location.href = tryUrl; - } - }).fail(function() { - location.href = otherDocsHomepage; - }); - return false; -} - -// Function to populate the version switcher -(function () { - // get JSON config - $.getJSON("{{ switcher_json_url }}", function(data, textStatus, jqXHR) { - // create the nodes first (before AJAX calls) to ensure the order is - // correct (for now, links will go to doc version homepage) - $.each(data, function(index, entry) { - // if no custom name specified (e.g., "latest"), use version string - if (!("name" in entry)) { - entry.name = entry.version; - } - // construct the appropriate URL, and add it to the dropdown - entry.url = buildURL(entry); - const node = document.createElement("a"); - node.setAttribute("class", "list-group-item list-group-item-action py-1"); - node.setAttribute("href", `${entry.url}`); - node.textContent = `${entry.name}`; - node.onclick = checkPageExistsAndRedirect; - $("#version_switcher").append(node); - }); - }); -})(); -</script> diff --git a/python/docs/source/conf.py b/python/docs/source/conf.py index 0f57cb37cee..38c331048e7 100644 --- a/python/docs/source/conf.py +++ b/python/docs/source/conf.py @@ -177,17 +177,10 @@ autosummary_generate = True # a list of builtin themes. html_theme = 'pydata_sphinx_theme' -html_context = { - "switcher_json_url": "_static/versions.json", - "switcher_template_url": "https://spark.apache.org/docs/{version}/api/python/index.html", -} - # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -html_theme_options = { - "navbar_end": ["version-switcher"] -} +#html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org