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

Enable MathJax in the TOC of Sage reference manual and documentation website #29993

Closed
kwankyu opened this issue Jun 26, 2020 · 51 comments
Closed

Comments

@kwankyu
Copy link
Collaborator

kwankyu commented Jun 26, 2020

We do that. The trick is to add :math: role somewhere. Try to find it :-)

We also reorganize the TOC a bit while we are at it. In particular,

  • the plane and space curves section is split away from elliptic and hyperelliptic curves section.

CC: @slel @jhpalmieri

Component: documentation

Author: Kwankyu Lee

Branch/Commit: 6c881bc

Reviewer: John Palmieri

Issue created by migration from https://trac.sagemath.org/ticket/29993

@kwankyu kwankyu added this to the sage-9.2 milestone Jun 26, 2020
@kwankyu
Copy link
Collaborator Author

kwankyu commented Jun 26, 2020

Branch: u/klee/29993

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 26, 2020

Commit: 18acfd2

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 26, 2020

Branch pushed to git repo; I updated commit sha1. New commits:

18acfd2Enable MathJax in TOC page

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 26, 2020

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

939308cEnable MathJax in TOC page

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 26, 2020

Changed commit from 18acfd2 to 939308c

@kwankyu

This comment has been minimized.

@kwankyu
Copy link
Collaborator Author

kwankyu commented Jun 26, 2020

Author: Kwankyu Lee

@kwankyu

This comment has been minimized.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 30, 2020

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

49e32daEnable MathJax in TOC page

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 30, 2020

Changed commit from 939308c to 49e32da

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 9, 2020

Changed commit from 49e32da to 3e266ab

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 9, 2020

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

3e266abEnable MathJax in TOC page

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 29, 2020

Changed commit from 3e266ab to 6e64dd8

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 29, 2020

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

6e64dd8Enable MathJax in TOC page

@jhpalmieri
Copy link
Member

comment:11

Fails to merge.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 11, 2020

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

032df6cEnable MathJax in TOC page

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 11, 2020

Changed commit from 6e64dd8 to 032df6c

@kwankyu

This comment has been minimized.

@davidlowryduda
Copy link
Contributor

comment:16

Is there a reason why we want to enable mathjax on the TOC? Maybe the idea is that perhaps we have been omitting putting tex in the TOC before for some reason, and now we can? Or is there perhaps a particular reason?

@jhpalmieri
Copy link
Member

comment:17

It looks okay to me. I don't understand the changes in the themes; can you explain those?

@kwankyu
Copy link
Collaborator Author

kwankyu commented Aug 16, 2020

comment:18

Replying to @davidlowryduda:

Is there a reason why we want to enable mathjax on the TOC? Maybe the idea is that perhaps we have been omitting putting tex in the TOC before for some reason, and now we can? Or is there perhaps a particular reason?

There have been maths in the TOC, like p-adic and SL_2(Z). I guess they were not in tex just because mathjax didn't work. This ticket solves the problem.

@kwankyu
Copy link
Collaborator Author

kwankyu commented Aug 20, 2020

comment:25

Replying to @kwankyu:

The pdf doc of the TOC does not still render the maths correctly with this ticket. That might be one of the reasons.

This is fixed now, by somewhat ad-hoc manner.

Along the way, I also resurrected the Sage reference manual website for pdfs, which has been broken (I might be guilty for this).

@jhpalmieri
Copy link
Member

comment:26

Would you mind changing :math:`e^\pi+1=0` to :math:`e^{i\pi}+1=0`? And I think I would call the line \(s=\frac{1}{2}+it\) just a "line", not an "imaginary line".

@kwankyu
Copy link
Collaborator Author

kwankyu commented Aug 21, 2020

comment:27

Replying to @jhpalmieri:

Would you mind changing :math:`e^\pi+1=0` to :math:`e^{i\pi}+1=0`?

Of course, not. Thank you.

And I think I would call the line \(s=\frac{1}{2}+it\) just a "line", not an "imaginary line".

Okay.

@kwankyu
Copy link
Collaborator Author

kwankyu commented Aug 21, 2020

comment:28

To check the documentation website for pdf docs, run:

sage --docbuild reference pdf
sage --docbuild website html

and open local/share/doc/sage/html/en/index.html.

Running

sage --docbuild website pdf

generates a not-so-useful file local/share/doc/sage/pdf/en/website/sage_documentation.pdf.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 21, 2020

Changed commit from 5976182 to 1f116f9

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 21, 2020

Branch pushed to git repo; I updated commit sha1. New commits:

1f116f9Fixes for reviewer comments

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 21, 2020

Branch pushed to git repo; I updated commit sha1. New commits:

6c881bcFixes missed in the previous commit

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 21, 2020

Changed commit from 1f116f9 to 6c881bc

@kwankyu kwankyu changed the title Enable MathJax in the TOC of Sage reference manual and Sage documentation site Enable MathJax in the TOC of Sage reference manual and documentation website Aug 21, 2020
@jhpalmieri
Copy link
Member

comment:32

The html version looks good, but I'm having problems with the PDF. You should be able to run sage --docbuild all pdf to have it build the html website file and everything else in PDF format.

  • Broken before this ticket: in local/share/doc/sage/html/en/index.html, there are supposed to be PDF icons next to each document, as links leading to the PDF builds. Those are missing, because the file _static/pdf.png is missing. For some reason, it is not copied from src/doc/en/website/static to local/share/doc/sage/html/en/_static.

  • If I copy that file by hand, then the links are available, but the one for the reference manual (local/share/doc/sage/pdf/en/reference/index.html) is badly formatted. It is an html file with links to the different components in PDF format, but the table of contents basically appear twice, once badly and then once better, but not perfect.

  • mathjax is not enabled in that main reference manual html file.

@kwankyu
Copy link
Collaborator Author

kwankyu commented Aug 21, 2020

comment:33

Replying to @jhpalmieri:

The html version looks good, but I'm having problems with the PDF. You should be able to run sage --docbuild all pdf to have it build the html website file and everything else in PDF format.

  • Broken before this ticket: in local/share/doc/sage/html/en/index.html, there are supposed to be PDF icons next to each document, as links leading to the PDF builds. Those are missing, because the file _static/pdf.png is missing. For some reason, it is not copied from src/doc/en/website/static to local/share/doc/sage/html/en/_static.

Did you run sage --docbuild website html? This copies the PDF icon.

  • If I copy that file by hand, then the links are available, but the one for the reference manual (local/share/doc/sage/pdf/en/reference/index.html) is badly formatted. It is an html file with links to the different components in PDF format, but the table of contents basically appear twice, once badly and then once better, but not perfect.

I think you are seeing the old version.

@jhpalmieri
Copy link
Member

comment:34

Replying to @kwankyu:

Replying to @jhpalmieri:

The html version looks good, but I'm having problems with the PDF. You should be able to run sage --docbuild all pdf to have it build the html website file and everything else in PDF format.

  • Broken before this ticket: in local/share/doc/sage/html/en/index.html, there are supposed to be PDF icons next to each document, as links leading to the PDF builds. Those are missing, because the file _static/pdf.png is missing. For some reason, it is not copied from src/doc/en/website/static to local/share/doc/sage/html/en/_static.

Did you run sage --docbuild website html? This copies the PDF icon.

This works, but it should not be necessary: I ran both sage --docbuild all html and sage --docbuild all pdf, and at least one of those should build the website page. See line 582 in src/sage_setup/docbuild/__init__.py:

            if format == 'pdf':
                # First build the website page. This only takes a few seconds.
                getattr(get_builder('website'), 'html')()
  • If I copy that file by hand, then the links are available, but the one for the reference manual (local/share/doc/sage/pdf/en/reference/index.html) is badly formatted. It is an html file with links to the different components in PDF format, but the table of contents basically appear twice, once badly and then once better, but not perfect.

I think you are seeing the old version.

The version I see has (for example) the new sentences "Welcome to the Sage reference manual. Here you find documentation for all of Sage <http://www.sagemath.org/>_'s features, illustrated with lots of examples. A thematic index follows." So it's the new one. (I also ran make doc-clean before building the documentation.) I'm attaching local/share/doc/sage/pdf/en/reference/index.html.

@kwankyu
Copy link
Collaborator Author

kwankyu commented Aug 21, 2020

comment:35

Attachment: index.html.gz

Replying to @jhpalmieri:

Replying to @kwankyu:

Replying to @jhpalmieri:

The html version looks good, but I'm having problems with the PDF. You should be able to run sage --docbuild all pdf to have it build the html website file and everything else in PDF format.

  • Broken before this ticket: in local/share/doc/sage/html/en/index.html, there are supposed to be PDF icons next to each document, as links leading to the PDF builds. Those are missing, because the file _static/pdf.png is missing. For some reason, it is not copied from src/doc/en/website/static to local/share/doc/sage/html/en/_static.

Did you run sage --docbuild website html? This copies the PDF icon.

This works, but it should not be necessary: I ran both sage --docbuild all html and sage --docbuild all pdf, and at least one of those should build the website page. See line 582 in src/sage_setup/docbuild/__init__.py:

            if format == 'pdf':
                # First build the website page. This only takes a few seconds.
                getattr(get_builder('website'), 'html')()

Strangely sage --docbuild all html does not copy the PDF icon, but ``sage --docbuild website html` does. I don't know why. I didn't touch this part.

I think you are seeing the old version.

The version I see has (for example) the new sentences "Welcome to the Sage reference manual. Here you find documentation for all of Sage <http://www.sagemath.org/>_'s features, illustrated with lots of examples. A thematic index follows." So it's the new one. (I also ran make doc-clean before building the documentation.) I'm attaching local/share/doc/sage/pdf/en/reference/index.html.

Right. It is strange. The file local/share/doc/sage/pdf/en/reference/index.html is generated using the file local/share/doc/sage/html/en/website/index.html as a template. Would you upload this file as well so that I can compare it with mine?

@kwankyu
Copy link
Collaborator Author

kwankyu commented Aug 21, 2020

comment:36

Replying to @kwankyu:

Strangely sage --docbuild all html does not copy the PDF icon, but ``sage --docbuild website html` does.

I withdraw this assertion. It is quite confusing...

@kwankyu
Copy link
Collaborator Author

kwankyu commented Aug 21, 2020

Attachment: index.2.html.gz

local/share/doc/sage/pdf/en/reference/index.html

@kwankyu
Copy link
Collaborator Author

kwankyu commented Aug 21, 2020

comment:37

I added the file local/share/doc/sage/pdf/en/reference/index.html, the right one.

@kwankyu
Copy link
Collaborator Author

kwankyu commented Aug 21, 2020

comment:38

I don't know why, but would you try specifically?

sage --docbuild reference pdf

@kwankyu
Copy link
Collaborator Author

kwankyu commented Aug 21, 2020

comment:39

Replying to @jhpalmieri:

I ran both sage --docbuild all html and sage --docbuild all pdf, and at least one of those should build the website page.

I now see what have happened to you. You did not run make build, but only ran make doc-clean, sage --docbuild all html and sage --docbuild all pdf. Right? Thus you built the new document by old docbuild code.

Please try again. This time you run make; sage --docbuild all pdf.

Still the PDF icon would not appear. This problem existed before this ticket, I think. Anyway, this copies the PDF icon to the right place:

$ sage --docbuild website html
[website  ] building [html]: targets for 1 source files that are out of date
[website  ] Merging environment/index files...
[website  ] ... done (0 todos, 1 index, 0 citations, 0 modules)
[website  ] Merging js index files...
[website  ] ... done (15 js index entries)
[website  ] copying static files... ... done
[website  ] dumping search index in English (code: en)... done
[website  ] The HTML pages are in local/share/doc/sage/html/en/website.
Build finished. The built documents can be found in .../local/share/doc/sage/html/en/website

Notice that "copying static files...". Then reload local/share/doc/sage/html/en/index.html.

@kwankyu
Copy link
Collaborator Author

kwankyu commented Aug 21, 2020

comment:40

To see clearly the problem of the PDF icon:

Running make doc-clean; sage --docbuild all html does not install the PDF icon to the right place, that is under local/share/doc/sage/html/en/website/_static.

Running make doc-clean; sage --docbuild website html does install the PDF icon to the right place, that is under local/share/doc/sage/html/en/website/_static.

@jhpalmieri
Copy link
Member

comment:41

Replying to @kwankyu:

Replying to @jhpalmieri:

I ran both sage --docbuild all html and sage --docbuild all pdf, and at least one of those should build the website page.

I now see what have happened to you. You did not run make build, but only ran make doc-clean, sage --docbuild all html and sage --docbuild all pdf. Right? Thus you built the new document by old docbuild code.

Please try again. This time you run make; sage --docbuild all pdf.

You're right, this fixed it.

Still the PDF icon would not appear. This problem existed before this ticket, I think.

Right, that's what I said in comment:32. It would be nice to fix that, too.

@kwankyu
Copy link
Collaborator Author

kwankyu commented Aug 21, 2020

comment:42

Replying to @jhpalmieri:

Still the PDF icon would not appear. This problem existed before this ticket, I think.

Right, that's what I said in comment:32. It would be nice to fix that, too.

I would love to see it fixed. But I have no idea of how to fix it. Do you have?

I suggest to fix it separately, and not to delay this ticket.

@kwankyu
Copy link
Collaborator Author

kwankyu commented Aug 22, 2020

comment:43

I created a ticket for the PDF icon problem: #30418.

@jhpalmieri
Copy link
Member

Reviewer: John Palmieri

@jhpalmieri
Copy link
Member

comment:44

Okay, let's merge it.

@vbraun
Copy link
Member

vbraun commented Aug 26, 2020

Changed branch from u/klee/29993 to 6c881bc

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

4 participants