[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/Convert/HTML.pm (_default_format_end
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/Convert/HTML.pm (_default_format_end_file) (_do_jslicenses_file, output): replace 'jslicenses_infojs' and 'jslicenses_math' by categories in 'jslicenses'. |
Date: |
Sun, 23 Jan 2022 15:50:13 -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 4dec3b20bb * tp/Texinfo/Convert/HTML.pm (_default_format_end_file)
(_do_jslicenses_file, output): replace 'jslicenses_infojs' and
'jslicenses_math' by categories in 'jslicenses'.
4dec3b20bb is described below
commit 4dec3b20bb25940543087262d54a391eafc7ec65
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Jan 23 21:49:59 2022 +0100
* tp/Texinfo/Convert/HTML.pm (_default_format_end_file)
(_do_jslicenses_file, output): replace 'jslicenses_infojs'
and 'jslicenses_math' by categories in 'jslicenses'.
---
ChangeLog | 6 +++++
tp/TODO | 3 +--
tp/Texinfo/Convert/HTML.pm | 62 +++++++++++++++++++++-------------------------
3 files changed, 35 insertions(+), 36 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a2114c50fb..4a9c819834 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-01-23 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Convert/HTML.pm (_default_format_end_file)
+ (_do_jslicenses_file, output): replace 'jslicenses_infojs'
+ and 'jslicenses_math' by categories in 'jslicenses'.
+
2022-01-23 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/Convert/HTML.pm (count_elements_in_filename),
diff --git a/tp/TODO b/tp/TODO
index 94f1a1159b..e9dc5147fd 100644
--- a/tp/TODO
+++ b/tp/TODO
@@ -45,8 +45,7 @@ Some internal state used in conversion:
$self->{'css_rule_lines'}
$self->{'css_map'}
_default_format_end_file
- $self->{'jslicenses_infojs'}
- $self->{'jslicenses_math'}
+ $self->{'jslicenses'}
Some private function used in conversion
_convert_informative_command
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index ef0824ddfc..50cc31b149 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -6431,8 +6431,6 @@ sub _load_htmlxref_files {
# from Converter
# labels
#
-# jslicenses_infojs
-# jslicenses_math
# jslicenses
#
# API exists
@@ -8057,10 +8055,11 @@ sub _default_format_end_file($$)
my $pre_body_close = $self->get_conf('PRE_BODY_CLOSE');
$pre_body_close = '' if (!defined($pre_body_close));
- if (scalar(keys %{$self->{'jslicenses_infojs'}})
- or (($self->get_file_information('mathjax', $filename)
- or !$self->get_conf('SPLIT'))
- and scalar(keys %{$self->{'jslicenses_math'}}))) {
+ if ($self->{'jslicenses'}
+ and (scalar(keys %{$self->{'jslicenses'}->{'infojs'}})
+ or (($self->get_file_information('mathjax', $filename)
+ or !$self->get_conf('SPLIT'))
+ and scalar(keys %{$self->{'jslicenses'}->{'mathjax'}})))) {
my $js_setting = $self->get_conf('JS_WEBLABELS');
my $js_path = $self->get_conf('JS_WEBLABELS_FILE');
if (defined($js_setting) and defined($js_path)
@@ -8511,14 +8510,16 @@ sub _do_jslicenses_file {
<body>
<table id="jslicense-labels1">
';
- my $h = $self->{'jslicenses'};
- for my $file (sort(keys %{$self->{'jslicenses'}})) {
- $a .= "<tr>\n";
- $a .= "<td><a href=\"$file\">$file</a></td>\n";
- $a .= "<td><a href=\"$h->{$file}->[1]\">$h->{$file}->[0]</a></td>\n";
- $a .= "<td><a href=\"$h->{$file}->[2]\">$h->{$file}->[2]</a></td>\n";
- $a .= "</tr>\n";
+ foreach my $category (sort(keys %{$self->{'jslicenses'}})) {
+ foreach my $file (sort(keys %{$self->{'jslicenses'}->{$category}})) {
+ my $file_info = $self->{'jslicenses'}->{$category}->{$file};
+ $a .= "<tr>\n";
+ $a .= "<td><a href=\"$file\">$file</a></td>\n";
+ $a .= "<td><a href=\"$file_info->[1]\">$file_info->[0]</a></td>\n";
+ $a .= "<td><a href=\"$file_info->[2]\">$file_info->[2]</a></td>\n";
+ $a .= "</tr>\n";
+ }
}
$a .= "</table>\n</body></html>\n";
@@ -9027,29 +9028,22 @@ sub output($$)
my $mathjax_script = $self->get_conf('MATHJAX_SCRIPT');
my $mathjax_source = $self->get_conf('MATHJAX_SOURCE');
- $self->{'jslicenses_math'}->{$mathjax_script} =
+ $self->{'jslicenses'}->{'mathjax'} = {
+ $mathjax_script =>
[ 'Apache License, Version 2.0.',
'https://www.apache.org/licenses/LICENSE-2.0',
- $mathjax_source ];
- # append to hash
- $self->{'jslicenses'} = {} if (not defined($self->{'jslicenses'}));
- %{$self->{'jslicenses'}} = ( %{$self->{'jslicenses'}},
- %{$self->{'jslicenses_math'}} );
-
+ $mathjax_source ]};
}
if ($self->get_conf('INFO_JS_DIR')) {
- $self->{'jslicenses_infojs'}->{'js/info.js'} =
- [ 'GNU General Public License 3.0 or later',
- 'http://www.gnu.org/licenses/gpl-3.0.html',
- 'js/info.js' ];
-
- $self->{'jslicenses_infojs'}->{'js/modernizr.js'} =
- [ 'Expat',
- 'http://www.jclark.com/xml/copying.txt',
- 'js/modernizr.js' ];
- $self->{'jslicenses'} = {} if (not defined($self->{'jslicenses'}));
- %{$self->{'jslicenses'}} = ( %{$self->{'jslicenses'}},
- %{$self->{'jslicenses_infojs'}} );
+ $self->{'jslicenses'}->{'infojs'} = {
+ 'js/info.js' =>
+ [ 'GNU General Public License 3.0 or later',
+ 'http://www.gnu.org/licenses/gpl-3.0.html',
+ 'js/info.js' ],
+ 'js/modernizr.js' =>
+ [ 'Expat',
+ 'http://www.jclark.com/xml/copying.txt',
+ 'js/modernizr.js' ]};
}
my $fh;
@@ -9215,7 +9209,7 @@ sub output($$)
$self->get_conf('INFO_JS_DIR'));
if (!-d $jsdir) {
if (-f $jsdir) {
- $self->document_error($self,
+ $self->document_error($self,
sprintf(__("%s already exists but is not a directory"), $jsdir));
} else {
mkdir $jsdir;
@@ -9234,7 +9228,7 @@ sub output($$)
my $from = File::Spec->catfile($jssrcdir, $f);
if (!copy($from, $jsdir)) {
- $self->document_error($self,
+ $self->document_error($self,
sprintf(__("error on copying %s into %s"), $from, $jsdir));
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/Convert/HTML.pm (_default_format_end_file) (_do_jslicenses_file, output): replace 'jslicenses_infojs' and 'jslicenses_math' by categories in 'jslicenses'.,
Patrice Dumas <=
- Prev by Date:
branch master updated: * tp/Texinfo/Convert/HTML.pm (count_elements_in_filename), tp/init/book.pm: add a specification argument to specify the count returned, total, current, or remaining. Use it in formatting functions. Remove 'counter_in_file' which can be obtained from the other counters.
- Next by Date:
branch master updated: * tp/Texinfo/Convert/HTML.pm (css_add_info, css_get_info): add API to get information on CSS rules, imports and styles, the non dynamic parts, and to modify.
- Previous by thread:
branch master updated: * tp/Texinfo/Convert/HTML.pm (count_elements_in_filename), tp/init/book.pm: add a specification argument to specify the count returned, total, current, or remaining. Use it in formatting functions. Remove 'counter_in_file' which can be obtained from the other counters.
- Next by thread:
branch master updated: * tp/Texinfo/Convert/HTML.pm (css_add_info, css_get_info): add API to get information on CSS rules, imports and styles, the non dynamic parts, and to modify.
- Index(es):