Skip to content
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

MAINT: upgrade latest build software versions #326

Merged
merged 19 commits into from
Nov 30, 2024
Merged

MAINT: upgrade latest build software versions #326

merged 19 commits into from
Nov 30, 2024

Conversation

mmcky
Copy link
Contributor

@mmcky mmcky commented Oct 18, 2024

This upgrades the software to the latest versions of jupyter-book including updates to quantecon-book-theme and sphinx-exercise for compatibility.

  • release quantecon-book-theme==0.7.5 once bugs fixed
  • release sphinx-exercise==1.0.1 once bugs fixed
  • review preview to check outputs using latest jupyter-book==1.0.3

Copy link

github-actions bot commented Oct 25, 2024

@github-actions github-actions bot temporarily deployed to pull request October 25, 2024 06:55 Inactive
@mmcky
Copy link
Contributor Author

mmcky commented Oct 25, 2024

Current issues with theme

Title Page

  • missing theme formatting line under Title
  • missing the quantecon logo
  • missing Authors information

Current Preview

Screenshot 2024-10-25 at 6 00 59 pm

Current Live Site

Screenshot 2024-10-25 at 6 01 09 pm

@mmcky
Copy link
Contributor Author

mmcky commented Oct 28, 2024

@DrDrij it looks like the variable names may have changed as we upgraded to jupyter-book<1.0 -- as the theme_authors variable in our quantecon_book_theme layout.html file is no longer filling in this section https://github.com/QuantEcon/quantecon-book-theme/blob/90fba30c2c4d7743333c9567bb8ac82b29871c36/src/quantecon_book_theme/theme/quantecon_book_theme/layout.html#L152

any ideas?

@DrDrij
Copy link
Member

DrDrij commented Oct 28, 2024

That's no good. Perhaps we hard code them temporarily?
I will examine further tomorrow afternoon @mmcky

@mmcky
Copy link
Contributor Author

mmcky commented Oct 29, 2024

thanks @DrDrij just not sure how the templates actually get rendered.

@mmcky
Copy link
Contributor Author

mmcky commented Oct 29, 2024

@DrDrij the interesting part is that the html is still there

                        <p class="qe-page__header-authors" font-size="18">
                            
                                
                                    <a href="http://www.tomsargent.com/" target="_blank"><span>Thomas J. Sargent</span></a>
                                
                            
                                
                                    and <a href="https://johnstachurski.net/" target="_blank"><span>John Stachurski</span></a>
                                
                            
                        </p>

but it just isn't showing up on the rendered page

@mmcky
Copy link
Contributor Author

mmcky commented Oct 29, 2024

however in the case of the logo the html is missing

The live site has

                            <p class="logo">
                                
                                    
                                    <a href=https://quantecon.org><img src="_static/qe-logo.png" class="logo logo-img" alt="logo"></a>
                                    
                                    <a href=https://quantecon.org><img src="_static/quantecon-logo-transparent.png" class="dark-logo-img" alt="logo"></a>
                                    
                                    
                                
                            </p>

                            <p class="powered">Powered by <a href="https://jupyterbook.org/">Jupyter Book</a></p>

while this preview build has

                            
                            <p class="logo">
                                
                            </p>

                            <p class="powered">Powered by <a href="https://jupyterbook.org/">Jupyter Book</a></p>

@DrDrij
Copy link
Member

DrDrij commented Oct 30, 2024

