Fred Drake | 8ca7006 | 1997-12-08 20:59:54 +0000 | [diff] [blame] | 1 | # myformat.perl by Guido van Rossum <guido@cwi.nl> 25 Jan 1994 -*- perl -*- |
Guido van Rossum | 9e93fb6 | 1994-01-25 20:06:09 +0000 | [diff] [blame] | 2 | # |
| 3 | # Extension to LaTeX2HTML for documents using myformat.sty. |
| 4 | # Subroutines of the form do_cmd_<name> here define translations |
| 5 | # for LaTeX commands \<name> defined in the corresponding .sty file. |
| 6 | # |
| 7 | # XXX Not complete: \indexii etc.; \funcitem etc. |
| 8 | |
Fred Drake | 4464022 | 1996-11-11 20:51:09 +0000 | [diff] [blame] | 9 | package main; |
Guido van Rossum | 9e93fb6 | 1994-01-25 20:06:09 +0000 | [diff] [blame] | 10 | |
Guido van Rossum | 9e93fb6 | 1994-01-25 20:06:09 +0000 | [diff] [blame] | 11 | # words typeset in a special way (not in HTML though) |
| 12 | |
| 13 | sub do_cmd_ABC{ join('', 'ABC', @_[0]); } |
| 14 | sub do_cmd_UNIX{ join('', 'Unix', @_[0]); } |
| 15 | sub do_cmd_ASCII{ join('', 'ASCII', @_[0]); } |
Fred Drake | bceaf35 | 1998-01-22 16:13:44 +0000 | [diff] [blame] | 16 | sub do_cmd_POSIX{ join('', 'POSIX', @_[0]); } |
Guido van Rossum | 9e93fb6 | 1994-01-25 20:06:09 +0000 | [diff] [blame] | 17 | sub do_cmd_C{ join('', 'C', @_[0]); } |
Guido van Rossum | b8b264b | 1994-08-12 13:13:50 +0000 | [diff] [blame] | 18 | sub do_cmd_Cpp{ join('', 'C++', @_[0]); } |
Guido van Rossum | 9e93fb6 | 1994-01-25 20:06:09 +0000 | [diff] [blame] | 19 | sub do_cmd_EOF{ join('', 'EOF', @_[0]); } |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 20 | sub do_cmd_NULL{ join('', '<tt>NULL</tt>', @_[0]); } |
Guido van Rossum | 9e93fb6 | 1994-01-25 20:06:09 +0000 | [diff] [blame] | 21 | |
Fred Drake | 3e1fe89 | 1996-11-11 23:03:36 +0000 | [diff] [blame] | 22 | sub do_cmd_e{ local($_) = @_; '\' . $_; } |
Guido van Rossum | 9e93fb6 | 1994-01-25 20:06:09 +0000 | [diff] [blame] | 23 | |
Fred Drake | 20ee206 | 1998-02-26 05:49:37 +0000 | [diff] [blame] | 24 | $AUTHOR_ADDRESS = '(not specified)'; |
| 25 | $PYTHON_VERSION = '(not specified)'; |
| 26 | |
| 27 | sub do_cmd_version{ $PYTHON_VERSION . @_[0]; } |
| 28 | sub do_cmd_release{ |
| 29 | local($_) = @_; |
| 30 | s/$any_next_pair_pr_rx//; |
| 31 | $PYTHON_VERSION = "$2"; |
| 32 | $_; |
| 33 | } |
| 34 | |
| 35 | sub do_cmd_authoraddress{ |
| 36 | local($_) = @_; |
| 37 | s/$any_next_pair_pr_rx//; |
| 38 | $AUTHOR_ADDRESS = "$2"; |
| 39 | $_; |
| 40 | } |
| 41 | |
| 42 | sub do_cmd_hackscore{ |
| 43 | local($_) = @_; |
| 44 | s/$any_next_pair_pr_rx/_/; |
| 45 | $_; |
| 46 | } |
| 47 | |
Fred Drake | c384d75 | 1996-11-11 16:04:35 +0000 | [diff] [blame] | 48 | sub do_cmd_optional{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 49 | local($_) = @_; |
| 50 | s/$any_next_pair_pr_rx/<\/var><big>\[<\/big><var>\2<\/var><big>\]<\/big><var>/; |
| 51 | $_; |
Guido van Rossum | 9e93fb6 | 1994-01-25 20:06:09 +0000 | [diff] [blame] | 52 | } |
| 53 | |
Fred Drake | c384d75 | 1996-11-11 16:04:35 +0000 | [diff] [blame] | 54 | sub do_cmd_varvars{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 55 | local($_) = @_; |
| 56 | s/$any_next_pair_pr_rx/<var>\2<\/var>/; |
| 57 | $_; |
Fred Drake | c384d75 | 1996-11-11 16:04:35 +0000 | [diff] [blame] | 58 | } |
| 59 | |
Fred Drake | 3e1fe89 | 1996-11-11 23:03:36 +0000 | [diff] [blame] | 60 | # texinfo-like formatting commands: \code{...} etc. |
| 61 | |
Fred Drake | c384d75 | 1996-11-11 16:04:35 +0000 | [diff] [blame] | 62 | sub do_cmd_code{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 63 | local($_) = @_; |
| 64 | s/$any_next_pair_pr_rx/<tt>\2<\/tt>/; |
| 65 | $_; |
Fred Drake | c384d75 | 1996-11-11 16:04:35 +0000 | [diff] [blame] | 66 | } |
| 67 | |
| 68 | sub do_cmd_sectcode{ &do_cmd_code(@_); } |
Fred Drake | bceaf35 | 1998-01-22 16:13:44 +0000 | [diff] [blame] | 69 | sub do_cmd_module{ &do_cmd_code(@_); } |
| 70 | sub do_cmd_keyword{ &do_cmd_code(@_); } |
| 71 | sub do_cmd_exception{ &do_cmd_code(@_); } |
| 72 | sub do_cmd_class{ &do_cmd_code(@_); } |
| 73 | sub do_cmd_function{ &do_cmd_code(@_); } |
Fred Drake | bceaf35 | 1998-01-22 16:13:44 +0000 | [diff] [blame] | 74 | sub do_cmd_constant{ &do_cmd_code(@_); } |
Fred Drake | 05ce570 | 1998-02-19 17:26:48 +0000 | [diff] [blame] | 75 | sub do_cmd_member{ &do_cmd_code(@_); } |
Fred Drake | bceaf35 | 1998-01-22 16:13:44 +0000 | [diff] [blame] | 76 | sub do_cmd_method{ &do_cmd_code(@_); } |
| 77 | sub do_cmd_email{ &do_cmd_code(@_); } |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 78 | sub do_cmd_program{ &do_cmd_code(@_); } |
Fred Drake | 05ce570 | 1998-02-19 17:26:48 +0000 | [diff] [blame] | 79 | sub do_cmd_cfunction{ &do_cmd_code(@_); } |
| 80 | sub do_cmd_cdata{ &do_cmd_code(@_); } |
| 81 | sub do_cmd_ctype{ &do_cmd_code(@_); } |
Fred Drake | bceaf35 | 1998-01-22 16:13:44 +0000 | [diff] [blame] | 82 | |
Fred Drake | ce0e175 | 1998-02-18 22:45:53 +0000 | [diff] [blame] | 83 | sub do_cmd_email{ |
| 84 | local($_) = @_; |
| 85 | s/$any_next_pair_pr_rx/<tt><font face=sans-serif>\2<\/font><\/tt>/; |
| 86 | $_; |
| 87 | } |
| 88 | |
Fred Drake | bceaf35 | 1998-01-22 16:13:44 +0000 | [diff] [blame] | 89 | sub do_cmd_url{ |
| 90 | # use the URL as both text and hyperlink |
| 91 | local($_) = @_; |
Fred Drake | ce0e175 | 1998-02-18 22:45:53 +0000 | [diff] [blame] | 92 | s/$any_next_pair_pr_rx//; |
| 93 | local($url) = $2; |
Fred Drake | c88aa35 | 1998-02-25 17:50:07 +0000 | [diff] [blame] | 94 | $url =~ s/~/~/g; |
Fred Drake | ce0e175 | 1998-02-18 22:45:53 +0000 | [diff] [blame] | 95 | "<tt><font face=sans-serif><a href=\"$url\">$url</a></font></tt>" . $_; |
Fred Drake | bceaf35 | 1998-01-22 16:13:44 +0000 | [diff] [blame] | 96 | } |
| 97 | |
| 98 | sub do_cmd_manpage{ |
| 99 | # two parameters: \manpage{name}{section} |
| 100 | local($_) = @_; |
| 101 | local($any_next_pair_pr_rx3) = "$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP"; |
| 102 | s/$next_pair_pr_rx$any_next_pair_pr_rx3/<em>\2<\/em>(\4)/; |
| 103 | $_; |
| 104 | } |
Fred Drake | c384d75 | 1996-11-11 16:04:35 +0000 | [diff] [blame] | 105 | |
Fred Drake | 4254363 | 1998-02-10 22:11:07 +0000 | [diff] [blame] | 106 | sub do_cmd_rfc{ |
| 107 | local($_) = @_; |
| 108 | s/$next_pair_pr_rx//; |
| 109 | local($br_id,$rfcnumber) = ($1, $2); |
| 110 | |
| 111 | # Save the reference |
| 112 | local($nstr) = &gen_index_id("RFC!RFC $rfcnumber", ''); |
| 113 | $index{$nstr} .= &make_half_href("$CURRENT_FILE#$br_id"); |
| 114 | "<a name=\"$br_id\">RFC $rfcnumber<\/a>" .$_; |
| 115 | } |
| 116 | |
Guido van Rossum | 9e93fb6 | 1994-01-25 20:06:09 +0000 | [diff] [blame] | 117 | sub do_cmd_kbd{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 118 | local($_) = @_; |
| 119 | s/$any_next_pair_pr_rx/<kbd>\2<\/kbd>/; |
| 120 | $_; |
Guido van Rossum | 9e93fb6 | 1994-01-25 20:06:09 +0000 | [diff] [blame] | 121 | } |
| 122 | |
| 123 | sub do_cmd_key{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 124 | local($_) = @_; |
| 125 | s/$any_next_pair_pr_rx/<tt>\2<\/tt>/; |
| 126 | $_; |
Guido van Rossum | 9e93fb6 | 1994-01-25 20:06:09 +0000 | [diff] [blame] | 127 | } |
| 128 | |
| 129 | sub do_cmd_var{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 130 | local($_) = @_; |
| 131 | s/$any_next_pair_pr_rx/<em>\2<\/em>/; |
| 132 | $_; |
Guido van Rossum | 9e93fb6 | 1994-01-25 20:06:09 +0000 | [diff] [blame] | 133 | } |
| 134 | |
| 135 | sub do_cmd_dfn{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 136 | local($_) = @_; |
| 137 | s/$any_next_pair_pr_rx/<i><dfn>\2<\/dfn><\/i>/; |
| 138 | $_; |
Guido van Rossum | 9e93fb6 | 1994-01-25 20:06:09 +0000 | [diff] [blame] | 139 | } |
| 140 | |
| 141 | sub do_cmd_emph{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 142 | local($_) = @_; |
| 143 | s/$any_next_pair_pr_rx/<em>\2<\/em>/; |
| 144 | $_; |
Guido van Rossum | 9e93fb6 | 1994-01-25 20:06:09 +0000 | [diff] [blame] | 145 | } |
| 146 | |
| 147 | sub do_cmd_strong{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 148 | local($_) = @_; |
| 149 | s/$any_next_pair_pr_rx/<b>\2<\/b>/; |
| 150 | $_; |
Guido van Rossum | 9e93fb6 | 1994-01-25 20:06:09 +0000 | [diff] [blame] | 151 | } |
| 152 | |
Fred Drake | 7c4cba8 | 1997-12-03 19:45:08 +0000 | [diff] [blame] | 153 | # file and samp are at the end of this file since they screw up fontlock. |
| 154 | |
Guido van Rossum | 9e93fb6 | 1994-01-25 20:06:09 +0000 | [diff] [blame] | 155 | # index commands |
| 156 | |
Fred Drake | 4254363 | 1998-02-10 22:11:07 +0000 | [diff] [blame] | 157 | $INDEX_SUBITEM = ""; |
| 158 | |
Fred Drake | f9fd4e8 | 1998-02-27 15:28:45 +0000 | [diff] [blame^] | 159 | sub get_indexsubitem{ |
| 160 | $INDEX_SUBITEM ? " $INDEX_SUBITEM" : ''; |
| 161 | } |
| 162 | |
Fred Drake | 4254363 | 1998-02-10 22:11:07 +0000 | [diff] [blame] | 163 | sub do_cmd_setindexsubitem{ |
| 164 | local($_) = @_; |
| 165 | s/$any_next_pair_pr_rx//; |
| 166 | $INDEX_SUBITEM = $2; |
| 167 | $_; |
| 168 | } |
| 169 | |
Guido van Rossum | 9e93fb6 | 1994-01-25 20:06:09 +0000 | [diff] [blame] | 170 | sub do_cmd_indexii{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 171 | local($_) = @_; |
| 172 | s/$next_pair_pr_rx//o; |
| 173 | local($br_id1, $str1) = ($1, $2); |
| 174 | s/$next_pair_pr_rx//o; |
| 175 | local($br_id2, $str2) = ($1, $2); |
| 176 | join('', &make_index_entry($br_id1, "$str1 $str2"), |
| 177 | &make_index_entry($br_id2, "$str2, $str1"), $_); |
Guido van Rossum | 9e93fb6 | 1994-01-25 20:06:09 +0000 | [diff] [blame] | 178 | } |
| 179 | |
| 180 | sub do_cmd_indexiii{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 181 | local($_) = @_; |
| 182 | s/$next_pair_pr_rx//o; |
| 183 | local($br_id1, $str1) = ($1, $2); |
| 184 | s/$next_pair_pr_rx//o; |
| 185 | local($br_id2, $str2) = ($1, $2); |
| 186 | s/$next_pair_pr_rx//o; |
| 187 | local($br_id3, $str3) = ($1, $2); |
| 188 | join('', &make_index_entry($br_id1, "$str1 $str2 $str3"), |
| 189 | &make_index_entry($br_id2, "$str2 $str3, $str1"), |
| 190 | &make_index_entry($br_id3, "$str3, $str1 $str2"), |
| 191 | $_); |
Guido van Rossum | 9e93fb6 | 1994-01-25 20:06:09 +0000 | [diff] [blame] | 192 | } |
| 193 | |
| 194 | sub do_cmd_indexiv{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 195 | local($_) = @_; |
| 196 | s/$next_pair_pr_rx//o; |
| 197 | local($br_id1, $str1) = ($1, $2); |
| 198 | s/$next_pair_pr_rx//o; |
| 199 | local($br_id2, $str2) = ($1, $2); |
| 200 | s/$next_pair_pr_rx//o; |
| 201 | local($br_id3, $str3) = ($1, $2); |
| 202 | s/$next_pair_pr_rx//o; |
| 203 | local($br_id4, $str4) = ($1, $2); |
| 204 | join('', &make_index_entry($br_id1, "$str1 $str2 $str3 $str4"), |
| 205 | &make_index_entry($br_id2, "$str2 $str3 $str4, $str1"), |
| 206 | &make_index_entry($br_id3, "$str3 $str4, $str1 $str2"), |
| 207 | &make_index_entry($br_id4, "$str4, $str1 $str2 $str3"), |
| 208 | $_); |
Guido van Rossum | 9e93fb6 | 1994-01-25 20:06:09 +0000 | [diff] [blame] | 209 | } |
| 210 | |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 211 | sub do_cmd_ttindex{ &do_cmd_index(@_); } |
Guido van Rossum | 9e93fb6 | 1994-01-25 20:06:09 +0000 | [diff] [blame] | 212 | |
| 213 | sub my_typed_index_helper{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 214 | local($word, $_) = @_; |
| 215 | s/$next_pair_pr_rx//o; |
| 216 | local($br_id, $str) = ($1, $2); |
| 217 | join('', &make_index_entry($br_id, "$str $word"), |
| 218 | &make_index_entry($br_id, "$word, $str"), $_); |
Guido van Rossum | 9e93fb6 | 1994-01-25 20:06:09 +0000 | [diff] [blame] | 219 | } |
| 220 | |
| 221 | sub do_cmd_stindex{ &my_typed_index_helper('statement', @_); } |
Guido van Rossum | 9e93fb6 | 1994-01-25 20:06:09 +0000 | [diff] [blame] | 222 | sub do_cmd_opindex{ &my_typed_index_helper('operator', @_); } |
| 223 | sub do_cmd_exindex{ &my_typed_index_helper('exception', @_); } |
| 224 | sub do_cmd_obindex{ &my_typed_index_helper('object', @_); } |
| 225 | |
| 226 | sub my_parword_index_helper{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 227 | local($word, $_) = @_; |
| 228 | s/$next_pair_pr_rx//o; |
| 229 | local($br_id, $str) = ($1, $2); |
| 230 | &make_index_entry($br_id, "$str ($word)") . $_; |
Guido van Rossum | 9e93fb6 | 1994-01-25 20:06:09 +0000 | [diff] [blame] | 231 | } |
| 232 | |
Fred Drake | 4254363 | 1998-02-10 22:11:07 +0000 | [diff] [blame] | 233 | |
| 234 | # Set this to true to strip out the <tt>...</tt> from index entries; |
| 235 | # this is analogous to using the second definition of \idxcode{} from |
| 236 | # myformat.sty. |
| 237 | # |
| 238 | # It is used from &make_mod_index_entry() and &make_str_index_entry(). |
| 239 | # |
| 240 | $STRIP_INDEX_TT = 0; |
| 241 | |
Fred Drake | 2549249 | 1998-02-13 15:08:36 +0000 | [diff] [blame] | 242 | sub make_mod_index_entry{ |
Fred Drake | 84818d7 | 1997-12-17 02:59:39 +0000 | [diff] [blame] | 243 | local($br_id,$str,$define) = @_; |
Fred Drake | ab0b65d | 1998-01-13 04:05:11 +0000 | [diff] [blame] | 244 | local($halfref) = &make_half_href("$CURRENT_FILE#$br_id"); |
| 245 | # If TITLE is not yet available (i.e the \index command is in the title |
| 246 | # of the current section), use $ref_before. |
Fred Drake | 84818d7 | 1997-12-17 02:59:39 +0000 | [diff] [blame] | 247 | $TITLE = $ref_before unless $TITLE; |
| 248 | # Save the reference |
Fred Drake | ab0b65d | 1998-01-13 04:05:11 +0000 | [diff] [blame] | 249 | if ($define eq "DEF") { |
| 250 | local($nstr,$garbage) = split / /, $str, 2; |
| 251 | $Modules{$nstr} .= $halfref; |
| 252 | } |
Fred Drake | 84818d7 | 1997-12-17 02:59:39 +0000 | [diff] [blame] | 253 | $str = &gen_index_id($str, $define); |
Fred Drake | 4254363 | 1998-02-10 22:11:07 +0000 | [diff] [blame] | 254 | if ($STRIP_INDEX_TT) { |
| 255 | $str =~ s/<tt>(.*)<\/tt>/\1/; |
| 256 | } |
Fred Drake | ab0b65d | 1998-01-13 04:05:11 +0000 | [diff] [blame] | 257 | $index{$str} .= $halfref; |
Fred Drake | 8da9e6a | 1997-12-18 14:14:16 +0000 | [diff] [blame] | 258 | "<a name=\"$br_id\">$anchor_invisible_mark<\/a>"; |
Fred Drake | 84818d7 | 1997-12-17 02:59:39 +0000 | [diff] [blame] | 259 | } |
| 260 | |
| 261 | sub my_module_index_helper{ |
Fred Drake | ce0e175 | 1998-02-18 22:45:53 +0000 | [diff] [blame] | 262 | local($word, $_) = @_; |
| 263 | s/$next_pair_pr_rx[\n]*//o; |
| 264 | local($br_id, $str) = ($1, $2); |
| 265 | local($section_tag) = join('', @curr_sec_id); |
| 266 | &make_mod_index_entry("SECTION$section_tag", |
| 267 | "<tt>$str</tt> ($word module)", 'DEF'); |
| 268 | $_; |
| 269 | } |
| 270 | |
| 271 | sub ref_module_index_helper{ |
| 272 | local($word, $_) = @_; |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 273 | s/$next_pair_pr_rx//o; |
| 274 | local($br_id, $str) = ($1, $2); |
Fred Drake | ce0e175 | 1998-02-18 22:45:53 +0000 | [diff] [blame] | 275 | &make_mod_index_entry($br_id, "<tt>$str</tt> ($word module)", 'REF') . $_; |
Fred Drake | 84818d7 | 1997-12-17 02:59:39 +0000 | [diff] [blame] | 276 | } |
| 277 | |
Guido van Rossum | 9e93fb6 | 1994-01-25 20:06:09 +0000 | [diff] [blame] | 278 | sub do_cmd_bifuncindex{ &my_parword_index_helper('built-in function', @_); } |
Fred Drake | ce0e175 | 1998-02-18 22:45:53 +0000 | [diff] [blame] | 279 | sub do_cmd_bimodindex{ &my_module_index_helper('built-in', @_); } |
| 280 | sub do_cmd_stmodindex{ &my_module_index_helper('standard', @_); } |
Guido van Rossum | 9e93fb6 | 1994-01-25 20:06:09 +0000 | [diff] [blame] | 281 | |
Fred Drake | ce0e175 | 1998-02-18 22:45:53 +0000 | [diff] [blame] | 282 | # these should be adjusted a bit.... |
| 283 | sub do_cmd_refbimodindex{ &ref_module_index_helper('built-in', @_); } |
| 284 | sub do_cmd_refstmodindex{ &ref_module_index_helper('standard', @_); } |
Fred Drake | 72df9bc | 1997-12-16 21:13:20 +0000 | [diff] [blame] | 285 | |
Fred Drake | c384d75 | 1996-11-11 16:04:35 +0000 | [diff] [blame] | 286 | sub do_cmd_nodename{ &do_cmd_label(@_); } |
| 287 | |
Fred Drake | 1af9e79 | 1998-01-12 23:15:29 +0000 | [diff] [blame] | 288 | sub init_myformat{ |
Fred Drake | 20ee206 | 1998-02-26 05:49:37 +0000 | [diff] [blame] | 289 | # XXX need some way for this to be called after &initialise; ??? |
Fred Drake | f9fd4e8 | 1998-02-27 15:28:45 +0000 | [diff] [blame^] | 290 | $anchor_mark = ''; |
| 291 | $icons{'anchor_mark'} = ''; |
Fred Drake | 1af9e79 | 1998-01-12 23:15:29 +0000 | [diff] [blame] | 292 | # <<2>>...<<2>> |
| 293 | $any_next_pair_rx3 = "$O(\\d+)$C([\\s\\S]*)$O\\3$C"; |
| 294 | $any_next_pair_rx5 = "$O(\\d+)$C([\\s\\S]*)$O\\5$C"; |
| 295 | $any_next_pair_rx7 = "$O(\\d+)$C([\\s\\S]*)$O\\7$C"; |
| 296 | $any_next_pair_rx9 = "$O(\\d+)$C([\\s\\S]*)$O\\9$C"; |
| 297 | # <#2#>...<#2#> |
| 298 | $any_next_pair_pr_rx_3 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP"; |
| 299 | $any_next_pair_pr_rx_5 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\5$CP"; |
| 300 | $any_next_pair_pr_rx_7 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\7$CP"; |
| 301 | $any_next_pair_pr_rx_9 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\9$CP"; |
Fred Drake | 1af9e79 | 1998-01-12 23:15:29 +0000 | [diff] [blame] | 302 | } |
| 303 | |
| 304 | &init_myformat; |
Fred Drake | c384d75 | 1996-11-11 16:04:35 +0000 | [diff] [blame] | 305 | |
Fred Drake | 84818d7 | 1997-12-17 02:59:39 +0000 | [diff] [blame] | 306 | # similar to make_index_entry(), but includes the string in the result |
| 307 | # instead of the dummy filler. |
| 308 | # |
Fred Drake | 2549249 | 1998-02-13 15:08:36 +0000 | [diff] [blame] | 309 | sub make_str_index_entry{ |
Fred Drake | 84818d7 | 1997-12-17 02:59:39 +0000 | [diff] [blame] | 310 | local($br_id,$str) = @_; |
| 311 | # If TITLE is not yet available (i.e the \index command is in the title |
| 312 | # of the current section), use $ref_before. |
| 313 | $TITLE = $ref_before unless $TITLE; |
| 314 | # Save the reference |
| 315 | local($nstr) = &gen_index_id($str, ''); |
Fred Drake | 4254363 | 1998-02-10 22:11:07 +0000 | [diff] [blame] | 316 | if ($STRIP_INDEX_TT) { |
| 317 | $nstr =~ s/<tt>(.*)<\/tt>/\1/; |
| 318 | } |
Fred Drake | 84818d7 | 1997-12-17 02:59:39 +0000 | [diff] [blame] | 319 | $index{$nstr} .= &make_half_href("$CURRENT_FILE#$br_id"); |
| 320 | "<a name=\"$br_id\">$str<\/a>"; |
| 321 | } |
| 322 | |
Fred Drake | f9fd4e8 | 1998-02-27 15:28:45 +0000 | [diff] [blame^] | 323 | # Changed from the stock version to indent {verbatim} sections, |
| 324 | # and make them smaller, to better match the LaTeX version: |
| 325 | |
| 326 | # (Used with LaTeX2HTML 96.1*) |
Fred Drake | 06e1664 | 1998-02-16 22:50:06 +0000 | [diff] [blame] | 327 | sub replace_verbatim { |
| 328 | # Modifies $_ |
Fred Drake | f9fd4e8 | 1998-02-27 15:28:45 +0000 | [diff] [blame^] | 329 | s/$verbatim_mark(verbatim)(\d+)/<p><dl><dd><font size=\"-1\"><pre>$verbatim{$2}<\/pre><\/font><\/dl>/go; |
Fred Drake | 06e1664 | 1998-02-16 22:50:06 +0000 | [diff] [blame] | 330 | s/$verbatim_mark(rawhtml)(\d+)/$verbatim{$2}/ego; # Raw HTML |
| 331 | } |
Fred Drake | f9fd4e8 | 1998-02-27 15:28:45 +0000 | [diff] [blame^] | 332 | |
| 333 | # (Used with LaTeX2HTML 98.1) |
| 334 | sub replace_verbatim_hook{ |
| 335 | # Modifies $_ |
| 336 | s/$math_verbatim_rx/&put_comment("MATH: ".$verbatim{$1})/eg; |
| 337 | # s/$verbatim_mark(verbatim\*?)(\d+)#/<PRE>\n$verbatim{$2}\n<\/PRE>/go; |
| 338 | s/$verbatim_mark(\w*[vV]erbatim\*?)(\d+)#/\n<p><dl><dd><font size=\"-1\">$verbatim{$2}<\/font><\/dl>\n/go; |
| 339 | # s/$verbatim_mark(rawhtml)(\d+)#/$verbatim{$2}/eg; # Raw HTML |
| 340 | # Raw HTML, but replacements may have protected characters |
| 341 | s/$verbatim_mark(rawhtml)(\d+)#/&unprotect_raw_html($verbatim{$2})/eg; |
| 342 | s/$verbatim_mark$keepcomments(\d+)#/$verbatim{$2}/ego; # Raw TeX |
| 343 | s/$unfinished_mark$keepcomments(\d+)#/$verbatim{$2}/ego; # Raw TeX |
| 344 | } |
Fred Drake | 06e1664 | 1998-02-16 22:50:06 +0000 | [diff] [blame] | 345 | |
Fred Drake | 7a7480d | 1996-10-29 15:56:57 +0000 | [diff] [blame] | 346 | sub do_env_cfuncdesc{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 347 | local($_) = @_; |
| 348 | local($return_type,$function_name,$arg_list,$idx) = ('', '', '', ''); |
| 349 | local($cfuncdesc_rx) = |
| 350 | "$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5"; |
| 351 | if (/$cfuncdesc_rx/o) { |
| 352 | $return_type = "$2"; |
| 353 | $function_name = "$4"; |
| 354 | $arg_list = "$6"; |
| 355 | $idx = &make_str_index_entry($3, |
| 356 | "<tt>$function_name</tt>" . &get_indexsubitem); |
| 357 | $idx =~ s/ \(.*\)//; |
| 358 | } |
| 359 | "<dl><dt>$return_type <b>$idx</b>" |
| 360 | . "(<var>$arg_list</var>)\n<dd>$'\n</dl>" |
Fred Drake | 7a7480d | 1996-10-29 15:56:57 +0000 | [diff] [blame] | 361 | } |
| 362 | |
Fred Drake | 9dcc5a9 | 1997-10-13 22:04:17 +0000 | [diff] [blame] | 363 | sub do_env_ctypedesc{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 364 | local($_) = @_; |
| 365 | local($type_name) = (''); |
| 366 | local($cfuncdesc_rx) = "$next_pair_rx"; |
| 367 | if (/$cfuncdesc_rx/o) { |
| 368 | $type_name = "$2"; |
| 369 | $idx = &make_str_index_entry($1, |
| 370 | "<tt>$type_name</tt>" . &get_indexsubitem); |
| 371 | $idx =~ s/ \(.*\)//; |
| 372 | } |
| 373 | "<dl><dt><b>$idx</b>\n<dd>$'\n</dl>" |
Fred Drake | 9dcc5a9 | 1997-10-13 22:04:17 +0000 | [diff] [blame] | 374 | } |
| 375 | |
| 376 | sub do_env_cvardesc{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 377 | local($_) = @_; |
| 378 | local($var_type,$var_name,$idx) = ('', '', ''); |
| 379 | local($cfuncdesc_rx) = "$next_pair_rx$any_next_pair_rx3"; |
| 380 | if (/$cfuncdesc_rx/o) { |
| 381 | $var_type = "$2"; |
| 382 | $var_name = "$4"; |
| 383 | $idx = &make_str_index_entry($3, |
| 384 | "<tt>$var_name</tt>" . &get_indexsubitem); |
| 385 | $idx =~ s/ \(.*\)//; |
| 386 | } |
| 387 | "<dl><dt>$var_type <b>$idx</b>\n" |
| 388 | . "<dd>$'\n</dl>"; |
Fred Drake | 9dcc5a9 | 1997-10-13 22:04:17 +0000 | [diff] [blame] | 389 | } |
| 390 | |
Fred Drake | c384d75 | 1996-11-11 16:04:35 +0000 | [diff] [blame] | 391 | sub do_env_funcdesc{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 392 | local($_) = @_; |
| 393 | local($function_name,$arg_list,$idx) = ('', '', ''); |
| 394 | local($funcdesc_rx) = "$next_pair_rx$any_next_pair_rx3"; |
| 395 | if (/$funcdesc_rx/o) { |
| 396 | $function_name = "$2"; |
| 397 | $arg_list = "$4"; |
| 398 | $idx = &make_str_index_entry($3, |
| 399 | "<tt>$function_name</tt>" . &get_indexsubitem); |
| 400 | $idx =~ s/ \(.*\)//; |
| 401 | } |
| 402 | "<dl><dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>$'\n</dl>"; |
Fred Drake | 1af9e79 | 1998-01-12 23:15:29 +0000 | [diff] [blame] | 403 | } |
| 404 | |
Fred Drake | 2549249 | 1998-02-13 15:08:36 +0000 | [diff] [blame] | 405 | sub do_env_funcdescni{ |
| 406 | local($_) = @_; |
| 407 | local($function_name,$arg_list,$idx) = ('', '', ''); |
| 408 | local($funcdesc_rx) = "$next_pair_rx$any_next_pair_rx3"; |
| 409 | if (/$funcdesc_rx/o) { |
| 410 | $function_name = "$2"; |
| 411 | $arg_list = "$4"; |
| 412 | if ($STRIP_INDEX_TT) { |
| 413 | $idx = $function_name; } |
| 414 | else { |
| 415 | $idx = "<tt>$function_name</tt>"; } |
| 416 | } |
| 417 | "<dl><dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>$'\n</dl>"; |
| 418 | } |
| 419 | |
Fred Drake | 1af9e79 | 1998-01-12 23:15:29 +0000 | [diff] [blame] | 420 | sub do_cmd_funcline{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 421 | local($_) = @_; |
| 422 | local($funcdesc_rx) = "$next_pair_pr_rx$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP"; |
Fred Drake | 1af9e79 | 1998-01-12 23:15:29 +0000 | [diff] [blame] | 423 | |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 424 | s/$funcdesc_rx//o; |
| 425 | local($br_id, $function_name, $arg_list) = ($3, $2, $4); |
| 426 | local($idx) = &make_str_index_entry($br_id, "<tt>$function_name</tt>"); |
Fred Drake | 1af9e79 | 1998-01-12 23:15:29 +0000 | [diff] [blame] | 427 | |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 428 | "<dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>" . $_; |
Fred Drake | 7c4cba8 | 1997-12-03 19:45:08 +0000 | [diff] [blame] | 429 | } |
| 430 | |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 431 | # Change this flag to index the opcode entries. I don't think it's very |
| 432 | # useful to index them, since they're only presented to describe the dis |
| 433 | # module. |
| 434 | # |
| 435 | $INDEX_OPCODES = 0; |
| 436 | |
Fred Drake | 7c4cba8 | 1997-12-03 19:45:08 +0000 | [diff] [blame] | 437 | sub do_env_opcodedesc{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 438 | local($_) = @_; |
| 439 | local($opcode_name,$arg_list,$stuff,$idx) = ('', '', '', ''); |
| 440 | local($opcodedesc_rx) = "$next_pair_rx$any_next_pair_rx3"; |
| 441 | if (/$opcodedesc_rx/o) { |
| 442 | $opcode_name = "$2"; |
| 443 | $arg_list = "$4"; |
| 444 | if ($INDEX_OPCODES) { |
| 445 | $idx = &make_str_index_entry($3, |
| 446 | "<tt>$opcode_name</tt> (byte code instruction)"); |
| 447 | $idx =~ s/ \(byte code instruction\)//; |
| 448 | } |
| 449 | else { |
| 450 | $idx = "<tt>$opcode_name</tt>"; |
| 451 | } |
| 452 | } |
| 453 | $stuff = "<dl><dt><b>$idx</b>"; |
| 454 | if ($arg_list) { |
| 455 | $stuff .= " <var>$arg_list</var>"; |
| 456 | } |
| 457 | $stuff . "\n<dd>$'\n</dl>"; |
Fred Drake | c384d75 | 1996-11-11 16:04:35 +0000 | [diff] [blame] | 458 | } |
| 459 | |
| 460 | sub do_env_datadesc{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 461 | local($_) = @_; |
| 462 | local($idx) = ''; |
| 463 | if (/$next_pair_rx/o) { |
| 464 | $idx = &make_str_index_entry($1, "<tt>$2</tt>" . &get_indexsubitem); |
| 465 | $idx =~ s/ \(.*\)//; |
| 466 | } |
| 467 | "<dl><dt><b>$idx</b>\n<dd>$'\n</dl>" |
Fred Drake | 1af9e79 | 1998-01-12 23:15:29 +0000 | [diff] [blame] | 468 | } |
| 469 | |
Fred Drake | 2549249 | 1998-02-13 15:08:36 +0000 | [diff] [blame] | 470 | sub do_env_datadescni{ |
| 471 | local($_) = @_; |
| 472 | local($idx) = ''; |
| 473 | if (/$next_pair_rx/o) { |
| 474 | if ($STRING_INDEX_TT) { |
| 475 | $idx = "$2"; } |
| 476 | else { |
| 477 | $idx = "<tt>$2</tt>"; } |
| 478 | } |
| 479 | "<dl><dt><b>$idx</b>\n<dd>$'\n</dl>" |
| 480 | } |
| 481 | |
Fred Drake | 1af9e79 | 1998-01-12 23:15:29 +0000 | [diff] [blame] | 482 | sub do_cmd_dataline{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 483 | local($_) = @_; |
Fred Drake | 1af9e79 | 1998-01-12 23:15:29 +0000 | [diff] [blame] | 484 | |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 485 | s/$next_pair_pr_rx//o; |
| 486 | local($br_id, $data_name) = ($1, $2); |
| 487 | local($idx) = &make_str_index_entry($br_id, "<tt>$data_name</tt>" |
| 488 | . &get_indexsubitem); |
| 489 | $idx =~ s/ \(.*\)//; |
Fred Drake | 1af9e79 | 1998-01-12 23:15:29 +0000 | [diff] [blame] | 490 | |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 491 | "<dt><b>$idx</b>\n<dd>" . $_; |
Fred Drake | c384d75 | 1996-11-11 16:04:35 +0000 | [diff] [blame] | 492 | } |
| 493 | |
| 494 | sub do_env_excdesc{ &do_env_datadesc(@_); } |
Fred Drake | 05ce570 | 1998-02-19 17:26:48 +0000 | [diff] [blame] | 495 | sub do_env_classdesc{ &do_env_funcdesc(@_); } |
| 496 | sub do_env_fulllineitems{ &do_env_itemize(@_); } |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 497 | |
Fred Drake | c384d75 | 1996-11-11 16:04:35 +0000 | [diff] [blame] | 498 | |
Fred Drake | 9597daf | 1997-12-22 22:37:34 +0000 | [diff] [blame] | 499 | @col_aligns = ("<td>", "<td>", "<td>"); |
| 500 | |
| 501 | sub setup_column_alignments{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 502 | local($_) = @_; |
| 503 | local($j1,$a1,$a2,$a3,$j4) = split(/[|]/,$_); |
| 504 | local($th1,$th2,$th3) = ('<th>', '<th>', '<th>'); |
| 505 | $col_aligns[0] = (($a1 eq "c") ? "<td align=center>" : "<td>"); |
| 506 | $col_aligns[1] = (($a2 eq "c") ? "<td align=center>" : "<td>"); |
| 507 | $col_aligns[2] = (($a3 eq "c") ? "<td align=center>" : "<td>"); |
| 508 | # return the aligned header start tags; only used for \begin{tableiii?} |
| 509 | $th1 = (($a1 eq "l") ? "<th align=left>" |
| 510 | : ($a1 eq "r" ? "<th align=right>" : "<th>")); |
| 511 | $th2 = (($a2 eq "l") ? "<th align=left>" |
| 512 | : ($a2 eq "r" ? "<th align=right>" : "<th>")); |
| 513 | $th3 = (($a3 eq "l") ? "<th align=left>" |
| 514 | : ($a3 eq "r" ? "<th align=right>" : "<th>")); |
| 515 | ($th1, $th2, $th3); |
Fred Drake | 9597daf | 1997-12-22 22:37:34 +0000 | [diff] [blame] | 516 | } |
| 517 | |
| 518 | sub do_env_tableii{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 519 | local($_) = @_; |
| 520 | local($font,$h1,$h2) = ('', '', ''); |
| 521 | local($tableiii_rx) = |
| 522 | "$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5$any_next_pair_rx7"; |
| 523 | if (/$tableiii_rx/o) { |
| 524 | $font = $4; |
| 525 | $h1 = $6; |
| 526 | $h2 = $8; |
| 527 | } |
| 528 | local($th1,$th2,$th3) = &setup_column_alignments($2); |
| 529 | $globals{"lineifont"} = $font; |
Fred Drake | f9fd4e8 | 1998-02-27 15:28:45 +0000 | [diff] [blame^] | 530 | "<table border align=center>" |
| 531 | . "\n <tr>$th1<b>$h1</b></th>" |
| 532 | . "\n $th2<b>$h2</b></th>$'" |
| 533 | . "\n</table>"; |
Fred Drake | 9597daf | 1997-12-22 22:37:34 +0000 | [diff] [blame] | 534 | } |
| 535 | |
| 536 | sub do_cmd_lineii{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 537 | local($_) = @_; |
| 538 | s/$next_pair_pr_rx//o; |
| 539 | local($c1) = $2; |
| 540 | s/$next_pair_pr_rx//o; |
| 541 | local($c2) = $2; |
| 542 | local($font) = $globals{"lineifont"}; |
| 543 | local($c1align, $c2align) = @col_aligns[0,1]; |
| 544 | "<tr>$c1align<$font>$c1</$font></td>\n" |
| 545 | . " $c2align$c2</td>$'"; |
Fred Drake | 9597daf | 1997-12-22 22:37:34 +0000 | [diff] [blame] | 546 | } |
| 547 | |
| 548 | sub do_env_tableiii{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 549 | local($_) = @_; |
| 550 | local($font,$h1,$h2,$h3) = ('', '', '', ''); |
Fred Drake | 1af9e79 | 1998-01-12 23:15:29 +0000 | [diff] [blame] | 551 | |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 552 | local($tableiii_rx) = |
| 553 | "$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5$any_next_pair_rx7" |
| 554 | . "$any_next_pair_rx9"; |
| 555 | if (/$tableiii_rx/o) { |
| 556 | $font = $4; |
| 557 | $h1 = $6; |
| 558 | $h2 = $8; |
| 559 | $h3 = $10; |
| 560 | } |
| 561 | local($th1,$th2,$th3) = &setup_column_alignments($2); |
| 562 | $globals{"lineifont"} = $font; |
Fred Drake | f9fd4e8 | 1998-02-27 15:28:45 +0000 | [diff] [blame^] | 563 | "<table border align=center>" |
| 564 | . "\n <tr>$th1<b>$h1</b></th>" |
| 565 | . "\n $th2<b>$h2</b></th>" |
| 566 | . "\n $th3<b>$h3</b></th>$'" |
| 567 | . "\n</table>"; |
Fred Drake | 9597daf | 1997-12-22 22:37:34 +0000 | [diff] [blame] | 568 | } |
| 569 | |
| 570 | sub do_cmd_lineiii{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 571 | local($_) = @_; |
| 572 | s/$next_pair_pr_rx//o; |
| 573 | local($c1) = $2; |
| 574 | s/$next_pair_pr_rx//o; |
| 575 | local($c2) = $2; |
| 576 | s/$next_pair_pr_rx//o; |
| 577 | local($c3) = $2; |
| 578 | local($font) = $globals{"lineifont"}; |
| 579 | local($c1align, $c2align, $c3align) = @col_aligns; |
| 580 | "<tr>$c1align<$font>$c1</$font></td>\n" |
| 581 | . " $c2align$c2</td>\n" |
| 582 | . " $c3align$c3</td>$'"; |
Fred Drake | 9597daf | 1997-12-22 22:37:34 +0000 | [diff] [blame] | 583 | } |
| 584 | |
Fred Drake | 9dcc5a9 | 1997-10-13 22:04:17 +0000 | [diff] [blame] | 585 | sub do_env_seealso{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 586 | "<p><b>See Also:</b></p>\n" . @_[0]; |
Fred Drake | 9dcc5a9 | 1997-10-13 22:04:17 +0000 | [diff] [blame] | 587 | } |
| 588 | |
| 589 | sub do_cmd_seemodule{ |
Fred Drake | ce0e175 | 1998-02-18 22:45:53 +0000 | [diff] [blame] | 590 | # Insert the right magic to jump to the module definition. This should |
| 591 | # work most of the time, at least for repeat builds.... |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 592 | local($_) = @_; |
| 593 | local($any_next_pair_pr_rx3) = "$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP"; |
Fred Drake | ce0e175 | 1998-02-18 22:45:53 +0000 | [diff] [blame] | 594 | s/$next_pair_pr_rx$any_next_pair_pr_rx3//; |
| 595 | local($module,$text,$node,$key) = ($2, $4, '', "module$2"); |
| 596 | $key =~ s/_//g; |
Fred Drake | 05ce570 | 1998-02-19 17:26:48 +0000 | [diff] [blame] | 597 | # XXX somewhat bogus computation of $node |
Fred Drake | ce0e175 | 1998-02-18 22:45:53 +0000 | [diff] [blame] | 598 | # $node = $external_labels{$key} unless |
| 599 | # ($node = $ref_files{$key}); |
| 600 | $node = $key; |
Fred Drake | ce0e175 | 1998-02-18 22:45:53 +0000 | [diff] [blame] | 601 | "<p>Module <tt><b><a href=\"$node#$key\">$module</a></b></tt>" |
| 602 | . " ($text)</p>" |
| 603 | . $_; |
Fred Drake | 9dcc5a9 | 1997-10-13 22:04:17 +0000 | [diff] [blame] | 604 | } |
| 605 | |
| 606 | sub do_cmd_seetext{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 607 | "<p>" . @_[0]; |
Fred Drake | 9dcc5a9 | 1997-10-13 22:04:17 +0000 | [diff] [blame] | 608 | } |
| 609 | |
Fred Drake | 7c4cba8 | 1997-12-03 19:45:08 +0000 | [diff] [blame] | 610 | # These are located down here since they screw up fontlock. |
| 611 | |
| 612 | sub do_cmd_file{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 613 | # This uses a weird HTML construct to adjust the font to be |
| 614 | # reasonable match that used in the printed form as much as |
| 615 | # possible. The expected behavior is that a browser that doesn't |
| 616 | # understand "<font face=...>" markup will use courier (or whatever |
| 617 | # the font is for <tt>). |
| 618 | local($_) = @_; |
| 619 | s/$any_next_pair_pr_rx/`<tt><font face=sans-serif>\2<\/font><\/tt>'/; |
| 620 | $_; |
Fred Drake | 7c4cba8 | 1997-12-03 19:45:08 +0000 | [diff] [blame] | 621 | } |
| 622 | |
| 623 | sub do_cmd_samp{ |
Fred Drake | 00dcfb2 | 1998-02-13 07:21:03 +0000 | [diff] [blame] | 624 | local($_) = @_; |
| 625 | s/$any_next_pair_pr_rx/`<samp>\2<\/samp>'/; |
| 626 | $_; |
Fred Drake | 7c4cba8 | 1997-12-03 19:45:08 +0000 | [diff] [blame] | 627 | } |
| 628 | |
Guido van Rossum | 9e93fb6 | 1994-01-25 20:06:09 +0000 | [diff] [blame] | 629 | 1; # This must be the last line |