-
-
Notifications
You must be signed in to change notification settings - Fork 476
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
Detect and use system MathJax-3.x #36098
Changes from all commits
7342cbf
f435b02
de55f27
ab1649c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
>=dev-libs/mathjax-3 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
SAGE_SPKG_CONFIGURE([mathjax], [ | ||
# Arch: /usr/share/mathjax | ||
# Gentoo: /usr/share/mathjax | ||
# Void: /usr/share/mathjax | ||
AC_MSG_CHECKING([for MathJax-3.x]) | ||
m4_foreach([mathjax_dir], [/usr/share/mathjax], [ | ||
# tex-chtml.hs is used in src/sage_docbuild/conf.py | ||
# and was not present in MathJax-2.x | ||
AS_IF([test -f "mathjax_dir/tex-chtml.js"], [ | ||
SAGE_MATHJAX_DIR="mathjax_dir" | ||
AC_MSG_RESULT([mathjax_dir]) | ||
]) | ||
]) | ||
AS_IF([test -z "${SAGE_MATHJAX_DIR}"], [ | ||
AC_MSG_RESULT([no]) | ||
sage_spkg_install_mathjax=yes | ||
]) | ||
],[],[],[ | ||
# post-check | ||
AS_IF([test x$sage_spkg_install_mathjax = xyes], [ | ||
# Our spkg-src script adds an extra "mathjax" | ||
SAGE_MATHJAX_DIR='${prefix}'/share/mathjax/mathjax | ||
]) | ||
|
||
AC_SUBST(SAGE_MATHJAX_DIR, "${SAGE_MATHJAX_DIR}") | ||
]) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -374,8 +374,7 @@ def set_intersphinx_mappings(app, config): | |
if os.environ.get('SAGE_USE_CDNS', 'no') == 'yes': | ||
mathjax_path = "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js" | ||
else: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean the lines L377,378. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No. This would not work... |
||
mathjax_path = 'mathjax/tex-chtml.js' | ||
html_common_static_path += [MATHJAX_DIR] | ||
mathjax_path = os.path.join(MATHJAX_DIR, 'tex-chtml.js') | ||
|
||
# A list of glob-style patterns that should be excluded when looking for source | ||
# files. They are matched against the source file names relative to the | ||
|
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.
There seems no easy fix. A trick is to add ".." to
'${prefix}'/share/mathjax/mathjax
here so that we use ".." to indicate that this is an spkg mathjax, and then use the indicator to differentiate how to tell sphinx where to find mathjax inconf.py
. Yes, this is ugly...