[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/Convert/HTML.pm (output): set MATHJA
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/Convert/HTML.pm (output): set MATHJAX_SCRIPT and MATHJAX_SOURCE dynamic defaults earlier such that they can be known and modified in init files. |
Date: |
Sun, 02 Jan 2022 15:35:22 -0500 |
This is an automated email from the git hooks/post-receive script.
pertusus pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new 59b48681bc * tp/Texinfo/Convert/HTML.pm (output): set MATHJAX_SCRIPT
and MATHJAX_SOURCE dynamic defaults earlier such that they can be known and
modified in init files.
59b48681bc is described below
commit 59b48681bcf5c52389fbfcebbe0ccc05e1a7eac5
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Jan 2 21:34:53 2022 +0100
* tp/Texinfo/Convert/HTML.pm (output): set MATHJAX_SCRIPT and
MATHJAX_SOURCE dynamic defaults earlier such that they can be known
and modified in init files.
---
ChangeLog | 6 ++++++
tp/TODO | 3 ---
tp/Texinfo/Convert/HTML.pm | 40 +++++++++++++++++++++++-----------------
3 files changed, 29 insertions(+), 20 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 36976c49bc..4cad99347e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-01-02 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Convert/HTML.pm (output): set MATHJAX_SCRIPT and
+ MATHJAX_SOURCE dynamic defaults earlier such that they can be known
+ and modified in init files.
+
2022-01-02 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/Convert/LaTeX.pm (output, _convert): do not remove the
diff --git a/tp/TODO b/tp/TODO
index f51ffcb589..240ac3af36 100644
--- a/tp/TODO
+++ b/tp/TODO
@@ -13,9 +13,6 @@ xmllint --nonet --noout --valid commands.xml
Before next release
===================
-HTML.pm l 8024 check if setting MATHJAX_SCRIPT and MATHJAX_SOURCE is not
-set and HTML_MATH is mathjax shouldn't be done before.
-
Bugs
====
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 9a2d0db0fc..1280349878 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -7880,6 +7880,27 @@ sub output($$)
}
$self->set_conf('EXTERNAL_CROSSREF_SPLIT', $self->get_conf('SPLIT'));
+ if ($self->get_conf('HTML_MATH')
+ and $self->get_conf('HTML_MATH') eq 'mathjax') {
+ # See https://www.gnu.org/licenses/javascript-labels.html
+ #
+ # The link to the source for mathjax does not strictly follow the advice
+ # there: instead we link to instructions for obtaining the full source in
+ # its preferred form of modification.
+
+ my $mathjax_script = $self->get_conf('MATHJAX_SCRIPT');
+ if (! defined($mathjax_script)) {
+ $mathjax_script =
'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js';
+ $self->set_conf('MATHJAX_SCRIPT', $mathjax_script);
+ }
+
+ my $mathjax_source = $self->get_conf('MATHJAX_SOURCE');
+ if (! defined($mathjax_source)) {
+ $mathjax_source =
'http://docs.mathjax.org/en/latest/web/hosting.html#getting-mathjax-via-git';
+ $self->set_conf('MATHJAX_SOURCE', $mathjax_source);
+ }
+ }
+
# the configuration has potentially been modified for
# this output file especially. Set a corresponding initial
# configuration.
@@ -8058,24 +8079,9 @@ sub output($$)
if ($self->get_conf('HTML_MATH')
and $self->get_conf('HTML_MATH') eq 'mathjax') {
# See https://www.gnu.org/licenses/javascript-labels.html
- #
- # The link to the source for mathjax does not strictly follow the advice
- # there: instead we link to instructions for obtaining the full source in
- # its preferred form of modification.
- my ($mathjax_script, $mathjax_source);
-
- $mathjax_script = $self->get_conf('MATHJAX_SCRIPT');
- if (!$mathjax_script) {
- $mathjax_script =
'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js';
- $self->set_conf('MATHJAX_SCRIPT', $mathjax_script);
- }
-
- $mathjax_source = $self->get_conf('MATHJAX_SOURCE');
- if (!$mathjax_source) {
- $mathjax_source =
'http://docs.mathjax.org/en/latest/web/hosting.html#getting-mathjax-via-git';
- $self->set_conf('MATHJAX_SOURCE', $mathjax_source);
- }
+ my $mathjax_script = $self->get_conf('MATHJAX_SCRIPT');
+ my $mathjax_source = $self->get_conf('MATHJAX_SOURCE');
$self->{'jslicenses_math'}->{$mathjax_script} =
[ 'Apache License, Version 2.0.',
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/Convert/HTML.pm (output): set MATHJAX_SCRIPT and MATHJAX_SOURCE dynamic defaults earlier such that they can be known and modified in init files.,
Patrice Dumas <=