[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Thu, 18 Jan 2024 18:44:52 -0500 (EST) |
branch: master
commit 8f0b8d3f6adc4e5dfa58f3c3b5c97237fe637e29
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Thu Jan 18 23:03:36 2024 +0100
* tp/Texinfo/Convert/Converter.pm (set_document),
tp/Texinfo/Convert/HTML.pm (get_value): do not set
'document_descriptor' nor 'document_values'.
* tp/Texinfo/Convert/Converter.pm (set_document),
tp/Texinfo/Convert/HTML.pm (_convert_listoffloats_command),
tp/Texinfo/Convert/IXIN.pm, tp/Texinfo/Convert/LaTeX.pm
(_prepare_floats, _latex_header, _convert),
tp/Texinfo/Convert/Plaintext.pm (_convert): do not set 'floats',
instead use document floats_information to get document floats
information.
---
ChangeLog | 14 ++++++++++++++
tp/Texinfo/Convert/Converter.pm | 7 +------
tp/Texinfo/Convert/HTML.pm | 16 ++++++++++------
tp/Texinfo/Convert/IXIN.pm | 12 +++++++-----
tp/Texinfo/Convert/LaTeX.pm | 36 ++++++++++++++++++++++++++----------
tp/Texinfo/Convert/Plaintext.pm | 12 ++++++++----
6 files changed, 66 insertions(+), 31 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index bf4c72684a..2ac70af8d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -33,6 +33,20 @@
* tp/Texinfo/Common.pm (debug_print_tree): Also print 'unit_contents'
keys to allow printing an "output unit".
+2024-01-18 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Convert/Converter.pm (set_document),
+ tp/Texinfo/Convert/HTML.pm (get_value): do not set
+ 'document_descriptor' nor 'document_values'.
+
+ * tp/Texinfo/Convert/Converter.pm (set_document),
+ tp/Texinfo/Convert/HTML.pm (_convert_listoffloats_command),
+ tp/Texinfo/Convert/IXIN.pm, tp/Texinfo/Convert/LaTeX.pm
+ (_prepare_floats, _latex_header, _convert),
+ tp/Texinfo/Convert/Plaintext.pm (_convert): do not set 'floats',
+ instead use document floats_information to get document floats
+ information.
+
2024-01-18 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/Common.pm (set_output_encodings): use document in input
diff --git a/tp/Texinfo/Convert/Converter.pm b/tp/Texinfo/Convert/Converter.pm
index b7d7c948d8..43c8fbfce2 100644
--- a/tp/Texinfo/Convert/Converter.pm
+++ b/tp/Texinfo/Convert/Converter.pm
@@ -270,16 +270,11 @@ sub set_document($$)
my $identifier_target = $document->labels_information();
my $sections_list = $document->sections_list();
- $converter->{'floats'} = $floats if ($floats);
$converter->{'identifiers_target'} = $identifier_target
if ($identifier_target);
$converter->{'sections_list'} = $sections_list if ($sections_list);
$converter->{'indices_information'}
= $document->indices_information();
- $converter->{'document_values'} = $document->{'values'};
- # From and for XS
- $converter->{'document_descriptor'}
- = $document->document_descriptor();
}
Texinfo::Common::set_output_encodings($converter, $document);
@@ -2128,7 +2123,7 @@ are described in the Texinfo manual.
Those customization options, when appropriate, override the document content.
B<TODO what about the other options (all are used in converters>
B<TODO document this associated information
-('indices_information', 'floats'..., most available
+('indices_information' ..., most available
in HTML converter, either through $converter-E<gt>get_info('document') or
label_command())>
The C<converter> function returns a converter object (a blessed hash
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index c8562c39fb..388de87972 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -1962,9 +1962,9 @@ sub get_value($$)
{
my $self = shift;
my $value = shift;
- if (defined($self->{'document_values'})
- and exists ($self->{'document_values'}->{$value})) {
- return $self->{'document_values'}->{$value};
+ if ($self->{'document'} and $self->{'document'}->{'values'}
+ and exists($self->{'document'}->{'values'}->{$value})) {
+ return $self->{'document'}->{'values'}->{$value};
} else {
return undef;
}
@@ -2290,13 +2290,13 @@ sub get_file_information($$;$)
# information from converter available 'read-only', in general set up before
# really starting the formatting (except for current_filename).
-# 'floats', 'sections_list' are set up in the generic
+# 'sections_list' are set up in the generic
# converter
my %available_converter_info;
foreach my $converter_info ('copying_comment', 'current_filename',
'destination_directory', 'document', 'document_name',
'documentdescription_string', 'expanded_formats',
- 'floats', 'index_entries', 'index_entries_by_letter', 'indices_information',
+ 'index_entries', 'index_entries_by_letter', 'indices_information',
'jslicenses', 'identifiers_target',
'line_break_element', 'non_breaking_space', 'paragraph_symbol',
'sections_list',
@@ -5383,7 +5383,11 @@ sub _convert_listoffloats_command($$$$)
# should probably never happen
return '' if (in_string($self));
- my $floats = $self->get_info('floats');
+ my $floats;
+ my $document = $self->get_info('document');
+ if ($document) {
+ $floats = $document->floats_information();
+ }
my $listoffloats_name = $command->{'extra'}->{'float_type'};
if ($floats and $floats->{$listoffloats_name}
and scalar(@{$floats->{$listoffloats_name}})) {
diff --git a/tp/Texinfo/Convert/IXIN.pm b/tp/Texinfo/Convert/IXIN.pm
index d25a4e674e..d5a59b2e73 100644
--- a/tp/Texinfo/Convert/IXIN.pm
+++ b/tp/Texinfo/Convert/IXIN.pm
@@ -381,8 +381,10 @@ sub output_ixin($$)
# FIXME title: use simpletitle or fulltitle
my $document_info;
+ my $floats;
if ($self->->{'document'}) {
$document_info = $self->{'document'}->global_information();
+ $floats = $self->{'document'}->floats_information();
}
if ($document_info and $document_info->{'dircategory_direntry'}) {
@@ -790,8 +792,8 @@ sub output_ixin($$)
my %floats_information;
# collect all float types corresponding to float commands
- if ($self->{'floats'}) {
- foreach my $float_type (keys(%{$self->{'floats'}})) {
+ if ($floats) {
+ foreach my $float_type (keys(%{$floats})) {
$floats_information{$float_type} = {};
}
}
@@ -815,10 +817,10 @@ sub output_ixin($$)
my $floats_index = '';
foreach my $type (sort(keys(%floats_information))) {
my $float_text_len = 0;
- if ($self->{'floats'}->{$type}) {
+ if ($floats->{$type}) {
my $float_nr = 0;
my $float_text = '';
- foreach my $float (@{$self->{'floats'}->{$type}}) {
+ foreach my $float (@{$floats->{$type}}) {
$float_nr++;
my $associated_node_id;
# associated node already found when collecting labels
@@ -863,7 +865,7 @@ sub output_ixin($$)
# determine type expandable string from first float if it was not
# already determined from listoffloats
if (!defined($floats_information{$type}->{'type'})) {
- my $float_element = $self->{'floats'}->{$type}->[0];
+ my $float_element = $floats->{$type}->[0];
if ($float_element->{'extra'}->{'float_type'} ne '') {
$floats_information{$type}->{'type'}
= $self->convert_tree($float_element->{'args'}->[0]);
diff --git a/tp/Texinfo/Convert/LaTeX.pm b/tp/Texinfo/Convert/LaTeX.pm
index f3f82148f9..91cf00bb45 100644
--- a/tp/Texinfo/Convert/LaTeX.pm
+++ b/tp/Texinfo/Convert/LaTeX.pm
@@ -902,13 +902,19 @@ my %LaTeX_floats = (
sub _prepare_floats($)
{
my $self = shift;
- if ($self->{'floats'}) {
+
+ my $floats;
+ if ($self->{'document'}) {
+ $floats = $self->{'document'}->floats_information();
+ }
+
+ if ($floats) {
$self->{'normalized_float_latex'} = {};
$self->{'latex_floats'} = {};
- foreach my $normalized_float_type (sort(keys(%{$self->{'floats'}}))) {
+ foreach my $normalized_float_type (sort(keys(%{$floats}))) {
my $latex_variable_float_name;
- if (scalar(@{$self->{'floats'}->{$normalized_float_type}})) {
- my $float = $self->{'floats'}->{$normalized_float_type}->[0];
+ if (scalar(@{$floats->{$normalized_float_type}})) {
+ my $float = $floats->{$normalized_float_type}->[0];
$latex_variable_float_name
= Texinfo::Convert::NodeNameNormalization::transliterate_texinfo(
{'contents' => $float->{'args'}->[0]->{'contents'}});
@@ -1343,7 +1349,12 @@ sub _latex_header() {
}
$header_code .= "\n";
- if ($self->{'floats'}) {
+ my $floats;
+ if ($self->{'document'}) {
+ $floats = $self->{'document'}->floats_information();
+ }
+
+ if ($floats) {
foreach my $normalized_float_type
(sort(keys(%{$self->{'normalized_float_latex'}}))) {
my $latex_float_name
@@ -1352,7 +1363,7 @@ sub _latex_header() {
my $float_type = '';
if ($normalized_float_type ne '') {
_push_new_context($self, 'float_type '.$normalized_float_type);
- my $float = $self->{'floats'}->{$normalized_float_type}->[0];
+ my $float = $floats->{$normalized_float_type}->[0];
my $float_type = _convert($self, $float->{'args'}->[0]);
_pop_context($self);
}
@@ -1632,7 +1643,7 @@ roundcorner=10pt}
if ($self->{'packages'}->{'geometry'}) {
$usepackage_end .= "\\usepackage{geometry}\n";
}
- if ($self->{'floats'}) {
+ if ($floats) {
$usepackage_end .= "\\usepackage{float}\n";
}
if ($self->{'packages'}->{'babel'}) {
@@ -3901,9 +3912,14 @@ sub _convert($$)
return $result;
} elsif ($cmdname eq 'listoffloats') {
my $normalized_float_type = $element->{'extra'}->{'float_type'};
- if ($self->{'floats'}
- and $self->{'floats'}->{$normalized_float_type}
- and @{$self->{'floats'}->{$normalized_float_type}}) {
+ my $floats;
+ if ($self->{'document'}) {
+ $floats = $self->{'document'}->floats_information();
+ }
+
+ if ($floats
+ and $floats->{$normalized_float_type}
+ and @{$floats->{$normalized_float_type}}) {
if (not exists($self->{'normalized_float_latex'}
->{$normalized_float_type})) {
cluck("\@listoffloats $normalized_float_type: not found\n");
diff --git a/tp/Texinfo/Convert/Plaintext.pm b/tp/Texinfo/Convert/Plaintext.pm
index 015d9b819e..fa71b2d63d 100644
--- a/tp/Texinfo/Convert/Plaintext.pm
+++ b/tp/Texinfo/Convert/Plaintext.pm
@@ -3183,16 +3183,20 @@ sub _convert($$)
} elsif ($command eq 'listoffloats') {
my $float_type = $element->{'extra'}->{'float_type'};
my $lines_count = 0;
- if ($self->{'floats'}
- and $self->{'floats'}->{$float_type}
- and scalar(@{$self->{'floats'}->{$float_type}})) {
+ my $floats;
+ if ($self->{'document'}) {
+ $floats = $self->{'document'}->floats_information();
+ }
+ if ($floats
+ and $floats->{$float_type}
+ and scalar(@{$floats->{$float_type}})) {
if (!$self->{'empty_lines_count'}) {
_stream_output($self, undef, "\n");
$lines_count++;
}
_stream_output($self, undef, "* Menu:\n\n");
$lines_count += 2;
- foreach my $float (@{$self->{'floats'}->{$float_type}}) {
+ foreach my $float (@{$floats->{$float_type}}) {
next if !$float->{'args'} or !$float->{'args'}->[1]
or !$float->{'args'}->[1]->{'contents'}
or !@{$float->{'args'}->[1]->{'contents'}};
- master updated (be96e0d57e -> 54faad841f), Patrice Dumas, 2024/01/18
- [no subject], Patrice Dumas, 2024/01/18
- [no subject], Patrice Dumas, 2024/01/18
- [no subject],
Patrice Dumas <=
- [no subject], Patrice Dumas, 2024/01/18
- [no subject], Patrice Dumas, 2024/01/18
- [no subject], Patrice Dumas, 2024/01/18
- [no subject], Patrice Dumas, 2024/01/18