-
Notifications
You must be signed in to change notification settings - Fork 144
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
landing page: support different MathJax delimeters #2794
landing page: support different MathJax delimeters #2794
Conversation
@@ -407,6 +407,14 @@ <h4>{{ _("Request access") }}</h4> | |||
|
|||
{%- block javascript %} | |||
{% if config.THEME_MATHJAX_CDN %} | |||
<script type="text/javascript"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move the entire block to invenio-theme
, but pay attention to the else
below include config.THEME_JAVASCRIPT_TEMPLATE
7334543
to
3b49d2a
Compare
3b49d2a
to
f91acf9
Compare
{%- block javascript %} | ||
{{ super() }} | ||
{%- endblock javascript %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: If we simply call super we can simply remove the block and it would be the same, no?
{%- block javascript %} | |
{{ super() }} | |
{%- endblock javascript %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that in the child component I'm calling super.super()
, some tests were failing because it couldn't find javascript block in here.
{% if config.THEME_MATHJAX_CDN %} | ||
<script type="text/javascript"> | ||
window.MathJax = { | ||
tex: { | ||
inlineMath: [['$', '$'], ['\\(', '\\)']], | ||
processEscapes: true // Allows escaping $ signs if needed | ||
} | ||
}; | ||
</script> | ||
<script type="text/javascript" src="{{ config.THEME_MATHJAX_CDN }}"></script> | ||
{% endif %} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: I think this is duplicated, if we are adding it to the base page.html (as done in this PR) it shouldn't be needed here? unless I am missing something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This piece of code will be called in the else
of this condition (in reality this is record detail view in the requests): https://github.com/inveniosoftware/invenio-app-rdm/pull/2794/files#diff-d74bd02e8b7c3bedcec8f02daae657ffd97db51aea164a8a80ca5dfc88b39658R412
And the code from base page.html is called from here: https://github.com/inveniosoftware/invenio-app-rdm/pull/2794/files#diff-d74bd02e8b7c3bedcec8f02daae657ffd97db51aea164a8a80ca5dfc88b39658R410
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm I would expect that if it's already added in invenio_theme/templates/semantic-ui/invenio_theme/page.html
it's present in all the views as it's the global template we use, unless I am wrong.
I am also suprised about the super.super()
, I think that this is skipping the parent super and going to the grandfather, see this for reference: https://jinja.palletsprojects.com/en/3.1.x/templates/#nesting-extends
I find it a bit confusing to follow this and would expect to have a simpler way to enable it.
I think that adding it to the base global page is correct and from there I would simply call super() if we ever need to override that block. Maybe I am missing something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to review all this IRL, because it is not clear to me why we need it. From a quick look, we always use THEME_JAVASCRIPT_TEMPLATE
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed with @sakshamarora1 LGTU! 🚀
Add support for
$
and\
MathJax delimeters.Examples of records that are using different types:
https://repository.cern/records/fp18d-jc149
https://zenodo.org/records/8292839