GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Update ``python-docs-theme`` to work with Sphinx 5 & 6 by AA-Turner · Pull Request #99 · python/python-docs-theme

Conversation

@AA-Turner

@AA-Turner AA-Turner commented Nov 11, 2022

Copy link
Copy Markdown
Member

Updated remaining jQuery scripts to standard JavaScript, and a few fixes for CSS changes.

A

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@AA-Turner
AA-Turner requested a review from JulienPalard November 11, 2022 16:04
@AA-Turner

AA-Turner commented Nov 11, 2022

Copy link
Copy Markdown
Member Author

Turns out this is required for Sphinx 5... python/cpython#99381

A

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AA-Turner AA-Turner changed the title Update for Sphinx 6 Update for Sphinx 5 and 6 Nov 11, 2022
pradyunsg
pradyunsg approved these changes Nov 11, 2022
View reviewed changes

@pradyunsg pradyunsg left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
ezio-melotti
ezio-melotti reviewed Nov 12, 2022
View reviewed changes

@ezio-melotti ezio-melotti left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to the inline comments, I have two generic comments:

  • The use of semicolons at the end of the line seems inconsistent. Unless there is a specific reason to keep them, I would just remove them all.
  • I would avoid the use of if (...) return; or if (...) break; or even if (...) some_functions(). The expression after the condition should go on a new line, and it should be surrounded by { }, e.g.:
    if (...) {
       ...
    }

Fun fact: I originally implemented both the collapsible sidebar (~12 years ago in python/cpython#47393) and the copybutton (~11 years ago in python/cpython@59dba38) and since then they have traveled around a number of dirs and repos. It's nice to see that in the meanwhile things got standardized and JS evolved to the point that JQuery is no longer needed.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

hugovk and m-aciek reacted with hooray emoji
All reactions
  • 🎉 2 reactions
Comment thread .github/workflows/tests.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread python_docs_theme/static/copybutton.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread python_docs_theme/static/copybutton.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread python_docs_theme/static/copybutton.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@AA-Turner
AA-Turner force-pushed the sphinx-6 branch from 1c8b559 to c51a6e0 Compare November 12, 2022 14:40
@hugovk

hugovk commented Feb 6, 2023

Copy link
Copy Markdown
Member

Is this ready to merge?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hugovk
hugovk force-pushed the sphinx-6 branch from 9ca3650 to 4df1954 Compare February 13, 2023 11:37
@hugovk

hugovk commented Feb 13, 2023

Copy link
Copy Markdown
Member

Rebased on main to build RTD preview:

  • https://python-docs-theme-previews--99.org.readthedocs.build/en/99/

And there's an error in the console:

sidebar.js:34 Uncaught TypeError: Cannot read properties of null (reading 'querySelector')
    at HTMLDocument.initialiseSidebar (sidebar.js:34:38)

From the last line of:

  const bodyWrapper = document.getElementsByClassName("bodywrapper")[0]
  const sidebar = document.getElementsByClassName("sphinxsidebar")[0]
  const sidebarWrapper = document.getElementsByClassName('sphinxsidebarwrapper')[0]
  const sidebarButton = document.getElementById("sidebarbutton")
  const sidebarArrow = sidebarButton.querySelector('span')
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@m-aciek m-aciek mentioned this pull request Mar 13, 2023
Faster load ? #58
Closed
AA-Turner added 3 commits April 11, 2023 14:46
@AA-Turner
Use double quotation marks in __init__.py
706f0d4
@AA-Turner
Drop semicolons in menu.js
458d6cd
@AA-Turner
Use braces for if-statements in menu.js
0986415
@AA-Turner
AA-Turner force-pushed the sphinx-6 branch from 4df1954 to 5cf2065 Compare April 11, 2023 14:15
AA-Turner and others added 5 commits April 11, 2023 15:25
@AA-Turner
Use double quotation marks in menu.js
b0b8e70
@AA-Turner
Mark a parameter as unused in menu.js
b0c184d
@AA-Turner
Drop jQuery in sidebars.js
40a3de3
@AA-Turner
Drop jQuery in copybutton.js
320a929
@AA-Turner
Introduce getHideableCopyButtonElements()
aa604d0
@AA-Turner
AA-Turner force-pushed the sphinx-6 branch from 5cf2065 to aa604d0 Compare April 11, 2023 15:47
@AA-Turner
AA-Turner requested a review from hugovk April 11, 2023 15:51
@AA-Turner

AA-Turner commented Apr 11, 2023

Copy link
Copy Markdown
Member Author

Updated the JavaScript, the previous version was attempting to access an element that had yet to be created. Thank you for the review!

A

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AA-Turner
Mild JavaScript refactor
df3872d
hugovk
hugovk approved these changes Apr 11, 2023
View reviewed changes

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working fine now, thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@AA-Turner
AA-Turner requested review from JulienPalard and ezio-melotti and removed request for JulienPalard April 11, 2023 20:27
@AA-Turner AA-Turner changed the title Update for Sphinx 5 and 6 Update python-docs-theme to work with Sphinx 5 & 6 Apr 12, 2023
@JulienPalard
JulienPalard merged commit 32115c4 into python:main Apr 13, 2023
@JulienPalard

JulienPalard commented Apr 13, 2023

Copy link
Copy Markdown
Member

I just built https://docs.python.org/3.12/ after merging this PR.

AA-Turner and hugovk reacted with hooray emoji
All reactions
  • 🎉 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AA-Turner

AA-Turner commented Apr 13, 2023

Copy link
Copy Markdown
Member Author

I just built docs.python.org/3.12 after merging this PR.

Working for me in Firefox 112 on Windows! If you have time over the next few weeks, please would we be able to make a 2023.4 release, to unblock python/cpython#99381?

A

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@JulienPalard

JulienPalard commented Apr 17, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Releasing: #126

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AA-Turner AA-Turner mentioned this pull request Apr 20, 2023
Releasing v2023.5 #126
Merged
@jurasofish jurasofish mentioned this pull request May 12, 2023
bug: Doesn't work for Sphinx==6.2.1 jurasofish/sphinx-toggleprompt#23
Closed
@AA-Turner
AA-Turner deleted the sphinx-6 branch July 15, 2024 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@hugovk hugovk hugovk approved these changes
@pradyunsg pradyunsg pradyunsg approved these changes
@ezio-melotti ezio-melotti Awaiting requested review from ezio-melotti
@JulienPalard JulienPalard Awaiting requested review from JulienPalard

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@AA-Turner @hugovk @JulienPalard @pradyunsg @ezio-melotti
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.