texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/texi2html ChangeLog TODO texi2html.pl t...


From: Patrice Dumas
Subject: texinfo/texi2html ChangeLog TODO texi2html.pl t...
Date: Wed, 23 Jun 2010 19:45:08 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        10/06/23 19:45:08

Modified files:
        texi2html      : ChangeLog TODO texi2html.pl 
        texi2html/test/htmlxref: htmlxref.cnf 

Log message:
                * texi2html.pl: add variable substitution in htmlxref.cnf. Karl
                idea.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/texi2html/ChangeLog?cvsroot=texinfo&r1=1.502&r2=1.503
http://cvs.savannah.gnu.org/viewcvs/texinfo/texi2html/TODO?cvsroot=texinfo&r1=1.176&r2=1.177
http://cvs.savannah.gnu.org/viewcvs/texinfo/texi2html/texi2html.pl?cvsroot=texinfo&r1=1.386&r2=1.387
http://cvs.savannah.gnu.org/viewcvs/texinfo/texi2html/test/htmlxref/htmlxref.cnf?cvsroot=texinfo&r1=1.2&r2=1.3

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/texinfo/texinfo/texi2html/ChangeLog,v
retrieving revision 1.502
retrieving revision 1.503
diff -u -b -r1.502 -r1.503
--- ChangeLog   22 Jun 2010 23:25:28 -0000      1.502
+++ ChangeLog   23 Jun 2010 19:45:07 -0000      1.503
@@ -1,3 +1,8 @@
+2010-06-23  Patrice Dumas  <address@hidden>
+
+       * texi2html.pl: add variable substitution in htmlxref.cnf. Karl
+       idea.
+
 2010-06-22  Patrice Dumas  <address@hidden>
 
        * texi2html.pl: format the key of index entries as late as possible

Index: TODO
===================================================================
RCS file: /sources/texinfo/texinfo/texi2html/TODO,v
retrieving revision 1.176
retrieving revision 1.177
diff -u -b -r1.176 -r1.177
--- TODO        22 Jun 2010 23:25:28 -0000      1.176
+++ TODO        23 Jun 2010 19:45:08 -0000      1.177
@@ -3,14 +3,8 @@
 Before next release
 -------------------
 
-* variable expansion in htmlxref.cnf. syntax could be like
-var = value
-and expand ${var}
-
 * chapter and section in htmlxref.cnf
 
-* fix index entry and letter association
-
 * texi2html generates too much in cross references (report from Karl):
 
 For this xref:
@@ -24,10 +18,20 @@
       omitted
     * the node should only be used if there is no section name.
 
+* unconditionnally add a colon after index node and menu node
+  when not in texi2html mode. Report from Karl.
+
+* verify that a format option switch never overwrite previously
+  set user option switch. For example, right now, --html overrides
+  --no-split which is bad. Report from Karl.
 
 Later
 -----
 
+* have a way to know whether a description is present or not 
+  when formatting the menu_entry. This could allow not having a 
+  colon after menu_entry when there is no description.
+
 * test --headers --output, and the other order, especially when in 
   info mode, such that it triggers also plaintext. Also test with 
   directories and files.
@@ -413,8 +417,8 @@
   into errors.
 
 * when determining the different letters and later sorting them, there 
-  should not be transliteration, but instead perl sorting and i18n stuff
-  should be used. Cf testcases in encoding/encoding_index*.
+  perl sorting and i18n stuff should be used at least when 
+  --enable-encoding is set. Cf testcases in encoding/encoding_index*.
   Currently, for example for encoding_index-latin1 accented letters are
   at the end. And degree is at o...
 

Index: texi2html.pl
===================================================================
RCS file: /sources/texinfo/texinfo/texi2html/texi2html.pl,v
retrieving revision 1.386
retrieving revision 1.387
diff -u -b -r1.386 -r1.387
--- texi2html.pl        22 Jun 2010 23:25:29 -0000      1.386
+++ texi2html.pl        23 Jun 2010 19:45:08 -0000      1.387
@@ -91,7 +91,7 @@
 }
 
 # CVS version:
-# $Id: texi2html.pl,v 1.386 2010/06/22 23:25:29 pertusus Exp $
+# $Id: texi2html.pl,v 1.387 2010/06/23 19:45:08 pertusus Exp $
 
 # Homepage:
 my $T2H_HOMEPAGE = "http://www.nongnu.org/texi2html/";;
@@ -4314,6 +4314,7 @@
 # parse texinfo cnf file for external manual specifications. This was
 # discussed on texinfo list but not in makeinfo for now. 
 my @texinfo_htmlxref_files = locate_init_file ($texinfo_htmlxref, 1, 
address@hidden);
+
 foreach my $file (@texinfo_htmlxref_files)
 {
     print STDERR "html refs config file: $file\n" if ($T2H_DEBUG);    
@@ -4323,6 +4324,7 @@
          next;
     }
     my $line_nr = 0;
+    my %variables;
     while (my $hline = <HTMLXREF>)
     {
         my $line = $hline;
@@ -4331,6 +4333,15 @@
         #$hline =~ s/[#]\s.*//;
         $hline =~ s/^\s*//;
         next if $hline =~ /^\s*$/;
+        if ($hline =~ s/^\s*(\w+)\s*=\s*//)
+        {
+           # handle variables
+           my $var = $1;
+           my $re = join '|', map { quotemeta $_ } keys %variables;
+           $hline =~ s/\$\{($re)\}/defined $variables{$1} ? $variables{$1} : 
"\${$1}"/ge;
+           $variables{$var} = $hline;
+           next;
+        }
         my @htmlxref = split /\s+/, $hline;
         my $manual = shift @htmlxref;
         my $split_or_mono = shift @htmlxref;
@@ -4344,6 +4355,8 @@
         
         if (defined($href))
         {
+            my $re = join '|', map { quotemeta $_ } keys %variables;
+            $href =~ s/\$\{($re)\}/defined $variables{$1} ? $variables{$1} : 
"\${$1}"/ge;
             $href =~ s/\/*$// if ($split_or_mono ne 'mono');
             
$Texi2HTML::GLOBAL{'htmlxref'}->{$manual}->{$split_or_mono}->{'href'} = $href;
         }

Index: test/htmlxref/htmlxref.cnf
===================================================================
RCS file: /sources/texinfo/texinfo/texi2html/test/htmlxref/htmlxref.cnf,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- test/htmlxref/htmlxref.cnf  21 Jun 2010 07:03:15 -0000      1.2
+++ test/htmlxref/htmlxref.cnf  23 Jun 2010 19:45:08 -0000      1.3
@@ -1,4 +1,9 @@
 # a comment
   # a comment
-manual split split-dir-manual/
+
+R = split
+ _1A=dir-
+S = ${R}-${_1A}manu
+
+manual split ${S}al/
 manual mono   mono-manual.html



reply via email to

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