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

math formulas in published 10.2 documentation are broken #36824

Closed
2 tasks done
haraldschilly opened this issue Dec 6, 2023 · 10 comments
Closed
2 tasks done

math formulas in published 10.2 documentation are broken #36824

haraldschilly opened this issue Dec 6, 2023 · 10 comments

Comments

@haraldschilly
Copy link
Member

haraldschilly commented Dec 6, 2023

Steps To Reproduce

build the html files via the doc-html build target

Expected Behavior

the URLs of all assets in all *html pages must be relative, not absolute.

Actual Behavior

The doc-html build target produces the *.html artifacts. They contain an absolute paths:

~/sage-git/local/share/doc/sage/html$ grep -R /user/sage-git/local/share/mathjax/mathjax/tex-chtml.js | head
ru/tutorial/interfaces.html:    <script defer="defer" src="/home/user/sage-git/local/share/mathjax/mathjax/tex-chtml.js"></script>
ru/tutorial/interactive_shell.html:    <script defer="defer" src="/home/user/sage-git/local/share/mathjax/mathjax/tex-chtml.js"></script>
ru/tutorial/tour_help.html:    <script defer="defer" src="/home/user/sage-git/local/share/mathjax/mathjax/tex-chtml.js"></script>
ru/tutorial/tour_linalg.html:    <script defer="defer" src="/home/user/sage-git/local/share/mathjax/mathjax/tex-chtml.js"></script>
ru/tutorial/tour_polynomial.html:    <script defer="defer" src="/home/user/sage-git/local/share/mathjax/mathjax/tex-chtml.js"></script>
ru/tutorial/tour_advanced.html:    <script defer="defer" src="/home/user/sage-git/local/share/mathjax/mathjax/tex-chtml.js"></script>
ru/tutorial/tour_functions.html:    <script defer="defer" src="/home/user/sage-git/local/share/mathjax/mathjax/tex-chtml.js"></script>
[...]

Additional Information

The browser can't load the asset. This is the error.

GET https://doc.sagemath.org/home/user/sage-git/local/share/mathjax/mathjax/tex-chtml.js net::ERR_ABORTED 404 (Not Found)

The "/home/user/sage-git/local/" shouldn't be there.

In the vicinity of this in the generated html pages at the bottom, there are other assets loaded like that:

    <script src="_static/scripts/furo.js"></script>
    <script src="_static/clipboard.min.js"></script>
    <script src="_static/copybutton.js"></script>

P.S.: I had to click on the "I have read the documentation and troubleshoot guide" checkbox to submit this issue, although I did NOT read it. Please let me know if there is a fix for this anywhere in it.

Environment

- **OS**: Linux
- **Sage Version**: 10.2

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide
@haraldschilly
Copy link
Member Author

git-grepping around the problem is caused by ab1649c … feels like the case of publishing the documentation wasn't considered at all.

@dimpase
Copy link
Member

dimpase commented Dec 6, 2023

This is strange, as we now have a CI which builds and publishes (temp) docs, see e.g.
https://deploy-preview-36771--sagemath-tobias.netlify.app/html/en/ from
#36771

@orlitzky @tobiasdiez

@dimpase
Copy link
Member

dimpase commented Dec 6, 2023

@haraldschilly - would installing mathjax locally on the server solve this?

@haraldschilly
Copy link
Member Author

On that page, the same asset is loaded from an external site:

<script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>

So, the question is, how can the location be changed? In general, if there is a breaking change for publishing the documentation, it would be really nice if I get to know it.

@dimpase
Copy link
Member

dimpase commented Dec 6, 2023

the line you cite comes from src/sage_docbuild/conf.py and is conditional:

if os.environ.get('SAGE_USE_CDNS', 'no') == 'yes':
    mathjax_path = "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"
else:
    mathjax_path = os.path.join(MATHJAX_DIR, 'tex-chtml.js')

did you have 'SAGE_USE_CDNS=yes while building the docs? (it might be the latter got broken, testing this now)

@dimpase
Copy link
Member

dimpase commented Dec 6, 2023

On that page, the same asset is loaded from an external site:

what's that here?

@haraldschilly
Copy link
Member Author

@dimpase No, I just run make doc-html && make doc-pdf and that's it. Thanks for pointing this out.

@haraldschilly
Copy link
Member Author

On that page, the same asset is loaded from an external site:

what's that here?

https://deploy-preview-36771--sagemath-tobias.netlify.app/html/en/

@dimpase
Copy link
Member

dimpase commented Dec 6, 2023

@dimpase No, I just run make doc-html && make doc-pdf and that's it. Thanks for pointing this out.

I understood your that wrongly, sorry. Anyway, OK, so I suppose that if you clean the docs and rerun this with SAGE_USE_CDNS=yes you'll get it fixed.

@tobiasdiez
Copy link
Contributor

tobiasdiez commented Dec 6, 2023

@haraldschilly You can find the workflow that currently publishes the dev-preview of the docs at https://github.com/sagemath/sage/blob/develop/.github/workflows/doc-build.yml.

Thanks for your continued work on the docs. As it is hard to test your post-processing, would it be possible if you could add them here in the main repo? Maybe we can even set-up an automatic publishing to production on releases, fully automating the process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants