Skip to content

PYDOC-7: Add python logo to top of sidebar + breadcrumb root. #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b072728
Update README.rst, info about fork and pointers to original.
python-sidebar Feb 20, 2023
9ccd09b
update .gitignore for fork repo
gamepad-coder Feb 20, 2023
e86c57f
PYDOC-6a: Update .gitignore in fork repo
gamepad-coder Feb 20, 2023
c28acec
PYDOC-6a: Update requirements.txt for fork repo. Add RTD theme.
gamepad-coder Feb 20, 2023
877941a
PYDOC-6a: Update Sphinx conf.py, replace `'python_docs_theme'` with `…
gamepad-coder Feb 20, 2023
b2a4553
PYDOC-6a: Add sphinx_rtd_theme's html_theme_options for TOC sidebar.
gamepad-coder Feb 20, 2023
e414d61
PYDOC-6a: Add back in iconic css.
gamepad-coder Feb 20, 2023
7af5d91
PYDOC-6a: Update index to mention this is a fork.
gamepad-coder Feb 20, 2023
2bcbcb9
PYDOC-6a: Minor aesthetic update to fork label.
gamepad-coder Feb 20, 2023
40bfe8c
PYDOC-6a: Override rtd theme to point breadcrumb home button + search…
gamepad-coder Feb 20, 2023
0dafa5d
PYDOC-6a: Update index, outer nest the <a> element to fix css styling.
gamepad-coder Feb 20, 2023
eca4713
PYDOC-6a: Update fork's CSS to sideport the style for the footnote [1…
gamepad-coder Feb 20, 2023
dc0cdca
PYDOC-6a: Add favicon to prebuild _static folder
gamepad-coder Feb 20, 2023
8fbc50a
PYDOC-6a: Move hidden deprecated install/index.rst into TOC Tree unde…
gamepad-coder Feb 20, 2023
119d2d2
PYDOC-6a: Add html_favicon = `'_static/py.svg'` to conf.py
gamepad-coder Feb 20, 2023
f30c0ba
PYDOC-6a: Update contents.rst (used for global TOC) to contain all re…
gamepad-coder Feb 20, 2023
67f063a
PYDOC-6a: Copy donation footer into template dir so rtd theme can acc…
gamepad-coder Feb 20, 2023
465ab3c
PYDOC-6a: Update fork note on index.html.
gamepad-coder Feb 20, 2023
bc35e0c
PYDOC-6a: Add custom pydoc theme vars into rtd theme locally.
gamepad-coder Feb 20, 2023
f6b4c45
PYDOC-6a: Update css for index headers + footer styles
gamepad-coder Feb 20, 2023
580915b
PYDOC-6a: Replace normal sphinx_rtd_theme footer with the custom pyth…
gamepad-coder Feb 20, 2023
83baa02
PYDOC-6a: Minor comment about unintuitive theme_ setup and use in con…
gamepad-coder Feb 20, 2023
30f2f2a
PYDOC-6a: Update css, fix pre highlighting inside toc.
gamepad-coder Feb 20, 2023
6e6b5e6
PYDOC-6a: Remove conf.py added vars now that copying to rtd theme's c…
gamepad-coder Feb 20, 2023
aa18d65
PYDOC-6a: .gitignore update
gamepad-coder Feb 20, 2023
44f67ab
Merge pull request #1 from python-docs-101/PYDOC-6-rebuild-official-d…
python-sidebar Feb 20, 2023
267b660
Merge branch 'python:main' into main
python-sidebar Feb 22, 2023
d664a36
PYDOC-7: Change css pseudo-element ::before from house emoji to pytho…
gamepad-coder Feb 22, 2023
5a16b43
PYDOC-7: Add https:// so CSS knows it's a URL
gamepad-coder Feb 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
92 changes: 92 additions & 0 deletions Doc/_static/css_for_fork/py_rtd_fork.css
Original file line number Diff line number Diff line change
@@ -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;
}
14 changes: 14 additions & 0 deletions Doc/_static/py.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
140 changes: 135 additions & 5 deletions Doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
37 changes: 24 additions & 13 deletions Doc/contents.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,40 @@
Python Documentation contents
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

.. toctree::
.. |hr| raw:: html

<hr>

.. toctree::

whatsnew/index.rst
---------------------- <glossary.rst>
tutorial/index.rst
using/index.rst
reference/index.rst
library/index.rst
reference/index.rst
using/index.rst
howto/index.rst

---------------------- <glossary.rst>
installing/index.rst
distributing/index.rst
extending/index.rst
c-api/index.rst
distributing/index.rst
installing/index.rst
howto/index.rst
faq/index.rst

---------------------- <glossary.rst>

Python Module Index <https://python-docs-101.github.io/py-modindex.html>
General Index <https://python-docs-101.github.io/genindex.html>
Search page <https://python-docs-101.github.io/search.html>
Complete TOC <https://python-docs-101.github.io/contents.html>
glossary.rst


---------------------- <glossary.rst>
about.rst
Contributing to Docs <https://devguide.python.org/documentation/help-documenting/index.html#helping-with-documentation>
bugs.rst
copyright.rst
license.rst
copyright.rst

.. to include legacy packaging docs in build

.. toctree::
:hidden:

install/index.rst
6 changes: 6 additions & 0 deletions Doc/installing/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,9 @@ obtaining other binary extensions without needing to build them locally.

`Python Packaging User Guide: Binary Extensions
<https://packaging.python.org/extensions/>`__


.. toctree::
:hidden:

../install/index.rst
14 changes: 14 additions & 0 deletions Doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
##########################################################################
# Added by this RTD fork repo:
# https://github.com/python-docs-101/Python-Documentation-Theme-Fork
##########################################################################

sphinx_rtd_theme



##########################################################################
# Original requirements.txt below this comment
##########################################################################


# Requirements to build the Python documentation

# Sphinx version is pinned so that new versions that introduce new warnings
Expand Down
3 changes: 3 additions & 0 deletions Doc/tools/templates/footerdonate.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% trans %}The Python Software Foundation is a non-profit corporation.{% endtrans %}
<a href="https://www.python.org/psf/donations/">{% trans %}Please donate.{% endtrans %}</a>
<br />
18 changes: 17 additions & 1 deletion Doc/tools/templates/indexcontent.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,24 @@
{% block body %}
<h1>{{ docstitle|e }}</h1>
<p>
{% trans %}Welcome! This is the official documentation for Python {{ release }}.{% endtrans %}
{% trans %}Welcome! This is
<a href="https://github.com/python-docs-101/python-docs-101.github.io">
<strong style="font-size:larger;">
<code>A FORK OF</code>
</strong>
</a>
the official documentation for Python {{ release }}.{% endtrans %}
</p>
<div style="background-color:#edf0f2; padding-left:7px;"><br>
<span style="font-size:larger;">Fork note:</span><br><br>
<p style="padding-left: 3vw;">
◀ We added a TOC sidebar to this entire site!
<br>
Otherwise, the rest of this repo is identical to the main docs at <a href="https://docs.python.org/">https://docs.python.org</a>
</p>
<span style="font-size:larger;">Happy coding 👩‍💻</span><br><br>
</div>
<br>
<p><strong>{% trans %}Parts of the documentation:{% endtrans %}</strong></p>
<table class="contentstable" align="center"><tr>
<td width="50%">
Expand Down
Loading