[Python-checkins] CVS: python/dist/src/Doc/perl howto.perl,1.5,1.6 manual.perl,1.5,1.6 python.perl,1.96,1.97

Fred L. Drake fdrake@users.sourceforge.net
Tue, 10 Apr 2001 10:13:41 -0700


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

Modified Files:
	howto.perl manual.perl python.perl 
Log Message:

Add corresponding support for the alltt environment to the HTML generator.


Index: howto.perl
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/perl/howto.perl,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** howto.perl	1999/04/13 22:17:54	1.5
--- howto.perl	2001/04/10 17:13:39	1.6
***************
*** 7,11 ****
  
  do_require_package("article");
! #do_require_package("verbatim");
  do_require_package("python");
  
--- 7,11 ----
  
  do_require_package("article");
! do_require_package("alltt");
  do_require_package("python");
  

Index: manual.perl
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/perl/manual.perl,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** manual.perl	1999/04/13 22:17:55	1.5
--- manual.perl	2001/04/10 17:13:39	1.6
***************
*** 10,14 ****
  
  do_require_package("report");
! #do_require_package("verbatim");
  do_require_package("python");
  
--- 10,14 ----
  
  do_require_package("report");
! do_require_package("alltt");
  do_require_package("python");
  

Index: python.perl
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/perl/python.perl,v
retrieving revision 1.96
retrieving revision 1.97
diff -C2 -r1.96 -r1.97
*** python.perl	2001/03/29 18:24:08	1.96
--- python.perl	2001/04/10 17:13:39	1.97
***************
*** 1594,1596 ****
--- 1594,1642 ----
  
  
+ $alltt_start = '<dl><dd><pre class="verbatim">';
+ $alltt_end = '</pre></dl>';
+ 
+ sub do_env_alltt {
+     local ($_) = @_;
+     local($closures,$reopens,@open_block_tags);
+ 
+     # get the tag-strings for all open tags
+     local(@keep_open_tags) = @$open_tags_R;
+     ($closures,$reopens) = &preserve_open_tags() if (@$open_tags_R);
+ 
+     # get the tags for text-level tags only
+     $open_tags_R = [ @keep_open_tags ];
+     local($local_closures, $local_reopens);
+     ($local_closures, $local_reopens,@open_block_tags)
+       = &preserve_open_block_tags
+ 	if (@$open_tags_R);
+ 
+     $open_tags_R = [ @open_block_tags ];
+ 
+     do {
+ 	local($open_tags_R) = [ @open_block_tags ];
+ 	local(@save_open_tags) = ();
+ 
+ 	local($cnt) = ++$global{'max_id'};
+ 	$_ = join('',"$O$cnt$C\\tt$O", ++$global{'max_id'}, $C
+ 		, $_ , $O, $global{'max_id'}, "$C$O$cnt$C");
+ 
+ 	$_ = &translate_environments($_);
+ 	$_ = &translate_commands($_) if (/\\/);
+ 
+ 	# preserve space-runs, using &nbsp;
+ 	while (s/(\S) ( +)/$1$2;SPMnbsp;/g){};
+ 	s/(<BR>) /$1;SPMnbsp;/g;
+ 
+ 	$_ = join('', $closures, $alltt_start, $local_reopens
+ 		, $_
+ 		, &balance_tags() #, $local_closures
+ 		, $alltt_end, $reopens);
+ 	undef $open_tags_R; undef @save_open_tags;
+     };
+     $open_tags_R = [ @keep_open_tags ];
+     $_;
+ }
+ 
+ 
  1;				# This must be the last line