-
-
Notifications
You must be signed in to change notification settings - Fork 491
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
Enforce MathJax for every page of Sage documentation #33347
Comments
This comment has been minimized.
This comment has been minimized.
comment:2
I don't know much about html. What is the disadvantage to duplicate MathJax inclusion in html files? |
comment:3
We could also adopt a style that strongly discourages math from titles, and we could replace (for example) |
comment:4
Replying to @jhpalmieri:
Perhaps the same disadvantage of running a program twice, aside aesthetic reason. |
comment:5
Replying to @jhpalmieri:
Doc files are in reStructuredText format. HTML tags do not work in rst files, as I understand. If Sphinx people do not help, then we may go for the option (2) somehow. |
comment:6
Replying to @kwankyu:
The web page https://developer.yahoo.com/performance/rules.html claims that duplicate inclusion of javascript files hurts performance. |
comment:7
Replying to @kwankyu:
No kidding.
rst can also do bold, italics, superscripts, and subscripts. |
This comment has been minimized.
This comment has been minimized.
comment:8
Replying to @jhpalmieri:
Okay, then. |
comment:9
How would you like to proceed? Should we start converting math in module titles to bold, italics, etc.? |
comment:10
Replying to @jhpalmieri:
I would like to go for the option 1 or 2. If Sphinx people do not provide an official way to enforce MathJax inclusion, then we may investigate unofficial ways (such as tweaking Shinx's I really don't like the option 4, which would make our documentation include maths in an alternative format. Anyway I am busy now for my main work. Let me get back to this ticket later. |
comment:11
For the option 2, this dummy works pretty well: --- a/src/doc/en/reference/finite_rings/index.rst
+++ b/src/doc/en/reference/finite_rings/index.rst
@@ -1,5 +1,8 @@
Finite Rings
-====================================
+============
+
+.. math::
+ :nowrap:
Finite Rings
------------ Getting maths back by adding this bit of ugly thing seems worth it. |
comment:12
This single change works, since diff --git a/src/doc/en/reference/footer.txt b/src/doc/en/reference/footer.txt
index fa7bc30eea..e9b5166be4 100644
--- a/src/doc/en/reference/footer.txt
+++ b/src/doc/en/reference/footer.txt
@@ -1,6 +1,9 @@
Indices and Tables
==================
+.. math::
+ :nowrap:
+
* `Index <../genindex.html>`_
* `Module Index <../py-modindex.html>`_
* `Search Page <../search.html>`_ |
comment:13
I can push a branch with that change (+ some minor fixes for the TOC entries for the p-adics page) if you want. |
comment:14
Replying to @jhpalmieri:
Please go ahead. Thank you. |
comment:15
Moreover we may need to add somewhere in the developer manual a remark about the purpose of the added lines to prevent anyone from deleting the seemingly useless lines. |
comment:16
Replying to @jhpalmieri:
Good idea! |
Commit: |
comment:18
Okay, here is a branch. Before this, about half of the p-adic TOC entries used New commits:
|
Author: John Palmieri |
comment:20
As in https://en.wikipedia.org/wiki/P-adic_analysis p-adic seems in a better style than p-Adic in titles. If you agree, I can upload a commit to apply this style to p-adics. |
comment:21
Replying to @kwankyu:
+1. Good main title "p-adic analysis" there, though the main title "p-adic_quantum_mechanics" |
New commits:
|
Changed branch from u/jhpalmieri/sphinx-force-mathjax to public/33347 |
Reviewer: Kwankyu Lee |
comment:23
I am positive on the branch. But let me do the final check on the built documentation. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:25
One easy-to-fix doctest failure, otherwise looks good to me. For a future ticket: if we can think of a way to solve it, changing the html title of the web page to not use math would be nice. As it is, the title bar in my browser says |
comment:26
Replying to @jhpalmieri:
Simply removing |
comment:27
Morally greenbot. |
Changed branch from public/33347 to |
HTML pages of our documentation that contain maths only in TOC trees do not render maths by MathJax because Sphinx does not include MathJax javascript files as the Sphinx MathJax extension does not recognize maths in TOC trees and to save loading time. See for instance,
https://doc.sagemath.org/html/en/reference/schemes/index.html
There could be several solutions:
Fix in the upstream Sphinx MathJax extension. A relevant discussion is
There is no way to enforce MathJax when maths only appear in TOC trees. sphinx-doc/sphinx#10192
Add dummy :math:... to every inflicted pages to enable MathJax.
Enable MathJax by brute force by adding line
for
conf
files. But this results in duplicate MathJax inclusionin the generated html file.
A good solution would be implemented in this ticket.
Component: documentation
Author: John Palmieri
Branch/Commit:
231b0e0
Reviewer: Kwankyu Lee
Issue created by migration from https://trac.sagemath.org/ticket/33347
The text was updated successfully, but these errors were encountered: