blob: 90751b0a14ad4736f247ee1de34412d01fe38f3d [file] [log] [blame]
Fred Drake8ca70061997-12-08 20:59:54 +00001# myformat.perl by Guido van Rossum <guido@cwi.nl> 25 Jan 1994 -*- perl -*-
Guido van Rossum9e93fb61994-01-25 20:06:09 +00002#
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 Drake44640221996-11-11 20:51:09 +00009package main;
Guido van Rossum9e93fb61994-01-25 20:06:09 +000010
11# \bcode and \ecode brackets around verbatim
12
13sub do_cmd_bcode{ @_[0]; }
14sub do_cmd_ecode{ @_[0]; }
15
16# words typeset in a special way (not in HTML though)
17
18sub do_cmd_ABC{ join('', 'ABC', @_[0]); }
19sub do_cmd_UNIX{ join('', 'Unix', @_[0]); }
20sub do_cmd_ASCII{ join('', 'ASCII', @_[0]); }
21sub do_cmd_C{ join('', 'C', @_[0]); }
Guido van Rossumb8b264b1994-08-12 13:13:50 +000022sub do_cmd_Cpp{ join('', 'C++', @_[0]); }
Guido van Rossum9e93fb61994-01-25 20:06:09 +000023sub do_cmd_EOF{ join('', 'EOF', @_[0]); }
Guido van Rossumd9a26ff1997-11-18 15:31:16 +000024sub do_cmd_NULL{ join('', 'NULL', @_[0]); }
Guido van Rossum9e93fb61994-01-25 20:06:09 +000025
Fred Drake3e1fe891996-11-11 23:03:36 +000026sub do_cmd_e{ local($_) = @_; '&#92;' . $_; }
Guido van Rossum9e93fb61994-01-25 20:06:09 +000027
Fred Drakec384d751996-11-11 16:04:35 +000028sub do_cmd_optional{
Guido van Rossum9e93fb61994-01-25 20:06:09 +000029 local($_) = @_;
Fred Drake7c4cba81997-12-03 19:45:08 +000030 s/$any_next_pair_pr_rx/<\/var><big>\[<\/big><var>\2<\/var><big>\]<\/big><var>/;
Guido van Rossum9e93fb61994-01-25 20:06:09 +000031 $_;
32}
33
Fred Drakec384d751996-11-11 16:04:35 +000034sub do_cmd_varvars{
35 local($_) = @_;
Fred Drake7c4cba81997-12-03 19:45:08 +000036 s/$any_next_pair_pr_rx/<var>\2<\/var>/;
Fred Drakec384d751996-11-11 16:04:35 +000037 $_;
38}
39
Fred Drake3e1fe891996-11-11 23:03:36 +000040# texinfo-like formatting commands: \code{...} etc.
41
Fred Drakec384d751996-11-11 16:04:35 +000042sub do_cmd_code{
43 local($_) = @_;
Fred Drake7c4cba81997-12-03 19:45:08 +000044 s/$any_next_pair_pr_rx/<code>\2<\/code>/;
Fred Drakec384d751996-11-11 16:04:35 +000045 $_;
46}
47
48sub do_cmd_sectcode{ &do_cmd_code(@_); }
49
Guido van Rossum9e93fb61994-01-25 20:06:09 +000050sub do_cmd_kbd{
51 local($_) = @_;
Fred Drake7c4cba81997-12-03 19:45:08 +000052 s/$any_next_pair_pr_rx/<kbd>\2<\/kbd>/;
Guido van Rossum9e93fb61994-01-25 20:06:09 +000053 $_;
54}
55
56sub do_cmd_key{
57 local($_) = @_;
Fred Drake7c4cba81997-12-03 19:45:08 +000058 s/$any_next_pair_pr_rx/<tt>\2<\/tt>/;
Guido van Rossum9e93fb61994-01-25 20:06:09 +000059 $_;
60}
61
62sub do_cmd_var{
63 local($_) = @_;
Fred Drake7c4cba81997-12-03 19:45:08 +000064 s/$any_next_pair_pr_rx/<var>\2<\/var>/;
Guido van Rossum9e93fb61994-01-25 20:06:09 +000065 $_;
66}
67
68sub do_cmd_dfn{
69 local($_) = @_;
Fred Drake7c4cba81997-12-03 19:45:08 +000070 s/$any_next_pair_pr_rx/<i><dfn>\2<\/dfn><\/i>/;
Guido van Rossum9e93fb61994-01-25 20:06:09 +000071 $_;
72}
73
74sub do_cmd_emph{
75 local($_) = @_;
Fred Drake7c4cba81997-12-03 19:45:08 +000076 s/$any_next_pair_pr_rx/<em>\2<\/em>/;
Guido van Rossum9e93fb61994-01-25 20:06:09 +000077 $_;
78}
79
80sub do_cmd_strong{
81 local($_) = @_;
Fred Drake1af9e791998-01-12 23:15:29 +000082 s/$any_next_pair_pr_rx/<b>\2<\/b>/;
Guido van Rossum9e93fb61994-01-25 20:06:09 +000083 $_;
84}
85
Fred Drake7c4cba81997-12-03 19:45:08 +000086# file and samp are at the end of this file since they screw up fontlock.
87
Guido van Rossum9e93fb61994-01-25 20:06:09 +000088# index commands
89
90sub do_cmd_indexii{
91 local($_) = @_;
92 s/$next_pair_pr_rx//o;
93 local($br_id1, $str1) = ($1, $2);
94 s/$next_pair_pr_rx//o;
95 local($br_id2, $str2) = ($1, $2);
96 join('', &make_index_entry($br_id1, "$str1 $str2"),
97 &make_index_entry($br_id2, "$str2, $str1"), $_);
98}
99
100sub do_cmd_indexiii{
101 local($_) = @_;
102 s/$next_pair_pr_rx//o;
103 local($br_id1, $str1) = ($1, $2);
104 s/$next_pair_pr_rx//o;
105 local($br_id2, $str2) = ($1, $2);
106 s/$next_pair_pr_rx//o;
107 local($br_id3, $str3) = ($1, $2);
108 join('', &make_index_entry($br_id1, "$str1 $str2 $str3"),
109 &make_index_entry($br_id2, "$str2 $str3, $str1"),
110 &make_index_entry($br_id3, "$str3, $str1 $str2"),
Fred Drake72df9bc1997-12-16 21:13:20 +0000111 $_);
Guido van Rossum9e93fb61994-01-25 20:06:09 +0000112}
113
114sub do_cmd_indexiv{
115 local($_) = @_;
116 s/$next_pair_pr_rx//o;
117 local($br_id1, $str1) = ($1, $2);
118 s/$next_pair_pr_rx//o;
119 local($br_id2, $str2) = ($1, $2);
120 s/$next_pair_pr_rx//o;
121 local($br_id3, $str3) = ($1, $2);
122 s/$next_pair_pr_rx//o;
123 local($br_id4, $str4) = ($1, $2);
124 join('', &make_index_entry($br_id1, "$str1 $str2 $str3 $str4"),
125 &make_index_entry($br_id2, "$str2 $str3 $str4, $str1"),
126 &make_index_entry($br_id3, "$str3 $str4, $str1 $str2"),
127 &make_index_entry($br_id4, "$str4, $str1 $str2 $str3"),
Fred Drake72df9bc1997-12-16 21:13:20 +0000128 $_);
Guido van Rossum9e93fb61994-01-25 20:06:09 +0000129}
130
131sub do_cmd_ttindex{
132 &do_cmd_index(@_);
133}
134
135sub my_typed_index_helper{
136 local($word, $_) = @_;
137 s/$next_pair_pr_rx//o;
138 local($br_id, $str) = ($1, $2);
139 join('', &make_index_entry($br_id, "$str $word"),
140 &make_index_entry($br_id, "$word, $str"), $_);
141}
142
143sub do_cmd_stindex{ &my_typed_index_helper('statement', @_); }
Guido van Rossum9e93fb61994-01-25 20:06:09 +0000144sub do_cmd_opindex{ &my_typed_index_helper('operator', @_); }
145sub do_cmd_exindex{ &my_typed_index_helper('exception', @_); }
146sub do_cmd_obindex{ &my_typed_index_helper('object', @_); }
147
148sub my_parword_index_helper{
149 local($word, $_) = @_;
150 s/$next_pair_pr_rx//o;
151 local($br_id, $str) = ($1, $2);
Fred Drake72df9bc1997-12-16 21:13:20 +0000152 &make_index_entry($br_id, "$str ($word)") . $_;
Guido van Rossum9e93fb61994-01-25 20:06:09 +0000153}
154
Fred Drake84818d71997-12-17 02:59:39 +0000155sub make_mod_index_entry {
156 local($br_id,$str,$define) = @_;
Fred Drakeab0b65d1998-01-13 04:05:11 +0000157 local($halfref) = &make_half_href("$CURRENT_FILE#$br_id");
158 # If TITLE is not yet available (i.e the \index command is in the title
159 # of the current section), use $ref_before.
Fred Drake84818d71997-12-17 02:59:39 +0000160 $TITLE = $ref_before unless $TITLE;
161 # Save the reference
Fred Drakeab0b65d1998-01-13 04:05:11 +0000162 if ($define eq "DEF") {
163 local($nstr,$garbage) = split / /, $str, 2;
164 $Modules{$nstr} .= $halfref;
165 }
Fred Drake84818d71997-12-17 02:59:39 +0000166 $str = &gen_index_id($str, $define);
Fred Drakeab0b65d1998-01-13 04:05:11 +0000167 $index{$str} .= $halfref;
Fred Drake8da9e6a1997-12-18 14:14:16 +0000168 "<a name=\"$br_id\">$anchor_invisible_mark<\/a>";
Fred Drake84818d71997-12-17 02:59:39 +0000169}
170
171sub my_module_index_helper{
172 local($word, $_, $define) = @_;
173 s/$next_pair_pr_rx//o;
174 local($br_id, $str) = ($1, $2);
175 &make_mod_index_entry($br_id, "<tt>$str</tt> ($word module)",
176 $define) . $_;
177}
178
Guido van Rossum9e93fb61994-01-25 20:06:09 +0000179sub do_cmd_bifuncindex{ &my_parword_index_helper('built-in function', @_); }
Fred Drake84818d71997-12-17 02:59:39 +0000180sub do_cmd_bimodindex{ &my_module_index_helper('built-in', @_, 'DEF'); }
181sub do_cmd_stmodindex{ &my_module_index_helper('standard', @_, 'DEF'); }
Guido van Rossum9e93fb61994-01-25 20:06:09 +0000182sub do_cmd_bifuncindex{ &my_parword_index_helper('standard module', @_); }
183
Fred Drake84818d71997-12-17 02:59:39 +0000184sub do_cmd_refbimodindex{ &my_module_index_helper('built-in', @_, 'REF'); }
185sub do_cmd_refstmodindex{ &my_module_index_helper('standard', @_, 'REF'); }
Fred Drake72df9bc1997-12-16 21:13:20 +0000186
Fred Drakec384d751996-11-11 16:04:35 +0000187sub do_cmd_nodename{ &do_cmd_label(@_); }
188
Fred Drake1af9e791998-01-12 23:15:29 +0000189sub do_cmd_mytableofcontents{ @_[0]; }
Fred Drake46fbd7f1998-01-09 05:22:44 +0000190
Fred Drake1af9e791998-01-12 23:15:29 +0000191sub init_myformat{
192 # XXX need some way for this to be called after &initialise;
193 # <<2>>...<<2>>
194 $any_next_pair_rx3 = "$O(\\d+)$C([\\s\\S]*)$O\\3$C";
195 $any_next_pair_rx5 = "$O(\\d+)$C([\\s\\S]*)$O\\5$C";
196 $any_next_pair_rx7 = "$O(\\d+)$C([\\s\\S]*)$O\\7$C";
197 $any_next_pair_rx9 = "$O(\\d+)$C([\\s\\S]*)$O\\9$C";
198 # <#2#>...<#2#>
199 $any_next_pair_pr_rx_3 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP";
200 $any_next_pair_pr_rx_5 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\5$CP";
201 $any_next_pair_pr_rx_7 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\7$CP";
202 $any_next_pair_pr_rx_9 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\9$CP";
203 $new_command{"indexsubitem"} = "";
204}
205
206&init_myformat;
Fred Drakec384d751996-11-11 16:04:35 +0000207
208sub get_indexsubitem{
209 local($result) = $new_command{"indexsubitem"};
210 #print "\nget_indexsubitem ==> $result\n";
Fred Drake9597daf1997-12-22 22:37:34 +0000211 $result ? " $result" : '';
Fred Drakec384d751996-11-11 16:04:35 +0000212}
213
Fred Drake84818d71997-12-17 02:59:39 +0000214# similar to make_index_entry(), but includes the string in the result
215# instead of the dummy filler.
216#
217sub make_str_index_entry {
218 local($br_id,$str) = @_;
219 # If TITLE is not yet available (i.e the \index command is in the title
220 # of the current section), use $ref_before.
221 $TITLE = $ref_before unless $TITLE;
222 # Save the reference
223 local($nstr) = &gen_index_id($str, '');
224 $index{$nstr} .= &make_half_href("$CURRENT_FILE#$br_id");
225 "<a name=\"$br_id\">$str<\/a>";
226}
227
Fred Drake7a7480d1996-10-29 15:56:57 +0000228sub do_env_cfuncdesc{
229 local($_) = @_;
Fred Drake7c4cba81997-12-03 19:45:08 +0000230 local($return_type,$function_name,$arg_list,$idx) = ('', '', '', '');
Fred Drake7a7480d1996-10-29 15:56:57 +0000231 local($cfuncdesc_rx) =
Fred Drakec384d751996-11-11 16:04:35 +0000232 "$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5";
Fred Drake7a7480d1996-10-29 15:56:57 +0000233 $* = 1;
234 if (/$cfuncdesc_rx/o) {
235 $return_type = "$2";
236 $function_name = "$4";
237 $arg_list = "$6";
Fred Drake7c4cba81997-12-03 19:45:08 +0000238 $idx = &make_str_index_entry($3,
Fred Drake9597daf1997-12-22 22:37:34 +0000239 "<tt>$function_name</tt>" . &get_indexsubitem);
Fred Drake7a7480d1996-10-29 15:56:57 +0000240 }
241 $* = 0;
Fred Drake1af9e791998-01-12 23:15:29 +0000242 "<dl><dt>$return_type <b>$idx</b>" .
Fred Drake7c4cba81997-12-03 19:45:08 +0000243 "(<var>$arg_list</var>)\n<dd>$'\n</dl>"
Fred Drake7a7480d1996-10-29 15:56:57 +0000244}
245
Fred Drake9dcc5a91997-10-13 22:04:17 +0000246sub do_env_ctypedesc{
247 local($_) = @_;
248 local($type_name) = ('');
249 local($cfuncdesc_rx) =
250 "$next_pair_rx";
251 $* = 1;
252 if (/$cfuncdesc_rx/o) {
253 $type_name = "$2";
Fred Drake7c4cba81997-12-03 19:45:08 +0000254 $idx = &make_str_index_entry($1,
Fred Drake9597daf1997-12-22 22:37:34 +0000255 "<tt>$type_name</tt>" . &get_indexsubitem);
Fred Drake9dcc5a91997-10-13 22:04:17 +0000256 }
257 $* = 0;
Fred Drake1af9e791998-01-12 23:15:29 +0000258 "<dl><dt><b>$idx</b>\n<dd>$'\n</dl>"
Fred Drake9dcc5a91997-10-13 22:04:17 +0000259}
260
261sub do_env_cvardesc{
262 local($_) = @_;
Fred Drake7c4cba81997-12-03 19:45:08 +0000263 local($var_type,$var_name,$idx) = ('', '', '');
Fred Drake1af9e791998-01-12 23:15:29 +0000264 local($cfuncdesc_rx) = "$next_pair_rx$any_next_pair_rx3";
Fred Drake9dcc5a91997-10-13 22:04:17 +0000265 $* = 1;
266 if (/$cfuncdesc_rx/o) {
267 $var_type = "$2";
268 $var_name = "$4";
Fred Drake9597daf1997-12-22 22:37:34 +0000269 $idx = &make_str_index_entry($3,"<tt>$var_name</tt>" . &get_indexsubitem);
Fred Drake9dcc5a91997-10-13 22:04:17 +0000270 }
271 $* = 0;
Fred Drake1af9e791998-01-12 23:15:29 +0000272 "<dl><dt>$var_type <b>$idx</b>\n" .
Fred Drake7c4cba81997-12-03 19:45:08 +0000273 "<dd>$'\n</dl>";
Fred Drake9dcc5a91997-10-13 22:04:17 +0000274}
275
Fred Drakec384d751996-11-11 16:04:35 +0000276sub do_env_funcdesc{
277 local($_) = @_;
Fred Drake7c4cba81997-12-03 19:45:08 +0000278 local($function_name,$arg_list,$idx) = ('', '', '');
Fred Drakec384d751996-11-11 16:04:35 +0000279 local($funcdesc_rx) = "$next_pair_rx$any_next_pair_rx3";
280 $* = 1;
281 if (/$funcdesc_rx/o) {
282 $function_name = "$2";
283 $arg_list = "$4";
Fred Drake7c4cba81997-12-03 19:45:08 +0000284 $idx = &make_str_index_entry($3,
Fred Drake9597daf1997-12-22 22:37:34 +0000285 "<tt>$function_name</tt>" . &get_indexsubitem);
Fred Drakec384d751996-11-11 16:04:35 +0000286 }
287 $* = 0;
Fred Drake1af9e791998-01-12 23:15:29 +0000288 "<dl><dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>$'\n</dl>";
289}
290
291sub do_cmd_funcline{
292 local($_) = @_;
293 local($funcdesc_rx) = "$next_pair_pr_rx$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP";
294
295 s/$funcdesc_rx//o;
296 local($br_id, $function_name, $arg_list) = ($3, $2, $4);
297 local($idx) = &make_str_index_entry($br_id, "<tt>$function_name</tt>");
298
299 "<dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>" . $_;
Fred Drake7c4cba81997-12-03 19:45:08 +0000300}
301
302sub do_env_opcodedesc{
303 local($_) = @_;
304 local($opcode_name,$arg_list,$stuff,$idx) = ('', '', '', '');
305 local($opcodedesc_rx) = "$next_pair_rx$any_next_pair_rx3";
306 $* = 1;
307 if (/$opcodedesc_rx/o) {
308 $opcode_name = "$2";
309 $arg_list = "$4";
310 $idx = &make_str_index_entry($3,
311 "<tt>$opcode_name</tt> (byte code instruction)");
312 }
313 $* = 0;
Fred Drake1af9e791998-01-12 23:15:29 +0000314 $stuff = "<dl><dt><b>$idx</b>";
Fred Drake7c4cba81997-12-03 19:45:08 +0000315 if ($arg_list) {
316 $stuff = "$stuff&nbsp;&nbsp;&nbsp;&nbsp;<var>$arg_list</var>";
317 }
318 $stuff . "\n<dd>$'\n</dl>";
Fred Drakec384d751996-11-11 16:04:35 +0000319}
320
321sub do_env_datadesc{
322 local($_) = @_;
Fred Drake7c4cba81997-12-03 19:45:08 +0000323 local($data_name,$idx) = ('', '');
Fred Drakec384d751996-11-11 16:04:35 +0000324 local($datadesc_rx) = "$next_pair_rx";
325 $* = 1;
326 if (/$datadesc_rx/o) {
327 $data_name = "$2";
Fred Drake7c4cba81997-12-03 19:45:08 +0000328 $idx = &make_str_index_entry($3,
Fred Drake9597daf1997-12-22 22:37:34 +0000329 "<tt>$data_name</tt>" . &get_indexsubitem);
Fred Drakec384d751996-11-11 16:04:35 +0000330 }
331 $* = 0;
Fred Drake1af9e791998-01-12 23:15:29 +0000332 "<dl><dt><b>$idx</b>\n<dd>$'\n</dl>"
333}
334
335sub do_cmd_dataline{
336 local($_) = @_;
337
338 s/$next_pair_pr_rx//o;
339 local($br_id, $data_name) = ($1, $2);
340 local($idx) = &make_str_index_entry($br_id, "<tt>$data_name</tt>");
341
342 "<dt><b>$idx</b>\n<dd>" . $_;
Fred Drakec384d751996-11-11 16:04:35 +0000343}
344
345sub do_env_excdesc{ &do_env_datadesc(@_); }
346
Fred Drake9597daf1997-12-22 22:37:34 +0000347@col_aligns = ("<td>", "<td>", "<td>");
348
349sub setup_column_alignments{
350 local($_) = @_;
351 local($j1,$a1,$a2,$a3,$j4) = split(/[|]/,$_);
Fred Drake1af9e791998-01-12 23:15:29 +0000352 local($th1,$th2,$th3) = ('<th>', '<th>', '<th>');
Fred Drake9597daf1997-12-22 22:37:34 +0000353 $col_aligns[0] = (($a1 eq "c") ? "<td align=center>" : "<td>");
354 $col_aligns[1] = (($a2 eq "c") ? "<td align=center>" : "<td>");
355 $col_aligns[2] = (($a3 eq "c") ? "<td align=center>" : "<td>");
Fred Drake1af9e791998-01-12 23:15:29 +0000356 # return the aligned header start tags; only used for \begin{tableiii?}
357 $th1 = (($a1 eq "l") ? "<th align=left>"
358 : ($a1 eq "r" ? "<th align=right>" : "<th>"));
359 $th2 = (($a2 eq "l") ? "<th align=left>"
360 : ($a2 eq "r" ? "<th align=right>" : "<th>"));
361 $th3 = (($a3 eq "l") ? "<th align=left>"
362 : ($a3 eq "r" ? "<th align=right>" : "<th>"));
363 ($th1, $th2, $th3);
Fred Drake9597daf1997-12-22 22:37:34 +0000364}
365
366sub do_env_tableii{
367 local($_) = @_;
368 local($font,$h1,$h2) = ('', '', '');
369 local($tableiii_rx) =
370 "$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5$any_next_pair_rx7";
371 $* = 1;
372 if (/$tableiii_rx/o) {
Fred Drake9597daf1997-12-22 22:37:34 +0000373 $font = $4;
374 $h1 = $6;
375 $h2 = $8;
376 }
Fred Drake1af9e791998-01-12 23:15:29 +0000377 local($th1,$th2,$th3) = &setup_column_alignments($2);
Fred Drake9597daf1997-12-22 22:37:34 +0000378 $globals{"lineifont"} = $font;
Fred Drake1af9e791998-01-12 23:15:29 +0000379 "<table border align=center>\n <tr>$th1$h1</th>\n $th2$h2</th>$'\n"
Fred Drake9597daf1997-12-22 22:37:34 +0000380 . "</table>";
381}
382
383sub do_cmd_lineii{
384 local($_) = @_;
385 s/$next_pair_pr_rx//o;
386 local($c1) = $2;
387 s/$next_pair_pr_rx//o;
388 local($c2) = $2;
389 local($font) = $globals{"lineifont"};
390 local($c1align, $c2align) = @col_aligns[0,1];
391 "<tr>$c1align<$font>$c1</$font></td>\n"
392 . " $c2align$c2</td>$'";
393}
394
395sub do_env_tableiii{
396 local($_) = @_;
397 local($font,$h1,$h2,$h3) = ('', '', '', '');
Fred Drake1af9e791998-01-12 23:15:29 +0000398
Fred Drake9597daf1997-12-22 22:37:34 +0000399 local($tableiii_rx) =
400 "$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5$any_next_pair_rx7"
401 . "$any_next_pair_rx9";
402 $* = 1;
403 if (/$tableiii_rx/o) {
Fred Drake9597daf1997-12-22 22:37:34 +0000404 $font = $4;
405 $h1 = $6;
406 $h2 = $8;
407 $h3 = $10;
408 }
Fred Drake1af9e791998-01-12 23:15:29 +0000409 local($th1,$th2,$th3) = &setup_column_alignments($2);
Fred Drake9597daf1997-12-22 22:37:34 +0000410 $globals{"lineifont"} = $font;
Fred Drake1af9e791998-01-12 23:15:29 +0000411 "<table border align=center>\n <tr>$th1$h1</th>\n $th2$h2</th>"
412 . "\n $th3$h3</th>$'\n"
Fred Drake9597daf1997-12-22 22:37:34 +0000413 . "</table>";
414}
415
416sub do_cmd_lineiii{
417 local($_) = @_;
418 s/$next_pair_pr_rx//o;
419 local($c1) = $2;
420 s/$next_pair_pr_rx//o;
421 local($c2) = $2;
422 s/$next_pair_pr_rx//o;
423 local($c3) = $2;
424 local($font) = $globals{"lineifont"};
425 local($c1align, $c2align, $c3align) = @col_aligns;
426 "<tr>$c1align<$font>$c1</$font></td>\n"
427 . " $c2align$c2</td>\n"
428 . " $c3align$c3</td>$'";
429}
430
Fred Drake9dcc5a91997-10-13 22:04:17 +0000431sub do_env_seealso{
432 local($_) = @_;
Fred Drake7c4cba81997-12-03 19:45:08 +0000433 "<p><b>See Also:</b></p>\n" . $_;
Fred Drake9dcc5a91997-10-13 22:04:17 +0000434}
435
436sub do_cmd_seemodule{
437 local($_) = @_;
438 local($any_next_pair_pr_rx3) = "$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP";
Fred Drake7c4cba81997-12-03 19:45:08 +0000439 s/$next_pair_pr_rx$any_next_pair_pr_rx3/<p><code><b>\2<\/b><\/code> (\4)<\/p>/;
Fred Drake9dcc5a91997-10-13 22:04:17 +0000440 $_;
441}
442
443sub do_cmd_seetext{
444 local($_) = @_;
445 "<p>" . $_;
446}
447
Fred Drake7c4cba81997-12-03 19:45:08 +0000448# These are located down here since they screw up fontlock.
449
450sub do_cmd_file{
451 local($_) = @_;
452 s/$any_next_pair_pr_rx/`<code>\2<\/code>'/;
453 $_;
454}
455
456sub do_cmd_samp{
457 local($_) = @_;
458 s/$any_next_pair_pr_rx/`<samp>\2<\/samp>'/;
459 $_;
460}
461
Guido van Rossum9e93fb61994-01-25 20:06:09 +00004621; # This must be the last line