Looks like authors is printed out in 2 places, the first instance shows on all other pages except 'main-index':
(https://github.com/QuantEcon/quantecon-book-theme/blob/90fba30c2c4d7743333c9567bb8ac82b29871c36/src/quantecon_book_theme/theme/quantecon_book_theme/layout.html#L152)

image

And the second is appearing in the content area, after the Heading 1 element, so in the content block: (https://github.com/QuantEcon/quantecon-book-theme/blob/90fba30c2c4d7743333c9567bb8ac82b29871c36/src/quantecon_book_theme/theme/quantecon_book_theme/layout.html#L175C30-L175C39)

image

So it means we've lost the author header printing out in the {% block body %} {% endblock %} include.

On further inspection, I see that the theme uses Javascript to move the authors on the homepage to sit in the right place under the Heading 1 (https://github.com/QuantEcon/quantecon-book-theme/blob/90fba30c2c4d7743333c9567bb8ac82b29871c36/src/quantecon_book_theme/assets/scripts/index.js#L380).

How many years ago did I write this? 🙈

So JS is broken somewhere — try to open the left menu or use any of the theme toolbar buttons around the page.

The console gives a little details which indicates we have lost jQuery.

image

It appears that https://671b40f5a93d541ba1e37280--epic-agnesi-957267.netlify.app/_static/scripts/sphinx-book-theme.js isn't loading (404). Has that changed with the new version @mmcky ?

Hope this gives some clue. I can investigate further, interested in your thoughts?

@agoose77
Copy link

@DrDrij @mmcky I'm having conversations in two places! I'll move the chat here.

@DrDrij yes, Sphinx 6 dropped JQuery. The easiest fix is to bundle it with webpack by adding it to your dependencies, importing it in your JS file, and setting noconflict mode.

As for the SBT -- I wonder whether you really should only inherit from pydata-sphinx-theme, as that is where most/all of the accessibility etc features are.

@mmcky
Copy link
Contributor Author

mmcky commented Nov 18, 2024

thanks @DrDrij and @agoose77.

@DrDrij we will need to add in jQuery to get this to work for now.

@agoose77 I agree that we should be inheriting from pydata-sphinx-theme. With our planned upcoming migration to mystmd I am just focused on the essentials to get this working with the latest jupyter-book so we can freeze this theme at that point in time.

@github-actions github-actions bot temporarily deployed to pull request November 19, 2024 00:12 Inactive
@github-actions github-actions bot temporarily deployed to pull request November 19, 2024 00:24 Inactive
@mmcky
Copy link
Contributor Author

mmcky commented Nov 19, 2024

@DrDrij @agoose77 thanks again for your help here.

I have pinned quantecon-book-theme to use sphinx>=5,<6 for now and is building this PR with the elements we expect to be in place.

I have opened QuantEcon/quantecon-book-theme#274 to see if we can fix the jQuery issue and remove this pin. But happy with this solution for now given the upcoming switch to mystmd

@github-actions github-actions bot temporarily deployed to pull request November 19, 2024 00:34 Inactive
@github-actions github-actions bot temporarily deployed to pull request November 19, 2024 01:15 Inactive
@github-actions github-actions bot temporarily deployed to pull request November 19, 2024 04:11 Inactive
@github-actions github-actions bot temporarily deployed to pull request November 19, 2024 05:12 Inactive
@mmcky mmcky added the ready label Nov 19, 2024
@github-actions github-actions bot temporarily deployed to pull request November 30, 2024 00:31 Inactive
@github-actions github-actions bot temporarily deployed to pull request November 30, 2024 01:16 Inactive
@mmcky
Copy link
Contributor Author

mmcky commented Nov 30, 2024

@HumphreyYang this PR makes major upgrades to our jupyter-book infrastructure to use jb==1.0.3 and all associated packages I have updated last week including sphinx-exercise, sphinx-proof for compatibility.

I have done a pretty good review and check but if you have time to cast your eye over this preview to see if you spot any regressions that would be super helpful.

https://674a6757a64b3c66ca69bb11--epic-agnesi-957267.netlify.app/

@HumphreyYang
Copy link
Collaborator

Many thanks @mmcky. I did not spot any issue!

I think we did not use proof env in this repo so perhaps I can have another look in the undergraduate series once this change is implemented over there?

@mmcky
Copy link
Contributor Author

mmcky commented Nov 30, 2024

thanks @HumphreyYang

@mmcky mmcky merged commit b7a0c22 into main Nov 30, 2024
5 checks passed
@mmcky mmcky deleted the maint-18octb branch November 30, 2024 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants