Skip to content

Andrew/mathjax#393

Merged
ayjayt merged 4 commits into
masterfrom
andrew/mathjax
Aug 22, 2025
Merged

Andrew/mathjax#393
ayjayt merged 4 commits into
masterfrom
andrew/mathjax

Conversation

@ayjayt
Copy link
Copy Markdown
Collaborator

@ayjayt ayjayt commented Aug 19, 2025

This updates mathjax and script ordering to be more in line with expectations

@ayjayt ayjayt requested a review from emilykl August 19, 2025 18:27
@ayjayt
Copy link
Copy Markdown
Collaborator Author

ayjayt commented Aug 19, 2025

To address these two issues:

#388
#360

Comment thread src/py/kaleido/vendor/index.html Outdated
Comment on lines +3 to +6
<!--
THIS FILE IS AN EXAMPLE, IT IS GENERATED AUTOMATICALLY AT RUNTIME
TO ENSURE FULLY UPDATED RESOURCES
-->
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't make sense to me, what is the function of this file? Should it be checked into git at all?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Legacy code that I've been using throughout this process and as documentation. It's definitely on its way out, I can axe it.

Comment thread src/py/kaleido/vendor/index.html Outdated
window.PlotlyConfig = { MathJaxConfig: 'local' };
</script>

<!-- Only your one tweak; preset handles TeX+AMS+SVG -->
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

<script src="\S[^\n]*/kaleido_scopes\.js"></script>
</head>
<body style="{margin: 0; padding: 0;}"><img id="kaleido-image"></img></body>
<body style="{margin: 0; padding: 0;}"><img id="kaleido\-image" /></body>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the backslash in the id?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not super happy with how convoluted these tests are and I'm thinking about doing them line by line.

In certain instances, '-' is a reserved character in regex. In this particular instance, it doesn't need to be, but can be, escaped.

There's a run on testing today, this whole strategy might change in another PR.

@emilykl
Copy link
Copy Markdown
Collaborator

emilykl commented Aug 19, 2025

@ayjayt Just to make sure I understand -- the root cause of the two linked issues is the fact that the Mathjax script was being loaded after the Plotly script?

@ayjayt
Copy link
Copy Markdown
Collaborator Author

ayjayt commented Aug 19, 2025

@ayjayt Just to make sure I understand -- the root cause of the two linked issues is the fact that the Mathjax script was being loaded after the Plotly script?

a) we bring mathjax into line with plotly.py which solves one issues.
b) the other issue needs to be tested by the user, since I can't reproduce

It seems to me mathjax should be loaded if I'm going to tell plotly that it is loaded

Copy link
Copy Markdown
Collaborator

@emilykl emilykl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gvwilson gvwilson added feature something new P1 needs immediate attention labels Aug 22, 2025
@ayjayt ayjayt merged commit d0336f8 into master Aug 22, 2025
4 checks passed
@ayjayt ayjayt deleted the andrew/mathjax branch August 22, 2025 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature something new P1 needs immediate attention

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kaleido not using latex for text Kaleido v1.0.0 cannot display latex formula normally

3 participants