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