texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

texinfo/tp texi2any.pl Texinfo/Common.pm Texinf...


From: Patrice Dumas
Subject: texinfo/tp texi2any.pl Texinfo/Common.pm Texinf...
Date: Wed, 16 Jan 2013 00:02:50 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        13/01/16 00:02:50

Modified files:
        tp             : texi2any.pl 
        tp/Texinfo     : Common.pm 
Added files:
        tp/Texinfo/Convert: TexinfoSXML.pm 
Removed files:
        tp/Texinfo/Convert: SXML.pm 

Log message:
        Rename SXML as TexinfoSXML.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/texi2any.pl?cvsroot=texinfo&r1=1.159&r2=1.160
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Common.pm?cvsroot=texinfo&r1=1.169&r2=1.170
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/TexinfoSXML.pm?cvsroot=texinfo&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/SXML.pm?cvsroot=texinfo&r1=1.2&r2=0

Patches:
Index: texi2any.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/texi2any.pl,v
retrieving revision 1.159
retrieving revision 1.160
diff -u -b -r1.159 -r1.160
--- texi2any.pl 15 Jan 2013 20:18:51 -0000      1.159
+++ texi2any.pl 16 Jan 2013 00:02:49 -0000      1.160
@@ -101,7 +101,7 @@
 use Texinfo::Convert::Info;
 use Texinfo::Convert::HTML;
 use Texinfo::Convert::XML;
-use Texinfo::Convert::SXML;
+use Texinfo::Convert::TexinfoSXML;
 use Texinfo::Convert::DocBook;
 use Texinfo::Convert::TextContent;
 use Texinfo::Convert::PlainTexinfo;
@@ -826,8 +826,8 @@
        $format = set_format('rawtext', 1);
      } elsif ($var eq 'TEXTCONTENT') {
        $format = set_format('textcontent', 1);
-     } elsif ($var eq 'SXML') {
-       $format = set_format('sxml', 1);
+     } elsif ($var eq 'TEXINFOSXML') {
+       $format = set_format('texinfosxml', 1);
      }
      set_from_cmdline ($var, $value);
      # FIXME do that here or when all command line options are processed?
@@ -922,9 +922,9 @@
              'nodes_tree' => 1,
              'converter' => sub{Texinfo::Convert::XML->converter(@_)},
            },
