[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/Convert/Converter.pm, tp/Texinfo/Con
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/Convert/Converter.pm, tp/Texinfo/Convert/DocBook.pm, tp/Texinfo/Convert/HTML.pm, tp/Texinfo/Convert/IXIN.pm, tp/Texinfo/Convert/IXINSXML.pm, tp/Texinfo/Convert/Info.pm, tp/Texinfo/Convert/LaTeX.pm, tp/Texinfo/Convert/PlainTexinfo.pm, tp/Texinfo/Convert/NodeNameNormalization.pm, tp/Texinfo/Convert/Plaintext.pm, tp/Texinfo/Convert/Texinfo.pm, tp/Texinfo/Convert/TexinfoSXML.pm, tp/Texinfo/Convert/TexinfoXML.pm, tp/Texinfo/Convert/Text.pm, tp/Texinfo/Convert/TextContent.pm, tp/Tex [...] |
Date: |
Sat, 04 Sep 2021 10:54:30 -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 ca113a3 * tp/Texinfo/Convert/Converter.pm,
tp/Texinfo/Convert/DocBook.pm, tp/Texinfo/Convert/HTML.pm,
tp/Texinfo/Convert/IXIN.pm, tp/Texinfo/Convert/IXINSXML.pm,
tp/Texinfo/Convert/Info.pm, tp/Texinfo/Convert/LaTeX.pm,
tp/Texinfo/Convert/PlainTexinfo.pm,
tp/Texinfo/Convert/NodeNameNormalization.pm, tp/Texinfo/Convert/Plaintext.pm,
tp/Texinfo/Convert/Texinfo.pm, tp/Texinfo/Convert/TexinfoSXML.pm,
tp/Texinfo/Convert/TexinfoXML.pm, tp/Texinfo/Convert/Text.pm,
tp/Texinfo/Convert/Tex [...]
ca113a3 is described below
commit ca113a32111aca3fbb647003dc8ad2a295ea82e7
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Sep 4 16:54:21 2021 +0200
* tp/Texinfo/Convert/Converter.pm, tp/Texinfo/Convert/DocBook.pm,
tp/Texinfo/Convert/HTML.pm, tp/Texinfo/Convert/IXIN.pm,
tp/Texinfo/Convert/IXINSXML.pm, tp/Texinfo/Convert/Info.pm,
tp/Texinfo/Convert/LaTeX.pm, tp/Texinfo/Convert/PlainTexinfo.pm,
tp/Texinfo/Convert/NodeNameNormalization.pm,
tp/Texinfo/Convert/Plaintext.pm, tp/Texinfo/Convert/Texinfo.pm,
tp/Texinfo/Convert/TexinfoSXML.pm, tp/Texinfo/Convert/TexinfoXML.pm,
tp/Texinfo/Convert/Text.pm, tp/Texinfo/Convert/TextContent.pm,
tp/Texinfo/Convert/Unicode.pm, tp/Texinfo/Convert/Utils.pm,
tp/Texinfo/Encoding.pm, tp/Texinfo/ParserNonXS.pm,
tp/Texinfo/Report.pm, tp/Texinfo/Structuring.pm,
tp/Texinfo/Transformations.pm, tp/Texinfo/Translations.pm,
tp/Texinfo/XS/parsetexi/Parsetexi.pm: do not export symbols that
are always called as methods on an object. Add $VERSION to
modules lacking one. Other minor fixes related to exporting
and using modules.
Rename Texinfo::Convert::Unicode unicode_accents() as
_format_unicode_accents_stack() and eight_bit_accents() as
_format_eight_bit_accents_stack().
Export protect_hashchar_at_line_beginning() in
Texinfo::Transformations.
* tp/Texinfo/Common.pm (modify_tree), tp/Texinfo/Transformations.pm,
Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm,
Pod-Simple-Texinfo/pod2texi.pl, tp/texi2any.pl:
remove the first argument of Texinfo::Common::modify_tree(),
also in all the functions called by modify_tree and calling
modify_tree.
---
ChangeLog | 31 ++++++++++
Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm | 2 +-
Pod-Simple-Texinfo/pod2texi.pl | 4 +-
tp/TODO | 3 +
tp/Texinfo/Common.pm | 37 ++++++------
tp/Texinfo/Convert/Converter.pm | 6 +-
tp/Texinfo/Convert/DocBook.pm | 16 +-----
tp/Texinfo/Convert/HTML.pm | 17 +-----
tp/Texinfo/Convert/IXIN.pm | 15 +----
tp/Texinfo/Convert/IXINSXML.pm | 15 +----
tp/Texinfo/Convert/Info.pm | 13 +----
tp/Texinfo/Convert/LaTeX.pm | 14 +----
tp/Texinfo/Convert/NodeNameNormalization.pm | 6 +-
tp/Texinfo/Convert/PlainTexinfo.pm | 4 ++
tp/Texinfo/Convert/Plaintext.pm | 14 +----
tp/Texinfo/Convert/Texinfo.pm | 6 +-
tp/Texinfo/Convert/TexinfoSXML.pm | 23 ++------
tp/Texinfo/Convert/TexinfoXML.pm | 17 +-----
tp/Texinfo/Convert/Text.pm | 6 +-
tp/Texinfo/Convert/TextContent.pm | 3 +
tp/Texinfo/Convert/Unicode.pm | 24 ++++----
tp/Texinfo/Convert/Utils.pm | 2 +-
tp/Texinfo/Encoding.pm | 17 +-----
tp/Texinfo/ParserNonXS.pm | 13 +----
tp/Texinfo/Report.pm | 13 -----
tp/Texinfo/Structuring.pm | 5 +-
tp/Texinfo/Transformations.pm | 66 ++++++++++-----------
tp/Texinfo/Translations.pm | 85 ++++++++++++----------------
tp/Texinfo/XS/parsetexi/Parsetexi.pm | 3 -
tp/t/accents.t | 10 ++--
tp/t/automatic_nodes.t | 24 ++++----
tp/t/reference_to_text_in_tree.t | 2 +-
tp/t/test_utils.pl | 12 ++--
tp/texi2any.pl | 4 +-
34 files changed, 209 insertions(+), 323 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 2d87a35..966ef4c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,36 @@
2021-09-04 Patrice Dumas <pertusus@free.fr>
+ * tp/Texinfo/Convert/Converter.pm, tp/Texinfo/Convert/DocBook.pm,
+ tp/Texinfo/Convert/HTML.pm, tp/Texinfo/Convert/IXIN.pm,
+ tp/Texinfo/Convert/IXINSXML.pm, tp/Texinfo/Convert/Info.pm,
+ tp/Texinfo/Convert/LaTeX.pm, tp/Texinfo/Convert/PlainTexinfo.pm,
+ tp/Texinfo/Convert/NodeNameNormalization.pm,
+ tp/Texinfo/Convert/Plaintext.pm, tp/Texinfo/Convert/Texinfo.pm,
+ tp/Texinfo/Convert/TexinfoSXML.pm, tp/Texinfo/Convert/TexinfoXML.pm,
+ tp/Texinfo/Convert/Text.pm, tp/Texinfo/Convert/TextContent.pm,
+ tp/Texinfo/Convert/Unicode.pm, tp/Texinfo/Convert/Utils.pm,
+ tp/Texinfo/Encoding.pm, tp/Texinfo/ParserNonXS.pm,
+ tp/Texinfo/Report.pm, tp/Texinfo/Structuring.pm,
+ tp/Texinfo/Transformations.pm, tp/Texinfo/Translations.pm,
+ tp/Texinfo/XS/parsetexi/Parsetexi.pm: do not export symbols that
+ are always called as methods on an object. Add $VERSION to
+ modules lacking one. Other minor fixes related to exporting
+ and using modules.
+ Rename Texinfo::Convert::Unicode unicode_accents() as
+ _format_unicode_accents_stack() and eight_bit_accents() as
+ _format_eight_bit_accents_stack().
+ Export protect_hashchar_at_line_beginning() in
+ Texinfo::Transformations.
+
+ * tp/Texinfo/Common.pm (modify_tree), tp/Texinfo/Transformations.pm,
+ Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm,
+ Pod-Simple-Texinfo/pod2texi.pl, tp/texi2any.pl:
+ remove the first argument of Texinfo::Common::modify_tree(),
+ also in all the functions called by modify_tree and calling
+ modify_tree.
+
+2021-09-04 Patrice Dumas <pertusus@free.fr>
+
* tp/Texinfo/Common.pm,
tp/Texinfo/Convert/Converter.pm (float_name_caption),
tp/Texinfo/Convert/Utils.pm (@MONTH_NAMES, expand_verbatiminclude)
diff --git a/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm
b/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm
index 233ac84..ef81ac7 100644
--- a/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm
+++ b/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm
@@ -292,7 +292,7 @@ sub _reference_to_text_in_texi($)
{
my $texinfo = shift;
my $tree = parse_texi_text(undef, $texinfo);
- Texinfo::Transformations::reference_to_arg_in_tree(undef, $tree);
+ Texinfo::Transformations::reference_to_arg_in_tree($tree);
return Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
}
diff --git a/Pod-Simple-Texinfo/pod2texi.pl b/Pod-Simple-Texinfo/pod2texi.pl
index 440adf5..899cfa4 100755
--- a/Pod-Simple-Texinfo/pod2texi.pl
+++ b/Pod-Simple-Texinfo/pod2texi.pl
@@ -250,8 +250,8 @@ sub _fix_texinfo_tree($$$$;$)
# new nodes should only be created for the $added_sections.
if ($section_nodes) {
($tree->{'contents'}, $added_nodes)
- =
Texinfo::Transformations::insert_nodes_for_sectioning_commands($parser,
- $tree, $nodes_list, $targets_list, $labels);
+ = Texinfo::Transformations::insert_nodes_for_sectioning_commands($tree,
+ $nodes_list, $targets_list, $labels);
if ($self and $self->texinfo_sectioning_base_level > 0) {
# prepend the manual name
foreach my $node (@$added_nodes) {
diff --git a/tp/TODO b/tp/TODO
index 1f8c343..331d2d5 100644
--- a/tp/TODO
+++ b/tp/TODO
@@ -31,6 +31,9 @@ Texinfo/Convert/DocBook.pm
use Texinfo::Convert::Plaintext;
# FIXME use _image_text
+not internal (maybe move?)
+Texinfo::Common::_convert_text_options
+
Bugs
====
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index 7ad70df..1012a92 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -1917,10 +1917,9 @@ sub copy_tree($;$)
return $copy;
}
-sub modify_tree($$$;$);
-sub modify_tree($$$;$)
+sub modify_tree($$;$);
+sub modify_tree($$;$)
{
- my $self = shift;
my $tree = shift;
my $operation = shift;
my $argument = shift;
@@ -1929,8 +1928,8 @@ sub modify_tree($$$;$)
if ($tree->{'args'}) {
my @args = @{$tree->{'args'}};
for (my $i = 0; $i <= $#args; $i++) {
- my @new_args = &$operation($self, 'arg', $args[$i], $argument);
- modify_tree($self, $args[$i], $operation, $argument);
+ my @new_args = &$operation('arg', $args[$i], $argument);
+ modify_tree($args[$i], $operation, $argument);
# this puts the new args at the place of the old arg using the
# offset from the end of the array
splice (@{$tree->{'args'}}, $i - $#args -1, 1, @new_args);
@@ -1939,8 +1938,8 @@ sub modify_tree($$$;$)
if ($tree->{'contents'}) {
my @contents = @{$tree->{'contents'}};
for (my $i = 0; $i <= $#contents; $i++) {
- my @new_contents = &$operation($self, 'content', $contents[$i],
$argument);
- modify_tree($self, $contents[$i], $operation, $argument);
+ my @new_contents = &$operation('content', $contents[$i], $argument);
+ modify_tree($contents[$i], $operation, $argument);
# this puts the new contents at the place of the old content using the
# offset from the end of the array
splice (@{$tree->{'contents'}}, $i - $#contents -1, 1, @new_contents);
@@ -1949,9 +1948,8 @@ sub modify_tree($$$;$)
return $tree;
}
-sub _protect_comma($$$)
+sub _protect_comma($$)
{
- my $self = shift;
my $type = shift;
my $current = shift;
@@ -1961,7 +1959,7 @@ sub _protect_comma($$$)
sub protect_comma_in_tree($)
{
my $tree = shift;
- return modify_tree(undef, $tree, \&_protect_comma);
+ return modify_tree($tree, \&_protect_comma);
}
sub _new_asis_command_with_text($$;$)
@@ -2022,9 +2020,8 @@ sub _protect_text($$)
}
}
-sub _protect_colon($$$)
+sub _protect_colon($$)
{
- my $self = shift;
my $type = shift;
my $current = shift;
@@ -2034,12 +2031,11 @@ sub _protect_colon($$$)
sub protect_colon_in_tree($)
{
my $tree = shift;
- return modify_tree(undef, $tree, \&_protect_colon);
+ return modify_tree($tree, \&_protect_colon);
}
-sub _protect_node_after_label($$$)
+sub _protect_node_after_label($$)
{
- my $self = shift;
my $type = shift;
my $current = shift;
@@ -2049,7 +2045,7 @@ sub _protect_node_after_label($$$)
sub protect_node_after_label_in_tree($)
{
my $tree = shift;
- return modify_tree(undef, $tree, \&_protect_node_after_label);
+ return modify_tree($tree, \&_protect_node_after_label);
}
sub protect_first_parenthesis($)
@@ -2253,9 +2249,8 @@ sub move_index_entries_after_items($) {
}
}
-sub _move_index_entries_after_items($$$)
+sub _move_index_entries_after_items($$)
{
- my $self = shift;
my $type = shift;
my $current = shift;
@@ -2269,7 +2264,7 @@ sub _move_index_entries_after_items($$$)
sub move_index_entries_after_items_in_tree($)
{
my $tree = shift;
- return modify_tree(undef, $tree, \&_move_index_entries_after_items);
+ return modify_tree($tree, \&_move_index_entries_after_items);
}
sub _relate_index_entry_to_table_entry($)
@@ -2313,7 +2308,7 @@ sub _relate_index_entry_to_table_entry($)
sub _relate_index_entries_to_table_entries_in_tree($$$)
{
- my ($self, $type, $current) = @_;
+ my ($type, $current) = @_;
if ($current->{'type'} and ($current->{'type'} eq 'table_entry')) {
_relate_index_entry_to_table_entry($current);
@@ -2324,7 +2319,7 @@ sub _relate_index_entries_to_table_entries_in_tree($$$)
sub relate_index_entries_to_table_entries_in_tree($)
{
my $tree = shift;
- return modify_tree(undef, $tree,
+ return modify_tree($tree,
\&_relate_index_entries_to_table_entries_in_tree);
}
diff --git a/tp/Texinfo/Convert/Converter.pm b/tp/Texinfo/Convert/Converter.pm
index ea17c20..0519fd3 100644
--- a/tp/Texinfo/Convert/Converter.pm
+++ b/tp/Texinfo/Convert/Converter.pm
@@ -42,7 +42,7 @@ use Texinfo::Structuring;
use Carp qw(cluck);
require Exporter;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+use vars qw($VERSION @ISA @EXPORT_OK %EXPORT_TAGS);
@ISA = qw(Exporter Texinfo::Report Texinfo::Translations);
%EXPORT_TAGS = ( 'all' => [ qw(
@@ -54,11 +54,9 @@ xml_accents
@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
-@EXPORT = qw(
-);
-
$VERSION = '6.8dev';
+
my %defaults = (
'documentlanguage' => undef,
);
diff --git a/tp/Texinfo/Convert/DocBook.pm b/tp/Texinfo/Convert/DocBook.pm
index d00eaf6..216722f 100644
--- a/tp/Texinfo/Convert/DocBook.pm
+++ b/tp/Texinfo/Convert/DocBook.pm
@@ -36,22 +36,12 @@ use Data::Dumper;
use Carp qw(cluck);
require Exporter;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
-@ISA = qw(Exporter Texinfo::Convert::Converter);
-
-%EXPORT_TAGS = ( 'all' => [ qw(
- convert
- convert_tree
- output
-) ] );
-
-@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
-
-@EXPORT = qw(
-);
+use vars qw($VERSION @ISA);
+@ISA = qw(Texinfo::Convert::Converter);
$VERSION = '6.8dev';
+
my $nbsp = '&#'.hex('00A0').';';
my $mdash = '&#'.hex('2014').';';
my $ndash = '&#'.hex('2013').';';
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 54d6e7e..37b7244 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -72,23 +72,12 @@ use Carp qw(cluck confess);
use File::Copy qw(copy);
require Exporter;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
-@ISA = qw(Exporter Texinfo::Convert::Converter);
-
-%EXPORT_TAGS = ( 'all' => [ qw(
- convert
- convert_tree
- output
- output_internal_links
-) ] );
-
-@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
-
-@EXPORT = qw(
-);
+use vars qw($VERSION @ISA);
+@ISA = qw(Texinfo::Convert::Converter);
$VERSION = '6.8dev';
+
# misc commands that are of use for formatting.
my %formatting_misc_commands =
%Texinfo::Convert::Text::formatting_misc_commands;
my %no_brace_commands = %Texinfo::Common::no_brace_commands;
diff --git a/tp/Texinfo/Convert/IXIN.pm b/tp/Texinfo/Convert/IXIN.pm
index 1a5a25f..9dbe131 100644
--- a/tp/Texinfo/Convert/IXIN.pm
+++ b/tp/Texinfo/Convert/IXIN.pm
@@ -34,21 +34,12 @@ use Texinfo::Common;
use Carp qw(cluck);
-require Exporter;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
-@ISA = qw(Exporter Texinfo::Convert::Converter);
-
-%EXPORT_TAGS = ( 'all' => [ qw(
- output_ixin
-) ] );
-
-@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
-
-@EXPORT = qw(
-);
+use vars qw($VERSION @ISA);
+@ISA = qw(Texinfo::Convert::Converter);
$VERSION = '6.8dev';
+
my $ixin_version = 1;
sub _ixin_version($)
diff --git a/tp/Texinfo/Convert/IXINSXML.pm b/tp/Texinfo/Convert/IXINSXML.pm
index a518df0..a18ea49 100644
--- a/tp/Texinfo/Convert/IXINSXML.pm
+++ b/tp/Texinfo/Convert/IXINSXML.pm
@@ -33,21 +33,12 @@ use Texinfo::Convert::IXIN;
use Carp qw(cluck);
-require Exporter;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
-@ISA = qw(Exporter Texinfo::Convert::TexinfoSXML Texinfo::Convert::IXIN);
-
-%EXPORT_TAGS = ( 'all' => [ qw(
- output
-) ] );
-
-@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
-
-@EXPORT = qw(
-);
+use vars qw($VERSION @ISA);
+@ISA = qw(Texinfo::Convert::TexinfoSXML Texinfo::Convert::IXIN);
$VERSION = '6.8dev';
+
my %defaults = (
'ENABLE_ENCODING' => 0,
'FORMAT_MENU' => 'menu',
diff --git a/tp/Texinfo/Convert/Info.pm b/tp/Texinfo/Convert/Info.pm
index 882596b..1e88a6a 100644
--- a/tp/Texinfo/Convert/Info.pm
+++ b/tp/Texinfo/Convert/Info.pm
@@ -29,22 +29,13 @@ use Texinfo::Convert::Text;
use Texinfo::Convert::Paragraph;
-
require Exporter;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+use vars qw($VERSION @ISA);
@ISA = qw(Texinfo::Convert::Plaintext);
-%EXPORT_TAGS = ( 'all' => [ qw(
- convert
-) ] );
-
-@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
-
-@EXPORT = qw(
-);
-
$VERSION = '6.8dev';
+
my $STDIN_DOCU_NAME = 'stdin';
my %defaults = Texinfo::Convert::Plaintext::converter_defaults(undef, undef);
diff --git a/tp/Texinfo/Convert/LaTeX.pm b/tp/Texinfo/Convert/LaTeX.pm
index bc14d74..d175995 100644
--- a/tp/Texinfo/Convert/LaTeX.pm
+++ b/tp/Texinfo/Convert/LaTeX.pm
@@ -164,22 +164,12 @@ use Texinfo::Convert::NodeNameNormalization;
use Texinfo::Convert::Text;
-require Exporter;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+use vars qw($VERSION @ISA);
@ISA = qw(Texinfo::Convert::Converter);
-%EXPORT_TAGS = ( 'all' => [ qw(
- convert
- output
-) ] );
-
-@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
-
-@EXPORT = qw(
-);
-
$VERSION = '6.8dev';
+
# misc commands that are of use for formatting.
my %formatting_misc_commands =
%Texinfo::Convert::Text::formatting_misc_commands;
diff --git a/tp/Texinfo/Convert/NodeNameNormalization.pm
b/tp/Texinfo/Convert/NodeNameNormalization.pm
index e757883..65a0e7d 100644
--- a/tp/Texinfo/Convert/NodeNameNormalization.pm
+++ b/tp/Texinfo/Convert/NodeNameNormalization.pm
@@ -35,7 +35,7 @@ use Texinfo::Convert::Text;
use Texinfo::Convert::Unicode;
require Exporter;
-use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+use vars qw($VERSION @ISA @EXPORT_OK %EXPORT_TAGS);
@ISA = qw(Exporter);
%EXPORT_TAGS = ( 'all' => [ qw(
@@ -45,8 +45,8 @@ use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
-@EXPORT = qw(
-);
+$VERSION = '6.8dev';
+
my %normalize_node_brace_no_arg_commands
= %Texinfo::Convert::Text::text_brace_no_arg_commands;
diff --git a/tp/Texinfo/Convert/PlainTexinfo.pm
b/tp/Texinfo/Convert/PlainTexinfo.pm
index 4e45f3f..6052a7e 100644
--- a/tp/Texinfo/Convert/PlainTexinfo.pm
+++ b/tp/Texinfo/Convert/PlainTexinfo.pm
@@ -26,11 +26,15 @@ package Texinfo::Convert::PlainTexinfo;
use 5.00405;
use strict;
+use Texinfo::Convert::Texinfo;
use Texinfo::Convert::Converter;
use vars qw($VERSION @ISA);
@ISA = qw(Texinfo::Convert::Converter);
+$VERSION = '6.8dev';
+
+
my %defaults = (
'OUTFILE' => '-',
'EXTENSION' => 'texi',
diff --git a/tp/Texinfo/Convert/Plaintext.pm b/tp/Texinfo/Convert/Plaintext.pm
index 85f8200..2e184d1 100644
--- a/tp/Texinfo/Convert/Plaintext.pm
+++ b/tp/Texinfo/Convert/Plaintext.pm
@@ -34,9 +34,8 @@ use Texinfo::Convert::Utils;
use Texinfo::Convert::Converter;
use Texinfo::Convert::Paragraph;
-
require Exporter;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+use vars qw($VERSION @ISA);
@ISA = qw(Texinfo::Convert::Converter);
# Some extra initialization for the first time this module is loaded.
@@ -53,18 +52,9 @@ sub import {
goto &Exporter::import;
}
-%EXPORT_TAGS = ( 'all' => [ qw(
- convert
- output
-) ] );
-
-@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
-
-@EXPORT = qw(
-);
-
$VERSION = '6.8dev';
+
# misc commands that are of use for formatting.
my %formatting_misc_commands =
%Texinfo::Convert::Text::formatting_misc_commands;
diff --git a/tp/Texinfo/Convert/Texinfo.pm b/tp/Texinfo/Convert/Texinfo.pm
index e6c87a9..d97517c 100644
--- a/tp/Texinfo/Convert/Texinfo.pm
+++ b/tp/Texinfo/Convert/Texinfo.pm
@@ -27,7 +27,7 @@ use strict;
use Texinfo::Common;
require Exporter;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+use vars qw($VERSION @ISA @EXPORT_OK %EXPORT_TAGS);
@ISA = qw(Exporter);
%EXPORT_TAGS = ( 'all' => [ qw(
@@ -37,11 +37,9 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
-@EXPORT = qw(
-);
-
$VERSION = '6.8dev';
+
my %misc_commands = %Texinfo::Common::misc_commands;
my %brace_commands = %Texinfo::Common::brace_commands;
my %block_commands = %Texinfo::Common::block_commands;
diff --git a/tp/Texinfo/Convert/TexinfoSXML.pm
b/tp/Texinfo/Convert/TexinfoSXML.pm
index 6a3dd38..db06dbb 100644
--- a/tp/Texinfo/Convert/TexinfoSXML.pm
+++ b/tp/Texinfo/Convert/TexinfoSXML.pm
@@ -28,23 +28,12 @@ use strict;
use Texinfo::Convert::TexinfoXML;
use Carp qw(cluck);
-require Exporter;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
-@ISA = qw(Exporter Texinfo::Convert::TexinfoXML);
-
-%EXPORT_TAGS = ( 'all' => [ qw(
- convert
- convert_tree
- output
-) ] );
-
-@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
-
-@EXPORT = qw(
-);
+use vars qw($VERSION @ISA);
+@ISA = qw(Texinfo::Convert::TexinfoXML);
$VERSION = '6.8dev';
+
# SXML specific
my %defaults = (
'ENABLE_ENCODING' => 0,
@@ -125,15 +114,15 @@ sub close_element($$)
return $result;
}
-my %commands_formatting = %Texinfo::Convert::TexinfoXML::commands_formatting;
+my %no_arg_commands_formatting =
%Texinfo::Convert::TexinfoXML::no_arg_commands_formatting;
# format specific
sub format_atom($$)
{
my $self = shift;
my $atom = shift;
- if ($commands_formatting{$atom} ne '') {
- return '('.$commands_formatting{$atom}.' (@))';
+ if ($no_arg_commands_formatting{$atom} ne '') {
+ return '('.$no_arg_commands_formatting{$atom}.' (@))';
} else {
return '';
}
diff --git a/tp/Texinfo/Convert/TexinfoXML.pm b/tp/Texinfo/Convert/TexinfoXML.pm
index a59bbdc..6692ffa 100644
--- a/tp/Texinfo/Convert/TexinfoXML.pm
+++ b/tp/Texinfo/Convert/TexinfoXML.pm
@@ -30,23 +30,12 @@ use Texinfo::Convert::Texinfo;
use Data::Dumper;
use Carp qw(cluck);
-require Exporter;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
-@ISA = qw(Exporter Texinfo::Convert::Converter);
-
-%EXPORT_TAGS = ( 'all' => [ qw(
- convert
- convert_tree
- output
-) ] );
-
-@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
-
-@EXPORT = qw(
-);
+use vars qw($VERSION @ISA);
+@ISA = qw(Texinfo::Convert::Converter);
$VERSION = '6.8dev';
+
# XML specific
my %defaults = (
'ENABLE_ENCODING' => 0,
diff --git a/tp/Texinfo/Convert/Text.pm b/tp/Texinfo/Convert/Text.pm
index 996543e..e76e46d 100644
--- a/tp/Texinfo/Convert/Text.pm
+++ b/tp/Texinfo/Convert/Text.pm
@@ -36,7 +36,7 @@ use Carp qw(cluck carp);
use File::Basename;
require Exporter;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+use vars qw($VERSION @ISA @EXPORT_OK %EXPORT_TAGS);
@ISA = qw(Exporter);
%EXPORT_TAGS = ( 'all' => [ qw(
@@ -47,11 +47,9 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
-@EXPORT = qw(
-);
-
$VERSION = '6.8dev';
+
# this is in fact not needed for 'footnote', 'shortcaption', 'caption'
# when they have no brace_command_arg, see below.
my %ignored_brace_commands;
diff --git a/tp/Texinfo/Convert/TextContent.pm
b/tp/Texinfo/Convert/TextContent.pm
index 4533f76..2010467 100644
--- a/tp/Texinfo/Convert/TextContent.pm
+++ b/tp/Texinfo/Convert/TextContent.pm
@@ -30,6 +30,9 @@ use Texinfo::Convert::Converter;
use vars qw($VERSION @ISA);
@ISA = qw(Texinfo::Convert::Converter);
+$VERSION = '6.8dev';
+
+
my %ignored_brace_commands;
# Handle better @errormsg?
foreach my $ignored_brace_command ('hyphenation', 'errormsg') {
diff --git a/tp/Texinfo/Convert/Unicode.pm b/tp/Texinfo/Convert/Unicode.pm
index 63b0636..887aeef 100644
--- a/tp/Texinfo/Convert/Unicode.pm
+++ b/tp/Texinfo/Convert/Unicode.pm
@@ -26,18 +26,18 @@ package Texinfo::Convert::Unicode;
use 5.007_003;
use strict;
+use Carp qw(cluck);
+
use Encode;
use Unicode::Normalize;
-use Carp qw(cluck);
use Unicode::EastAsianWidth;
-require Exporter;
-use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
-
use Texinfo::Encoding;
use Texinfo::MiscXS;
+require Exporter;
+
# Some extra initialization for the first time this module is loaded.
# This could be done in a UNITCHECK block, but they were introduced in
# Perl 5.10.
@@ -52,6 +52,8 @@ sub import {
goto &Exporter::import;
}
+use vars qw($VERSION @ISA @EXPORT_OK %EXPORT_TAGS);
+
%EXPORT_TAGS = ( 'all' => [ qw(
unicode_accent
encoded_accents
@@ -62,8 +64,8 @@ sub import {
@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
-@EXPORT = qw(
-);
+$VERSION = '6.8dev';
+
our %unicode_diacritics = (
'H' => '030B',
@@ -1296,7 +1298,7 @@ sub _eight_bit_and_unicode_point($$)
}
# format a stack of accents as unicode
-sub unicode_accents($$$$;$)
+sub _format_unicode_accents_stack($$$$;$)
{
my $converter = shift;
my $result = shift;
@@ -1325,7 +1327,7 @@ sub unicode_accents($$$$;$)
return $result;
}
-sub eight_bit_accents($$$$$;$)
+sub _format_eight_bit_accents_stack($$$$$;$)
{
my $converter = shift;
my $unicode_formatted = shift;
@@ -1457,10 +1459,10 @@ sub encoded_accents($$$$$;$)
if ($encoding) {
if ($encoding eq 'utf-8') {
- return unicode_accents($converter, $text, $stack, $format_accent,
- $set_case);
+ return _format_unicode_accents_stack($converter, $text, $stack,
+ $format_accent, $set_case);
} elsif ($Texinfo::Encoding::eight_bit_encoding_aliases{$encoding}) {
- return eight_bit_accents($converter, $text, $stack, $encoding,
+ return _format_eight_bit_accents_stack($converter, $text, $stack,
$encoding,
$format_accent, $set_case);
}
}
diff --git a/tp/Texinfo/Convert/Utils.pm b/tp/Texinfo/Convert/Utils.pm
index 08db26c..ee59bd6 100644
--- a/tp/Texinfo/Convert/Utils.pm
+++ b/tp/Texinfo/Convert/Utils.pm
@@ -38,7 +38,7 @@ use Carp qw(cluck);
require Exporter;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+use vars qw($VERSION @ISA @EXPORT_OK %EXPORT_TAGS);
@ISA = qw(Exporter);
%EXPORT_TAGS = ( 'all' => [ qw(
diff --git a/tp/Texinfo/Encoding.pm b/tp/Texinfo/Encoding.pm
index 6abbd4a..0c074b7 100644
--- a/tp/Texinfo/Encoding.pm
+++ b/tp/Texinfo/Encoding.pm
@@ -25,24 +25,11 @@ use strict;
use Encode;
require Exporter;
-use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+use vars qw(@ISA @EXPORT_OK);
@ISA = qw(Exporter);
-# Items to export into callers namespace by default. Note: do not export
-# names by default without a very good reason. Use EXPORT_OK instead.
-# Do not simply export all your public functions/methods/constants.
+@EXPORT_OK = qw( encoding_alias );
-# This allows declaration use Texinfo::Covert::Text ':all';
-# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
-# will save memory.
-%EXPORT_TAGS = ( 'all' => [ qw(
- encoding_alias
-) ] );
-
-@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
-
-@EXPORT = qw(
-);
# charset related definitions.
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index 2350a22..3e33bf6 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -65,7 +65,7 @@ use Texinfo::Convert::NodeNameNormalization;
use Texinfo::Translations;
require Exporter;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+use vars qw($VERSION @ISA @EXPORT_OK %EXPORT_TAGS);
@ISA = qw(Exporter Texinfo::Translations);
our $module_loaded = 0;
@@ -83,27 +83,18 @@ sub import {
goto &Exporter::import;
}
-
%EXPORT_TAGS = ( 'all' => [ qw(
parser
parse_texi_text
parse_texi_line
parse_texi_file
- indices_information
- floats_information
- internal_references_information
- labels_information
- global_commands_information
- global_informations
) ] );
@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
-@EXPORT = qw(
-);
-
$VERSION = '6.8dev';
+
sub N__($)
{
return $_[0];
diff --git a/tp/Texinfo/Report.pm b/tp/Texinfo/Report.pm
index 5eb995a..9cce8d1 100644
--- a/tp/Texinfo/Report.pm
+++ b/tp/Texinfo/Report.pm
@@ -19,19 +19,6 @@
package Texinfo::Report;
-require Exporter;
-use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
-@ISA = qw(Exporter);
-
-%EXPORT_TAGS = ( 'all' => [ qw(
- errors
-) ] );
-
-@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
-
-@EXPORT = qw(
-);
-
use 5.00405;
use strict;
diff --git a/tp/Texinfo/Structuring.pm b/tp/Texinfo/Structuring.pm
index e1d859e..6816948 100644
--- a/tp/Texinfo/Structuring.pm
+++ b/tp/Texinfo/Structuring.pm
@@ -42,7 +42,7 @@ use Texinfo::Convert::NodeNameNormalization;
use Carp qw(cluck);
require Exporter;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+use vars qw($VERSION @ISA @EXPORT_OK %EXPORT_TAGS);
@ISA = qw(Exporter);
%EXPORT_TAGS = ( 'all' => [ qw(
@@ -66,9 +66,6 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
-@EXPORT = qw(
-);
-
$VERSION = '6.8dev';
diff --git a/tp/Texinfo/Transformations.pm b/tp/Texinfo/Transformations.pm
index a6269f7..e90165b 100644
--- a/tp/Texinfo/Transformations.pm
+++ b/tp/Texinfo/Transformations.pm
@@ -24,13 +24,22 @@ use 5.00405;
use strict;
+use Carp qw(cluck);
+
use Texinfo::Common;
use Texinfo::Structuring;
-# Export?
-# protect_hashchar_at_line_beginning
+require Exporter;
+use vars qw($VERSION @ISA @EXPORT_OK %EXPORT_TAGS);
+@ISA = qw(Exporter);
-use Carp qw(cluck);
+%EXPORT_TAGS = ( 'all' => [ qw(
+protect_hashchar_at_line_beginning
+) ] );
+
+@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
+
+$VERSION = '6.8dev';
# Add raise/lowersections to be back at the normal level
sub _correct_level($$;$)
@@ -150,7 +159,6 @@ sub fill_gaps_in_sectioning($)
# input for the node name tree.
sub _reference_to_arg($$$)
{
- my $self = shift;
my $type = shift;
my $current = shift;
@@ -183,18 +191,16 @@ sub _reference_to_arg($$$)
}
}
-sub reference_to_arg_in_tree($$)
+sub reference_to_arg_in_tree($)
{
- my $self = shift;
my $tree = shift;
- return Texinfo::Common::modify_tree($self, $tree, \&_reference_to_arg);
+ return Texinfo::Common::modify_tree($tree, \&_reference_to_arg);
}
# prepare a new node
# modifies $nodes_list, $targets_list, $labels
-sub _new_node($$$$$)
+sub _new_node($$$$)
{
- my $self = shift;
my $node_tree = shift;
my $nodes_list = shift;
my $targets_list = shift;
@@ -203,7 +209,7 @@ sub _new_node($$$$$)
$node_tree = Texinfo::Common::protect_comma_in_tree($node_tree);
$node_tree->{'contents'}
= Texinfo::Common::protect_first_parenthesis($node_tree->{'contents'});
- $node_tree = reference_to_arg_in_tree($self, $node_tree);
+ $node_tree = reference_to_arg_in_tree($node_tree);
my $empty_node = 0;
if (!$node_tree->{'contents'}
@@ -272,11 +278,10 @@ sub _new_node($$$$$)
# reassociate a tree element to the new node, from previous node
sub _reassociate_to_node($$$$)
{
- my $self = shift;
my $type = shift;
my $current = shift;
- my $nodes = shift;
- my ($new_node, $previous_node) = @{$nodes};
+ my $argument = shift;
+ my ($new_node, $previous_node) = @{$argument};
if ($current->{'cmdname'} and $current->{'cmdname'} eq 'menu') {
if ($previous_node) {
@@ -311,9 +316,8 @@ sub _reassociate_to_node($$$$)
}
# modifies $nodes_list, $targets_list, $labels
-sub insert_nodes_for_sectioning_commands($$$$$)
+sub insert_nodes_for_sectioning_commands($$$$)
{
- my $self = shift;
my $root = shift;
my $nodes_list = shift;
my $targets_list = shift;
@@ -339,7 +343,7 @@ sub insert_nodes_for_sectioning_commands($$$$$)
$new_node_tree = Texinfo::Common::copy_tree({'contents'
=> $content->{'args'}->[0]->{'contents'}});
}
- my $new_node = _new_node($self, $new_node_tree, $nodes_list,
+ my $new_node = _new_node($new_node_tree, $nodes_list,
$targets_list, $labels);
if (defined($new_node)) {
push @contents, $new_node;
@@ -348,7 +352,7 @@ sub insert_nodes_for_sectioning_commands($$$$$)
$content->{'extra'}->{'associated_node'} = $new_node;
$new_node->{'parent'} = $content->{'parent'};
# reassociate index entries and menus
- Texinfo::Common::modify_tree($self, $content, \&_reassociate_to_node,
+ Texinfo::Common::modify_tree($content, \&_reassociate_to_node,
[$new_node, $previous_node]);
}
}
@@ -759,11 +763,11 @@ sub _is_cpp_line($)
sub _protect_hashchar_at_line_beginning($$$)
{
- my $self = shift;
my $type = shift;
my $current = shift;
+ my $argument = shift;
- my ($registrar, $configuration_informations) = @$self;
+ my ($registrar, $configuration_informations) = @$argument;
#print STDERR "$type $current "._print_current($current)."\n";
# if the next is a hash character at line beginning, mark it
@@ -803,19 +807,17 @@ sub _protect_hashchar_at_line_beginning($$$)
if ($protect_hash) {
my @result = ();
if ($current->{'type'} and $current->{'type'} eq 'raw') {
- if ($self) {
- my $parent = $current->{'parent'};
- while ($parent) {
- if ($parent->{'cmdname'} and $parent->{'line_nr'}) {
- if ($registrar) {
- $registrar->line_warn($configuration_informations, sprintf(__(
- "could not protect hash character in \@%s"),
- $parent->{'cmdname'}), $parent->{'line_nr'});
- }
- last;
+ my $parent = $current->{'parent'};
+ while ($parent) {
+ if ($parent->{'cmdname'} and $parent->{'line_nr'}) {
+ if ($registrar) {
+ $registrar->line_warn($configuration_informations, sprintf(__(
+ "could not protect hash character in \@%s"),
+ $parent->{'cmdname'}), $parent->{'line_nr'});
}
- $parent = $parent->{'parent'};
+ last;
}
+ $parent = $parent->{'parent'};
}
} else {
$current->{'text'} =~ s/^(\s*)#//;
@@ -838,8 +840,8 @@ sub protect_hashchar_at_line_beginning($$$)
my $configuration_informations = shift;
my $tree = shift;
- my $self = [$registrar, $configuration_informations];
- return Texinfo::Common::modify_tree($self, $tree,
\&_protect_hashchar_at_line_beginning);
+ return Texinfo::Common::modify_tree($tree,
\&_protect_hashchar_at_line_beginning,
+ [$registrar,
$configuration_informations]);
}
1;
diff --git a/tp/Texinfo/Translations.pm b/tp/Texinfo/Translations.pm
index e8c7989..7f523ae 100644
--- a/tp/Texinfo/Translations.pm
+++ b/tp/Texinfo/Translations.pm
@@ -20,24 +20,13 @@
package Texinfo::Translations;
require Exporter;
-use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
-@ISA = qw(Exporter);
-
-%EXPORT_TAGS = ( 'all' => [ qw(
- gdt
-) ] );
-
-@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
-
-@EXPORT = qw(
-);
use 5.00405;
use strict;
use POSIX qw(setlocale LC_ALL);
use Locale::Messages;
-# to be able to load a parser if none was given to gdt.
+# to be able to load a (simple) parser if none was given to gdt.
use Texinfo::Parser;
# we want a reliable way to switch locale for the document
@@ -190,7 +179,7 @@ sub gdt($$;$$)
$translation_result =~ s/\{($re)\}/\@txiinternalvalue\{$1\}/g;
}
- # Don't reuse the current parser itself, as (tested) the parsing goes
+ # Don't reuse the current parser itself, as (tested) the parsing goes
# wrong, certainly because the parsed text can affect the parser state.
my $current_parser;
if (ref($self) eq 'Texinfo::Parser') {
@@ -253,7 +242,7 @@ sub _substitute_element_array ($$) {
} @{$array};
}
-# Recursively substitute @txiinternalvalue elements in $TREE with
+# Recursively substitute @txiinternalvalue elements in $TREE with
# their values given in $CONTEXT.
sub _substitute ($$);
sub _substitute ($$) {
@@ -293,7 +282,7 @@ sub complete_indices
my $self = shift;
my ($index_entry, $index_contents_normalized);
-
+
my $save_lang = $self->get_conf('documentlanguage');
foreach my $index_name (keys(%{$self->{'index_names'}})) {
@@ -304,7 +293,7 @@ sub complete_indices
if (!defined $entry->{'content'}) {
my $def_command = $entry->{'command'}->{'extra'}->{'def_command'};
- my $def_parsed_hash =
$entry->{'command'}->{'extra'}->{'def_parsed_hash'};
+ my $def_parsed_hash =
$entry->{'command'}->{'extra'}->{'def_parsed_hash'};
if ($def_parsed_hash and $def_parsed_hash->{'class'}
and $def_command) {
# Use the document language that was current when the command was
@@ -372,7 +361,7 @@ Texinfo::Translations - Translations of output documents
strings for Texinfo mod
=head1 DESCRIPTION
-The Texinfo::Translations module helps with string translations
+The Texinfo::Translations module helps with translations
in output documents.
Translation of error messages uses another interface which
@@ -381,44 +370,29 @@ described as it is described in details elsewhere.
=head1 METHODS
-No method is exported in the default case.
+No method is exported.
-The C<gdt> method is used to translate strings to be output in
+The C<gdt> method is used to translate strings to be output in
converted documents, and return a texinfo tree.
=over
=item $tree = $converter->gdt($string, $replaced_substrings, $mode)
-The I<$string> is a string to be translated. In the default case,
-the function returns a Texinfo tree, as the string is
-interpreted as Texinfo code after
-translation. I<$replaced_substrings> is an optional
-hash reference specifying some
-substitution to be done after the translation. The key of
-the I<$replaced_substrings> hash reference identifies what is to
-be substituted, and the value is some string, texinfo tree or array content
-that is substituted in the resulting texinfo tree.
-In the string to be translated word in brace matching keys of
-I<$replaced_substrings> are replaced.
-
-I<$mode> is an optional string which may modify how the function
-behaves. The possible values are
-
-=over
-
-=item translated_text
-
-In that case the string is not considered to be Texinfo, a plain string
-that is returned after translation and substitution. The substitutions
-may only be strings in that case.
-
-=back
-
-For example in the following call, the string
+The I<$string> is a string to be translated. In the default case,
+the function returns a Texinfo tree, as the string is interpreted
+as Texinfo code after translation. I<$replaced_substrings> is an
+optional hash reference specifying some substitution to be done
+after the translation. The key of the I<$replaced_substrings> hash
+reference identifies what is to be substituted, and the value is
+some string, texinfo tree or array content that is substituted in
+the resulting texinfo tree. In the string to be translated word
+in brace matching keys of I<$replaced_substrings> are replaced.
+
+For example, in the following call, the string
I<See {reference} in @cite{{book}}> is translated, then
parsed as a Texinfo string, with I<{reference}> substituted by
-I<$tree_reference> in the resulting tree, and I<{book}>
+I<$tree_reference> in the resulting tree, and I<{book}>
replaced by the associated texinfo tree text element:
$tree = $converter->gdt('See {reference} in @cite{{book}}',
@@ -426,13 +400,24 @@ replaced by the associated texinfo tree text element:
'book' => {'text' => $book_name}});
C<gdt> uses the information in the I<$converter> to know the
-encoding and documentlanguage. More precisely,
-C<< $converter->{'encoding_name'} >>, C<< $converter->{'perl_encoding'} >>
-and C<< $converter->get_conf('documentlanguage') >> are used.
+encoding and documentlanguage.
-C<gdt> uses a gettext-like infrastructure to retrieve the
+C<gdt> uses a gettext-like infrastructure to retrieve the
translated strings, using the I<texinfo_document> domain.
+I<$mode> is an optional string which may modify how the function
+behaves. The possible values are:
+
+=over
+
+=item translated_text
+
+In that case the string is not considered to be Texinfo, a plain string
+that is returned after translation and substitution. The substitutions
+may only be strings in that case.
+
+=back
+
=back
=head1 AUTHOR
diff --git a/tp/Texinfo/XS/parsetexi/Parsetexi.pm
b/tp/Texinfo/XS/parsetexi/Parsetexi.pm
index e5644b5..6722248 100644
--- a/tp/Texinfo/XS/parsetexi/Parsetexi.pm
+++ b/tp/Texinfo/XS/parsetexi/Parsetexi.pm
@@ -38,9 +38,6 @@ our %EXPORT_TAGS = ( 'all' => [ qw(
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
-our @EXPORT = qw(
-
-);
sub get_conf($$)
{
diff --git a/tp/t/accents.t b/tp/t/accents.t
index 6297130..4fda0c4 100644
--- a/tp/t/accents.t
+++ b/tp/t/accents.t
@@ -83,8 +83,9 @@ sub test_enable_encoding ($)
my $text = Texinfo::Convert::Text::convert_to_text({'contents' =>
$contents});
my $result =
- Texinfo::Convert::Unicode::eight_bit_accents(undef, $text,
$commands_stack,
- 'iso-8859-1', \&Texinfo::Convert::Text::ascii_accent_fallback);
+ Texinfo::Convert::Unicode::_format_eight_bit_accents_stack(undef, $text,
+ $commands_stack, 'iso-8859-1',
+
\&Texinfo::Convert::Text::ascii_accent_fallback);
my $html_converter = Texinfo::Convert::HTML->converter();
$html_converter->{'conf'}->{'USE_NUMERIC_ENTITY'} = 0;
@@ -98,8 +99,9 @@ sub test_enable_encoding ($)
Texinfo::Convert::Utils::find_innermost_accent_contents($tree);
$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);
+ my $result_unicode =
Texinfo::Convert::Unicode::_format_unicode_accents_stack(
+ undef, $text,
$commands_stack,
+
\&Texinfo::Convert::Text::ascii_accent_fallback);
if (defined($reference)) {
#ok (Encode::decode('iso-8859-1', $reference) eq $result, $name);
diff --git a/tp/t/automatic_nodes.t b/tp/t/automatic_nodes.t
index f43d2ca..96899cf 100644
--- a/tp/t/automatic_nodes.t
+++ b/tp/t/automatic_nodes.t
@@ -23,7 +23,7 @@ sub test_new_node($$$$)
my $name = shift;
my $parser = Texinfo::Parser::parser();
- my $line = $parser->parse_texi_line ($in);
+ my $node_tree = $parser->parse_texi_line ($in);
my $registrar = $parser->registered_errors();
my ($labels, $targets_list, $nodes_list) = $parser->labels_information();
my $parser_informations = $parser->global_informations();
@@ -31,8 +31,8 @@ sub test_new_node($$$$)
Texinfo::Structuring::associate_internal_references($registrar, $parser,
$parser_informations, $labels, $refs);
# $labels, $nodes_list, $targets_list are modified
- my $node = Texinfo::Transformations::_new_node($parser, $line,
- $nodes_list, $targets_list, $labels);
+ my $node = Texinfo::Transformations::_new_node($node_tree, $nodes_list,
+ $targets_list, $labels);
my ($texi_result, $normalized);
if (defined($node)) {
@@ -50,7 +50,7 @@ sub test_new_node($$$$)
if (!defined($normalized_ref) and defined($normalized)) {
print STDERR " --> $name($normalized): $texi_result";
} else {
- is ($normalized_ref, $normalized, "$name normalized");
+ is ($normalized, $normalized_ref, "$name normalized");
is ($texi_result, $out, $name);
}
}
@@ -84,8 +84,8 @@ my $parser_informations = $parser->global_informations();
my $refs = $parser->internal_references_information();
Texinfo::Structuring::associate_internal_references($registrar, $parser,
$parser_informations, $labels, $refs);
-my $node = Texinfo::Transformations::_new_node($parser, $line_tree,
- $nodes_list, $targets_list, $labels);
+my $node = Texinfo::Transformations::_new_node($line_tree, $nodes_list,
+ $targets_list, $labels);
is ('@node a node 1
', Texinfo::Convert::Texinfo::convert_to_texinfo($node), 'duplicate node
added');
#print STDERR Texinfo::Convert::Texinfo::convert_to_texinfo($node);
@@ -162,8 +162,8 @@ Text.
Texinfo::Structuring::associate_internal_references($registrar, $parser,
$parser_informations, $labels, $refs);
my ($new_content, $added_nodes)
- = Texinfo::Transformations::insert_nodes_for_sectioning_commands($parser,
- $tree, $nodes_list, $targets_list, $labels);
+ = Texinfo::Transformations::insert_nodes_for_sectioning_commands($tree,
+ $nodes_list, $targets_list, $labels);
$tree->{'contents'} = $new_content;
my $result = Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
is ($reference, $result, 'add nodes');
@@ -188,8 +188,8 @@ $refs = $parser->internal_references_information();
Texinfo::Structuring::associate_internal_references($registrar, $parser,
$parser_informations, $labels, $refs);
($new_content, $added_nodes)
- = Texinfo::Transformations::insert_nodes_for_sectioning_commands($parser,
- $tree, $nodes_list, $targets_list, $labels);
+ = Texinfo::Transformations::insert_nodes_for_sectioning_commands($tree,
+ $nodes_list, $targets_list, $labels);
$tree->{'contents'} = $new_content;
my ($index_names, $merged_indices) = $parser->indices_information();
ok (($labels->{'chap'}->{'menus'} and @{$labels->{'chap'}->{'menus'}}
@@ -221,8 +221,8 @@ is ($labels->{'chap'},
$index_names->{'cp'}->{'index_entries'}->[0]->{'node'},
# # In fact, here we also check that there is no debugging message...
# ($labels, $targets_list, $nodes_list) = $parser->labels_information();
# ($new_content, $added_nodes)
-# = Texinfo::Transformations::insert_nodes_for_sectioning_commands($parser,
-# $tree, $nodes_list, $targets_list, $labels);
+# = Texinfo::Transformations::insert_nodes_for_sectioning_commands($tree,
+# $nodes_list, $targets_list, $labels);
# ($index_names, $merged_indices) = $parser->indices_information();
# ($labels, $targets_list, $nodes_list) = $parser->labels_information();
# is ($labels->{'SEE-ALSO'},
$index_names->{'cp'}->{'index_entries'}->[0]->{'node'},
diff --git a/tp/t/reference_to_text_in_tree.t b/tp/t/reference_to_text_in_tree.t
index a80227e..756458f 100644
--- a/tp/t/reference_to_text_in_tree.t
+++ b/tp/t/reference_to_text_in_tree.t
@@ -23,7 +23,7 @@ sub run_test($$$)
my $tree = $parser->parse_texi_text($in);
my $corrected_tree
- = Texinfo::Transformations::reference_to_arg_in_tree($parser, $tree);
+ = Texinfo::Transformations::reference_to_arg_in_tree($tree);
my $texi_result =
Texinfo::Convert::Texinfo::convert_to_texinfo($corrected_tree);
if (!defined($out)) {
diff --git a/tp/t/test_utils.pl b/tp/t/test_utils.pl
index 0b2ae41..0348faa 100644
--- a/tp/t/test_utils.pl
+++ b/tp/t/test_utils.pl
@@ -372,9 +372,8 @@ sub duplicate_key_array($$)
# used to have a similar output as the XS parser
# when using the pure perl parser.
-sub _duplicate_element_keys($$$)
+sub _duplicate_element_keys($$)
{
- my $self = shift;
my $type = shift;
my $current = shift;
@@ -416,11 +415,10 @@ sub _duplicate_element_keys($$$)
return ($current);
}
-sub duplicate_tree_element_keys($$)
+sub duplicate_tree_element_keys($)
{
- my $self = shift;
my $tree = shift;
- return Texinfo::Common::modify_tree($self, $tree, \&_duplicate_element_keys);
+ return Texinfo::Common::modify_tree($tree, \&_duplicate_element_keys);
}
sub cmp_trimmed($$$$)
@@ -1046,11 +1044,11 @@ sub test($$)
if ($elements) {
$split_result = $elements;
foreach my $element (@$elements) {
- duplicate_tree_element_keys($parser, $element);
+ duplicate_tree_element_keys($element);
}
} else {
$split_result = $result;
- duplicate_tree_element_keys($parser, $result);
+ duplicate_tree_element_keys($result);
}
{
diff --git a/tp/texi2any.pl b/tp/texi2any.pl
index 5dcc5b8..60d90cb 100755
--- a/tp/texi2any.pl
+++ b/tp/texi2any.pl
@@ -1238,9 +1238,7 @@ while(@input_files) {
if ($tree_transformations{'insert_nodes_for_sectioning_commands'}) {
my ($modified_contents, $added_nodes)
- # the first argument is ultimately passed to Texinfo::Common::modify_tree
- # functions, but they do not actually use this argument
- = Texinfo::Transformations::insert_nodes_for_sectioning_commands(undef,
+ = Texinfo::Transformations::insert_nodes_for_sectioning_commands(
$tree, $nodes_list, $targets_list, $labels);
if (!defined($modified_contents)) {
document_warn(__(
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/Convert/Converter.pm, tp/Texinfo/Convert/DocBook.pm, tp/Texinfo/Convert/HTML.pm, tp/Texinfo/Convert/IXIN.pm, tp/Texinfo/Convert/IXINSXML.pm, tp/Texinfo/Convert/Info.pm, tp/Texinfo/Convert/LaTeX.pm, tp/Texinfo/Convert/PlainTexinfo.pm, tp/Texinfo/Convert/NodeNameNormalization.pm, tp/Texinfo/Convert/Plaintext.pm, tp/Texinfo/Convert/Texinfo.pm, tp/Texinfo/Convert/TexinfoSXML.pm, tp/Texinfo/Convert/TexinfoXML.pm, tp/Texinfo/Convert/Text.pm, tp/Texinfo/Convert/TextContent.pm, tp/Tex [...],
Patrice Dumas <=
- Prev by Date:
branch master updated: * tp/Texinfo/Common.pm, tp/Texinfo/Convert/Converter.pm (float_name_caption), tp/Texinfo/Convert/Utils.pm (@MONTH_NAMES, expand_verbatiminclude) (definition_category, expand_today, translated_command_tree) (numbered_heading, definition_arguments_content) (find_innermost_accent_contents), tp/Texinfo/Convert/NodeNameNormalization.pm (set_nodes_list_labels), tp/Texinfo/Transformations.pm (protect_hashchar_at_line_beginning), tp/Texinfo/Translations.pm (complete_indices), tp/Texinfo/XS/parsete [...]
- Next by Date:
branch master updated: * tp/Texinfo/Convert/Converter.pm (txt_image_text), tp/Texinfo/Convert/Plaintext.pm (_image_text), tp/Texinfo/Convert/DocBook.pm, tp/Texinfo/Convert/Info.pm: move _image_text() from Texinfo::Convert::Plaintext to Texinfo::Convert::Converter and rename as txt_image_text().
- Previous by thread:
branch master updated: * tp/Texinfo/Common.pm, tp/Texinfo/Convert/Converter.pm (float_name_caption), tp/Texinfo/Convert/Utils.pm (@MONTH_NAMES, expand_verbatiminclude) (definition_category, expand_today, translated_command_tree) (numbered_heading, definition_arguments_content) (find_innermost_accent_contents), tp/Texinfo/Convert/NodeNameNormalization.pm (set_nodes_list_labels), tp/Texinfo/Transformations.pm (protect_hashchar_at_line_beginning), tp/Texinfo/Translations.pm (complete_indices), tp/Texinfo/XS/parsete [...]
- Next by thread:
branch master updated: * tp/Texinfo/Convert/Converter.pm (txt_image_text), tp/Texinfo/Convert/Plaintext.pm (_image_text), tp/Texinfo/Convert/DocBook.pm, tp/Texinfo/Convert/Info.pm: move _image_text() from Texinfo::Convert::Plaintext to Texinfo::Convert::Converter and rename as txt_image_text().
- Index(es):