diff --git a/.gitignore b/.gitignore index d9c4a7972f076d..1cdcf0b8953d78 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,14 @@ +########################################################################## +# Added by this RTD fork repo: +# https://github.com/python-docs-101/Python-Documentation-Theme-Fork +########################################################################## +.config/* +__notes__* + +########################################################################## +# Original .gitignore below this comment +########################################################################## + ##### # First, rules intended to apply in all subdirectories. # These contain no slash, or only a trailing slash. diff --git a/Doc/_static/css_for_fork/py_rtd_fork.css b/Doc/_static/css_for_fork/py_rtd_fork.css new file mode 100644 index 00000000000000..edf857348153d8 --- /dev/null +++ b/Doc/_static/css_for_fork/py_rtd_fork.css @@ -0,0 +1,92 @@ +/* Import from original theme. */ +pre { + padding: 5px; + background-color: #eeffcc; + color: #333333; + line-height: 120%; + border: 1px solid #ac9; + border-left: none; + border-right: none; +} + +/* Import from original theme. */ +div.body a { + color: #0072aa; +} +div.body a:visited { + color: #6363bb; +} +div.body a:hover { + color: #00B0E4; +} +/* minor edit to add scope `div.wy-nav-content` to fix sidebar */ +div.wy-nav-content a code span.pre { + color: #2980b9; +} + +/* Import from original theme. + Fixes an awful issue where RTD theme settings made non-hyperlinks look like hyperlinks. +*/ +html.writer-html4 .rst-content dl:not(.docutils)>dt, html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt { + color: #222222; +} + +/* Import from original theme. + Make inline code blocks look more like GitHub and Slack +*/ +code, +.rst-content code, +.rst-content code.literal, +.rst-content tt, +.rst-content tt.literal { + color: #333333; + padding: 0 1px 0 1px; + font-size: 0.95em; + background-color: #ecf0f3; +} + +/* Import from original theme. */ +a.headerlink { + visibility: hidden; +} + +a.brackets:before { + content: "["; +} + +a.brackets:after { + content: "]"; +} + + +/* Import from original theme. */ +span.linkdescr { + font-style: italic; + padding-top: 5px; + font-size: 90%; +} +a.biglink { + font-size: 1.3em; +} + +div.footer { + line-height: 150%; + margin-top: -2em; + text-align: right; + width: auto; + margin-right: 10px; + font-size: 75%; + padding: 9px 0 9px 0; +} + + +a.icon.icon-home::before { + content: ''; + height: 21px; + width: 21px; + margin-left: -8px; + margin-bottom: -4px; + background: url(https://python-docs-101.github.io/_static/py.svg); + background-size: 19px 20px; + background-repeat: no-repeat; +} \ No newline at end of file diff --git a/Doc/_static/py.svg b/Doc/_static/py.svg new file mode 100644 index 00000000000000..90b6c9004b7418 --- /dev/null +++ b/Doc/_static/py.svg @@ -0,0 +1,14 @@ + diff --git a/Doc/conf.py b/Doc/conf.py index b3da8fa9ec4497..b92ff7ecf35e8a 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -85,16 +85,146 @@ # Options for HTML output # ----------------------- -# Use our custom theme. -html_theme = 'python_docs_theme' -html_theme_path = ['tools'] + +##<>========================================================= +## @@~@@ FORK MODIFIES THIS SECTOION -- replaced +##=========================================================== +## Original options using `html_theme = 'python_docs_theme'` +##=========================================================== +# # Use our custom theme. +# html_theme = 'python_docs_theme' +# html_theme_path = ['tools'] +# html_theme_options = { +# 'collapsiblesidebar': True, +# 'issues_url': '/bugs.html', +# 'license_url': '/license.html', +# 'root_include_title': False # We use the version switcher instead. +# } +##>======================================================== + + +##<>========================================================= +## @@~@@ FORK MODIFIES THIS SECTOION -- added +##=========================================================== +## Original options using `html_theme = 'python_docs_theme'` +##=========================================================== +html_theme = 'sphinx_rtd_theme' +html_theme_path = [''] +html_favicon = '_static/py.svg' +# html_logo = '_static/py.svg' html_theme_options = { - 'collapsiblesidebar': True, + #------------------------------------------------------------------- + # Add these variables manually to: + # Doc/venv/lib/python3.9/site-packages/sphinx_rtd_theme/theme.conf + # then they can be accessed via theme_issues_url + theme_license_url + #------------------------------------------------------------------- 'issues_url': '/bugs.html', 'license_url': '/license.html', - 'root_include_title': False # We use the version switcher instead. + + #*************************************************************** + # DOCS: sphinx_rtd_theme : collapse_navigation * + #*************************************************************** + # Poorly named. * + # * + # From sphinx-rtd-theme.readthedocs.io: * + # * + # Type: boolean * + # Default: True * + # * + # Description: * + # * + # With collapse_navigation enabled * + # * + # Navigation entries are not expandable * + # – the [+] icons next to each entry are removed. * + # * + #*************************************************************** + # This really means, * + # "Do you want to collapse all the nav * + # and not include sub-pages?" * + # * + # We want to tell it: * + # "False, I wish to include sub-pages." * + #*************************************************************** + 'collapse_navigation': False, + + #********************************************************************** + # DOCS: sphinx_rtd_theme : navigation_depth * + #********************************************************************** + # * + # From sphinx-rtd-theme.readthedocs.io: * + # * + # Type: integer * + # Default: 4 * + # * + # Description: * + # The maximum depth of the table of contents tree. * + # Set this to -1 to allow unlimited depth. * + # * + #********************************************************************** + 'navigation_depth': -1, + + #************************************************************ + # DOCS: sphinx_rtd_theme : titles_only * + #************************************************************ + # * + # From sphinx-rtd-theme.readthedocs.io: * + # * + # Type: boolean * + # Default: False * + # * + # Description: * + # When enabled, page subheadings * + # are not included in the navigation. * + # * + #************************************************************ + 'titles_only': False, + + #************************************************************ + # DOCS: sphinx_rtd_theme : warning * + #************************************************************ + # * + # Note: * + # * + # Setting collapse_navigation to False * + # and using a high value for navigation_depth * + # on projects with many files and a deep file structure * + # * + # can cause long compilation times * + # and can result in HTML files * + # that are significantly larger in file size. * + # * + #************************************************************ } +##>======================================================== +## @@~@@ FORK MODIFIES THIS SECTOION -- added +## endof update +##=========================================================== + +##------------------------------------------------------------------------- +## <> RTD CSS Config +##------------------------------------------------------------------------- +## See +## https://docs.readthedocs.io/en/stable/guides/adding-custom-css.html +##------------------------------------------------------------------------- +# These folders are copied to the documentation's HTML output +html_static_path = ['_static'] + +# These paths are either relative to html_static_path +# or fully qualified paths (eg. https://...) +html_css_files = [ + 'css_for_fork/py_rtd_fork.css', +] +##------------------------------------------------------------------------- +## > RTD CSS Config +##------------------------------------------------------------------------- + + + + + + # Override stylesheet fingerprinting for Windows CHM htmlhelp to fix GH-91207 # https://github.com/python/cpython/issues/91207 if any('htmlhelp' in arg for arg in sys.argv): diff --git a/Doc/contents.rst b/Doc/contents.rst index 464f93bdf85f95..54e2c72197de75 100644 --- a/Doc/contents.rst +++ b/Doc/contents.rst @@ -2,29 +2,40 @@ Python Documentation contents %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -.. toctree:: +.. |hr| raw:: html + +
- {% trans %}Welcome! This is the official documentation for Python {{ release }}.{% endtrans %}
+ {% trans %}Welcome! This is
+
+
+ A FORK OF
+
+
+ the official documentation for Python {{ release }}.{% endtrans %}
+ ◀ We added a TOC sidebar to this entire site!
+
+ Otherwise, the rest of this repo is identical to the main docs at https://docs.python.org
+
{% trans %}Parts of the documentation:{% endtrans %}
diff --git a/Doc/venv/lib/python3.9/site-packages/sphinx_rtd_theme/breadcrumbs.html b/Doc/venv/lib/python3.9/site-packages/sphinx_rtd_theme/breadcrumbs.html
new file mode 100644
index 00000000000000..a583588bc73900
--- /dev/null
+++ b/Doc/venv/lib/python3.9/site-packages/sphinx_rtd_theme/breadcrumbs.html
@@ -0,0 +1,77 @@
+{%- if meta is defined and meta is not none %}
+ {%- set check_meta = True %}
+{%- else %}
+ {%- set check_meta = False %}
+{%- endif %}
+
+{%- if check_meta and 'github_url' in meta %}
+ {%- set display_github = True %}
+{%- endif %}
+
+{%- if check_meta and 'bitbucket_url' in meta %}
+ {%- set display_bitbucket = True %}
+{%- endif %}
+
+{%- if check_meta and 'gitlab_url' in meta %}
+ {%- set display_gitlab = True %}
+{%- endif %}
+
+{%- set display_vcs_links = display_vcs_links if display_vcs_links is defined else True %}
+
+{#- Translators: This is an ARIA section label for page links, including previous/next page link and links to GitHub/GitLab/etc. -#}
+
+ {#- SIDE NAV, TOGGLES ON MOBILE #}
+
+
+
+ {%- block content %}
+ {%- if theme_style_external_links|tobool %}
+
+ {% include "versions.html" -%}
+
+
+
+ {#- Do not conflict with RTD insertion of analytics script #}
+ {%- if not READTHEDOCS %}
+ {%- if theme_analytics_id %}
+
+
+
+
+ {%- endif %}
+ {%- endif %}
+
+ {%- block footer %} {% endblock %}
+
+
+
diff --git a/Doc/venv/lib/python3.9/site-packages/sphinx_rtd_theme/theme.conf b/Doc/venv/lib/python3.9/site-packages/sphinx_rtd_theme/theme.conf
new file mode 100644
index 00000000000000..5deb83244e41c8
--- /dev/null
+++ b/Doc/venv/lib/python3.9/site-packages/sphinx_rtd_theme/theme.conf
@@ -0,0 +1,22 @@
+[theme]
+inherit = basic
+stylesheet = css/theme.css
+pygments_style = default
+
+[options]
+canonical_url =
+analytics_id =
+analytics_anonymize_ip = False
+collapse_navigation = True
+sticky_navigation = True
+navigation_depth = 4
+includehidden = True
+titles_only =
+logo_only =
+display_version = True
+prev_next_buttons_location = bottom
+style_external_links = False
+style_nav_header_background =
+vcs_pageview_mode =
+issues_url =
+license_url =
\ No newline at end of file
diff --git a/README.rst b/README.rst
index b1756e20c141ab..f3fa2a88fe7d1d 100644
--- a/README.rst
+++ b/README.rst
@@ -1,265 +1,33 @@
-This is Python version 3.12.0 alpha 5
-=====================================
+-------------------------------------------
+Fork of the official ``cpython`` repo's docs
+-------------------------------------------
-.. image:: https://github.com/python/cpython/workflows/Tests/badge.svg
- :alt: CPython build status on GitHub Actions
- :target: https://github.com/python/cpython/actions
+**Original repo**
-.. image:: https://dev.azure.com/python/cpython/_apis/build/status/Azure%20Pipelines%20CI?branchName=main
- :alt: CPython build status on Azure DevOps
- :target: https://dev.azure.com/python/cpython/_build/latest?definitionId=4&branchName=main
+* https://github.com/python/cpython/
+* The official docs https://docs.python.org/3/ live in that repo inside the ``/cpython/Doc/`` folder.
+
+**Notes**
-.. image:: https://img.shields.io/badge/discourse-join_chat-brightgreen.svg
- :alt: Python Discourse chat
- :target: https://discuss.python.org/
+* | ``cpython`` *is the official implementation of the Python programming language*
+ | *(powered by the* ``C`` *programming language under the hood).*
+* https://www.python.org/
+^^^^^^^^^^^^^^^^
+About this Fork
+^^^^^^^^^^^^^^^^
-Copyright © 2001-2023 Python Software Foundation. All rights reserved.
+* No functional code changes, only editing the documentation theme.
+* Goal is to create a mirror of the official Python Docs: but with a true TOC ("Table of Contents") sidebar.
+
-See the end of this file for further copyright and license information.
+^^^^^^^^^^^^
+Product
+^^^^^^^^^^^^
+Baked website output from this repo's cusomizations will live in this GitHub Pages repo:
-.. contents::
+* https://github.com/python-docs-101/python-docs-101.github.io
-General Information
--------------------
+The docs will be served on GitHub Pages here:
-- Website: https://www.python.org
-- Source code: https://github.com/python/cpython
-- Issue tracker: https://github.com/python/cpython/issues
-- Documentation: https://docs.python.org
-- Developer's Guide: https://devguide.python.org/
-
-Contributing to CPython
------------------------
-
-For more complete instructions on contributing to CPython development,
-see the `Developer Guide`_.
-
-.. _Developer Guide: https://devguide.python.org/
-
-Using Python
-------------
-
-Installable Python kits, and information about using Python, are available at
-`python.org`_.
-
-.. _python.org: https://www.python.org/
-
-Build Instructions
-------------------
-
-On Unix, Linux, BSD, macOS, and Cygwin::
-
- ./configure
- make
- make test
- sudo make install
-
-This will install Python as ``python3``.
-
-You can pass many options to the configure script; run ``./configure --help``
-to find out more. On macOS case-insensitive file systems and on Cygwin,
-the executable is called ``python.exe``; elsewhere it's just ``python``.
-
-Building a complete Python installation requires the use of various
-additional third-party libraries, depending on your build platform and
-configure options. Not all standard library modules are buildable or
-useable on all platforms. Refer to the
-`Install dependencies
+ {%- else %}
+
+
+
+ {%- endif %}
+ {% include "breadcrumbs.html" %}
+
+ {%- endblock %}
+
+ {%- block document %}
+
+ {%- endblock %}
+ {% include "footer.html" %}
+
+ {% block body %}{% endblock %}
+
+ {%- if self.comments()|trim %}
+
+ {%- block comments %}{% endblock %}
+
+ {%- endif%}
+ |
diff --git a/Doc/venv/lib/python3.9/site-packages/sphinx_rtd_theme/footer.html b/Doc/venv/lib/python3.9/site-packages/sphinx_rtd_theme/footer.html
new file mode 100644
index 00000000000000..d24e120d332e37
--- /dev/null
+++ b/Doc/venv/lib/python3.9/site-packages/sphinx_rtd_theme/footer.html
@@ -0,0 +1,53 @@
+
diff --git a/Doc/venv/lib/python3.9/site-packages/sphinx_rtd_theme/layout.html b/Doc/venv/lib/python3.9/site-packages/sphinx_rtd_theme/layout.html
new file mode 100644
index 00000000000000..ca07fe267a5b8d
--- /dev/null
+++ b/Doc/venv/lib/python3.9/site-packages/sphinx_rtd_theme/layout.html
@@ -0,0 +1,250 @@
+{# TEMPLATE VAR SETTINGS #}
+{%- set url_root = pathto('', 1) %}
+{%- if url_root == '#' %}{% set url_root = '' %}{% endif %}
+{%- if not embedded and docstitle %}
+ {%- set titlesuffix = " — "|safe + docstitle|e %}
+{%- else %}
+ {%- set titlesuffix = "" %}
+{%- endif %}
+{%- set lang_attr = 'en' if language == None else (language | replace('_', '-')) %}
+{%- set sphinx_writer = 'writer-html5' if html5_doctype else 'writer-html4' -%}
+
+{# Build sphinx_version_info tuple from sphinx_version string in pure Jinja #}
+{%- set (_ver_major, _ver_minor) = (sphinx_version.split('.') | list)[:2] | map('int') -%}
+{%- set sphinx_version_info = (_ver_major, _ver_minor, -1) -%}
+
+
+
+
+
+ {{- metatags }}
+
+ {%- block htmltitle %}
+