[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo ChangeLog util/Makefile.am util/texi2ht...
From: |
Patrice Dumas |
Subject: |
texinfo ChangeLog util/Makefile.am util/texi2ht... |
Date: |
Wed, 25 Jan 2012 20:16:48 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 12/01/25 20:16:48
Modified files:
. : ChangeLog
util : Makefile.am
Added files:
util : texi2html
Removed files:
tp : texi_sort_elements_count.pl
Log message:
* util/texi2html: new script to convert Texinfo to HTML,
setting the
default style to be the texi2html style.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/ChangeLog?cvsroot=texinfo&r1=1.1316&r2=1.1317
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/texi_sort_elements_count.pl?cvsroot=texinfo&r1=1.3&r2=0
http://cvs.savannah.gnu.org/viewcvs/texinfo/util/Makefile.am?cvsroot=texinfo&r1=1.42&r2=1.43
http://cvs.savannah.gnu.org/viewcvs/texinfo/util/texi2html?cvsroot=texinfo&rev=1.1
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/texinfo/texinfo/ChangeLog,v
retrieving revision 1.1316
retrieving revision 1.1317
diff -u -b -r1.1316 -r1.1317
--- ChangeLog 24 Jan 2012 22:16:57 -0000 1.1316
+++ ChangeLog 25 Jan 2012 20:16:47 -0000 1.1317
@@ -1,3 +1,8 @@
+2012-01-25 Patrice Dumas <address@hidden>
+
+ * util/texi2html: new script to convert Texinfo to HTML, setting the
+ default style to be the texi2html style.
+
2012-01-24 Patrice Dumas <address@hidden>
* tp/Texinfo/Convert/Plaintext.pm, tp/Texinfo/Convert/Unicode.pm,
Index: util/Makefile.am
===================================================================
RCS file: /sources/texinfo/texinfo/util/Makefile.am,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -b -r1.42 -r1.43
--- util/Makefile.am 20 Jan 2012 18:11:41 -0000 1.42
+++ util/Makefile.am 25 Jan 2012 20:16:48 -0000 1.43
@@ -1,4 +1,4 @@
-# $Id: Makefile.am,v 1.42 2012/01/20 18:11:41 karl Exp $
+# $Id: Makefile.am,v 1.43 2012/01/25 20:16:48 pertusus Exp $
# Makefile.am for texinfo/util.
# Run automake in .. to produce Makefile.in from this.
#
@@ -42,7 +42,8 @@
fixref.gawk gdoc gen-dir-node gendocs.sh gendocs_template infosrch \
install-info-html outline.gawk pdftexi2dvi \
prepinfo.awk tex3patch texi-docstring-magic.el texi2dvi texi2pdf txitextest \
- $(dist_pkgdata_DATA) texinfo-cat.in texi_sort_elements_count.pl
+ $(dist_pkgdata_DATA) texinfo-cat.in texi_sort_elements_count.pl \
+ texi2html
# We must not stress people's TeX installations.
Index: util/texi2html
===================================================================
RCS file: util/texi2html
diff -N util/texi2html
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ util/texi2html 25 Jan 2012 20:16:48 -0000 1.1
@@ -0,0 +1,23 @@
+#! /bin/sh
+# $Id: texi2html,v 1.1 2012/01/25 20:16:48 pertusus Exp $
+# Copyright 2012 Free Software Foundation, Inc.
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# Original author: Patrice Dumas.
+
+# Convert Texinfo to HTML, setting the default style to be the texi2html
+# style.
+
+# It is not fully compatible with texi2html. There is no possibility to
+# split indices anymore. Command line processing and options have also
+# somehow changed, and the customization API is new.
+#
+exec texi2any --set-init-variable TEXTCONTENT=1 "$@"
+
Index: tp/texi_sort_elements_count.pl
===================================================================
RCS file: tp/texi_sort_elements_count.pl
diff -N tp/texi_sort_elements_count.pl
--- tp/texi_sort_elements_count.pl 16 Jan 2012 22:09:48 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,236 +0,0 @@
-#! /usr/bin/perl -w
-
-# texi_sort_elements_count: sort elements based on words or line counts.
-#
-# Copyright 2012 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>
-
-
-use strict;
-
-use Getopt::Long qw(GetOptions);
-# to determine the path separator
-use Config;
-
-Getopt::Long::Configure("gnu_getopt");
-
-BEGIN
-{
- my $texinfolibdir = '@datadir@/@PACKAGE@';
- unshift @INC, ($texinfolibdir)
- if ($texinfolibdir ne ''
- and $texinfolibdir ne '@' .'datadir@/@PACKAGE'.'@');
-}
-
-use Texinfo::Parser;
-use Texinfo::Structuring;
-use Texinfo::Convert::TextContent;
-
-my $configured_version = '@PACKAGE_VERSION@';
-$configured_version = $Texinfo::Parser::VERSION
- if ($configured_version eq '@' . 'PACKAGE_VERSION@');
-
-my $real_command_name = $0;
-$real_command_name =~ s/.*\///;
-$real_command_name =~ s/\.pl$//;
-
-# determine the path separators
-my $path_separator = $Config{'path_sep'};
-$path_separator = ':' if (!defined($path_separator));
-my $quoted_path_separator = quotemeta($path_separator);
-
-my $force = 0;
-my $use_sections = 0;
-my $count_words = 0;
-my $no_warn = 0;
-
-# placeholder for future i18n.
-sub __($)
-{
- return $_[0];
-}
-
-my $format = 'info';
-# this is the format associated with the output format, which is replaced
-# when the output format changes. It may also be removed if there is the
-# corresponding --no-ifformat.
-#my $default_expanded_format = [ $format ];
-my @include_dirs = ();
-my @prepend_dirs = ();
-
-my $parser_default_options = {
- #'expanded_formats' => [],
- 'expanded_formats' => [ $format ],
- 'values' => {},
- #'gettext' => \&__
- };
-
-sub set_expansion($$) {
- my $region = shift;
- my $set = shift;
- $set = 1 if (!defined($set));
- if ($set) {
- push @{$parser_default_options->{'expanded_formats'}}, $region
- unless (grep {$_ eq $region}
@{$parser_default_options->{'expanded_formats'}});
- } else {
- @{$parser_default_options->{'expanded_formats'}} =
- grep {$_ ne $region} @{$parser_default_options->{'expanded_formats'}};
-# @{$default_expanded_format}
-# = grep {$_ ne $region} @{$default_expanded_format};
- }
-}
-
-my $result_options = Getopt::Long::GetOptions (
- 'help|h' => sub { print help(); exit 0; },
- 'version|V' => sub {print "$real_command_name $configured_version\n\n";
- printf __("Copyright (C) %s Free Software Foundation, Inc.
-License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
-This is free software: you are free to change and redistribute it.
-There is NO WARRANTY, to the extent permitted by law.\n"), '2012';
- exit 0;},
- 'force' => \$force,
- 'ifhtml!' => sub { set_expansion('html', $_[1]); },
- 'ifinfo!' => sub { set_expansion('info', $_[1]); },
- 'ifxml!' => sub { set_expansion('xml', $_[1]); },
- 'ifdocbook!' => sub { set_expansion('docbook', $_[1]); },
- 'iftex!' => sub { set_expansion('tex', $_[1]); },
- 'ifplaintext!' => sub { set_expansion('plaintext', $_[1]); },
- 'use-sections!' => \$use_sections,
- 'count-words!' => \$count_words,
- 'no-warn' => \$no_warn,
- 'D=s' => sub {$parser_default_options->{'values'}->{$_[1]} = 1;},
- 'U=s' => sub {delete $parser_default_options->{'values'}->{$_[1]};},
- 'I=s' => sub {
- push @include_dirs, split(/$quoted_path_separator/, $_[1]); },
- 'P=s' => sub { unshift @prepend_dirs, split(/$quoted_path_separator/,
$_[1]); },
- 'number-sections!' => sub { set_from_cmdline('NUMBER_SECTIONS', $_[1]); },
-);
-
-exit 1 if (!$result_options);
-
-my @input_files = @ARGV;
-# use STDIN if not a tty, like makeinfo does
address@hidden = ('-') if (!scalar(@input_files) and !-t STDIN);
-
-die sprintf(__("%s: missing file argument.\n"), $real_command_name)
- .sprintf(__("Try `%s --help' for more information.\n"), $real_command_name)
- unless (scalar(@input_files) >= 1);
-
-
-if (scalar(@input_files) > 1) {
- warn sprintf(__("%s: superfluous file arguments.\n"), $real_command_name);
-}
-
-my $input_file_name = shift @input_files;
-
-sub help()
-{
- my $help =
- sprintf(__("Usage: %s [OPTION]... TEXINFO-FILE...\n"), $real_command_name)
- ."\n".
- __("Dump out a list of elements sorted by the number of lines (or words)
-they contain after removal of address@hidden")
-."\n";
-
- $help .= __("General Options:
- --count-words count words instead of lines.
- --force keep on even if the Texinfo file parsing failed.
- --help display this help and exit.
- --no-warn suppress warnings (but not errors).
- --use-sections use sections as elements instead of nodes.
- --version display version information and exit.\n")
-."\n";
- $help .= __("Input file options:
- -D VAR define the variable VAR, as with address@hidden
- -I DIR append DIR to the address@hidden search path.
- -P DIR prepend DIR to the address@hidden search path.
- -U VAR undefine the variable VAR, as with
address@hidden")
-."\n";
- $help .= __("Conditional processing in input:
- --ifdocbook process address@hidden and address@hidden
- --ifhtml process address@hidden and address@hidden
- --ifinfo process address@hidden
- --ifplaintext process address@hidden
- --iftex process address@hidden and address@hidden
- --ifxml process address@hidden and address@hidden
- --no-ifdocbook do not process address@hidden and address@hidden text.
- --no-ifhtml do not process address@hidden and address@hidden text.
- --no-ifinfo do not process address@hidden text.
- --no-ifplaintext do not process address@hidden text.
- --no-iftex do not process address@hidden and address@hidden text.
- --no-ifxml do not process address@hidden and address@hidden text.
-
- Also, for the --no-ifFORMAT options, do process address@hidden text.\n");
- return $help;
-
-}
-
-sub _exit($)
-{
- my $error_count = shift;
- exit (1) if ($error_count and !$force);
-}
-
-sub handle_errors($$)
-{
- my $self = shift;
- my $error_count = shift;
- my ($errors, $new_error_count) = $self->errors();
- $error_count += $new_error_count if ($new_error_count);
- foreach my $error_message (@$errors) {
- warn $error_message->{'error_line'} if ($error_message->{'type'} eq 'error'
- or !$no_warn);
- }
-
- _exit($error_count);
- return $error_count;
-}
-
-my $input_directory = '.';
-if ($input_file_name =~ /(.*\/)/) {
- $input_directory = $1;
-}
-
-my $parser_options = { %$parser_default_options };
-$parser_options->{'include_directories'} = address@hidden;
-my @prependended_include_directories = ('.');
-push @prependended_include_directories, $input_directory
- if ($input_directory ne '.');
-unshift @{$parser_options->{'include_directories'}},
- @prependended_include_directories;
-unshift @{$parser_options->{'include_directories'}}, @prepend_dirs;
-
-my $error_count = 0;
-my $parser = Texinfo::Parser::parser($parser_options);
-my $tree = $parser->parse_texi_file($input_file_name);
-
-if (!defined($tree)) {
- handle_errors($parser, $error_count);
- exit (1);
-}
-
-my $converter_options = {};
-$converter_options->{'parser'} = $parser;
-my $converter = Texinfo::Convert::TextContent->converter($converter_options);
-
-my ($sorted_name_counts_array, $formatted_result)
- = $converter->sort_element_counts($tree, $use_sections,
- $count_words);
-
-print STDOUT $formatted_result;
-
-1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- texinfo ChangeLog util/Makefile.am util/texi2ht...,
Patrice Dumas <=