-  'sxml' => {
+  'texinfosxml' => {
              'nodes_tree' => 1,
-             'converter' => sub{Texinfo::Convert::SXML->converter(@_)},
+             'converter' => sub{Texinfo::Convert::TexinfoSXML->converter(@_)},
            },
   'docbook' => {
              'move_index_entries_after_items' => 1,

Index: Texinfo/Common.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Common.pm,v
retrieving revision 1.169
retrieving revision 1.170
diff -u -b -r1.169 -r1.170
--- Texinfo/Common.pm   15 Jan 2013 20:18:51 -0000      1.169
+++ Texinfo/Common.pm   16 Jan 2013 00:02:49 -0000      1.170
@@ -190,7 +190,7 @@
 
 my @formats_settable = (
   'DEBUGCOUNT', 'DEBUGTREE', 'RAWTEXT', 'TEXTCONTENT', 'PLAINTEXINFO',
-  'SXML',
+  'TEXINFOSXML',
 );
 
 my @variable_string_settables = (

Index: Texinfo/Convert/TexinfoSXML.pm
===================================================================
RCS file: Texinfo/Convert/TexinfoSXML.pm
diff -N Texinfo/Convert/TexinfoSXML.pm
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ Texinfo/Convert/TexinfoSXML.pm      16 Jan 2013 00:02:50 -0000      1.1
@@ -0,0 +1,192 @@
+# TexinfoSXML.pm: output tree as Texinfo SXML.
+#
+# Copyright 2013 Free Software Foundation, Inc.
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License,
+# or (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# 
+# Original author: Patrice Dumas <address@hidden>
+#
+# This is a simple subclass of Texinfo::Convert::XML that overrides
+# format specific functions.
+
+package Texinfo::Convert::TexinfoSXML;
+
+use 5.00405;
+use strict;
+
+use Texinfo::Convert::XML;
+use Carp qw(cluck);
+
+require Exporter;
+use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
address@hidden = qw(Exporter Texinfo::Convert::XML);
+
+# 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.
+
+# This allows declaration       use Texinfo::Convert::XML ':all';
+# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
+# will save memory.
+%EXPORT_TAGS = ( 'all' => [ qw(
+  convert
+  convert_tree
+  output
+) ] );
+
address@hidden = ( @{ $EXPORT_TAGS{'all'} } );
+
address@hidden = qw(
+);
+
+$VERSION = '5.0';
+
+# SXML specific
+my %defaults = (
+  'ENABLE_ENCODING'      => 0,
+  'SHOW_MENU'            => 1,
+  'EXTENSION'            => 'sxml',
+  #'output_perl_encoding' => 'utf8',
+  'OUTPUT_ENCODING_NAME' => 'utf-8',
+  'TEXINFO_DTD_VERSION'  => '5.0',
+  'OUTFILE'              => undef,
+  'SUBDIR'               => undef,
+  'output_format'        => 'texinfosxml',
+  'SPLIT'                => 0,
+  'documentlanguage'     => 'en',
+);
+
+sub converter_defaults($$)
+{
+  return %defaults;
+}
+
+# format specific.  Used in few places where plain text is used outside
+# of attributes.
+sub protect_text($$)
+{
+  my $self = shift;
+  my $string = shift;
+  $string =~ s/\\/\\\\/g;
+  $string =~ s/"/\\"/g;
+  return $string;
+}
+
+sub sxml_attributes($$)
+{
+  my $self = shift;
+  my $attributes = shift;
+  if (ref($attributes) ne 'ARRAY') {
+    cluck "attributes not an array($attributes).";
+  }
+  my $result = '(@';
+  for (my $i = 0; $i < scalar(@$attributes); $i += 2) {
+    $result .= " ($attributes->[$i] 
\"".$self->protect_text($attributes->[$i+1])."\")";
+  }
+  return $result . ')';
+}
+
+# format specific
+sub element($$$)
+{
+  my $self = shift;
+  my $element_name = shift;
+  my $attributes = shift;
+  my $result = '('.$element_name." ";
+  $attributes = [] if (!defined($attributes));
+  $result .= $self->sxml_attributes($attributes);
+  $result .= ')';
+  return $result;
+}
+
+# format specific
+sub open_element($$$)
+{
+  my $self = shift;
+  my $element_name = shift;
+  my $attributes = shift;
+  my $result = '('.$element_name." ";
+  $attributes = [] if (!defined($attributes));
+  $result .= $self->sxml_attributes($attributes);
+  $result .= " ";
+  return $result;
+}
+
+# format specific
+sub close_element($$)
+{
+  my $self = shift;
+  my $element_name = shift;
+  my $result= ')';
+  return $result;
+}
+
+my %commands_formatting = %Texinfo::Convert::XML::commands_formatting;
+
+# format specific
+sub format_atom($$)
+{
+  my $self = shift;
+  my $atom = shift;
+  if ($commands_formatting{$atom} ne '') {
+    return '('.$commands_formatting{$atom}.' (@))';
+  } else {
+    return '';
+  }
+}
+
+# format specific
+#FIXME
+sub format_comment($$)
+{
+  my $self = shift;
+  my $string = shift;
+
+  return '';
+}
+
+# format specific
+sub format_text($$)
+{
+  my $self = shift;
+  my $root = shift;
+  my $result = $self->protect_text($root->{'text'});
+  if (! defined($root->{'type'}) or $root->{'type'} ne 'raw') {
+    if (!$self->{'document_context'}->[-1]->{'monospace'}->[-1]) {
+      $result =~ s/``/" (textldquo (@)) "/g;
+      $result =~ s/\'\'/" (textrdquo (@)) "/g;
+      $result =~ s/---/" (textmdash (@)) "/g;
+      $result =~ s/--/" (textndash (@)) "/g;
+      $result =~ s/'/" (textrsquo (@)) "/g;
+      $result =~ s/`/" (textlsquo (@)) "/g;
+    }
+  }
+  return '"'.$result.'" ';
+}
+
+# output format specific
+sub format_header($)
+{
+  my $self = shift;
+  my $header = '';
+  my $encoding = '';
+  if ($self->get_conf('OUTPUT_ENCODING_NAME')
+      and $self->get_conf('OUTPUT_ENCODING_NAME') ne 'utf-8') {
+    $encoding = $self->get_conf('OUTPUT_ENCODING_NAME');
+  }
+  if ($self->{'output_file'} ne '') {
+    my $output_filename = $self->{'output_filename'};
+  }
+  return $header;
+}

Index: Texinfo/Convert/SXML.pm
===================================================================
RCS file: Texinfo/Convert/SXML.pm
diff -N Texinfo/Convert/SXML.pm
--- Texinfo/Convert/SXML.pm     15 Jan 2013 20:22:04 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,192 +0,0 @@
-# SXML.pm: output tree as SXML.
-#
-# Copyright 2013 Free Software Foundation, Inc.
-# 
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License,
-# or (at your option) any later version.
-# 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# 
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-# 
-# Original author: Patrice Dumas <address@hidden>
-#
-# This is a simple subclass of Texinfo::Convert::XML that overrides
-# format specific functions.
-
-package Texinfo::Convert::SXML;
-
-use 5.00405;
-use strict;
-
-use Texinfo::Convert::XML;
-use Carp qw(cluck);
-
-require Exporter;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
address@hidden = qw(Exporter Texinfo::Convert::XML);
-
-# 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.
-
-# This allows declaration       use Texinfo::Convert::XML ':all';
-# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
-# will save memory.
-%EXPORT_TAGS = ( 'all' => [ qw(
-  convert
-  convert_tree
-  output
-) ] );
-
address@hidden = ( @{ $EXPORT_TAGS{'all'} } );
-
address@hidden = qw(
-);
-
-$VERSION = '5.0';
-
-# SXML specific
-my %defaults = (
-  'ENABLE_ENCODING'      => 0,
-  'SHOW_MENU'            => 1,
-  'EXTENSION'            => 'sxml',
-  #'output_perl_encoding' => 'utf8',
-  'OUTPUT_ENCODING_NAME' => 'utf-8',
-  'TEXINFO_DTD_VERSION'  => '5.0',
-  'OUTFILE'              => undef,
-  'SUBDIR'               => undef,
-  'output_format'        => 'sxml',
-  'SPLIT'                => 0,
-  'documentlanguage'     => 'en',
-);
-
-sub converter_defaults($$)
-{
-  return %defaults;
-}
-
-# format specific.  Used in few places where plain text is used outside
-# of attributes.
-sub protect_text($$)
-{
-  my $self = shift;
-  my $string = shift;
-  $string =~ s/\\/\\\\/g;
-  $string =~ s/"/\\"/g;
-  return $string;
-}
-
-sub sxml_attributes($$)
-{
-  my $self = shift;
-  my $attributes = shift;
-  if (ref($attributes) ne 'ARRAY') {
-    cluck "attributes not an array($attributes).";
-  }
-  my $result = '(@';
-  for (my $i = 0; $i < scalar(@$attributes); $i += 2) {
-    $result .= " ($attributes->[$i] 
\"".$self->protect_text($attributes->[$i+1])."\")";
-  }
-  return $result . ')';
-}
-
-# format specific
-sub element($$$)
-{
-  my $self = shift;
-  my $element_name = shift;
-  my $attributes = shift;
-  my $result = '('.$element_name." ";
-  $attributes = [] if (!defined($attributes));
-  $result .= $self->sxml_attributes($attributes);
-  $result .= ')';
-  return $result;
-}
-
-# format specific
-sub open_element($$$)
-{
-  my $self = shift;
-  my $element_name = shift;
-  my $attributes = shift;
-  my $result = '('.$element_name." ";
-  $attributes = [] if (!defined($attributes));
-  $result .= $self->sxml_attributes($attributes);
-  $result .= " ";
-  return $result;
-}
-
-# format specific
-sub close_element($$)
-{
-  my $self = shift;
-  my $element_name = shift;
-  my $result= ')';
-  return $result;
-}
-
-my %commands_formatting = %Texinfo::Convert::XML::commands_formatting;
-
-# format specific
-sub format_atom($$)
-{
-  my $self = shift;
-  my $atom = shift;
-  if ($commands_formatting{$atom} ne '') {
-    return '('.$commands_formatting{$atom}.' (@))';
-  } else {
-    return '';
-  }
-}
-
-# format specific
-#FIXME
-sub format_comment($$)
-{
-  my $self = shift;
-  my $string = shift;
-
-  return '';
-}
-
-# format specific
-sub format_text($$)
-{
-  my $self = shift;
-  my $root = shift;
-  my $result = $self->protect_text($root->{'text'});
-  if (! defined($root->{'type'}) or $root->{'type'} ne 'raw') {
-    if (!$self->{'document_context'}->[-1]->{'monospace'}->[-1]) {
-      $result =~ s/``/" (textldquo (@)) "/g;
-      $result =~ s/\'\'/" (textrdquo (@)) "/g;
-      $result =~ s/---/" (textmdash (@)) "/g;
-      $result =~ s/--/" (textndash (@)) "/g;
-      $result =~ s/'/" (textrsquo (@)) "/g;
-      $result =~ s/`/" (textlsquo (@)) "/g;
-    }
-  }
-  return '"'.$result.'" ';
-}
-
-# output format specific
-sub format_header($)
-{
-  my $self = shift;
-  my $header = '';
-  my $encoding = '';
-  if ($self->get_conf('OUTPUT_ENCODING_NAME')
-      and $self->get_conf('OUTPUT_ENCODING_NAME') ne 'utf-8') {
-    $encoding = $self->get_conf('OUTPUT_ENCODING_NAME');
-  }
-  if ($self->{'output_file'} ne '') {
-    my $output_filename = $self->{'output_filename'};
-  }
-  return $header;
-}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]