diff --git a/presto-docs/requirements.txt b/presto-docs/requirements.txt index 690c9cf65121e..1c754cb933494 100644 --- a/presto-docs/requirements.txt +++ b/presto-docs/requirements.txt @@ -1,3 +1,3 @@ sphinx==7.2.6 -sphinx-material==0.0.35 -sphinx-copybutton==0.5.0 +sphinx-immaterial==0.11.11 +sphinx-copybutton==0.5.2 diff --git a/presto-docs/src/main/sphinx/_templates/layout.html b/presto-docs/src/main/sphinx/_templates/layout.html deleted file mode 100644 index 68eb3bb0e84df..0000000000000 --- a/presto-docs/src/main/sphinx/_templates/layout.html +++ /dev/null @@ -1,8 +0,0 @@ -{# Import the theme's layout. #} -{% extends '!layout.html' %} - -{%- block fonticon %} - {# add Font Awesome here #} - -{{ super() }} -{%- endblock %} \ No newline at end of file diff --git a/presto-docs/src/main/sphinx/_templates/localtoc.html b/presto-docs/src/main/sphinx/_templates/localtoc.html deleted file mode 100644 index 6f56e497d9903..0000000000000 --- a/presto-docs/src/main/sphinx/_templates/localtoc.html +++ /dev/null @@ -1,50 +0,0 @@ -{# there is no extension block in localtoc.html. copy the original localtoc.html #} -{% set toc_nodes = derender_toc(toc, True, pagename) if display_toc else [] %} - \ No newline at end of file diff --git a/presto-docs/src/main/sphinx/_templates/partials/toc.html b/presto-docs/src/main/sphinx/_templates/partials/toc.html new file mode 100644 index 0000000000000..cb7339222e31c --- /dev/null +++ b/presto-docs/src/main/sphinx/_templates/partials/toc.html @@ -0,0 +1,60 @@ +{#- +This file was automatically generated - do not edit +-#} +{% set title = lang.t("toc.title") %} +{% if config.mdx_configs.toc and config.mdx_configs.toc.title %} +{% set title = config.mdx_configs.toc.title %} +{% endif %} + \ No newline at end of file diff --git a/presto-docs/src/main/sphinx/_templates/relbar.html b/presto-docs/src/main/sphinx/_templates/relbar.html deleted file mode 100644 index c341a403902b9..0000000000000 --- a/presto-docs/src/main/sphinx/_templates/relbar.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/presto-docs/src/main/sphinx/conf.py b/presto-docs/src/main/sphinx/conf.py index 7111dd8a21923..62ab4942c889f 100644 --- a/presto-docs/src/main/sphinx/conf.py +++ b/presto-docs/src/main/sphinx/conf.py @@ -60,15 +60,16 @@ def get_version(): # -- General configuration ----------------------------------------------------- -needs_sphinx = '3.3.0' + +needs_sphinx = '7.2.6' extensions = [ - 'sphinx_copybutton', 'download', 'issue', 'pr' + 'sphinx_immaterial', 'sphinx_copybutton', 'download', 'issue', 'pr' ] copyright = 'The Presto Foundation. All rights reserved. Presto is a registered trademark of LF Projects, LLC' -templates_path = ['templates'] +templates_path = ['_templates'] source_suffix = '.rst' @@ -96,7 +97,7 @@ def get_version(): # -- Options for HTML output --------------------------------------------------- -html_theme = 'sphinx_material' +html_theme = 'sphinx_immaterial' # Set link name generated in the top bar. html_title = '%s %s Documentation' % (project, release) @@ -107,101 +108,63 @@ def get_version(): # html_baseurl = 'overview.html' html_static_path = ['static'] -html_css_files = [ - 'presto.css', -] templates_path = ['_templates'] +# Set the primary domain to js because if left as the default python +# the theme errors when functions aren't available in a python module +primary_domain = 'js' + html_add_permalinks = '#' html_show_copyright = True html_show_sphinx = False -html_sidebars = { - "**": ['logo-text.html', 'globaltoc.html', 'localtoc.html', 'searchbox.html'] -} - -html_show_sourcelink = False -# Material theme options (see theme.conf for more information) html_theme_options = { -# Set the name to appear in the left sidebar/header. If not provided, uses -# html_short_title if defined, or html_title - # 'nav_title': 'Project Name', - # Set your GA account ID to enable tracking - 'google_analytics_account': 'G-K7GB6F0LBZ', - - # Specify a base_url used to generate sitemap.xml. If not - # specified, then no sitemap will be built. - 'base_url': '/', - -# Colors -# The theme color for mobile browsers. Hex color. - 'theme_color': '374665', - # Primary colors: -# red, pink, purple, deep-purple, indigo, blue, light-blue, cyan, -# teal, green, light-green, lime, yellow, amber, orange, deep-orange, -# brown, grey, blue-grey, white. default is blue. - 'color_primary': 'grey', - # Accent colors: -# red, pink, purple, deep-purple, indigo, blue, light-blue, cyan, -# teal, green, light-green, lime, yellow, amber, orange, deep-orange - 'color_accent': 'blue', - -# Repository integration -# Set the repo url for the link to appear + "analytics": { + "provider": "google", + "property": "G-K7GB6F0LBZ" + }, + 'features': [ + 'toc.follow', + 'toc.sticky', + ], + 'palette': [ + { + "media": "(prefers-color-scheme: light)", + "scheme": "default", + "primary": "black", + "accent": "cyan", + "toggle": { + "icon": "material/toggle-switch-off-outline", + "name": "Switch to dark mode", + } + }, + { + "media": "(prefers-color-scheme: dark)", + "scheme": "slate", + "primary": "light-blue", + "accent": "deep-orange", + "toggle": { + "icon": "material/toggle-switch", + "name": "Switch to light mode", + } + }, + ], + 'edit_uri': 'blob/master/presto-docs/src/main/sphinx', + + # 'base_url': '/', 'repo_url': 'https://github.com/prestodb/presto', 'repo_name': 'Presto', - 'repo_type': 'github', - - -# TOC Tree generation -# The maximum depth of the global TOC; set it to -1 to allow unlimited depth -'globaltoc_depth': 2, -# If true, TOC entries that are not ancestors of the current page are collapsed -'globaltoc_collapse': True, -# If true, the global TOC tree will also contain hidden entries -'globaltoc_includehidden': False, - - -# Include the master document at the top of the page in the breadcrumb bar. -# You must also set this to true if you want to override the rootrellink block, in which -# case the content of the overridden block will appear -# master_doc = True - -# A list of dictionaries where each has three keys: -# href: The URL or pagename (str) -# title: The title to appear (str) -# internal: Flag indicating to use pathto (bool) -# nav_links = - -# Text to appear at the top of the home page in a "hero" div. Must be a -# dict[str, str] of the form pagename: hero text, e.g., {'index': 'text on index'} -# heroes = - -# Enable the version dropdown feature. See the demo site for the structure -# of the json file required. -# 'version_dropdown': 'True', - -# Text to use in the dropdown menu -# version_dropdown_text = Versions - -# Optional dictionary that to use when populating the version dropdown. -# The key is the text that appears, and the value is the absolute path -# of the alternative versions -# version_info = - -# Relative path to json file. The default is "versions.json" which assumes the -# file hosted in the root of the site. You can use other file names or locations, e.g., -# "_static/old_versions.json" -# 'version_json': 'static/versions.json', - -# Table classes to _not_ strip. Must be a list. Classes on this list are *not* -# removed from tables. All other classes are removed, and only tables with outclasses -# are styled by default. -# table_classes = - + # If true, TOC entries that are not ancestors of the current page are collapsed + 'globaltoc_collapse': True, + "social": [ + { + "icon": "fontawesome/brands/github", + "link": "https://github.com/prestodb/presto", + }, + ], } diff --git a/presto-docs/src/main/sphinx/rest/node.rst b/presto-docs/src/main/sphinx/rest/node.rst index 3dc060f85fcef..1c32a7c3009d1 100644 --- a/presto-docs/src/main/sphinx/rest/node.rst +++ b/presto-docs/src/main/sphinx/rest/node.rst @@ -54,37 +54,36 @@ Node Resource **Example response with Errors**: .. sourcecode:: http - - - HTTP/1.1 200 OK - Vary: Accept - Content-Type: text/javascript - - [ - { - "age": "4.45m", - "lastFailureInfo": { - "message": "Connect Timeout", - "stack": [ - "org.eclipse.jetty.io.ManagedSelector$ConnectTimeout.run(ManagedSelector.java:683)", - .... - "java.lang.Thread.run(Thread.java:745)" - ], - "suppressed": [], - "type": "java.net.SocketTimeoutException" - }, - "lastRequestTime": "2017-08-05T11:53:00.647Z", - "lastResponseTime": "2017-08-05T11:53:00.647Z", - "recentFailureRatio": 0.47263053472046446, - "recentFailures": 2.8445543205610617, - "recentFailuresByType": { - "java.net.SocketTimeoutException": 2.8445543205610617 - }, - "recentRequests": 6.018558073577414, - "recentSuccesses": 3.1746446343010297, - "uri": "http://172.19.0.3:8080" - } - ] + + HTTP/1.1 200 OK + Vary: Accept + Content-Type: text/javascript + + [ + { + "age": "4.45m", + "lastFailureInfo": { + "message": "Connect Timeout", + "stack": [ + "org.eclipse.jetty.io.ManagedSelector$ConnectTimeout.run(ManagedSelector.java:683)", + .... + "java.lang.Thread.run(Thread.java:745)" + ], + "suppressed": [], + "type": "java.net.SocketTimeoutException" + }, + "lastRequestTime": "2017-08-05T11:53:00.647Z", + "lastResponseTime": "2017-08-05T11:53:00.647Z", + "recentFailureRatio": 0.47263053472046446, + "recentFailures": 2.8445543205610617, + "recentFailuresByType": { + "java.net.SocketTimeoutException": 2.8445543205610617 + }, + "recentRequests": 6.018558073577414, + "recentSuccesses": 3.1746446343010297, + "uri": "http://172.19.0.3:8080" + } + ] .. function:: GET /v1/node/failed @@ -97,29 +96,33 @@ Node Resource .. sourcecode:: http - [ - { - "age": "1.37m", - "lastFailureInfo": { - "message": "Connect Timeout", - "stack": [ - "org.eclipse.jetty.io.ManagedSelector$ConnectTimeout.run(ManagedSelector.java:683)", - ..... - "java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)", - "java.lang.Thread.run(Thread.java:745)" - ], - "suppressed": [], - "type": "java.net.SocketTimeoutException" - }, - "lastRequestTime": "2017-08-05T11:52:42.647Z", - "lastResponseTime": "2017-08-05T11:52:42.647Z", - "recentFailureRatio": 0.22498784153043677, - "recentFailures": 20.11558290058638, - "recentFailuresByType": { - "java.net.SocketTimeoutException": 20.11558290058638 - }, - "recentRequests": 89.40742203558189, - "recentSuccesses": 69.30583024727453, - "uri": "http://172.19.0.3:8080" - } - ] + HTTP/1.1 200 OK + Vary: Accept + Content-Type: text/javascript + + [ + { + "age": "1.37m", + "lastFailureInfo": { + "message": "Connect Timeout", + "stack": [ + "org.eclipse.jetty.io.ManagedSelector$ConnectTimeout.run(ManagedSelector.java:683)", + ..... + "java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)", + "java.lang.Thread.run(Thread.java:745)" + ], + "suppressed": [], + "type": "java.net.SocketTimeoutException" + }, + "lastRequestTime": "2017-08-05T11:52:42.647Z", + "lastResponseTime": "2017-08-05T11:52:42.647Z", + "recentFailureRatio": 0.22498784153043677, + "recentFailures": 20.11558290058638, + "recentFailuresByType": { + "java.net.SocketTimeoutException": 20.11558290058638 + }, + "recentRequests": 89.40742203558189, + "recentSuccesses": 69.30583024727453, + "uri": "http://172.19.0.3:8080" + } + ] diff --git a/presto-docs/src/main/sphinx/rest/query.rst b/presto-docs/src/main/sphinx/rest/query.rst index 445522a5b60ea..0f9fb55ddcba3 100644 --- a/presto-docs/src/main/sphinx/rest/query.rst +++ b/presto-docs/src/main/sphinx/rest/query.rst @@ -25,7 +25,7 @@ on a Presto installation. **Example response**: - .. sourcecode:: http + .. code-block:: json { "queryId" : "20131229_211533_00017_dk5x2", diff --git a/presto-docs/src/main/sphinx/static/presto.css b/presto-docs/src/main/sphinx/static/presto.css deleted file mode 100644 index 711d24a1ddd99..0000000000000 --- a/presto-docs/src/main/sphinx/static/presto.css +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Licensed 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. - */ - - -@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700;900&display=swap'); -@import url('https://fonts.googleapis.com/css2?family=Montserrat&display=swap'); - -html{ - scroll-behavior: smooth; -} - -body{ - -webkit-font-smoothing:antialiased; - -moz-osx-font-smoothing:grayscale; -} - -body,input,h1,h2,h3,h4,h5{ - -webkit-font-feature-settings:"kern","liga"; - font-feature-settings:"kern","liga"; - font-family:'Montserrat','Roboto', "Helvetica Neue", Helvetica, Arial, sans-serif; - color: #000; -} - -.md-typeset a { - color: #206688!important; - font-weight: 500; -} - -.md-sidebar--primary{ - background-color: rgb(170, 205, 224); -} - -.md-sidebar--secondary{ - background-color: rgba(170, 205, 224,.2); - padding: 0; -} - -.md-nav__link--active{ - background-color: white; - color: #000; - font-weight: bold; -} - -.md-search__inner{ - width:20rem; - background-color: black; -} - -.md-header, -.md-hero, -.md-footer-nav, -.md-tabs{ - color:#45cbe6; - background-color: #222!important; -} - -.md-search__input { - background-color: rgba(255,255,255,.26)!important; -} - -.md-typeset h1{ - font-size: 1.5em; - font-weight: 700; - color: #000000; -} - -.md-typeset h2{ - font-size: 1.4em; - font-weight: 400; -} - -.md-typeset h3{ - font-size: 1.3em; - font-weight: 200; -} - -.md-typeset{ - font-weight: 300; -} - -.md-typeset .admonition, .md-typeset .admonition-title { - font-size: 0.7rem -} - -.o-tooltip--left:after { - font-size: 0.6rem; -} - -/* hide children of Release Notes */ -div.toctree-wrapper > ul > li:last-child > ul { - display: none; -} - -.copybtn:hover { - cursor: copy; -}