[Python-checkins] python/dist/src/Doc/perl l2hinit.perl,1.74.6.1,1.74.6.2 python.perl,1.137.4.1,1.137.4.2

fdrake@users.sourceforge.net fdrake@users.sourceforge.net
Thu, 24 Jul 2003 19:46:06 -0700


Update of /cvsroot/python/python/dist/src/Doc/perl
In directory sc8-pr-cvs1:/tmp/cvs-serv24384/perl

Modified Files:
      Tag: indexing-cleanup-branch
	l2hinit.perl python.perl 
Log Message:
Start changing the data files generated during the HTML formatting to use
an XML-based representation.

**NOTE:**  This breaks formatting of the indexes on this branch for now
because the index generation tools have not yet been modified to use this
new XML-based input.  The XML format itself is expected to change to
provide more detailed information.


Index: l2hinit.perl
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/perl/l2hinit.perl,v
retrieving revision 1.74.6.1
retrieving revision 1.74.6.2
diff -C2 -d -r1.74.6.1 -r1.74.6.2
*** l2hinit.perl	22 Jul 2003 06:44:33 -0000	1.74.6.1
--- l2hinit.perl	25 Jul 2003 02:46:04 -0000	1.74.6.2
***************
*** 319,322 ****
--- 319,323 ----
  sub add_idx() {
      print "\nBuilding HTML for the index ...";
+     print IDXFILE "</index>\n";
      close(IDXFILE);
      insert_index($idx_mark, 'index.dat', $INDEX_COLUMNS, 1, '');
***************
*** 347,363 ****
      }
      open(MODIDXFILE, '>modindex.dat') || die "\n$!\n";
      foreach $key (keys %Modules) {
  	# dump the line in the data file; just use an empty seqno field
  	my $plat = '';
  	if ($ModulePlatforms{$key} && !$allthesame) {
! 	    $plat = (" <em>(<span class=\"platform\">$ModulePlatforms{$key}"
! 		     . '</span>)</em>');
  	}
!         my $s = "$Modules{$key}$IDXFILE_FIELD_SEP$key";
!         $s =~ s/<a href="([^\"]+)">/$1/;
!         print MODIDXFILE ("$s$plat"
!                           . $IDXFILE_FIELD_SEP
!                           . "\n");
      }
      close(MODIDXFILE);
  
--- 348,367 ----
      }
      open(MODIDXFILE, '>modindex.dat') || die "\n$!\n";
+     print MODIDXFILE "<index>\n";
      foreach $key (keys %Modules) {
  	# dump the line in the data file; just use an empty seqno field
  	my $plat = '';
  	if ($ModulePlatforms{$key} && !$allthesame) {
! 	    $plat = "<span class=\"platform\">$ModulePlatforms{$key}</span>";
  	}
!         my $s = $Modules{$key};
!         $s =~ /<a href="([^\"]+)">/;
!         my $link = $1;
!         print MODIDXFILE "  <entry link='$link'>\n";
!         print MODIDXFILE "    <text>$key</text>\n";
!         print MODIDXFILE "    <annotation>$plat</annotation>\n" if $plat;
!         print MODIDXFILE "  </entry>\n";
      }
+     print MODIDXFILE "</index>\n";
      close(MODIDXFILE);
  

Index: python.perl
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/perl/python.perl,v
retrieving revision 1.137.4.1
retrieving revision 1.137.4.2
diff -C2 -d -r1.137.4.1 -r1.137.4.2
*** python.perl	22 Jul 2003 06:44:34 -0000	1.137.4.1
--- python.perl	25 Jul 2003 02:46:04 -0000	1.137.4.2
***************
*** 480,500 ****
  
  # We're in the document subdirectory when this happens!
- #
  open(IDXFILE, '>index.dat') || die "\n$!\n";
  open(INTLABELS, '>intlabels.pl') || die "\n$!\n";
  print INTLABELS "%internal_labels = ();\n";
  print INTLABELS "1;		# hack in case there are no entries\n\n";
  
- # Using \0 for this is bad because we can't use common tools to work with the
- # resulting files.  Things like grep can be useful with this stuff!
- #
- $IDXFILE_FIELD_SEP = "\1";
- 
  sub write_idxfile($$){
      my($ahref, $str) = @_;
!     my $info = "$ahref$IDXFILE_FIELD_SEP$str\n";
!     $info =~ s/<a href=['"]([^'"]+)['"]>/$1/;
!     $info =~ s/###/$IDXFILE_FIELD_SEP/;
!     print IDXFILE $info;
  }
  
--- 480,508 ----
  
  # We're in the document subdirectory when this happens!
  open(IDXFILE, '>index.dat') || die "\n$!\n";
+ print IDXFILE "<index>\n";
+ 
  open(INTLABELS, '>intlabels.pl') || die "\n$!\n";
  print INTLABELS "%internal_labels = ();\n";
  print INTLABELS "1;		# hack in case there are no entries\n\n";
  
  sub write_idxfile($$){
      my($ahref, $str) = @_;
!     $ahref =~ /<a href=['"]([^'"]+)['"]>$/;
!     my $link = $1;
!     $str =~ /(.*)###0*([1-9]\d*)$/;
!     my $text = $1;
!     my $seqno = $2;
!     my $annotation = '';
!     if ($text =~ /(.*) \(([^)]+)\)$/) {
!         $annotation = $2;
!         $text = $1;
!     }
!     print IDXFILE "  <entry link='$link'";
!     print IDXFILE " seqno='$seqno'" if $seqno;
!     print IDXFILE ">\n";
!     print IDXFILE "    <text>$text</text>\n";
!     print IDXFILE "    <annotation>$annotation</annotation>\n" if $annotation;
!     print IDXFILE "  </entry>\n";
  }