diff --git a/.ci/docker/requirements-ci.txt b/.ci/docker/requirements-ci.txt index dcd2afa7a13..a36be1ac327 100644 --- a/.ci/docker/requirements-ci.txt +++ b/.ci/docker/requirements-ci.txt @@ -16,18 +16,23 @@ hypothesis==6.84.2 parameterized==0.9.0 # Doc build requirements, same as https://github.com/pytorch/pytorch/blob/main/.ci/docker/requirements-docs.txt -sphinx==5.3.0 sphinx-reredirects==0.1.4 -sphinx-gallery==0.14.0 -breathe==4.34.0 -exhale==0.2.3 -docutils==0.16 matplotlib>=3.9.4 + # PyTorch Theme --e git+https://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme -myst-parser==0.18.1 -sphinx_design==0.4.1 +sphinx==7.2.6 +-e git+https://github.com/pytorch/pytorch_sphinx_theme.git@pytorch_sphinx_theme2#egg=pytorch_sphinx_theme2 +sphinxcontrib.katex==0.9.10 +breathe==4.34.0 # only if generating C++ +exhale==0.2.3 # only if generating C++ docs +docutils==>=0.18.1,<0.21 +sphinx-design==0.6.1 +sphinxcontrib-mermaid==1.0.0 +myst-parser==0.18.1 # if want to contribute in markdown +sphinx-gallery==0.14.0 # only if hosting interactive tutorials +sphinx-sitemap==2.7.1 sphinx-copybutton==0.5.0 + # script unit test requirements yaspin==3.1.0 diff --git a/docs/source/_static/css/custom.css b/docs/source/_static/css/custom.css deleted file mode 100644 index 3ae9585701e..00000000000 --- a/docs/source/_static/css/custom.css +++ /dev/null @@ -1,194 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. - */ - -/* sphinx-design styles for cards/tabs -*/ -:root { - --sd-color-info: #ee4c2c; - --sd-color-primary: #6c6c6d; - --sd-color-primary-highlight: #f3f4f7; - --sd-color-card-border-hover: #ee4c2c; - --sd-color-card-border: #f3f4f7; - --sd-color-card-background: #fff; - --sd-color-card-text: inherit; - --sd-color-card-header: transparent; - --sd-color-card-footer: transparent; - --sd-color-tabs-label-active: #ee4c2c; - --sd-color-tabs-label-hover: #ee4c2c; - --sd-color-tabs-label-inactive: #6c6c6d; - --sd-color-tabs-underline-active: #ee4c2c; - --sd-color-tabs-underline-hover: #fabdbd; - --sd-color-tabs-underline-inactive: transparent; - --sd-color-tabs-overline: rgb(222, 222, 222); - --sd-color-tabs-underline: rgb(222, 222, 222); -} - -.sd-text-info { - color: #ee4c2c; -} - -.sd-card-img-top { - background: #ee4c2c; - height: 5px !important; -} - -.sd-card { - position: relative; - background-color: #fff; - opacity: 1.0; - border-radius: 0px; - width: 30%; - border: none; - padding-bottom: 0px; -} - - -.sd-card-img:hover { - opacity: 1.0; - background-color: #f3f4f7; -} - - -.sd-card:after { - display: block; - opacity: 1; - content: ''; - border-bottom: solid 1px #ee4c2c; - background-color: #fff; - transform: scaleX(0); - transition: transform .250s ease-in-out; - transform-origin: 0% 50%; -} - -.sd-card:hover { - background-color: #fff; - opacity: 1; - border-top: 1px solid #f3f4f7; - border-left: 1px solid #f3f4f7; - border-right: 1px solid #f3f4f7; -} - -.sd-card:hover:after { - transform: scaleX(1); -} - -.card-prerequisites:hover { - transition: none; - border: none; -} - -.card-prerequisites:hover:after { - transition: none; - transform: none; -} - -.card-prerequisites:after { - display: block; - content: ''; - border-bottom: none; - background-color: #fff; - transform: none; - transition: none; - transform-origin: none; -} - - -details.sd-dropdown { - font-weight: 300; - width: auto; -} - -details.sd-dropdown:after { - border: none; - transition: none; -} - -details.sd-dropdown:hover { - border: none; - transition: none; -} - -details.sd-dropdown .sd-summary-content { - font-weight: 300; -} - -details.sd-dropdown .highlight .n { - font-weight: normal; -} - -.et-page-column1 { - float: left; - width: 70%; - font-size: 1rem; -} - -.et-page-column2 { - float: right; - padding-top: 40px; - padding-left: 60px; - padding-right: 60px; - padding-bottom: 60px; - width: 30%; -} - -.et-page-column-row:after { - content: ""; - display: table; - clear: both; -} - -/* For screens smaller than 768px (typical mobile devices) */ -@media screen and (max-width: 768px) { - .et-page-column1, .et-page-column2 { - float: none; /* Remove floats */ - width: 100%; /* Full width for both columns */ - padding: 0; - font-size: 1rem; - } - - .et-page-column2 img { - display: none; - } - .et-page-column-row:after { - content: ""; - display: table; - clear: both; - } -} - -article.pytorch-article .class .method dt { - border-top: none; -} - -article.pytorch-article .class .simple dt { - border-top: none; -} - -article.pytorch-article .function dt.sig { - border-top: none; -} - -/* styles needed for 3rd level left nav */ - -.pytorch-left-menu ul, .pytorch-right-menu ul { - margin-left: 1.2em; -} - -.pytorch-left-menu li.toctree-l2.current > a { - color: #e44c2c; -} - -/* The next two styles enable normal hihglighting in the third level nav -in right side bar.*/ -#pytorch-right-menu .side-scroll-highlight { - color: #6c6c6d; -} - -#pytorch-right-menu a.reference.internal.side-scroll-highlight-local { - color: #ee4c2c; -} diff --git a/docs/source/_static/css/progress-bar.css b/docs/source/_static/css/progress-bar.css deleted file mode 100644 index 9b3aeb9d301..00000000000 --- a/docs/source/_static/css/progress-bar.css +++ /dev/null @@ -1,117 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. - */ - -.progress-bar-wrapper { - margin-top: auto; - display: flex; - justify-content: space-between; - margin-bottom: 20px; - position: sticky; - top: 0; - background: white; - padding-top: 20px; - padding-bottom: 20px; - z-index: 2; -} - -.progress-bar-item { - position: relative; - display: flex; - flex-direction: column; - align-items: center; - flex: 1; - - @media (max-width: 768px) { - font-size: 12px; - } -} - -.progress-bar-item::before { - position: absolute; - content: ""; - border-bottom: 2px solid #ccc; - width: 100%; - top: 20px; - left: -50%; - z-index: 2; -} - -.progress-bar-item::after { - position: absolute; - content: ""; - border-bottom: 2px solid #ccc; - width: 100%; - top: 20px; - left: 50%; - z-index: 2; -} - -.progress-bar-item .step-number { - position: relative; - z-index: 5; - display: flex; - justify-content: center; - align-items: center; - width: 40px; - height: 40px; - border-radius: 50%; - border-color: #812CE5; - border-style: solid; - border-width: 1px; - color: #812CE5; - background: #fff; - margin-bottom: 6px; -} - -.progress-bar-item.active { - font-weight: bold; -} - -.progress-bar-item.completed .step-number { - background-color: #812CE5; - color: white; -} - -.progress-bar-item.completed::after { - position: absolute; - content: ""; - border-bottom: 2px solid #812CE5; - width: 100%; - top: 20px; - left: 50%; - z-index: 3; -} - -.progress-bar-item:first-child::before { - content: none; -} - -.progress-bar-item:last-child::after { - content: none; -} - -.progress-bar-item a:link { - color: #262626 !important; -} - -.step-caption:first-child { - margin-left: 10px; -} - -.step-caption { - text-align: center; -} - -.step-caption a:link { - color: #262626 !important; -} - -.step-caption a:hover { - color: #ee4c2c; - text-decoration: underline; -} diff --git a/docs/source/_static/js/progress-bar.js b/docs/source/_static/js/progress-bar.js deleted file mode 100644 index 878251cfc60..00000000000 --- a/docs/source/_static/js/progress-bar.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. - */ - -document.addEventListener("DOMContentLoaded", function() { - const steps = Array.from(document.querySelectorAll('.progress-bar-item')); - const h2s = Array.from(document.querySelectorAll('h2')); - - // Populate captions from h2s - h2s.forEach((h2, index) => { - const captionElem = document.getElementById(`caption-${index + 1}`); - if (captionElem) { - captionElem.innerText = h2.innerText; - } - }); - - // Throttle function to optimize performance - function throttle(func, delay) { - let lastCall = 0; - return function() { - const now = Date.now(); - if (now - lastCall < delay) return; - lastCall = now; - func.apply(this, arguments); - } - } - - document.addEventListener("scroll", throttle(function() { - let activeIndex = 0; - let closestDistance = Number.MAX_VALUE; - const totalHeight = document.documentElement.scrollHeight; - const viewportHeight = window.innerHeight; - const scrollBottom = window.scrollY + viewportHeight; - const isAtBottom = totalHeight === scrollBottom; - - h2s.forEach((h2, index) => { - const rect = h2.getBoundingClientRect(); - const distanceToTop = Math.abs(rect.top); - if (distanceToTop < closestDistance) { - closestDistance = distanceToTop; - activeIndex = index; - } - }); - - steps.forEach((step, index) => { - if (isAtBottom) { - step.classList.remove('active'); - step.classList.add('completed'); - } else { - if (index < activeIndex) { - step.classList.remove('active'); - step.classList.add('completed'); - } else if (index === activeIndex) { - step.classList.add('active'); - step.classList.remove('completed'); - } else { - step.classList.remove('active', 'completed'); - } - } - }); - }, 100)); -}); diff --git a/docs/source/_templates/layout.html b/docs/source/_templates/layout.html deleted file mode 100644 index 55f91103b35..00000000000 --- a/docs/source/_templates/layout.html +++ /dev/null @@ -1,145 +0,0 @@ -{% extends "!layout.html" %} - -{% block extrahead %} -{% if 'getting-started-setup' in pagename%} - - -{% elif 'compiler-delegate-and-partitioner' in pagename%} - - -{% elif 'xtensa' in pagename%} - - -{% elif 'qualcomm-ai-engine-direct-backend' in pagename%} - - -{% elif 'coreml' in pagename%} - - -{% elif 'mps' in pagename%} - - -{% endif %} -{{ super() }} -{% endblock %} - - -{% block sidebartitle %} -