Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 1 | # python.perl by Fred L. Drake, Jr. <fdrake@acm.org> -*- perl -*- |
| 2 | # |
| 3 | # Heavily based on Guido van Rossum's myformat.perl (now obsolete). |
| 4 | # |
| 5 | # Extension to LaTeX2HTML for documents using myformat.sty. |
| 6 | # Subroutines of the form do_cmd_<name> here define translations |
| 7 | # for LaTeX commands \<name> defined in the corresponding .sty file. |
| 8 | |
| 9 | package main; |
| 10 | |
| 11 | |
| 12 | # words typeset in a special way (not in HTML though) |
| 13 | |
| 14 | sub do_cmd_ABC{ 'ABC' . @_[0]; } |
| 15 | sub do_cmd_UNIX{ 'Unix'. @_[0]; } |
| 16 | sub do_cmd_ASCII{ 'ASCII' . @_[0]; } |
| 17 | sub do_cmd_POSIX{ 'POSIX' . @_[0]; } |
| 18 | sub do_cmd_C{ 'C' . @_[0]; } |
| 19 | sub do_cmd_Cpp{ 'C++' . @_[0]; } |
| 20 | sub do_cmd_EOF{ 'EOF' . @_[0]; } |
| 21 | sub do_cmd_NULL{ '<tt>NULL</tt>' . @_[0]; } |
| 22 | |
| 23 | sub do_cmd_e{ '\' . @_[0]; } |
| 24 | |
| 25 | $AUTHOR_ADDRESS = ''; |
| 26 | $PYTHON_VERSION = ''; |
| 27 | |
| 28 | sub do_cmd_version{ $PYTHON_VERSION . @_[0]; } |
| 29 | sub do_cmd_release{ |
| 30 | local($_) = @_; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 31 | s/$next_pair_pr_rx//; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 32 | $PYTHON_VERSION = "$2"; |
| 33 | $_; |
| 34 | } |
| 35 | |
| 36 | sub do_cmd_authoraddress{ |
| 37 | local($_) = @_; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 38 | s/$next_pair_pr_rx//; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 39 | $AUTHOR_ADDRESS = "$2"; |
| 40 | $_; |
| 41 | } |
| 42 | |
| 43 | sub do_cmd_hackscore{ |
| 44 | local($_) = @_; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 45 | s/$next_pair_pr_rx/_/; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 46 | $_; |
| 47 | } |
| 48 | |
| 49 | sub do_cmd_optional{ |
| 50 | local($_) = @_; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 51 | s|$next_pair_pr_rx|</var><big>\[</big><var>\2</var><big>\]</big><var>|; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 52 | $_; |
| 53 | } |
| 54 | |
| 55 | sub do_cmd_varvars{ |
| 56 | local($_) = @_; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 57 | s|$next_pair_pr_rx|<var>\2</var>|; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 58 | $_; |
| 59 | } |
| 60 | |
Fred Drake | 10ad52e | 1998-04-04 04:19:20 +0000 | [diff] [blame^] | 61 | sub use_current{ |
Fred Drake | 2b8093a | 1998-04-02 22:33:44 +0000 | [diff] [blame] | 62 | local($_) = @_; |
| 63 | s|$next_pair_pr_rx|\2|; |
| 64 | $_; |
| 65 | } |
| 66 | |
Fred Drake | 10ad52e | 1998-04-04 04:19:20 +0000 | [diff] [blame^] | 67 | sub do_cmd_pytype{ use_current(); } |
| 68 | sub do_cmd_makevar{ use_current(); } |
| 69 | |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 70 | # Logical formatting (some based on texinfo), needs to be converted to |
| 71 | # minimalist HTML. The "minimalist" is primarily to reduce the size of |
| 72 | # output files for users that read them over the network rather than |
| 73 | # from local repositories. |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 74 | |
| 75 | sub do_cmd_code{ |
| 76 | local($_) = @_; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 77 | s|$next_pair_pr_rx|<tt>\2</tt>|; |
| 78 | $_; |
| 79 | } |
| 80 | |
| 81 | sub use_sans_serif{ |
| 82 | local($_) = @_; |
| 83 | s|$next_pair_pr_rx|<font face=sans-serif>\2</font>|; |
| 84 | $_; |
| 85 | } |
| 86 | |
| 87 | sub use_italics{ |
| 88 | local($_) = @_; |
| 89 | s|$next_pair_pr_rx|<i>\2</i>|; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 90 | $_; |
| 91 | } |
| 92 | |
| 93 | sub do_cmd_sectcode{ &do_cmd_code(@_); } |
| 94 | sub do_cmd_module{ &do_cmd_code(@_); } |
| 95 | sub do_cmd_keyword{ &do_cmd_code(@_); } |
| 96 | sub do_cmd_exception{ &do_cmd_code(@_); } |
| 97 | sub do_cmd_class{ &do_cmd_code(@_); } |
| 98 | sub do_cmd_function{ &do_cmd_code(@_); } |
| 99 | sub do_cmd_constant{ &do_cmd_code(@_); } |
| 100 | sub do_cmd_member{ &do_cmd_code(@_); } |
| 101 | sub do_cmd_method{ &do_cmd_code(@_); } |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 102 | sub do_cmd_cfunction{ &do_cmd_code(@_); } |
| 103 | sub do_cmd_cdata{ &do_cmd_code(@_); } |
| 104 | sub do_cmd_ctype{ &do_cmd_code(@_); } |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 105 | sub do_cmd_regexp{ &do_cmd_code(@_); } |
| 106 | sub do_cmd_key{ &do_cmd_code(@_); } |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 107 | |
Fred Drake | fc16e78 | 1998-03-12 21:03:26 +0000 | [diff] [blame] | 108 | sub do_cmd_character{ &do_cmd_samp(@_); } |
| 109 | |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 110 | sub do_cmd_program{ &do_cmd_strong(@_); } |
| 111 | |
| 112 | sub do_cmd_email{ &use_sans_serif(@_); } |
| 113 | sub do_cmd_mimetype{ &use_sans_serif(@_); } |
| 114 | |
| 115 | sub do_cmd_var{ &use_italics(@_); } |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 116 | sub do_cmd_dfn{ &use_italics(@_); } # make an index entry? |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 117 | sub do_cmd_emph{ &use_italics(@_); } |
| 118 | |
Fred Drake | 1a7af39 | 1998-04-01 22:44:56 +0000 | [diff] [blame] | 119 | sub do_cmd_newsgroup{ |
| 120 | local($_) = @_; |
| 121 | s/$next_pair_pr_rx//o; |
| 122 | my $newsgroup = $2; |
| 123 | my $stuff = "<a href=\"news:$newsgroup\"><font face=sans-serif>" |
| 124 | . "$newsgroup</font></a>"; |
| 125 | $stuff . $_; |
| 126 | } |
Fred Drake | fc16e78 | 1998-03-12 21:03:26 +0000 | [diff] [blame] | 127 | |
| 128 | sub do_cmd_envvar{ |
| 129 | local($_) = @_; |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 130 | s/$next_pair_pr_rx//; |
| 131 | my($br_id,$envvar) = ($1, $2); |
| 132 | my($name,$aname,$ahref) = link_info($br_id); |
| 133 | add_index_entry("environment variables!$envvar@\$$envvar", $ahref); |
| 134 | add_index_entry("$envvar@\$$envvar", $ahref); |
| 135 | "$aname\$$envvar</a>" . $_; |
Fred Drake | fc16e78 | 1998-03-12 21:03:26 +0000 | [diff] [blame] | 136 | } |
| 137 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 138 | sub do_cmd_url{ |
| 139 | # use the URL as both text and hyperlink |
| 140 | local($_) = @_; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 141 | s/$next_pair_pr_rx//; |
| 142 | my $url = $2; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 143 | $url =~ s/~/~/g; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 144 | "<a href=\"$url\"><font face=sans-serif>$url</font></a>" . $_; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 145 | } |
| 146 | |
| 147 | sub do_cmd_manpage{ |
| 148 | # two parameters: \manpage{name}{section} |
| 149 | local($_) = @_; |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 150 | my $rx = "$next_pair_pr_rx$any_next_pair_pr_rx3"; |
| 151 | s|$rx|<i>\2</i>(\4)|; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 152 | $_; |
| 153 | } |
| 154 | |
| 155 | sub do_cmd_rfc{ |
| 156 | local($_) = @_; |
| 157 | s/$next_pair_pr_rx//; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 158 | my($br_id,$rfcnumber) = ($1, $2); |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 159 | |
| 160 | # Save the reference |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 161 | my $nstr = &gen_index_id("RFC!RFC $rfcnumber", ''); |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 162 | $index{$nstr} .= &make_half_href("$CURRENT_FILE#$br_id"); |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 163 | "<a name=$br_id>RFC $rfcnumber</a>" .$_; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 164 | } |
| 165 | |
| 166 | sub do_cmd_kbd{ |
| 167 | local($_) = @_; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 168 | s|$next_pair_pr_rx|<kbd>\2</kbd>|; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 169 | $_; |
| 170 | } |
| 171 | |
| 172 | sub do_cmd_strong{ |
| 173 | local($_) = @_; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 174 | s|$next_pair_pr_rx|<b>\2</b>|; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 175 | $_; |
| 176 | } |
| 177 | |
| 178 | sub do_cmd_deprecated{ |
| 179 | # two parameters: \deprecated{version}{whattodo} |
| 180 | local($_) = @_; |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 181 | my $rx = "$next_pair_pr_rx$any_next_pair_pr_rx3"; |
| 182 | s|$rx|<b>Deprecated since release \2.</b>\n\4<p>|; |
| 183 | $_; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 184 | } |
| 185 | |
| 186 | # file and samp are at the end of this file since they screw up fontlock. |
| 187 | |
| 188 | # index commands |
| 189 | |
| 190 | $INDEX_SUBITEM = ""; |
| 191 | |
| 192 | sub get_indexsubitem{ |
Fred Drake | fc16e78 | 1998-03-12 21:03:26 +0000 | [diff] [blame] | 193 | #$INDEX_SUBITEM ? " $INDEX_SUBITEM" : ''; |
| 194 | ''; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 195 | } |
| 196 | |
| 197 | sub do_cmd_setindexsubitem{ |
| 198 | local($_) = @_; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 199 | s/$next_pair_pr_rx//; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 200 | $INDEX_SUBITEM = $2; |
| 201 | $_; |
| 202 | } |
| 203 | |
Fred Drake | fc16e78 | 1998-03-12 21:03:26 +0000 | [diff] [blame] | 204 | sub do_cmd_withsubitem{ |
| 205 | # We can't really do the right right thing, because LaTeX2HTML doesn't |
| 206 | # do things in the right order, but we need to at least strip this stuff |
| 207 | # out, and leave anything that the second argument expanded out to. |
| 208 | # |
| 209 | local($_) = @_; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 210 | my $any_next_pair_pr_rx3 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP"; |
Fred Drake | fc16e78 | 1998-03-12 21:03:26 +0000 | [diff] [blame] | 211 | s/$next_pair_pr_rx$any_next_pair_pr_rx3/\4/; |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 212 | $INDEX_SUBITEM = $2; |
Fred Drake | fc16e78 | 1998-03-12 21:03:26 +0000 | [diff] [blame] | 213 | $_; |
| 214 | } |
| 215 | |
| 216 | sub do_cmd_makemodindex{ @_[0]; } |
| 217 | |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 218 | # We're in the document subdirectory when this happens! |
| 219 | open(IDXFILE, ">index.dat") || die "\n$!\n"; |
| 220 | open(INTLABELS, ">intlabels.pl") || die "\n$!\n"; |
| 221 | print INTLABELS |
| 222 | "%internal_labels = ();\n1; # hack in case there are no entries\n\n"; |
| 223 | |
| 224 | sub gen_target_name{ |
| 225 | "l2h-" . @_[0]; |
| 226 | } |
| 227 | |
| 228 | sub gen_target{ |
| 229 | "<a name=\"" . @_[0] . "\">"; |
| 230 | } |
| 231 | |
| 232 | sub gen_link{ |
| 233 | my($node,$target) = @_; |
| 234 | print INTLABELS "\$internal_labels{\"$target\"} = \"$URL/$node\";\n"; |
| 235 | "<a href=\"$node#$target\">"; |
| 236 | } |
| 237 | |
| 238 | sub make_index_entry{ |
| 239 | my($br_id,$str) = @_; |
| 240 | my($name,$aname,$ahref) = link_info($br_id); |
| 241 | add_index_entry($str, $ahref); |
| 242 | "$aname$anchor_invisible_mark</a>"; |
| 243 | } |
| 244 | |
| 245 | sub add_index_entry{ |
| 246 | # add an entry to the index structures; ignore the return value |
| 247 | my($str,$ahref) = @_; |
| 248 | $str = gen_index_id($str, ''); |
| 249 | $index{$str} .= $ahref; |
| 250 | print IDXFILE $ahref, "\0", $str, "\n"; |
| 251 | } |
| 252 | |
| 253 | sub link_info{ |
| 254 | my $name = gen_target_name(@_[0]); |
| 255 | my $aname = gen_target($name); |
| 256 | my $ahref = gen_link($CURRENT_FILE, $name); |
| 257 | return ($name, $aname, $ahref); |
| 258 | } |
| 259 | |
| 260 | sub do_cmd_index{ |
| 261 | local($_) = @_; |
| 262 | s/$next_pair_pr_rx[\n]?//o; |
| 263 | my($br_id,$str) = ($1, $2); |
| 264 | # |
| 265 | my($name,$aname,$ahref) = link_info($br_id); |
| 266 | add_index_entry("$str", $ahref); |
| 267 | "$aname$anchor_invisible_mark</a>" . $_; |
| 268 | } |
| 269 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 270 | sub do_cmd_indexii{ |
| 271 | local($_) = @_; |
| 272 | s/$next_pair_pr_rx//o; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 273 | my($br_id1,$str1) = ($1, $2); |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 274 | s/$next_pair_pr_rx[\n]?//o; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 275 | my($br_id2,$str2) = ($1, $2); |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 276 | # |
| 277 | my($name,$aname,$ahref) = link_info($br_id1); |
| 278 | add_index_entry("$str1!$str2", $ahref); |
| 279 | add_index_entry("$str2!$str1", $ahref); |
| 280 | "$aname$anchor_invisible_mark</a>" . $_; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 281 | } |
| 282 | |
| 283 | sub do_cmd_indexiii{ |
| 284 | local($_) = @_; |
| 285 | s/$next_pair_pr_rx//o; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 286 | my($br_id1,$str1) = ($1, $2); |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 287 | s/$next_pair_pr_rx//o; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 288 | my($br_id2,$str2) = ($1, $2); |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 289 | s/$next_pair_pr_rx[\n]?//o; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 290 | my($br_id3,$str3) = ($1, $2); |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 291 | # |
| 292 | my($name,$aname,$ahref) = link_info($br_id1); |
| 293 | add_index_entry("$str1!$str2 $str3", $ahref); |
| 294 | add_index_entry("$str2!$str3, $str1", $ahref); |
| 295 | add_index_entry("$str3!$str1 $str2", $ahref); |
| 296 | "$aname$anchor_invisible_mark</a>" . $_; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 297 | } |
| 298 | |
| 299 | sub do_cmd_indexiv{ |
| 300 | local($_) = @_; |
| 301 | s/$next_pair_pr_rx//o; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 302 | my($br_id1,$str1) = ($1, $2); |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 303 | s/$next_pair_pr_rx//o; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 304 | my($br_id2,$str2) = ($1, $2); |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 305 | s/$next_pair_pr_rx//o; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 306 | my($br_id3,$str3) = ($1, $2); |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 307 | s/$next_pair_pr_rx[\n]?//o; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 308 | my($br_id4,$str4) = ($1, $2); |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 309 | # |
| 310 | my($name,$aname,$ahref) = link_info($br_id1); |
| 311 | add_index_entry("$str1!$str2 $str3 $str4", $ahref); |
| 312 | add_index_entry("$str2!$str3 $str4, $str1", $ahref); |
| 313 | add_index_entry("$str3!$str4, $str1 $str2", $ahref); |
| 314 | add_index_entry("$str4!$$str1 $str2 $str3", $ahref); |
| 315 | "$aname$anchor_invisible_mark</a>" . $_; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 316 | } |
| 317 | |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 318 | sub do_cmd_ttindex{ |
| 319 | local($_) = @_; |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 320 | s/$next_pair_pr_rx[\n]?//; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 321 | my($br_id,$str) = ($1, $2); |
| 322 | &make_index_entry($br_id, $str . &get_indexsubitem) . $_; |
| 323 | } |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 324 | |
| 325 | sub my_typed_index_helper{ |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 326 | local($word,$_) = @_; |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 327 | s/$next_pair_pr_rx[\n]?//o; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 328 | my($br_id,$str) = ($1, $2); |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 329 | # |
| 330 | my($name,$aname,$ahref) = link_info($br_id1); |
| 331 | add_index_entry("$str $word", $ahref); |
| 332 | add_index_entry("$word!$str", $ahref); |
| 333 | "$aname$anchor_invisible_mark</a>" . $_; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 334 | } |
| 335 | |
| 336 | sub do_cmd_stindex{ &my_typed_index_helper('statement', @_); } |
| 337 | sub do_cmd_opindex{ &my_typed_index_helper('operator', @_); } |
| 338 | sub do_cmd_exindex{ &my_typed_index_helper('exception', @_); } |
| 339 | sub do_cmd_obindex{ &my_typed_index_helper('object', @_); } |
| 340 | |
| 341 | sub my_parword_index_helper{ |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 342 | local($word,$_) = @_; |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 343 | s/$next_pair_pr_rx[\n]?//o; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 344 | my($br_id,$str) = ($1, $2); |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 345 | make_index_entry($br_id, "$str ($word)") . $_; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 346 | } |
| 347 | |
| 348 | |
| 349 | # Set this to true to strip out the <tt>...</tt> from index entries; |
| 350 | # this is analogous to using the second definition of \idxcode{} from |
| 351 | # myformat.sty. |
| 352 | # |
| 353 | # It is used from &make_mod_index_entry() and &make_str_index_entry(). |
| 354 | # |
| 355 | $STRIP_INDEX_TT = 0; |
| 356 | |
| 357 | sub make_mod_index_entry{ |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 358 | my($br_id,$str,$define) = @_; |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 359 | my($name,$aname,$ahref) = link_info($br_id); |
| 360 | $str =~ s|<tt>(.*)</tt>|\1| |
| 361 | if $STRIP_INDEX_TT; |
| 362 | # equivalent of add_index_entry() using $define instead of '' |
| 363 | $str = gen_index_id($str, $define); |
| 364 | $index{$str} .= $ahref; |
| 365 | print IDXFILE $ahref, "\0", $str, "\n"; |
| 366 | |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 367 | if ($define eq 'DEF') { |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 368 | # add to the module index |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 369 | my($nstr,$garbage) = split / /, $str, 2; |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 370 | $Modules{$nstr} .= $ahref; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 371 | } |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 372 | "$aname$anchor_invisible_mark</a>"; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 373 | } |
| 374 | |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 375 | $THIS_MODULE = ''; |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 376 | $THIS_CLASS = ''; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 377 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 378 | sub my_module_index_helper{ |
| 379 | local($word, $_) = @_; |
| 380 | s/$next_pair_pr_rx[\n]*//o; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 381 | my($br_id, $str) = ($1, $2); |
| 382 | my $section_tag = join('', @curr_sec_id); |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 383 | $word = "$word " if $word; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 384 | $THIS_MODULE = "$str"; |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 385 | make_mod_index_entry("SECTION$section_tag", |
| 386 | "<tt>$str</tt> (${word}module)", 'DEF') . $_; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 387 | } |
| 388 | |
| 389 | sub ref_module_index_helper{ |
| 390 | local($word, $_) = @_; |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 391 | s/$next_pair_pr_rx[\n]?//o; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 392 | my($br_id, $str) = ($1, $2); |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 393 | $word = "$word " if $word; |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 394 | make_mod_index_entry($br_id, "<tt>$str</tt> (${word}module)", 'REF') . $_; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 395 | } |
| 396 | |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 397 | sub do_cmd_bifuncindex{ |
| 398 | local($_) = @_; |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 399 | s/$next_pair_pr_rx[\n]?//o; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 400 | my($br_id,$str,$fname) = ($1, $2, "<tt>$2()</tt>"); |
| 401 | $fname = "$str()" |
| 402 | if $STRIP_INDEX_TT; |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 403 | make_index_entry($br_id, "$fname (built-in function)") . $_; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 404 | } |
| 405 | |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 406 | sub do_cmd_modindex{ my_module_index_helper('', @_); } |
| 407 | sub do_cmd_bimodindex{ my_module_index_helper('built-in', @_); } |
| 408 | sub do_cmd_exmodindex{ my_module_index_helper('extension', @_); } |
| 409 | sub do_cmd_stmodindex{ my_module_index_helper('standard', @_); } |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 410 | |
| 411 | # these should be adjusted a bit.... |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 412 | sub do_cmd_refmodindex{ ref_module_index_helper('', @_); } |
| 413 | sub do_cmd_refbimodindex{ ref_module_index_helper('built-in', @_); } |
| 414 | sub do_cmd_refexmodindex{ ref_module_index_helper('extension', @_); } |
| 415 | sub do_cmd_refstmodindex{ ref_module_index_helper('standard', @_); } |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 416 | |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 417 | sub do_cmd_nodename{ do_cmd_label(@_); } |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 418 | |
| 419 | sub init_myformat{ |
| 420 | # XXX need some way for this to be called after &initialise; ??? |
| 421 | $anchor_mark = ''; |
| 422 | $icons{'anchor_mark'} = ''; |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 423 | my $cmark = "(?:$comment_mark)?"; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 424 | # <<2>>...<<2>> |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 425 | $next_pair_rx = "^[\\s\n%]*$O(\\d+)$C([\\s\\S]*)$O\\1$C"; |
| 426 | $any_next_pair_rx3 = "[\\s\n%]*$O(\\d+)$C([\\s\\S]*)$O\\3$C"; |
| 427 | $any_next_pair_rx5 = "[\\s\n%]*$O(\\d+)$C([\\s\\S]*)$O\\5$C"; |
| 428 | $any_next_pair_rx7 = "[\\s\n%]*$O(\\d+)$C([\\s\\S]*)$O\\7$C"; |
| 429 | $any_next_pair_rx9 = "[\\s\n%]*$O(\\d+)$C([\\s\\S]*)$O\\9$C"; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 430 | # <#2#>...<#2#> |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 431 | $next_pair_pr_rx = "^[\\s\n%]*$OP(\\d+)$CP([\\s\\S]*)$OP\\1$CP$cmark"; |
| 432 | $any_next_pair_pr_rx3 = "[\\s\n%]*$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP$cmark"; |
| 433 | $any_next_pair_pr_rx5 = "[\\s\n%]*$OP(\\d+)$CP([\\s\\S]*)$OP\\5$CP$cmark"; |
| 434 | $any_next_pair_pr_rx7 = "[\\s\n%]*$OP(\\d+)$CP([\\s\\S]*)$OP\\7$CP$cmark"; |
| 435 | $any_next_pair_pr_rx9 = "[\\s\n%]*$OP(\\d+)$CP([\\s\\S]*)$OP\\9$CP$cmark"; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 436 | } |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 437 | init_myformat(); |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 438 | |
| 439 | # similar to make_index_entry(), but includes the string in the result |
| 440 | # instead of the dummy filler. |
| 441 | # |
| 442 | sub make_str_index_entry{ |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 443 | my($br_id,$str) = @_; |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 444 | my($name,$aname,$ahref) = link_info($br_id); |
| 445 | $str =~ s|<tt>(.*)</tt>|\1| |
| 446 | if $STRIP_INDEX_TT; |
| 447 | add_index_entry($str, $ahref); |
| 448 | "$aname$str</a>"; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 449 | } |
| 450 | |
| 451 | # Changed from the stock version to indent {verbatim} sections, |
| 452 | # and make them smaller, to better match the LaTeX version: |
| 453 | |
| 454 | # (Used with LaTeX2HTML 96.1*) |
| 455 | sub replace_verbatim { |
| 456 | # Modifies $_ |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 457 | my($prefix,$suffix) = ("\n<p><dl><dd><pre>\n", "</pre></dl>"); |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 458 | s/$verbatim_mark(verbatim)(\d+)/$prefix$verbatim{$2}$suffix/go; |
| 459 | s/$verbatim_mark(rawhtml)(\d+)/$verbatim{$2}/ego; # Raw HTML |
| 460 | } |
| 461 | |
| 462 | # (Used with LaTeX2HTML 98.1) |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 463 | # The HTML this produces is bad; the <PRE> is on the outside of the <dl>, |
| 464 | # but I haven't found a workaround yet. |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 465 | sub replace_verbatim_hook{ |
| 466 | # Modifies $_ |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 467 | my($prefix,$suffix) = ("\n<p><dl><dd>", "</dl>"); |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 468 | s/$math_verbatim_rx/&put_comment("MATH: ".$verbatim{$1})/eg; |
| 469 | s/$verbatim_mark(\w*[vV]erbatim\*?)(\d+)\#/$prefix$verbatim{$2}$suffix/go; |
| 470 | # Raw HTML, but replacements may have protected characters |
| 471 | s/$verbatim_mark(rawhtml)(\d+)#/&unprotect_raw_html($verbatim{$2})/eg; |
| 472 | s/$verbatim_mark$keepcomments(\d+)#/$verbatim{$2}/ego; # Raw TeX |
| 473 | s/$unfinished_mark$keepcomments(\d+)#/$verbatim{$2}/ego; # Raw TeX |
| 474 | } |
| 475 | |
| 476 | sub do_env_cfuncdesc{ |
| 477 | local($_) = @_; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 478 | my($return_type,$function_name,$arg_list,$idx) = ('', '', '', ''); |
| 479 | my $any_next_pair_rx3 = "$O(\\d+)$C([\\s\\S]*)$O\\3$C"; |
| 480 | my $any_next_pair_rx5 = "$O(\\d+)$C([\\s\\S]*)$O\\5$C"; |
| 481 | my $cfuncdesc_rx = "$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5"; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 482 | if (/$cfuncdesc_rx/o) { |
| 483 | $return_type = "$2"; |
| 484 | $function_name = "$4"; |
| 485 | $arg_list = "$6"; |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 486 | $idx = make_str_index_entry($3, |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 487 | "<tt>$function_name()</tt>" . &get_indexsubitem); |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 488 | $idx =~ s/ \(.*\)//; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 489 | $idx =~ s/\(\)//; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 490 | } |
| 491 | "<dl><dt>$return_type <b>$idx</b>" |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 492 | . "(<var>$arg_list</var>)\n<dd>$'</dl>" |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 493 | } |
| 494 | |
| 495 | sub do_env_ctypedesc{ |
| 496 | local($_) = @_; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 497 | my $type_name = (''); |
| 498 | my $cfuncdesc_rx = "$next_pair_rx"; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 499 | if (/$cfuncdesc_rx/o) { |
| 500 | $type_name = "$2"; |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 501 | $idx = make_str_index_entry($1, |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 502 | "<tt>$type_name</tt>" . &get_indexsubitem); |
| 503 | $idx =~ s/ \(.*\)//; |
| 504 | } |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 505 | "<dl><dt><b>$idx</b>\n<dd>$'</dl>" |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 506 | } |
| 507 | |
| 508 | sub do_env_cvardesc{ |
| 509 | local($_) = @_; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 510 | my($var_type,$var_name,$idx) = ('', '', ''); |
| 511 | my $cfuncdesc_rx = "$next_pair_rx$any_next_pair_rx3"; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 512 | if (/$cfuncdesc_rx/o) { |
| 513 | $var_type = "$2"; |
| 514 | $var_name = "$4"; |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 515 | $idx = make_str_index_entry($3, |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 516 | "<tt>$var_name</tt>" . &get_indexsubitem); |
| 517 | $idx =~ s/ \(.*\)//; |
| 518 | } |
| 519 | "<dl><dt>$var_type <b>$idx</b>\n" |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 520 | . "<dd>$'</dl>"; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 521 | } |
| 522 | |
| 523 | sub do_env_funcdesc{ |
| 524 | local($_) = @_; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 525 | my($function_name,$arg_list,$idx) = ('', '', ''); |
| 526 | my $funcdesc_rx = "$next_pair_rx$any_next_pair_rx3"; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 527 | if (/$funcdesc_rx/o) { |
| 528 | $function_name = "$2"; |
| 529 | $arg_list = "$4"; |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 530 | $idx = make_str_index_entry($3, "<tt>$function_name()</tt>" |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 531 | . &get_indexsubitem); |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 532 | $idx =~ s/ \(.*\)//; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 533 | $idx =~ s/\(\)//; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 534 | } |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 535 | "<dl><dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>$'</dl>"; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 536 | } |
| 537 | |
| 538 | sub do_env_funcdescni{ |
| 539 | local($_) = @_; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 540 | my($function_name,$arg_list,$idx) = ('', '', ''); |
| 541 | my $funcdesc_rx = "$next_pair_rx$any_next_pair_rx3"; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 542 | if (/$funcdesc_rx/o) { |
| 543 | $function_name = "$2"; |
| 544 | $arg_list = "$4"; |
| 545 | if ($STRIP_INDEX_TT) { |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 546 | $idx = "$function_name"; } |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 547 | else { |
| 548 | $idx = "<tt>$function_name</tt>"; } |
| 549 | } |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 550 | "<dl><dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>$'</dl>"; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 551 | } |
| 552 | |
| 553 | sub do_cmd_funcline{ |
| 554 | local($_) = @_; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 555 | my $any_next_pair_pr_rx3 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP"; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 556 | |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 557 | s/$next_pair_pr_rx//o; |
| 558 | my $function_name = $2; |
| 559 | s/$next_pair_pr_rx//o; |
| 560 | my($br_id,$arg_list) = ($1, $2); |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 561 | my $idx = make_str_index_entry($br_id, "<tt>$function_name()</tt>" |
| 562 | . &get_indexsubitem); |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 563 | $idx =~ s/\(\)//; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 564 | |
| 565 | "<dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>" . $_; |
| 566 | } |
| 567 | |
| 568 | # Change this flag to index the opcode entries. I don't think it's very |
| 569 | # useful to index them, since they're only presented to describe the dis |
| 570 | # module. |
| 571 | # |
| 572 | $INDEX_OPCODES = 0; |
| 573 | |
| 574 | sub do_env_opcodedesc{ |
| 575 | local($_) = @_; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 576 | my($opcode_name,$arg_list,$stuff,$idx) = ('', '', '', ''); |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 577 | my $opcodedesc_rx = "$next_pair_rx$any_next_pair_rx3"; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 578 | if (/$opcodedesc_rx/o) { |
| 579 | $opcode_name = "$2"; |
| 580 | $arg_list = "$4"; |
| 581 | if ($INDEX_OPCODES) { |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 582 | $idx = make_str_index_entry($3, |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 583 | "<tt>$opcode_name</tt> (byte code instruction)"); |
| 584 | $idx =~ s/ \(byte code instruction\)//; |
| 585 | } |
| 586 | else { |
| 587 | $idx = "<tt>$opcode_name</tt>"; |
| 588 | } |
| 589 | } |
| 590 | $stuff = "<dl><dt><b>$idx</b>"; |
| 591 | if ($arg_list) { |
| 592 | $stuff .= " <var>$arg_list</var>"; |
| 593 | } |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 594 | $stuff . "\n<dd>$'</dl>"; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 595 | } |
| 596 | |
| 597 | sub do_env_datadesc{ |
| 598 | local($_) = @_; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 599 | my $idx = ''; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 600 | if (/$next_pair_rx/o) { |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 601 | $idx = make_str_index_entry($1, "<tt>$2</tt>" . &get_indexsubitem); |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 602 | $idx =~ s/ \(.*\)//; |
| 603 | } |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 604 | "<dl><dt><b>$idx</b>\n<dd>$'</dl>" |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 605 | } |
| 606 | |
| 607 | sub do_env_datadescni{ |
| 608 | local($_) = @_; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 609 | my $idx = ''; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 610 | if (/$next_pair_rx/o) { |
| 611 | if ($STRING_INDEX_TT) { |
| 612 | $idx = "$2"; } |
| 613 | else { |
| 614 | $idx = "<tt>$2</tt>"; } |
| 615 | } |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 616 | "<dl><dt><b>$idx</b>\n<dd>$'</dl>" |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 617 | } |
| 618 | |
| 619 | sub do_cmd_dataline{ |
| 620 | local($_) = @_; |
| 621 | |
| 622 | s/$next_pair_pr_rx//o; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 623 | my($br_id, $data_name) = ($1, $2); |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 624 | my $idx = make_str_index_entry($br_id, "<tt>$data_name</tt>" |
| 625 | . &get_indexsubitem); |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 626 | $idx =~ s/ \(.*\)//; |
| 627 | |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 628 | "<dt><b>$idx</b><dd>" . $_; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 629 | } |
| 630 | |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 631 | sub do_env_excdesc{ |
| 632 | local($_) = @_; |
| 633 | /$next_pair_rx/o; |
| 634 | my($br_id,$excname,$rest) = ($1, $2, $'); |
| 635 | my $idx = make_str_index_entry($br_id, |
| 636 | "<tt>$excname</tt> (exception in $THIS_MODULE)"); |
| 637 | $idx =~ s/ \(.*\)//; |
| 638 | "<dl><dt><b>$idx</b>\n<dd>$rest</dl>" |
| 639 | } |
| 640 | |
| 641 | sub do_env_fulllineitems{ do_env_itemize(@_); } |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 642 | |
| 643 | |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 644 | sub do_env_classdesc{ |
| 645 | local($_) = @_; |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 646 | my($class_name,$arg_list,$idx) = ('', '', ''); |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 647 | my $funcdesc_rx = "$next_pair_rx$any_next_pair_rx3"; |
| 648 | if (/$funcdesc_rx/o) { |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 649 | $class_name = "$2"; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 650 | $arg_list = "$4"; |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 651 | $THIS_CLASS = $class_name; |
| 652 | $idx = make_str_index_entry($3, |
| 653 | "<tt>$class_name</tt> (class in $THIS_MODULE)" ); |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 654 | $idx =~ s/ \(.*\)//; |
| 655 | } |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 656 | "<dl><dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>$'</dl>"; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 657 | } |
| 658 | |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 659 | |
| 660 | sub do_env_methoddesc{ |
| 661 | local($_) = @_; |
| 662 | my($class_name,$arg_list,$idx,$extra); |
| 663 | # Predefined $opt_arg_rx & $optional_arg_rx don't work because they |
| 664 | # require the argument to be there. |
| 665 | my $opt_arg_rx = "^\\s*(\\[([^]]*)\\])?"; |
| 666 | my $funcdesc_rx = "$opt_arg_rx$any_next_pair_rx3$any_next_pair_rx5"; |
| 667 | if (/$funcdesc_rx/o) { |
| 668 | $class_name = $2; |
| 669 | $class_name = $THIS_CLASS |
| 670 | unless $class_name; |
| 671 | $method_name = $4; |
| 672 | $arg_list = $6; |
| 673 | if ($class_name) { |
| 674 | $extra = " ($class_name method)"; |
| 675 | } |
| 676 | $idx = make_str_index_entry($3, "<tt>$method_name()</tt>$extra"); |
| 677 | $idx =~ s/ \(.*\)//; |
| 678 | $idx =~ s/\(\)//; |
| 679 | } |
| 680 | "<dl><dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>$'</dl>"; |
| 681 | } |
| 682 | |
| 683 | |
| 684 | sub do_env_methoddescni{ |
| 685 | local($_) = @_; |
| 686 | # Predefined $opt_arg_rx & $optional_arg_rx don't work because they |
| 687 | # require the argument to be there. |
| 688 | my $opt_arg_rx = "^\\s*(\\[([^]]*)\\])?"; |
| 689 | my $funcdesc_rx = "$opt_arg_rx$any_next_pair_rx3$any_next_pair_rx5"; |
| 690 | /$funcdesc_rx/o; |
| 691 | my $method = $4; |
| 692 | my $arg_list = $6; |
| 693 | "<dl><dt><b>$method</b> (<var>$arg_list</var>)\n<dd>$'</dl>"; |
| 694 | } |
| 695 | |
| 696 | |
| 697 | sub do_env_memberdesc{ |
| 698 | local($_) = @_; |
| 699 | # Predefined $opt_arg_rx & $optional_arg_rx don't work because they |
| 700 | # require the argument to be there. |
| 701 | my $opt_arg_rx = "^\\s*(\\[([^]]*)\\])?"; |
| 702 | my $funcdesc_rx = "$opt_arg_rx$any_next_pair_rx3$any_next_pair_rx5"; |
| 703 | /$funcdesc_rx/o; |
| 704 | my($class,$member,$arg_list) = ($2, $4, $6); |
| 705 | $class = $THIS_CLASS |
| 706 | unless $class; |
| 707 | $extra = " ($class_name attribute)" |
| 708 | if $class; |
| 709 | my $idx = make_str_index_entry($3, "<tt>$member()</tt>$extra"); |
| 710 | $idx =~ s/ \(.*\)//; |
| 711 | $idx =~ s/\(\)//; |
| 712 | "<dl><dt><b>$idx</b>\n<dd>$'</dl>"; |
| 713 | } |
| 714 | |
| 715 | |
| 716 | sub do_env_memberdescni{ |
| 717 | local($_) = @_; |
| 718 | # Predefined $opt_arg_rx & $optional_arg_rx don't work because they |
| 719 | # require the argument to be there. |
| 720 | my $opt_arg_rx = "^\\s*(\\[([^]]*)\\])?"; |
| 721 | my $funcdesc_rx = "$opt_arg_rx$any_next_pair_rx3"; |
| 722 | /$funcdesc_rx/o; |
| 723 | my $member = $4; |
| 724 | "<dl><dt><b>$member</b>\n<dd>$'</dl>"; |
| 725 | } |
| 726 | |
| 727 | |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 728 | @col_aligns = ("<td>", "<td>", "<td>"); |
| 729 | |
| 730 | sub setup_column_alignments{ |
| 731 | local($_) = @_; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 732 | my($j1,$a1,$a2,$a3,$j4) = split(/[|]/,$_); |
| 733 | my($th1,$th2,$th3) = ('<th>', '<th>', '<th>'); |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 734 | $col_aligns[0] = (($a1 eq "c") ? "<td align=center>" : "<td>"); |
| 735 | $col_aligns[1] = (($a2 eq "c") ? "<td align=center>" : "<td>"); |
| 736 | $col_aligns[2] = (($a3 eq "c") ? "<td align=center>" : "<td>"); |
| 737 | # return the aligned header start tags; only used for \begin{tableiii?} |
| 738 | $th1 = (($a1 eq "l") ? "<th align=left>" |
| 739 | : ($a1 eq "r" ? "<th align=right>" : "<th>")); |
| 740 | $th2 = (($a2 eq "l") ? "<th align=left>" |
| 741 | : ($a2 eq "r" ? "<th align=right>" : "<th>")); |
| 742 | $th3 = (($a3 eq "l") ? "<th align=left>" |
| 743 | : ($a3 eq "r" ? "<th align=right>" : "<th>")); |
| 744 | ($th1, $th2, $th3); |
| 745 | } |
| 746 | |
| 747 | sub do_env_tableii{ |
| 748 | local($_) = @_; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 749 | my($font,$h1,$h2) = ('', '', ''); |
| 750 | my $tableiii_rx = |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 751 | "$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5$any_next_pair_rx7"; |
| 752 | if (/$tableiii_rx/o) { |
| 753 | $font = $4; |
Fred Drake | 58b2bfd | 1998-04-02 20:14:04 +0000 | [diff] [blame] | 754 | $font = '' |
| 755 | if ($font eq 'textrm'); |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 756 | $h1 = $6; |
| 757 | $h2 = $8; |
| 758 | } |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 759 | my($th1,$th2,$th3) = setup_column_alignments($2); |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 760 | $globals{"lineifont"} = $font; |
| 761 | "<table border align=center>" |
| 762 | . "\n <tr>$th1<b>$h1</b></th>" |
| 763 | . "\n $th2<b>$h2</b></th>$'" |
| 764 | . "\n</table>"; |
| 765 | } |
| 766 | |
| 767 | sub do_cmd_lineii{ |
| 768 | local($_) = @_; |
| 769 | s/$next_pair_pr_rx//o; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 770 | my $c1 = $2; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 771 | s/$next_pair_pr_rx//o; |
Fred Drake | 58b2bfd | 1998-04-02 20:14:04 +0000 | [diff] [blame] | 772 | my($c2,$font,$efont) = ($2, $globals{"lineifont"}, ''); |
| 773 | if ($font) { |
| 774 | $font = "<$font>"; |
| 775 | $efont = "</$font>"; |
| 776 | } |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 777 | my($c1align,$c2align) = @col_aligns[0,1]; |
Fred Drake | 58b2bfd | 1998-04-02 20:14:04 +0000 | [diff] [blame] | 778 | "<tr>$c1align$font$c1$efont</td>\n" |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 779 | . " $c2align$c2</td>$'"; |
| 780 | } |
| 781 | |
| 782 | sub do_env_tableiii{ |
| 783 | local($_) = @_; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 784 | my($font,$h1,$h2,$h3) = ('', '', '', ''); |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 785 | |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 786 | my $tableiii_rx = |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 787 | "$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5$any_next_pair_rx7" |
| 788 | . "$any_next_pair_rx9"; |
| 789 | if (/$tableiii_rx/o) { |
| 790 | $font = $4; |
Fred Drake | 58b2bfd | 1998-04-02 20:14:04 +0000 | [diff] [blame] | 791 | $font = '' |
| 792 | if ($font eq 'textrm'); |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 793 | $h1 = $6; |
| 794 | $h2 = $8; |
| 795 | $h3 = $10; |
| 796 | } |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 797 | my($th1,$th2,$th3) = setup_column_alignments($2); |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 798 | $globals{"lineifont"} = $font; |
| 799 | "<table border align=center>" |
| 800 | . "\n <tr>$th1<b>$h1</b></th>" |
| 801 | . "\n $th2<b>$h2</b></th>" |
| 802 | . "\n $th3<b>$h3</b></th>$'" |
| 803 | . "\n</table>"; |
| 804 | } |
| 805 | |
| 806 | sub do_cmd_lineiii{ |
| 807 | local($_) = @_; |
| 808 | s/$next_pair_pr_rx//o; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 809 | my $c1 = $2; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 810 | s/$next_pair_pr_rx//o; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 811 | my $c2 = $2; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 812 | s/$next_pair_pr_rx//o; |
Fred Drake | 58b2bfd | 1998-04-02 20:14:04 +0000 | [diff] [blame] | 813 | my($c3,$font,$efont) = ($2, $globals{"lineifont"}, ''); |
| 814 | if ($font) { |
| 815 | $font = "<$font>"; |
| 816 | $efont = "</$font>"; |
| 817 | } |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 818 | my($c1align, $c2align, $c3align) = @col_aligns; |
Fred Drake | 58b2bfd | 1998-04-02 20:14:04 +0000 | [diff] [blame] | 819 | "<tr>$c1align$font$c1$efont</td>\n" |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 820 | . " $c2align$c2</td>\n" |
| 821 | . " $c3align$c3</td>$'"; |
| 822 | } |
| 823 | |
| 824 | sub do_env_seealso{ |
| 825 | "<p><b>See Also:</b></p>\n" . @_[0]; |
| 826 | } |
| 827 | |
| 828 | sub do_cmd_seemodule{ |
| 829 | # Insert the right magic to jump to the module definition. This should |
| 830 | # work most of the time, at least for repeat builds.... |
| 831 | local($_) = @_; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 832 | my $any_next_pair_pr_rx3 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP"; |
| 833 | my $any_next_pair_pr_rx5 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\5$CP"; |
| 834 | # Predefined $opt_arg_rx & $optional_arg_rx don't work because they |
| 835 | # require the argument to be there. |
| 836 | my $opt_arg_rx = "^\\s*(\\[([^]]*)\\])?"; |
| 837 | s/$opt_arg_rx$any_next_pair_pr_rx3$any_next_pair_pr_rx5//; |
| 838 | my($key,$module,$text) = ($2, $4, $6); |
| 839 | $key = $module unless $key; |
Fred Drake | b3c9bca | 1998-03-06 21:20:08 +0000 | [diff] [blame] | 840 | "<p>Module <tt><b><a href=\"module-$key.html\">$module</a></b></tt>" |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 841 | . " ($text)</p>" |
| 842 | . $_; |
| 843 | } |
| 844 | |
| 845 | sub do_cmd_seetext{ |
| 846 | "<p>" . @_[0]; |
| 847 | } |
| 848 | |
| 849 | |
| 850 | sub do_cmd_maketitle { |
| 851 | local($_) = @_; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 852 | my $the_title = ''; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 853 | if ($t_title) { |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 854 | $the_title .= "<h1 align=center>$t_title</h1>"; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 855 | } else { &write_warnings("\nThis document has no title."); } |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 856 | $the_title .= "\n<center>"; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 857 | if ($t_author) { |
| 858 | if ($t_authorURL) { |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 859 | my $href = &translate_commands($t_authorURL); |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 860 | $href = &make_named_href('author', $href, "<strong>${t_author}</strong>"); |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 861 | $the_title .= "\n<p>$href</p>"; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 862 | } else { |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 863 | $the_title .= "\n<p><strong>$t_author</strong></p>"; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 864 | } |
| 865 | } else { &write_warnings("\nThere is no author for this document."); } |
| 866 | if ($t_institute) { |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 867 | $the_title .= "\n<p>$t_institute</p>";} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 868 | if ($AUTHOR_ADDRESS) { |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 869 | $the_title .= "\n<p>$AUTHOR_ADDRESS</p>";} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 870 | if ($t_affil) { |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 871 | $the_title .= "\n<p><i>$t_affil</i></p>";} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 872 | if ($t_date) { |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 873 | $the_title .= "\n<p><strong>$t_date</strong>"; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 874 | if ($PYTHON_VERSION) { |
| 875 | $the_title .= "<br><strong>Release $PYTHON_VERSION</strong>";} |
| 876 | $the_title .= "</p>" |
| 877 | } |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 878 | $the_title .= "\n</center>"; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 879 | if ($t_address) { |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 880 | $the_title .= "\n<p>$t_address</p>"; |
| 881 | } else { $the_title .= "\n<p>"} |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 882 | if ($t_email) { |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 883 | $the_title .= "\n<p>$t_email</p>"; |
| 884 | }# else { $the_title .= "</p>" } |
| 885 | $the_title . "<hr>\n" . $_ ; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 886 | } |
| 887 | |
| 888 | |
Fred Drake | 42b31a5 | 1998-03-27 05:16:10 +0000 | [diff] [blame] | 889 | # sub do_cmd_indexlabel{ |
| 890 | # "genindex" . @_[0]; |
| 891 | # } |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 892 | |
Fred Drake | fc16e78 | 1998-03-12 21:03:26 +0000 | [diff] [blame] | 893 | |
| 894 | # These are located down here since they screw up fontlock. -- used to. |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 895 | |
| 896 | sub do_cmd_file{ |
| 897 | # This uses a weird HTML construct to adjust the font to be |
| 898 | # reasonable match that used in the printed form as much as |
| 899 | # possible. The expected behavior is that a browser that doesn't |
| 900 | # understand "<font face=...>" markup will use courier (or whatever |
| 901 | # the font is for <tt>). |
| 902 | local($_) = @_; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 903 | s|$next_pair_pr_rx|\"<tt>\2</tt>\"|; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 904 | $_; |
| 905 | } |
| 906 | |
| 907 | sub do_cmd_samp{ |
| 908 | local($_) = @_; |
Fred Drake | c9a4438 | 1998-03-17 06:29:13 +0000 | [diff] [blame] | 909 | s|$next_pair_pr_rx|\"<tt>\2</tt>\"|; |
Fred Drake | 6659c30 | 1998-03-03 22:02:19 +0000 | [diff] [blame] | 910 | $_; |
| 911 | } |
| 912 | |
| 913 | 1; # This must be the last line |