diff options
author | Fred Drake <fdrake@acm.org> | 1999-01-05 14:39:27 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 1999-01-05 14:39:27 (GMT) |
commit | 7d45f6dcc4883983ad33fde9fff0096636c3466e (patch) | |
tree | ffe4bc7aa3601ca0063f06daecbed4503b3dd230 /Doc | |
parent | caa0606471e48e9865df53158cc66de2143127e2 (diff) | |
download | cpython-7d45f6dcc4883983ad33fde9fff0096636c3466e.zip cpython-7d45f6dcc4883983ad33fde9fff0096636c3466e.tar.gz cpython-7d45f6dcc4883983ad33fde9fff0096636c3466e.tar.bz2 |
do_cmd_methodline(): New function, implements indexing version of
\methodline.
Fixed up support for \withsubitem, hopefully improving the fidelity of
the index a bit.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/perl/python.perl | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/Doc/perl/python.perl b/Doc/perl/python.perl index 6e7d38f..3986669 100644 --- a/Doc/perl/python.perl +++ b/Doc/perl/python.perl @@ -230,25 +230,30 @@ sub do_cmd_versionchanged{ $INDEX_SUBITEM = ""; sub get_indexsubitem{ - #$INDEX_SUBITEM ? " $INDEX_SUBITEM" : ''; - return ''; + return $INDEX_SUBITEM ? " $INDEX_SUBITEM" : ''; } sub do_cmd_setindexsubitem{ local($_) = @_; - $INDEX_SUBITEM = next_argument(); + my $subitem = next_argument(); + $INDEX_SUBITEM = $subitem; return $_; } sub do_cmd_withsubitem{ - # We can't really do the right right thing, because LaTeX2HTML doesn't + # We can't really do the right thing, because LaTeX2HTML doesn't # do things in the right order, but we need to at least strip this stuff # out, and leave anything that the second argument expanded out to. # local($_) = @_; - next_argument(); + my $oldsubitem = $INDEX_SUBITEM; + $INDEX_SUBITEM = next_argument(); my $stuff = next_argument(); - return $stuff . $_; + my ($open, $close) = ($O, $C); + return + $stuff + . "\\setindexsubitem${open}1$close$oldsubitem${open}1$close" + . $_; } # This is the prologue macro which is required to start writing the @@ -642,6 +647,25 @@ sub do_env_methoddesc{ } +sub do_cmd_methodline{ + local($_) = @_; + my $class_name = next_optional_argument(); + $class_name = $THIS_CLASS + unless $class_name; + my $method = next_argument(); + my $arg_list = next_argument(); + my $extra = ''; + if ($class_name) { + $extra = " ($class_name method)"; + } + my $idx = make_str_index_entry($br_id, "<tt>$method_name()</tt>$extra"); + $idx =~ s/ \(.*\)//; + $idx =~ s/\(\)//; + return "<dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>" + . $_; +} + + sub do_cmd_methodlineni{ local($_) = @_; next_optional_argument(); |