diff options
author | Fred Drake <fdrake@acm.org> | 1998-07-25 03:31:46 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 1998-07-25 03:31:46 (GMT) |
commit | f7685d79e26417e6f7fe0ed337548f58a61950b8 (patch) | |
tree | 5525cf00f5e32130385443cb234688243adb9100 /Doc/perl | |
parent | b3a3ed8f725c69ea24be582798b9cccede52df8a (diff) | |
download | cpython-f7685d79e26417e6f7fe0ed337548f58a61950b8.zip cpython-f7685d79e26417e6f7fe0ed337548f58a61950b8.tar.gz cpython-f7685d79e26417e6f7fe0ed337548f58a61950b8.tar.bz2 |
Fix up the synopsis table stuff so it gets things right at each chapter,
instead of stringing it all together.
Yay!
Diffstat (limited to 'Doc/perl')
-rw-r--r-- | Doc/perl/python.perl | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/Doc/perl/python.perl b/Doc/perl/python.perl index 7af1909..107ed54 100644 --- a/Doc/perl/python.perl +++ b/Doc/perl/python.perl @@ -867,19 +867,25 @@ sub do_cmd_maketitle { require SynopsisTable; -$MY_CHAPTER_COUNTER = 0; - -sub get_chapter_id{ - return $MY_CHAPTER_COUNTER; +sub get_chapter_id(){ + my $id = do_cmd_thechapter(''); + $id =~ s/<SPAN CLASS="arabic">(\d+)<\/SPAN>\./\1/; + return $id; } -sub get_synopsis_table{ - my $chap = @_; +%ModuleSynopses = ('chapter' => 'SynopsisTable instance'); + +sub get_synopsis_table($){ + my($chap) = @_; my $st = $ModuleSynopses{$chap}; - if (!$st) { - $st = SynopsisTable->new(); - $ModuleSynopses{$chap} = $st; + my $key; + foreach $key (keys %ModuleSynopses) { + if ($key eq $chap) { + return $ModuleSynopses{$chap}; + } } + $st = SynopsisTable->new(); + $ModuleSynopses{$chap} = $st; return $st; } @@ -907,17 +913,17 @@ sub do_cmd_modulesynopsis{ sub do_cmd_localmoduletable{ local($_) = @_; - $MY_CHAPTER_COUNTER = $MY_CHAPTER_COUNTER + 1; my $chap = get_chapter_id(); "<tex2htmllocalmoduletable><$chap>" . $_; } sub process_all_localmoduletables{ while (/<tex2htmllocalmoduletable><(\d+)>/) { + my $match = $&; my $chap = $1; my $st = get_synopsis_table($chap); my $data = $st->tohtml(); - s/$&/$data/; + s/$match/$data/; } } |