-
Notifications
You must be signed in to change notification settings - Fork 676
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
FIX: Enable maths in singlehtml mode #1774
FIX: Enable maths in singlehtml mode #1774
Conversation
Setting the html_assets_policy flag to always installs mathjax in singlehtml builder. This also helps in maths rendering for pdfhtml builder.
Thanks for submitting your first pull request! You are awesome! 🤗 |
for more information, see https://pre-commit.ci
Codecov Report
@@ Coverage Diff @@
## master #1774 +/- ##
==========================================
+ Coverage 91.37% 91.39% +0.02%
==========================================
Files 7 7
Lines 684 686 +2
==========================================
+ Hits 625 627 +2
Misses 59 59
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Thanks, @SimplyOm for the PR. |
Tagging @choldgraf here just in case he might have missed the previous comment. Please let us know how you think about this change. |
Hi @AakashGfude - not sure if @choldgraf is looking into this issue. Do you see any other concern approving this? An alternate choice can be to add this as a parameter to the config, defaulted to false. Then, if someone is okay adding assets to singlehtml, they can turn it on. |
Hi @SimplyOm, I think @choldgraf is a bit occupied at the moment, he will get back soon. |
@AakashGfude and @SimplyOm I think having it enabled by default on a per page basis is a good idea. It will resolve the case where sphinx doesn't add math due to the lack of a math directive. I am in favour of this. My only thought is sometimes the time it takes mathjax to render, the HTML scrapper takes a snapshot of the page prior to math being fully rendered. I think a small wait time has already been added previously? |
Good point @mmcky, not entirely sure about the wait time being added thing. Thank you for approving this, will merge this for now. And we can further enhance this in subsequent PRs? |
It looks good to me - please don't feel like I need to approve before merging PRs. If you think it's a good change just go for it 🙂 |
Thank you all for the help! Much appreciated. |
Setting the html_assets_policy flag to always includes mathjax in singlehtml builder. This also helps in maths rendering for pdfhtml builder. This flag is defaulted to per_page inside sphinx codebase, which leads to excluding mathjax for singlehtml builder.
Resolves #1705