[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/Common.pm (find_innermost_accent_con
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/Common.pm (find_innermost_accent_contents) (float_name_caption, labels_information), tp/Texinfo/Convert/Converter.pm (sort_element_counts), tp/Texinfo/Convert/DocBook.pm (_convert), tp/Texinfo/Convert/HTML.pm (_convert_def_line_type) (_prepare_footnotes, _external_node_href) (output_internal_links, output, _convert), tp/Texinfo/Convert/IXIN.pm (output_ixin), tp/Texinfo/Convert/Info.pm (output, _image), tp/Texinfo/Convert/LaTeX.pm (_convert), tp/Texinfo/Convert/PlainTexinfo.pm [...] |
Date: |
Tue, 17 Aug 2021 09:02:38 -0400 |
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 2517691 * tp/Texinfo/Common.pm (find_innermost_accent_contents)
(float_name_caption, labels_information), tp/Texinfo/Convert/Converter.pm
(sort_element_counts), tp/Texinfo/Convert/DocBook.pm (_convert),
tp/Texinfo/Convert/HTML.pm (_convert_def_line_type) (_prepare_footnotes,
_external_node_href) (output_internal_links, output, _convert),
tp/Texinfo/Convert/IXIN.pm (output_ixin), tp/Texinfo/Convert/Info.pm (output,
_image), tp/Texinfo/Convert/LaTeX.pm (_convert), tp/Texinfo/Conve [...]
2517691 is described below
commit 251769157fbcc5aec44004908bd9b5dc99aeb307
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Aug 17 15:02:25 2021 +0200
* tp/Texinfo/Common.pm (find_innermost_accent_contents)
(float_name_caption, labels_information),
tp/Texinfo/Convert/Converter.pm (sort_element_counts),
tp/Texinfo/Convert/DocBook.pm (_convert),
tp/Texinfo/Convert/HTML.pm (_convert_def_line_type)
(_prepare_footnotes, _external_node_href)
(output_internal_links, output, _convert),
tp/Texinfo/Convert/IXIN.pm (output_ixin),
tp/Texinfo/Convert/Info.pm (output, _image),
tp/Texinfo/Convert/LaTeX.pm (_convert),
tp/Texinfo/Convert/PlainTexinfo.pm (_convert),
tp/Texinfo/Convert/Plaintext.pm (_printindex_formatted)
(_image_formatted_text, _image),
tp/Texinfo/Convert/Texinfo.pm (convert)
(node_extra_to_texi, _expand_cmd_args_to_texi),
tp/Texinfo/Convert/TexinfoXML.pm (_texinfo_line, _convert),
tp/Texinfo/Convert/Text.pm (convert, text_accents),
tp/Texinfo/ParserNonXS.pm (_print_command_args_texi)
(_parse_float_type, _end_line)
(_register_extra_menu_entry_information, _parse_texi),
tp/Texinfo/Structuring.pm (_check_node_same_texinfo_code)
(_print_root_command_texi, _print_element_command_texi)
(do_index_keys),
tp/Texinfo/Transformations.pm (_reference_to_arg)
(_reassociate_to_node),
tp/init/chm.pm, tp/init/highlight_syntax.pm,
tp/init/latex2html.pm, tp/init/tex4ht.pm,
tp/t/*.t, tp/t/test_utils.pl, tp/texi2any.pl,
tp/t/init/redefine_need.init: rename Texinfo::Convert::Texinfo
convert() as convert_to_texinfo() and
Texinfo::Convert::Text convert() as convert_to_text()
to make clearer that those functions are not part of
the Converter traditionnal API.
* tp/Texinfo/Convert/Text.pm (convert_to_text, convert):
do not allow convert_to_text to be called with an object
oriented syntax. Add convert() to implement the Converter
traditionnal API.
* tp/Texinfo/Common.pm(_print_element_tree_simple): add
a function that can be used for debugging purposes.
---
ChangeLog | 42 ++++++++++++++++++++++++++
tp/Texinfo/Common.pm | 32 +++++++++++++++++---
tp/Texinfo/Convert/Converter.pm | 4 +--
tp/Texinfo/Convert/DocBook.pm | 12 ++++----
tp/Texinfo/Convert/HTML.pm | 14 +++++----
tp/Texinfo/Convert/IXIN.pm | 4 +--
tp/Texinfo/Convert/Info.pm | 8 ++---
tp/Texinfo/Convert/LaTeX.pm | 2 +-
tp/Texinfo/Convert/PlainTexinfo.pm | 6 ++--
tp/Texinfo/Convert/Plaintext.pm | 6 ++--
tp/Texinfo/Convert/Texinfo.pm | 33 ++++++++++----------
tp/Texinfo/Convert/TexinfoXML.pm | 6 ++--
tp/Texinfo/Convert/Text.pm | 32 ++++++++++----------
tp/Texinfo/ParserNonXS.pm | 20 ++++++------
tp/Texinfo/Structuring.pm | 10 +++---
tp/Texinfo/Transformations.pm | 6 ++--
tp/init/chm.pm | 2 +-
tp/init/highlight_syntax.pm | 2 +-
tp/init/latex2html.pm | 2 +-
tp/init/tex4ht.pm | 2 +-
tp/t/01use.t | 2 +-
tp/t/accents.t | 12 ++++----
tp/t/automatic_menus.t | 2 +-
tp/t/automatic_nodes.t | 12 ++++----
tp/t/do_master_menu.t | 8 ++---
tp/t/index_before_item.t | 2 +-
tp/t/init/redefine_need.init | 2 +-
tp/t/nodenormalization.t | 2 +-
tp/t/protect_character_in_texinfo.t | 2 +-
tp/t/reference_to_text_in_tree.t | 2 +-
tp/t/test_fill_gaps_in_sectioning.t | 2 +-
tp/t/test_protect_hashchar_at_line_beginning.t | 2 +-
tp/t/test_sort.t | 6 ++--
tp/t/test_tree_copy.t | 4 +--
tp/t/test_utils.pl | 8 ++---
tp/texi2any.pl | 2 +-
36 files changed, 191 insertions(+), 124 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 1442328..4dcf9a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,45 @@
+2021-08-17 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Common.pm (find_innermost_accent_contents)
+ (float_name_caption, labels_information),
+ tp/Texinfo/Convert/Converter.pm (sort_element_counts),
+ tp/Texinfo/Convert/DocBook.pm (_convert),
+ tp/Texinfo/Convert/HTML.pm (_convert_def_line_type)
+ (_prepare_footnotes, _external_node_href)
+ (output_internal_links, output, _convert),
+ tp/Texinfo/Convert/IXIN.pm (output_ixin),
+ tp/Texinfo/Convert/Info.pm (output, _image),
+ tp/Texinfo/Convert/LaTeX.pm (_convert),
+ tp/Texinfo/Convert/PlainTexinfo.pm (_convert),
+ tp/Texinfo/Convert/Plaintext.pm (_printindex_formatted)
+ (_image_formatted_text, _image),
+ tp/Texinfo/Convert/Texinfo.pm (convert)
+ (node_extra_to_texi, _expand_cmd_args_to_texi),
+ tp/Texinfo/Convert/TexinfoXML.pm (_texinfo_line, _convert),
+ tp/Texinfo/Convert/Text.pm (convert, text_accents),
+ tp/Texinfo/ParserNonXS.pm (_print_command_args_texi)
+ (_parse_float_type, _end_line)
+ (_register_extra_menu_entry_information, _parse_texi),
+ tp/Texinfo/Structuring.pm (_check_node_same_texinfo_code)
+ (_print_root_command_texi, _print_element_command_texi)
+ (do_index_keys),
+ tp/Texinfo/Transformations.pm (_reference_to_arg)
+ (_reassociate_to_node),
+ tp/init/chm.pm, tp/init/highlight_syntax.pm,
+ tp/init/latex2html.pm, tp/init/tex4ht.pm,
+ tp/t/*.t, tp/t/test_utils.pl, tp/texi2any.pl,
+ tp/t/init/redefine_need.init: rename Texinfo::Convert::Texinfo
+ convert() as convert_to_texinfo() and
+ Texinfo::Convert::Text convert() as convert_to_text()
+ to make clearer that those functions are not part of
+ the Converter traditionnal API.
+ * tp/Texinfo/Convert/Text.pm (convert_to_text, convert):
+ do not allow convert_to_text to be called with an object
+ oriented syntax. Add convert() to implement the Converter
+ traditionnal API.
+ * tp/Texinfo/Common.pm(_print_element_tree_simple): add
+ a function that can be used for debugging purposes.
+
2021-08-16 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/Convert/Unicode.pm (check_unicode_point_conversion)
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index ea37708..00a623e 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -1426,7 +1426,7 @@ sub find_innermost_accent_contents($;$)
or !$accent_commands{$current->{'cmdname'}}) {
#print STDERR "BUG: Not an accent command in accent\n";
cluck "BUG: Not an accent command in accent\n";
- #print STDERR Texinfo::Convert::Texinfo::convert($current)."\n";
+ #print STDERR
Texinfo::Convert::Texinfo::convert_to_texinfo($current)."\n";
#print STDERR Data::Dumper->Dump([$current]);
last;
}
@@ -1439,7 +1439,7 @@ sub find_innermost_accent_contents($;$)
if (!$arg->{'contents'}) {
print STDERR "BUG: No content in accent command\n";
#print STDERR Data::Dumper->Dump([$current]);
- #print STDERR Texinfo::Convert::Texinfo::convert($current)."\n";
+ #print STDERR
Texinfo::Convert::Texinfo::convert_to_texinfo($current)."\n";
return ([], \@accent_commands);
}
# inside the argument of an accent
@@ -1620,7 +1620,7 @@ sub float_name_caption($$)
}
#if ($self->get_conf('DEBUG')) {
# my $caption_texi =
- # Texinfo::Convert::Texinfo::convert({ 'contents' =>
$caption->{'contents'}});
+ # Texinfo::Convert::Texinfo::convert_to_texinfo({ 'contents' =>
$caption->{'contents'}});
# print STDERR " CAPTION: $caption_texi\n";
#}
my $type;
@@ -2383,6 +2383,28 @@ sub _print_current($)
}
}
+# for debugging
+sub _print_element_tree_simple($) {
+ my $current = shift;
+ if (ref($current) ne 'HASH') {
+ return "_print_element_tree_simple: $current not a hash\n";
+ }
+ my $type = '';
+ my $cmd = '';
+ my $parent_string = '';
+ my $text = '';
+ $type = "($current->{'type'})" if (defined($current->{'type'}));
+ $cmd = "\@$current->{'cmdname'}" if (defined($current->{'cmdname'}));
+ $text = "[T]" if (defined($current->{'text'}));
+ my $args = '';
+ my $contents = '';
+ $args = "[A".scalar(@{$current->{'args'}}).']' if $current->{'args'};
+ $contents = "[C".scalar(@{$current->{'contents'}}).']'
+ if $current->{'contents'};
+ return "$cmd$type$text$args$contents";
+}
+
+
sub move_index_entries_after_items($) {
# enumerate or itemize
my $current = shift;
@@ -2704,7 +2726,7 @@ sub labels_information
if ($normalized !~ /[^-]/) {
$self->line_error (sprintf(__("empty node name after expansion
`%s'"),
- Texinfo::Convert::Texinfo::convert({'contents'
+ Texinfo::Convert::Texinfo::convert_to_texinfo({'contents'
=> $target->{'extra'}->{'node_content'}})),
$target->{'line_nr'});
delete $target->{'extra'}->{'node_content'};
@@ -2713,7 +2735,7 @@ sub labels_information
$self->line_error(
sprintf(__("\@%s `%s' previously defined"),
$target->{'cmdname'},
- Texinfo::Convert::Texinfo::convert({'contents' =>
+ Texinfo::Convert::Texinfo::convert_to_texinfo({'contents'
=>
$target->{'extra'}->{'node_content'}})),
$target->{'line_nr'});
$self->line_error(
diff --git a/tp/Texinfo/Convert/Converter.pm b/tp/Texinfo/Convert/Converter.pm
index fec2694..71b7e80 100644
--- a/tp/Texinfo/Convert/Converter.pm
+++ b/tp/Texinfo/Convert/Converter.pm
@@ -1292,11 +1292,11 @@ sub sort_element_counts($$;$$)
and ($element->{'extra'}->{'node'} or
$element->{'extra'}->{'section'})) {
my $command = $element->{'extra'}->{'element_command'};
if ($command->{'cmdname'} eq 'node') {
- $name = Texinfo::Convert::Texinfo::convert({'contents'
+ $name = Texinfo::Convert::Texinfo::convert_to_texinfo({'contents'
=> $command->{'extra'}->{'nodes_manuals'}->[0]->{'node_content'}});
} else {
$name = "\@$command->{'cmdname'}"
- .Texinfo::Convert::Texinfo::convert($command->{'args'}->[0]);
+
.Texinfo::Convert::Texinfo::convert_to_texinfo($command->{'args'}->[0]);
}
}
chomp($name);
diff --git a/tp/Texinfo/Convert/DocBook.pm b/tp/Texinfo/Convert/DocBook.pm
index 79ace8b..e32acde 100644
--- a/tp/Texinfo/Convert/DocBook.pm
+++ b/tp/Texinfo/Convert/DocBook.pm
@@ -848,7 +848,7 @@ sub _convert($$;$)
if (scalar(@{$root->{'args'}}) == 3
and defined($root->{'args'}->[-1]) and
@{$root->{'args'}->[-1]->{'contents'}}) {
$filename
- = $self->xml_protect_text(Texinfo::Convert::Text::convert(
+ =
$self->xml_protect_text(Texinfo::Convert::Text::convert_to_text(
{'contents' => $root->{'args'}->[-1]->{'contents'}},
{'code' => 1, Texinfo::Common::_convert_text_options($self)}));
}
@@ -984,7 +984,7 @@ sub _convert($$;$)
}
} elsif ($root->{'cmdname'} eq 'image') {
if (defined($root->{'args'}->[0]) and
@{$root->{'args'}->[0]->{'contents'}}) {
- my $basefile = Texinfo::Convert::Text::convert(
+ my $basefile = Texinfo::Convert::Text::convert_to_text(
{'contents' => $root->{'args'}->[0]->{'contents'}},
{'code' => 1, Texinfo::Common::_convert_text_options($self)});
my $element;
@@ -1040,7 +1040,7 @@ sub _convert($$;$)
if (defined($root->{'args'}->[0]) and
@{$root->{'args'}->[0]->{'contents'}}) {
$email = $root->{'args'}->[0]->{'contents'};
$email_text
- = $self->_protect_text(Texinfo::Convert::Text::convert(
+ = $self->_protect_text(Texinfo::Convert::Text::convert_to_text(
{'contents' => $email},
{'code' => 1,
Texinfo::Common::_convert_text_options($self)}));
@@ -1062,7 +1062,7 @@ sub _convert($$;$)
my ($url_text, $url_content);
if (defined($root->{'args'}->[0]) and
@{$root->{'args'}->[0]->{'contents'}}) {
$url_content = $root->{'args'}->[0]->{'contents'};
- $url_text = $self->_protect_text(Texinfo::Convert::Text::convert(
+ $url_text =
$self->_protect_text(Texinfo::Convert::Text::convert_to_text(
{'contents' => $url_content},
{'code' => 1,
Texinfo::Common::_convert_text_options($self)}));
@@ -1236,7 +1236,7 @@ sub _convert($$;$)
$multiply = 1;
foreach my $prototype (@{$root->{'extra'}->{'prototypes'}}) {
my $prototype_text
- = Texinfo::Convert::Text::convert($prototype,
+ = Texinfo::Convert::Text::convert_to_text($prototype,
{Texinfo::Common::_convert_text_options($self)});
push @fractions,
Texinfo::Convert::Unicode::string_width($prototype_text);
@@ -1278,7 +1278,7 @@ sub _convert($$;$)
if ($root->{'args'} and $root->{'args'}->[0]
and $root->{'args'}->[0]->{'contents'}
and @{$root->{'args'}->[0]->{'contents'}}) {
- my $quotation_arg_text = Texinfo::Convert::Text::convert(
+ my $quotation_arg_text = Texinfo::Convert::Text::convert_to_text(
$root->{'args'}->[0],
{Texinfo::Common::_convert_text_options($self)});
if ($docbook_special_quotations{lc($quotation_arg_text)}) {
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 40c6ff7..4323d49 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -1332,6 +1332,8 @@ $default_commands_formatting{'normal'}->{'enddots'}
= '<small class="enddots">...</small>';
$default_commands_formatting{'preformatted'}->{'enddots'} = '...';
$default_commands_formatting{'normal'}->{'*'} = '<br>';
+# this is used in math too, not sure that it is the best
+# in that context, '<br>' could be better.
$default_commands_formatting{'preformatted'}->{'*'} = "\n";
@@ -4336,7 +4338,7 @@ sub _convert_def_line_type($$$$)
my $content = shift;
if ($self->in_string()) {
- return $self->protect_text(Texinfo::Convert::Text::convert(
+ return $self->protect_text(Texinfo::Convert::Text::convert_to_text(
$command, Texinfo::Common::_convert_text_options($self)));
}
@@ -6148,7 +6150,7 @@ sub _prepare_footnotes($)
$self->{'seen_ids'}->{$docid} = 1;
$self->{'targets'}->{$footnote} = { 'target' => $footid };
print STDERR "Enter footnote $footnote: target $footid, nr
$footnote_nr\n"
- .Texinfo::Convert::Texinfo::convert($footnote)."\n"
+ .Texinfo::Convert::Texinfo::convert_to_texinfo($footnote)."\n"
if ($self->get_conf('DEBUG'));
}
}
@@ -6184,7 +6186,7 @@ sub _external_node_href($$$$)
my $target_split;
my $file;
if ($external_node->{'manual_content'}) {
- my $manual_name = Texinfo::Convert::Text::convert(
+ my $manual_name = Texinfo::Convert::Text::convert_to_text(
{'contents' => $external_node->{'manual_content'}},
{ 'code' => 1,
Texinfo::Common::_convert_text_options($self)});
@@ -7199,7 +7201,7 @@ sub output_internal_links($)
$href = $self->command_href($command, '');
my $tree = $self->command_text($command, 'tree');
if ($tree) {
- $text = Texinfo::Convert::Text::convert($tree,
+ $text = Texinfo::Convert::Text::convert_to_text($tree,
{Texinfo::Common::_convert_text_options($self)});
}
}
@@ -7474,7 +7476,7 @@ sub output($$)
# copying comment
if ($self->{'extra'}->{'copying'}) {
- my $copying_comment = Texinfo::Convert::Text::convert(
+ my $copying_comment = Texinfo::Convert::Text::convert_to_text(
{'contents' => $self->{'extra'}->{'copying'}->{'contents'}},
{Texinfo::Common::_convert_text_options($self)});
if ($copying_comment ne '') {
@@ -8041,7 +8043,7 @@ sub _convert($$;$)
pop @{$self->{'document_context'}};
} elsif ($arg_type eq 'monospacetext') {
$arg_formatted->{$arg_type}
- = Texinfo::Convert::Text::convert($arg, {'code' => 1,
+ = Texinfo::Convert::Text::convert_to_text($arg, {'code' => 1,
Texinfo::Common::_convert_text_options($self)});
} elsif ($arg_type eq 'raw') {
$self->{'document_context'}->[-1]->{'raw'}++;
diff --git a/tp/Texinfo/Convert/IXIN.pm b/tp/Texinfo/Convert/IXIN.pm
index e5505f5..33f853b 100644
--- a/tp/Texinfo/Convert/IXIN.pm
+++ b/tp/Texinfo/Convert/IXIN.pm
@@ -827,13 +827,13 @@ sub output_ixin($$)
my $extension;
if (defined($command->{'args'}->[0])
and @{$command->{'args'}->[0]->{'contents'}}) {
- $basefile = Texinfo::Convert::Text::convert(
+ $basefile = Texinfo::Convert::Text::convert_to_text(
{'contents' => $command->{'args'}->[0]->{'contents'}},
{'code' => 1, Texinfo::Common::_convert_text_options($self)});
}
if (defined($command->{'args'}->[4])
and @{$command->{'args'}->[4]->{'contents'}}) {
- $extension = Texinfo::Convert::Text::convert(
+ $extension = Texinfo::Convert::Text::convert_to_text(
{'contents' => $command->{'args'}->[4]->{'contents'}},
{'code' => 1, Texinfo::Common::_convert_text_options($self)});
$extension =~ s/^\.//;
diff --git a/tp/Texinfo/Convert/Info.pm b/tp/Texinfo/Convert/Info.pm
index a51297e..8420eb2 100644
--- a/tp/Texinfo/Convert/Info.pm
+++ b/tp/Texinfo/Convert/Info.pm
@@ -250,7 +250,7 @@ sub output($)
if ($seen_anchors{$label_text}) {
$self->line_error(sprintf(__("\@%s output more than once: %s"),
$label->{'root'}->{'cmdname'},
- Texinfo::Convert::Texinfo::convert({'contents' =>
+ Texinfo::Convert::Texinfo::convert_to_texinfo({'contents' =>
$label->{'root'}->{'extra'}->{'node_content'}})),
$label->{'root'}->{'line_nr'});
next;
@@ -475,12 +475,12 @@ sub _image($$)
if (defined($root->{'args'}->[0])
and @{$root->{'args'}->[0]->{'contents'}}) {
- my $basefile = Texinfo::Convert::Text::convert(
+ my $basefile = Texinfo::Convert::Text::convert_to_text(
{'contents' => $root->{'args'}->[0]->{'contents'}},
{'code' => 1, Texinfo::Common::_convert_text_options($self)});
if (defined($root->{'args'}->[4])
and @{$root->{'args'}->[4]->{'contents'}}) {
- my $extension = Texinfo::Convert::Text::convert(
+ my $extension = Texinfo::Convert::Text::convert_to_text(
{'contents' => $root->{'args'}->[4]->{'contents'}},
{'code' => 1, Texinfo::Common::_convert_text_options($self)});
unshift @extensions, ".$extension";
@@ -499,7 +499,7 @@ sub _image($$)
my $alt;
if (defined($root->{'args'}->[3])
and @{$root->{'args'}->[3]->{'contents'}}) {
- $alt = Texinfo::Convert::Text::convert(
+ $alt = Texinfo::Convert::Text::convert_to_text(
{'contents' => $root->{'args'}->[3]->{'contents'}},
{Texinfo::Common::_convert_text_options($self)});
}
diff --git a/tp/Texinfo/Convert/LaTeX.pm b/tp/Texinfo/Convert/LaTeX.pm
index 4603fa0..a2445c6 100644
--- a/tp/Texinfo/Convert/LaTeX.pm
+++ b/tp/Texinfo/Convert/LaTeX.pm
@@ -1233,7 +1233,7 @@ sub _convert($$)
and @{$root->{'args'}->[0]->{'contents'}}) {
# distinguish text basefile used to find the file and
# converted basefile with special characters escaped
- my $basefile = Texinfo::Convert::Text::convert(
+ my $basefile = Texinfo::Convert::Text::convert_to_text(
{'contents' => $root->{'args'}->[0]->{'contents'}},
{'code' => 1, %{$self->{'convert_text_options'}}});
# FIXME not clear at all what can be in filenames here,
diff --git a/tp/Texinfo/Convert/PlainTexinfo.pm
b/tp/Texinfo/Convert/PlainTexinfo.pm
index bcc75d3..383d6f9 100644
--- a/tp/Texinfo/Convert/PlainTexinfo.pm
+++ b/tp/Texinfo/Convert/PlainTexinfo.pm
@@ -18,8 +18,8 @@
#
# Original author: Patrice Dumas <pertusus@free.fr>
-# This calls Texinfo::Convert::Texinfo::convert while inheriting standard
-# functions from Texinfo::Convert::Converter.
+# This calls Texinfo::Convert::Texinfo::convert_to_texinfo while
+# inheriting standard functions from Texinfo::Convert::Converter.
package Texinfo::Convert::PlainTexinfo;
@@ -64,7 +64,7 @@ sub _convert($$)
my $self = shift;
my $root = shift;
- return Texinfo::Convert::Texinfo::convert($root);
+ return Texinfo::Convert::Texinfo::convert_to_texinfo($root);
}
1;
diff --git a/tp/Texinfo/Convert/Plaintext.pm b/tp/Texinfo/Convert/Plaintext.pm
index a4701e9..eccc87d 100644
--- a/tp/Texinfo/Convert/Plaintext.pm
+++ b/tp/Texinfo/Convert/Plaintext.pm
@@ -1270,7 +1270,7 @@ sub _printindex_formatted($$;$)
if ($entry_text =~ /:/ and $self->get_conf('INDEX_SPECIAL_CHARS_WARNING'))
{
$self->line_warn (sprintf(__("Index entry in \@%s with : produces
invalid Info: %s"),
$entry->{'index_at_command'},
- Texinfo::Convert::Texinfo::convert($entry_tree)),
+ Texinfo::Convert::Texinfo::convert_to_texinfo($entry_tree)),
$entry->{'command'}->{'line_nr'});
}
@@ -1449,7 +1449,7 @@ sub _image_formatted_text($$$$)
$result = $text;
} elsif (defined($root->{'args'}->[3])
and @{$root->{'args'}->[3]->{'contents'}}) {
- $result = '[' .Texinfo::Convert::Text::convert(
+ $result = '[' .Texinfo::Convert::Text::convert_to_text(
{'contents' => $root->{'args'}->[3]->{'contents'}},
$self->{'convert_text_options'}) .']';
} else {
@@ -1467,7 +1467,7 @@ sub _image($$)
if (defined($root->{'args'}->[0])
and @{$root->{'args'}->[0]->{'contents'}}) {
- my $basefile = Texinfo::Convert::Text::convert(
+ my $basefile = Texinfo::Convert::Text::convert_to_text(
{'contents' => $root->{'args'}->[0]->{'contents'}},
{'code' => 1, %{$self->{'convert_text_options'}}});
my ($text, $width) = $self->_image_text($root, $basefile);
diff --git a/tp/Texinfo/Convert/Texinfo.pm b/tp/Texinfo/Convert/Texinfo.pm
index 43c54ca..e6c87a9 100644
--- a/tp/Texinfo/Convert/Texinfo.pm
+++ b/tp/Texinfo/Convert/Texinfo.pm
@@ -31,7 +31,7 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
@ISA = qw(Exporter);
%EXPORT_TAGS = ( 'all' => [ qw(
- convert
+ convert_to_texinfo
node_extra_to_texi
) ] );
@@ -61,14 +61,14 @@ for my $a (@ignored_types) {
# tree item to be shown, in the default case they are
# not shown.
# expand a tree to the corresponding texinfo.
-sub convert($;$);
-sub convert($;$)
+sub convert_to_texinfo($;$);
+sub convert_to_texinfo($;$)
{
my $root = shift;
my $expand_replaced = shift;
- die "convert: root undef\n" if (!defined($root));
- die "convert: bad root type (".ref($root).") $root\n"
+ die "convert_to_texinfo: root undef\n" if (!defined($root));
+ die "convert_to_texinfo: bad root type (".ref($root).") $root\n"
if (ref($root) ne 'HASH');
my $result = '';
@@ -96,14 +96,14 @@ sub convert($;$)
}
if (defined($root->{'contents'})) {
foreach my $child (@{$root->{'contents'}}) {
- $result .= convert($child, $expand_replaced);
+ $result .= convert_to_texinfo($child, $expand_replaced);
}
}
if ($root->{'extra'} and $root->{'extra'}->{'spaces_after_argument'}) {
$result .= $root->{'extra'}->{'spaces_after_argument'};
}
if ($root->{'extra'} and $root->{'extra'}->{'comment_at_end'}) {
- $result .= convert($root->{'extra'}->{'comment_at_end'},
+ $result .= convert_to_texinfo($root->{'extra'}->{'comment_at_end'},
$expand_replaced);
}
$result .= '}' if ($root->{'type'}
@@ -124,12 +124,11 @@ sub node_extra_to_texi($)
my $node = shift;
my $result = '';
if ($node->{'manual_content'}) {
- $result = '('.Texinfo::Convert::Texinfo::convert({'contents'
- => $node->{'manual_content'}}) .')';
+ $result = '('.convert_to_texinfo({'contents'
+ => $node->{'manual_content'}}) .')';
}
if ($node->{'node_content'}) {
- $result .= Texinfo::Convert::Texinfo::convert ({'contents'
- => $node->{'node_content'}});
+ $result .= convert_to_texinfo({'contents' => $node->{'node_content'}});
}
return $result;
}
@@ -158,7 +157,7 @@ sub _expand_cmd_args_to_texi($;$) {
$result .= $cmd->{'extra'}->{'spaces_before_argument'}
if $cmd->{'extra'} and $cmd->{'extra'}->{'spaces_before_argument'};
foreach my $arg (@{$cmd->{'args'}}) {
- $result .= convert($arg, $expand_replaced);
+ $result .= convert_to_texinfo($arg, $expand_replaced);
}
# for misc_commands with type special
} elsif (($cmd->{'extra'} or $cmdname eq 'macro' or $cmdname eq 'rmacro')
@@ -175,7 +174,7 @@ sub _expand_cmd_args_to_texi($;$) {
if ($arg->{'extra'} and $arg->{'extra'}->{'spaces_before_argument'}) {
$result .= $arg->{'extra'}->{'spaces_before_argument'};
}
- $result .= convert($arg);
+ $result .= convert_to_texinfo($arg);
$result .= ',';
}
$result =~ s/,$//;
@@ -202,7 +201,7 @@ sub _expand_cmd_args_to_texi($;$) {
if ($arg->{'extra'} and $arg->{'extra'}->{'spaces_before_argument'}) {
$result .= $arg->{'extra'}->{'spaces_before_argument'};
}
- $result .= convert($arg);
+ $result .= convert_to_texinfo($arg);
}
if ($cmdname eq 'verb') {
$result .= $cmd->{'extra'}->{'delimiter'};
@@ -226,9 +225,9 @@ Texinfo::Convert::Texinfo - Convert a Texinfo tree to
Texinfo code
=head1 SYNOPSIS
- use Texinfo::Convert::Texinfo qw(convert);
+ use Texinfo::Convert::Texinfo qw(convert_to_texinfo);
- my $texinfo_text = convert($tree);
+ my $texinfo_text = convert_to_texinfo($tree);
=head1 DESCRIPTION
@@ -242,7 +241,7 @@ and C<@value> are expanded, and some invalid code is
discarded.
=over
-=item $texinfo_text = convert($tree)
+=item $texinfo_text = convert_to_texinfo($tree)
Converts the Texinfo tree I<$tree> to Texinfo code.
diff --git a/tp/Texinfo/Convert/TexinfoXML.pm b/tp/Texinfo/Convert/TexinfoXML.pm
index ec40ef5..5ae3d31 100644
--- a/tp/Texinfo/Convert/TexinfoXML.pm
+++ b/tp/Texinfo/Convert/TexinfoXML.pm
@@ -677,7 +677,7 @@ sub _texinfo_line($$)
my $self = shift;
my $root = shift;
- my $line = Texinfo::Convert::Texinfo::convert($root->{'args'}->[-1]);
+ my $line =
Texinfo::Convert::Texinfo::convert_to_texinfo($root->{'args'}->[-1]);
chomp($line);
if ($line ne '') {
return ('line', $line);
@@ -1239,14 +1239,14 @@ sub _convert($$;$)
}
if (defined($root->{'args'}->[$manual_arg_index])
and @{$root->{'args'}->[$manual_arg_index]->{'contents'}}) {
- $manual = Texinfo::Convert::Text::convert({'contents'
+ $manual = Texinfo::Convert::Text::convert_to_text({'contents'
=> $root->{'args'}->[$manual_arg_index]->{'contents'}},
{'code' => 1,
Texinfo::Common::_convert_text_options($self)});
}
if (!defined($manual) and $root->{'extra'}->{'node_argument'}
and $root->{'extra'}->{'node_argument'}->{'manual_content'}) {
- $manual = Texinfo::Convert::Text::convert({'contents'
+ $manual = Texinfo::Convert::Text::convert_to_text({'contents'
=> $root->{'extra'}->{'node_argument'}->{'manual_content'}},
{'code' => 1, Texinfo::Common::_convert_text_options($self)});
}
diff --git a/tp/Texinfo/Convert/Text.pm b/tp/Texinfo/Convert/Text.pm
index 3837a29..1158005 100644
--- a/tp/Texinfo/Convert/Text.pm
+++ b/tp/Texinfo/Convert/Text.pm
@@ -38,7 +38,7 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
@ISA = qw(Exporter Texinfo::Convert::Converter);
%EXPORT_TAGS = ( 'all' => [ qw(
- convert
+ convert_to_text
ascii_accent
text_accents
) ] );
@@ -223,7 +223,7 @@ sub text_accents($;$$)
my $options = {};
$options->{'enabled_encoding'} = $encoding if (defined($encoding));
$options->{'sc'} = $set_case if (defined($set_case));
- my $text = convert({'contents' => $contents}, $options);
+ my $text = convert_to_text({'contents' => $contents}, $options);
my $result = Texinfo::Convert::Unicode::encoded_accents(undef, $text,
$stack, $encoding, \&ascii_accent_fallback, $set_case);
@@ -331,18 +331,11 @@ sub _code_options($)
return $code_options;
}
-sub convert($;$)
+sub convert_to_text($;$)
{
my $root = shift;
- # means it was called object oriented
- if (ref($root) ne 'HASH') {
- if (ref($root) eq 'ARRAY') {
- carp ("convert argument $root not blessed reference or HASH");
- return undef;
- }
- $root = shift;
- }
my $options = shift;
+
#print STDERR "CONVERT\n";
return _convert($root, $options);
}
@@ -558,7 +551,6 @@ sub _convert($;$)
push @contents, {'text' => "\n"};
$result = _convert({'contents' => \@contents}, _code_options($options));
}
- #$result = convert($root->{'args'}->[0], $options) if ($root->{'args'});
} elsif ($root->{'type'} and $root->{'type'} eq 'menu_entry') {
foreach my $arg (@{$root->{'args'}}) {
if ($arg->{'type'} eq 'menu_entry_node') {
@@ -661,6 +653,14 @@ sub convert_tree($$)
return _convert($root);
}
+sub convert($$)
+{
+ my $self = shift;
+ my $root = shift;
+
+ return _convert($root);
+}
+
# determine outfile and output to that file
my $STDIN_DOCU_NAME = 'stdin';
sub output($$)
@@ -753,12 +753,12 @@ Texinfo::Convert::Text - Convert Texinfo tree to simple
text
=head1 SYNOPSIS
- use Texinfo::Convert::Text qw(convert ascii_accent text_accents);
+ use Texinfo::Convert::Text qw(convert_to_text ascii_accent text_accents);
- my $result = convert($tree);
- my $result_encoded = convert($tree,
+ my $result = convert_to_text($tree);
+ my $result_encoded = convert_to_text($tree,
{'enabled_encoding' => 'utf-8'});
- my $result_converter = convert($tree,
+ my $result_converter = convert_to_text($tree,
{'converter' => $converter});
my $result_accent_text = ascii_accent('e', $accent_command);
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index e6f679d..8a00940 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -932,7 +932,7 @@ sub _print_command_args_texi($)
or $current->{'args'}->[0]->{'type'} eq 'brace_command_context');
$args .= '{' if ($with_brace);
foreach my $arg (@{$current->{'args'}}) {
- $args .= Texinfo::Convert::Texinfo::convert($arg).', ';
+ $args .= Texinfo::Convert::Texinfo::convert_to_texinfo($arg).', ';
}
$args =~ s/, $//;
}
@@ -2112,7 +2112,7 @@ sub _parse_float_type($)
if ($current->{'args'} and @{$current->{'args'}}) {
if (@{$current->{'args'}->[0]->{'contents'}}) {
my $normalized
- = Texinfo::Convert::Texinfo::convert(
+ = Texinfo::Convert::Texinfo::convert_to_texinfo(
{'contents' => $current->{'args'}->[0]->{'contents'}});
$current->{'extra'}->{'type'}->{'content'} =
$current->{'args'}->[0]->{'contents'};
@@ -2744,7 +2744,7 @@ sub _end_line($$$)
$self->_command_warn($current, $line_nr,
__("unexpected argument on \@%s line: %s"),
$current->{'parent'}->{'cmdname'},
- Texinfo::Convert::Texinfo::convert($content));
+ Texinfo::Convert::Texinfo::convert_to_texinfo($content));
}
}
}
@@ -2965,7 +2965,7 @@ sub _end_line($$$)
if (($superfluous_arg or $line =~ /\S/)
and defined($end_command)) {
my $texi_line
- = Texinfo::Convert::Texinfo::convert($current->{'args'}->[0]);
+ =
Texinfo::Convert::Texinfo::convert_to_texinfo($current->{'args'}->[0]);
$texi_line =~ s/^\s*([[:alnum:]][[:alnum:]-]+)//;
$self->_command_error($current, $line_nr,
__("superfluous argument to \@%s %s: %s"),
@@ -3050,7 +3050,7 @@ sub _end_line($$$)
# set, such that @include that are removed from the tree
# with type set to replaced are still shown in error messages.
my $texi_line
- = Texinfo::Convert::Texinfo::convert($current->{'args'}->[0], 1);
+ =
Texinfo::Convert::Texinfo::convert_to_texinfo($current->{'args'}->[0], 1);
$texi_line =~ s/^\s*//;
$texi_line =~ s/\s*$//;
@@ -3329,7 +3329,7 @@ sub _register_extra_menu_entry_information($$;$)
Texinfo::Convert::NodeNameNormalization::normalize_node($arg);
if ($normalized_menu_entry_name !~ /[^-]/) {
$self->line_warn(sprintf(__("empty menu entry name in `%s'"),
- Texinfo::Convert::Texinfo::convert($current)), $line_nr);
+ Texinfo::Convert::Texinfo::convert_to_texinfo($current)), $line_nr);
}
} elsif ($arg->{'type'} eq 'menu_entry_node') {
_isolate_last_space($self, $arg);
@@ -3599,7 +3599,7 @@ sub _parse_texi($;$)
or ($current->{'parent'}->{'cmdname'} ne 'macro'
and $current->{'parent'}->{'cmdname'} ne 'rmacro'))) {
my $macrobody =
- Texinfo::Convert::Texinfo::convert({ 'contents'
+ Texinfo::Convert::Texinfo::convert_to_texinfo({ 'contents'
=> $current->{'contents'} });
if ($current->{'args'} and $current->{'args'}->[0]) {
my $name = $current->{'args'}->[0]->{'text'};
@@ -4992,7 +4992,7 @@ sub _parse_texi($;$)
$self->line_warn(sprintf(__(
"in \@%s empty cross reference name after expansion
`%s'"),
$closed_command,
- Texinfo::Convert::Texinfo::convert({'contents' =>
$args[1]})),
+
Texinfo::Convert::Texinfo::convert_to_texinfo({'contents' => $args[1]})),
$line_nr);
}
}
@@ -5004,7 +5004,7 @@ sub _parse_texi($;$)
$self->line_warn(sprintf(__(
"in \@%s empty cross reference title after expansion
`%s'"),
$closed_command,
- Texinfo::Convert::Texinfo::convert(
+ Texinfo::Convert::Texinfo::convert_to_texinfo(
{'contents' => $args[2]})),
$line_nr);
}
@@ -5030,7 +5030,7 @@ sub _parse_texi($;$)
$self->line_error(sprintf(
__("%c%s expects `i' or `j' as argument, not `%s'"),
ord('@'), $dotless->{'cmdname'},
- Texinfo::Convert::Texinfo::convert($current)), $line_nr);
+ Texinfo::Convert::Texinfo::convert_to_texinfo($current)),
$line_nr);
}
}
} elsif ($explained_commands{$current->{'parent'}->{'cmdname'}}
diff --git a/tp/Texinfo/Structuring.pm b/tp/Texinfo/Structuring.pm
index 0710dfc..0d3dec5 100644
--- a/tp/Texinfo/Structuring.pm
+++ b/tp/Texinfo/Structuring.pm
@@ -341,7 +341,7 @@ sub _check_node_same_texinfo_code($$)
my $reference_node_texi;
if ($reference_node->{'extra'}->{'node_content'}) {
- $reference_node_texi = Texinfo::Convert::Texinfo::convert (
+ $reference_node_texi = Texinfo::Convert::Texinfo::convert_to_texinfo(
{'contents' => $reference_node->{'extra'}->{'node_content'}});
$reference_node_texi =~ s/\s+/ /g;
} else {
@@ -353,7 +353,7 @@ sub _check_node_same_texinfo_code($$)
my @contents_node = @{$node_extra->{'node_content'}};
pop @contents_node if ($contents_node[-1]->{'type'}
and $contents_node[-1]->{'type'} eq 'space_at_end_menu_node');
- $node_texi = Texinfo::Convert::Texinfo::convert (
+ $node_texi = Texinfo::Convert::Texinfo::convert_to_texinfo(
{'contents' => \@contents_node});
$node_texi =~ s/\s+/ /g;
} else {
@@ -1205,7 +1205,7 @@ sub _print_root_command_texi($)
return "Not a root command";
}
return '@'.$command->{'cmdname'}. ' '
- .Texinfo::Convert::Texinfo::convert ({'contents' => $tree})
+ .Texinfo::Convert::Texinfo::convert_to_texinfo({'contents' => $tree})
if ($tree);
return 'UNDEF @'.$command->{'cmdname'};
}
@@ -1229,7 +1229,7 @@ sub _print_element_command_texi($)
if ($element->{'extra'}->{'node_content'}) {
unshift @{$command->{'contents'}},
@{$element->{'extra'}->{'node_content'}};
}
- return Texinfo::Convert::Texinfo::convert($command);
+ return Texinfo::Convert::Texinfo::convert_to_texinfo($command);
}
my $command = $element->{'extra'}->{'element_command'};
@@ -1610,7 +1610,7 @@ sub do_index_keys($$)
if (defined $entry->{'sortas'}) {
$entry->{'key'} = $entry->{'sortas'};
} else {
- $entry->{'key'} = Texinfo::Convert::Text::convert(
+ $entry->{'key'} = Texinfo::Convert::Text::convert_to_text(
{'contents' => $entry->{'content'}}, $options);
if ($ignore_chars) {
$entry->{'key'} =~ s/[$ignore_chars]//g;
diff --git a/tp/Texinfo/Transformations.pm b/tp/Texinfo/Transformations.pm
index 6e5cdee..b50d951 100644
--- a/tp/Texinfo/Transformations.pm
+++ b/tp/Texinfo/Transformations.pm
@@ -164,7 +164,8 @@ sub _reference_to_arg($$$)
if (defined($current->{'args'}->[$index])) {
# This a double checking that there is some content.
# Not sure that it is useful.
- my $text =
Texinfo::Convert::Text::convert($current->{'args'}->[$index]);
+ my $text = Texinfo::Convert::Text::convert_to_text(
+ $current->{'args'}->[$index]);
if (defined($text) and $text =~ /\S/) {
my $result
= {'contents' => $current->{'args'}->[$index]->{'contents'},
@@ -289,7 +290,8 @@ sub _reassociate_to_node($$$$)
and (!$current->{'extra'}->{'index_entry'}->{'node'}
or $current->{'extra'}->{'index_entry'}->{'node'} ne
$previous_node)) {
print STDERR "Bug: index entry $current (".
- Texinfo::Convert::Texinfo::convert ({'contents' =>
$current->{'extra'}->{'index_entry'}->{'content'}})
+ Texinfo::Convert::Texinfo::convert_to_texinfo(
+ {'contents' => $current->{'extra'}->{'index_entry'}->{'content'}})
.") not in previous node $previous_node\n";
print STDERR " previous node:
"._print_root_command_texi($previous_node)."\n";
if ($current->{'extra'}->{'index_entry'}->{'node'}) {
diff --git a/tp/init/chm.pm b/tp/init/chm.pm
index 978f2d8..e6e236c 100644
--- a/tp/init/chm.pm
+++ b/tp/init/chm.pm
@@ -201,7 +201,7 @@ sub convert_tree ($$;$)
$options = {} if (!defined($options));
return $converter->protect_text(
- Texinfo::Convert::Text::convert($tree,
+ Texinfo::Convert::Text::convert_to_text($tree,
{Texinfo::Common::_convert_text_options($converter),
%$options}));
}
diff --git a/tp/init/highlight_syntax.pm b/tp/init/highlight_syntax.pm
index f3fab03..7bc978b 100644
--- a/tp/init/highlight_syntax.pm
+++ b/tp/init/highlight_syntax.pm
@@ -189,7 +189,7 @@ sub highlight_process($$)
and $tree->{'contents'}->[-1]->{'cmdname'} eq 'end') {
pop @{$tree->{'contents'}};
}
- my $text = Texinfo::Convert::Text::convert($tree, {'code' => 1,
+ my $text = Texinfo::Convert::Text::convert_to_text($tree, {'code' => 1,
Texinfo::Common::_convert_text_options($self)});
# make sure that the text ends with a newline
chomp ($text);
diff --git a/tp/init/latex2html.pm b/tp/init/latex2html.pm
index 848ba06..5abf001 100644
--- a/tp/init/latex2html.pm
+++ b/tp/init/latex2html.pm
@@ -232,7 +232,7 @@ sub l2h_process($$)
pop @{$tree->{'contents'}};
}
}
- my $text = Texinfo::Convert::Texinfo::convert($tree);
+ my $text = Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
#$text .= "\n" if ($command eq 'tex');
l2h_to_latex($self, $command, $text, $counter);
$commands_counters{$root} = $counter;
diff --git a/tp/init/tex4ht.pm b/tp/init/tex4ht.pm
index c535d3f..1840847 100644
--- a/tp/init/tex4ht.pm
+++ b/tp/init/tex4ht.pm
@@ -168,7 +168,7 @@ sub tex4ht_prepare($$)
pop @{$tree->{'contents'}};
}
}
- my $text = Texinfo::Convert::Texinfo::convert($tree);
+ my $text = Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
$commands{$command}->{'commands'}->[$counter-1] = $root;
# write to tex file
diff --git a/tp/t/01use.t b/tp/t/01use.t
index 0fb40ea..4d2664b 100644
--- a/tp/t/01use.t
+++ b/tp/t/01use.t
@@ -129,6 +129,6 @@ title@verb{: in verb } :}@@.
@end multitable
';
-is (Texinfo::Convert::Texinfo::convert($manual_tree),
+is (Texinfo::Convert::Texinfo::convert_to_texinfo($manual_tree),
$manual_tree_result, "tree_to_texi on a manually written tree");
diff --git a/tp/t/accents.t b/tp/t/accents.t
index 80fe140..2e91f91 100644
--- a/tp/t/accents.t
+++ b/tp/t/accents.t
@@ -26,7 +26,7 @@ sub test_accent_stack ($)
my $tree = $text_root->{'contents'}->[0]->{'contents'}->[0];
my ($contents, $commands_stack) =
Texinfo::Common::find_innermost_accent_contents($tree);
- my $text = Texinfo::Convert::Text::convert({'contents' => $contents});
+ my $text = Texinfo::Convert::Text::convert_to_text({'contents' =>
$contents});
my @stack = map {$_->{'cmdname'}} @$commands_stack;
if (defined($reference)) {
ok ($reference eq join('|',($text, @stack)), 'innermost '.$name);
@@ -76,7 +76,7 @@ sub test_enable_encoding ($)
my ($contents, $commands_stack) =
Texinfo::Common::find_innermost_accent_contents($tree);
- my $text = Texinfo::Convert::Text::convert({'contents' => $contents});
+ my $text = Texinfo::Convert::Text::convert_to_text({'contents' =>
$contents});
my $result =
Texinfo::Convert::Unicode::eight_bit_accents(undef, $text,
$commands_stack,
@@ -92,7 +92,7 @@ sub test_enable_encoding ($)
($contents, $commands_stack) =
Texinfo::Common::find_innermost_accent_contents($tree);
- $text = Texinfo::Convert::Text::convert({'contents' => $contents},
+ $text = Texinfo::Convert::Text::convert_to_text({'contents' => $contents},
{'enabled_encoding' => 'utf-8'});
my $result_unicode = Texinfo::Convert::Unicode::unicode_accents(undef,
$text,
$commands_stack,
\&Texinfo::Convert::Text::ascii_accent_fallback);
@@ -172,14 +172,14 @@ foreach my $test (
#my $aa = Texinfo::Parser::parse_texi_line(undef, '@aa{}');
my $res_e = Texinfo::Parser::parse_texi_line(undef, '@^e');
-my $result = Texinfo::Convert::Text::convert($res_e, {'enabled_encoding' =>
'utf-8'});
+my $result = Texinfo::Convert::Text::convert_to_text($res_e,
{'enabled_encoding' => 'utf-8'});
is ($result, "\x{00EA}", 'enable encoding @^e');
my $res_aa = Texinfo::Parser::parse_texi_line(undef, '@aa{}');
-$result = Texinfo::Convert::Text::convert($res_aa, {'enabled_encoding' =>
'utf-8'});
+$result = Texinfo::Convert::Text::convert_to_text($res_aa, {'enabled_encoding'
=> 'utf-8'});
is ($result, "\x{00E5}", 'enable encoding @aa{}');
-$result = Texinfo::Convert::Text::convert($res_aa, {'enabled_encoding' =>
'iso-8859-1'});
+$result = Texinfo::Convert::Text::convert_to_text($res_aa, {'enabled_encoding'
=> 'iso-8859-1'});
is ($result, "\x{00E5}", 'enable encoding latin1 @aa{}');
#print STDERR "$result\n";
#print STDERR "`$result'\n".ord($result)."\n".sprintf("%x\n",ord($result));
diff --git a/tp/t/automatic_menus.t b/tp/t/automatic_menus.t
index aeacb36..bc72656 100644
--- a/tp/t/automatic_menus.t
+++ b/tp/t/automatic_menus.t
@@ -32,7 +32,7 @@ sub test($$$;$)
} else {
$parser->Texinfo::Transformations::complete_tree_nodes_menus($tree);
}
- my $texi_result = Texinfo::Convert::Texinfo::convert($tree);
+ my $texi_result = Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
if (!defined($out)) {
print STDERR " --> $name:\n$texi_result";
diff --git a/tp/t/automatic_nodes.t b/tp/t/automatic_nodes.t
index 7e0e149..b22c6ff 100644
--- a/tp/t/automatic_nodes.t
+++ b/tp/t/automatic_nodes.t
@@ -29,7 +29,7 @@ sub test_new_node($$$$)
my ($texi_result, $normalized);
if (defined($node)) {
- $texi_result = Texinfo::Convert::Texinfo::convert($node);
+ $texi_result = Texinfo::Convert::Texinfo::convert_to_texinfo($node);
Texinfo::Structuring::associate_internal_references($parser);
$normalized = $node->{'extra'}->{'normalized'};
my $labels = $parser->labels_information();
@@ -70,8 +70,8 @@ my $line_tree = Texinfo::Parser::parse_texi_line (undef, 'a
node');
Texinfo::Structuring::associate_internal_references($parser);
my $node = Texinfo::Transformations::_new_node($parser, $line_tree);
is ('@node a node 1
-', Texinfo::Convert::Texinfo::convert($node), 'duplicate node added');
-#print STDERR Texinfo::Convert::Texinfo::convert($node);
+', Texinfo::Convert::Texinfo::convert_to_texinfo($node), 'duplicate node
added');
+#print STDERR Texinfo::Convert::Texinfo::convert_to_texinfo($node);
my $sections_text =
'@top top section
@@ -141,7 +141,7 @@ Text.
Texinfo::Structuring::associate_internal_references($parser);
my ($new_content, $added_nodes) =
Texinfo::Transformations::insert_nodes_for_sectioning_commands($parser, $tree);
$tree->{'contents'} = $new_content;
- my $result = Texinfo::Convert::Texinfo::convert($tree);
+ my $result = Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
is ($reference, $result, 'add nodes');
#print STDERR "$result";
@@ -166,7 +166,7 @@ my $labels = $parser->labels_information();
ok (($labels->{'chap'}->{'menus'} and @{$labels->{'chap'}->{'menus'}}
and scalar(@{$labels->{'chap'}->{'menus'}}) == 1
and !exists($labels->{'Top'}->{'menus'})), 'new node has a menu');
-is (Texinfo::Convert::Texinfo::convert($labels->{'chap'}->{'menus'}->[0]),
+is
(Texinfo::Convert::Texinfo::convert_to_texinfo($labels->{'chap'}->{'menus'}->[0]),
'@menu
* (some_manual)::
@end menu
@@ -174,7 +174,7 @@ is
(Texinfo::Convert::Texinfo::convert($labels->{'chap'}->{'menus'}->[0]),
#print STDERR join('|', keys(%{$index_names->{'cp'}->{'index_entries'}}))."\n";
is ($labels->{'chap'}, $index_names->{'cp'}->{'index_entries'}->[0]->{'node'},
'index entry reassociated');
-#print STDERR Texinfo::Convert::Texinfo::convert($tree);
+#print STDERR Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
# Note: this test doesn't pass anymore because we only notice duplicate
# nodes at the end.
diff --git a/tp/t/do_master_menu.t b/tp/t/do_master_menu.t
index 5b08418..ab36876 100644
--- a/tp/t/do_master_menu.t
+++ b/tp/t/do_master_menu.t
@@ -125,7 +125,7 @@ my $parser = Texinfo::Parser::parser();
my $tree = $parser->parse_texi_text($in_detailmenu);
Texinfo::Structuring::associate_internal_references($parser);
my $master_menu = Texinfo::Transformations::new_master_menu($parser);
-my $out = Texinfo::Convert::Texinfo::convert($master_menu);
+my $out = Texinfo::Convert::Texinfo::convert_to_texinfo($master_menu);
my $reference = '@detailmenu
--- The Detailed Node Listing ---
@@ -165,14 +165,14 @@ $parser = Texinfo::Parser::parser();
$tree = $parser->parse_texi_text($no_detailmenu);
Texinfo::Structuring::associate_internal_references($parser);
$master_menu = Texinfo::Transformations::new_master_menu($parser);
-$out = Texinfo::Convert::Texinfo::convert($master_menu);
+$out = Texinfo::Convert::Texinfo::convert_to_texinfo($master_menu);
is ($out, $reference, 'master menu no detailmenu');
$parser = Texinfo::Parser::parser();
$tree = $parser->parse_texi_text($in_detailmenu);
Texinfo::Structuring::associate_internal_references($parser);
Texinfo::Transformations::regenerate_master_menu($parser);
-$out = Texinfo::Convert::Texinfo::convert($tree);
+$out = Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
is ($out, _get_in($reference), 'regenerate with existing detailmenu');
#print STDERR "$out";
@@ -182,7 +182,7 @@ $parser = Texinfo::Parser::parser();
$tree = $parser->parse_texi_text($no_detailmenu);
Texinfo::Structuring::associate_internal_references($parser);
Texinfo::Transformations::regenerate_master_menu($parser);
-$out = Texinfo::Convert::Texinfo::convert($tree);
+$out = Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
is ($out, _get_in('',"\n".$reference), 'regenerate with no detailmenu');
diff --git a/tp/t/index_before_item.t b/tp/t/index_before_item.t
index d0a5383..a567e49 100644
--- a/tp/t/index_before_item.t
+++ b/tp/t/index_before_item.t
@@ -25,7 +25,7 @@ sub run_test($$$)
#print STDERR DebugTexinfo::DebugTree::convert(undef, $tree)."\n";
my $corrected_tree = move_index_entries_after_items_in_tree($tree);
- my $texi_result = Texinfo::Convert::Texinfo::convert($corrected_tree);
+ my $texi_result =
Texinfo::Convert::Texinfo::convert_to_texinfo($corrected_tree);
if (!defined($out)) {
print STDERR " --> $name:\n$texi_result";
diff --git a/tp/t/init/redefine_need.init b/tp/t/init/redefine_need.init
index 657d28c..12e351f 100644
--- a/tp/t/init/redefine_need.init
+++ b/tp/t/init/redefine_need.init
@@ -18,7 +18,7 @@ sub my_need_formatting($$$)
}
my $arg_text;
if ($command->{'args'} and $command->{'args'}->[0]) {
- $arg_text = Texinfo::Convert::Text::convert($command->{'args'}->[0]);
+ $arg_text =
Texinfo::Convert::Text::convert_to_text($command->{'args'}->[0]);
} else {
$arg_text = '';
}
diff --git a/tp/t/nodenormalization.t b/tp/t/nodenormalization.t
index 12122dc..a7c0e6a 100644
--- a/tp/t/nodenormalization.t
+++ b/tp/t/nodenormalization.t
@@ -136,7 +136,7 @@ in float
';
my $manual_tree = $parser->parse_texi_text($texinfo_manual);
-my $check_texinfo = Texinfo::Convert::Texinfo::convert($manual_tree);
+my $check_texinfo =
Texinfo::Convert::Texinfo::convert_to_texinfo($manual_tree);
is ($texinfo_manual, $check_texinfo, 'check manual parsing');
#print STDERR Data::Dumper->Dump([$manual_tree]);
diff --git a/tp/t/protect_character_in_texinfo.t
b/tp/t/protect_character_in_texinfo.t
index 87192ca..05804dd 100644
--- a/tp/t/protect_character_in_texinfo.t
+++ b/tp/t/protect_character_in_texinfo.t
@@ -32,7 +32,7 @@ sub run_test($$$$)
$tree = protect_node_after_label_in_tree($tree);
}
- my $texi_result = Texinfo::Convert::Texinfo::convert($tree);
+ my $texi_result = Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
if (!defined($out)) {
print STDERR " --> $name:\n$texi_result";
diff --git a/tp/t/reference_to_text_in_tree.t b/tp/t/reference_to_text_in_tree.t
index 1ee9574..e965217 100644
--- a/tp/t/reference_to_text_in_tree.t
+++ b/tp/t/reference_to_text_in_tree.t
@@ -24,7 +24,7 @@ sub run_test($$$)
my $corrected_tree
= Texinfo::Transformations::reference_to_arg_in_tree($parser, $tree);
- my $texi_result = Texinfo::Convert::Texinfo::convert($corrected_tree);
+ my $texi_result =
Texinfo::Convert::Texinfo::convert_to_texinfo($corrected_tree);
if (!defined($out)) {
print STDERR " --> $name:\n$texi_result";
diff --git a/tp/t/test_fill_gaps_in_sectioning.t
b/tp/t/test_fill_gaps_in_sectioning.t
index 096fa38..2bdb1f0 100644
--- a/tp/t/test_fill_gaps_in_sectioning.t
+++ b/tp/t/test_fill_gaps_in_sectioning.t
@@ -53,7 +53,7 @@ sub test_correction($$$)
#print STDERR Data::Dumper->Dump([$tree]);
#print STDERR Data::Dumper->Dump([$corrected_content]);
}
- my $texi_result = Texinfo::Convert::Texinfo::convert({'contents' =>
$corrected_content});
+ my $texi_result = Texinfo::Convert::Texinfo::convert_to_texinfo({'contents'
=> $corrected_content});
if (!defined($out)) {
print STDERR " --> $name:\n$texi_result";
} else {
diff --git a/tp/t/test_protect_hashchar_at_line_beginning.t
b/tp/t/test_protect_hashchar_at_line_beginning.t
index 5961511..2131a86 100644
--- a/tp/t/test_protect_hashchar_at_line_beginning.t
+++ b/tp/t/test_protect_hashchar_at_line_beginning.t
@@ -45,7 +45,7 @@ sub run_test($$$;$)
}
}
- my $texi_result = Texinfo::Convert::Texinfo::convert($corrected_tree);
+ my $texi_result =
Texinfo::Convert::Texinfo::convert_to_texinfo($corrected_tree);
if (!defined($out)) {
print STDERR " --> $name:\n$texi_result";
diff --git a/tp/t/test_sort.t b/tp/t/test_sort.t
index ea64e92..5a49e2b 100644
--- a/tp/t/test_sort.t
+++ b/tp/t/test_sort.t
@@ -14,15 +14,15 @@ use Test::Deep;
ok(1, "modules loading");
my $tree = Texinfo::Parser::parse_texi_line(undef, '@copyright{}
@quotedblbase{}');
-my $result = Texinfo::Convert::Text::convert($tree, {'sort_string' => 1});
+my $result = Texinfo::Convert::Text::convert_to_text($tree, {'sort_string' =>
1});
is ($result, 'C ,,', 'sort no encoding');
-$result = Texinfo::Convert::Text::convert($tree, {'sort_string' => 1,
+$result = Texinfo::Convert::Text::convert_to_text($tree, {'sort_string' => 1,
'enabled_encoding' => 'utf-8'});
is ($result, "\x{00A9} \x{201E}", 'sort utf-8');
-$result = Texinfo::Convert::Text::convert($tree, {'sort_string' => 1,
+$result = Texinfo::Convert::Text::convert_to_text($tree, {'sort_string' => 1,
'enabled_encoding' => 'iso-8859-1'});
is ($result, "\x{00A9} ,,", 'sort iso-8859-1');
diff --git a/tp/t/test_tree_copy.t b/tp/t/test_tree_copy.t
index 49dd8a3..f49d670 100644
--- a/tp/t/test_tree_copy.t
+++ b/tp/t/test_tree_copy.t
@@ -77,11 +77,11 @@ my $tree = Texinfo::Parser::parse_texi_text(undef, $text);
my $reference_associations = {};
my $copy = Texinfo::Common::copy_tree($tree, undef);
-# my $texi_tree = Texinfo::Convert::Texinfo::convert($tree);
+# my $texi_tree = Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
#
# is ($text, $texi_tree, "tree to texi and original match");
#
-# my $texi_copy = Texinfo::Convert::Texinfo::convert($copy);
+# my $texi_copy = Texinfo::Convert::Texinfo::convert_to_texinfo($copy);
# is ($texi_copy, $texi_tree, "tree and copy to texi match");
#{
diff --git a/tp/t/test_utils.pl b/tp/t/test_utils.pl
index 0c6fd68..14545eb 100644
--- a/tp/t/test_utils.pl
+++ b/tp/t/test_utils.pl
@@ -863,7 +863,7 @@ sub test($$)
$parser->Texinfo::Transformations::set_menus_to_simple_menu();
}
- my $converted_text = Texinfo::Convert::Text::convert($result, {'TEST' => 1});
+ my $converted_text = Texinfo::Convert::Text::convert_to_text($result,
{'TEST' => 1});
my %converted;
my %converted_errors;
@@ -1017,7 +1017,7 @@ sub test($$)
local $Data::Dumper::Sortkeys = \&filter_tree_keys;
$out_result = Data::Dumper->Dump([$split_result],
['$result_trees{\''.$test_name.'\'}']);
}
- my $texi_string_result = Texinfo::Convert::Texinfo::convert($result);
+ my $texi_string_result =
Texinfo::Convert::Texinfo::convert_to_texinfo($result);
$out_result .= "\n".'$result_texis{\''.$test_name.'\'} = \''
.protect_perl_string($texi_string_result)."';\n\n";
$out_result .= "\n".'$result_texts{\''.$test_name.'\'} = \''
@@ -1070,7 +1070,7 @@ sub test($$)
print OUT $out_result;
close (OUT);
- print STDERR "-->
$test_name\n".Texinfo::Convert::Texinfo::convert($result)."\n"
+ print STDERR "-->
$test_name\n".Texinfo::Convert::Texinfo::convert_to_texinfo($result)."\n"
if ($self->{'generate'});
}
if (!$self->{'generate'}) {
@@ -1090,7 +1090,7 @@ sub test($$)
$test_name.' errors');
ok (Data::Compare::Compare($indices, $result_indices{$test_name}),
$test_name.' indices');
- ok (Texinfo::Convert::Texinfo::convert($result) eq
$result_texis{$test_name},
+ ok (Texinfo::Convert::Texinfo::convert_to_texinfo($result) eq
$result_texis{$test_name},
$test_name.' texi');
if ($todos{'text'}) {
SKIP: {
diff --git a/tp/texi2any.pl b/tp/texi2any.pl
index f7117d5..ad1d605 100755
--- a/tp/texi2any.pl
+++ b/tp/texi2any.pl
@@ -1236,7 +1236,7 @@ while(@input_files) {
if (defined(get_conf('MACRO_EXPAND')) and $file_number == 0) {
require Texinfo::Convert::Texinfo;
- my $texinfo_text = Texinfo::Convert::Texinfo::convert($tree);
+ my $texinfo_text = Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
#print STDERR "$texinfo_text\n";
my $macro_expand_file = get_conf('MACRO_EXPAND');
my $macro_expand_fh = Texinfo::Common::open_out($parser,
$macro_expand_file);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/Common.pm (find_innermost_accent_contents) (float_name_caption, labels_information), tp/Texinfo/Convert/Converter.pm (sort_element_counts), tp/Texinfo/Convert/DocBook.pm (_convert), tp/Texinfo/Convert/HTML.pm (_convert_def_line_type) (_prepare_footnotes, _external_node_href) (output_internal_links, output, _convert), tp/Texinfo/Convert/IXIN.pm (output_ixin), tp/Texinfo/Convert/Info.pm (output, _image), tp/Texinfo/Convert/LaTeX.pm (_convert), tp/Texinfo/Convert/PlainTexinfo.pm [...],
Patrice Dumas <=