blob: 1f93b5e3c8600bfc4068cb7bddfbedd7f2f5ba7c [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]); }
Fred Drakebceaf351998-01-22 16:13:44 +000021sub do_cmd_POSIX{ join('', 'POSIX', @_[0]); }
Guido van Rossum9e93fb61994-01-25 20:06:09 +000022sub do_cmd_C{ join('', 'C', @_[0]); }
Guido van Rossumb8b264b1994-08-12 13:13:50 +000023sub do_cmd_Cpp{ join('', 'C++', @_[0]); }
Guido van Rossum9e93fb61994-01-25 20:06:09 +000024sub do_cmd_EOF{ join('', 'EOF', @_[0]); }
Guido van Rossumd9a26ff1997-11-18 15:31:16 +000025sub do_cmd_NULL{ join('', 'NULL', @_[0]); }
Guido van Rossum9e93fb61994-01-25 20:06:09 +000026
Fred Drake3e1fe891996-11-11 23:03:36 +000027sub do_cmd_e{ local($_) = @_; '&#92;' . $_; }
Guido van Rossum9e93fb61994-01-25 20:06:09 +000028
Fred Drakec384d751996-11-11 16:04:35 +000029sub do_cmd_optional{
Guido van Rossum9e93fb61994-01-25 20:06:09 +000030 local($_) = @_;
Fred Drake7c4cba81997-12-03 19:45:08 +000031 s/$any_next_pair_pr_rx/<\/var><big>\[<\/big><var>\2<\/var><big>\]<\/big><var>/;
Guido van Rossum9e93fb61994-01-25 20:06:09 +000032 $_;
33}
34
Fred Drakec384d751996-11-11 16:04:35 +000035sub do_cmd_varvars{
36 local($_) = @_;
Fred Drake7c4cba81997-12-03 19:45:08 +000037 s/$any_next_pair_pr_rx/<var>\2<\/var>/;
Fred Drakec384d751996-11-11 16:04:35 +000038 $_;
39}
40
Fred Drake3e1fe891996-11-11 23:03:36 +000041# texinfo-like formatting commands: \code{...} etc.
42
Fred Drakec384d751996-11-11 16:04:35 +000043sub do_cmd_code{
44 local($_) = @_;
Fred Drake7c4cba81997-12-03 19:45:08 +000045 s/$any_next_pair_pr_rx/<code>\2<\/code>/;
Fred Drakec384d751996-11-11 16:04:35 +000046 $_;
47}
48
49sub do_cmd_sectcode{ &do_cmd_code(@_); }
Fred Drakebceaf351998-01-22 16:13:44 +000050sub do_cmd_module{ &do_cmd_code(@_); }
51sub do_cmd_keyword{ &do_cmd_code(@_); }
52sub do_cmd_exception{ &do_cmd_code(@_); }
53sub do_cmd_class{ &do_cmd_code(@_); }
54sub do_cmd_function{ &do_cmd_code(@_); }
55sub do_cmd_cfunction{ &do_cmd_code(@_); }
56sub do_cmd_constant{ &do_cmd_code(@_); }
57sub do_cmd_method{ &do_cmd_code(@_); }
58sub do_cmd_email{ &do_cmd_code(@_); }
59
60sub do_cmd_url{
61 # use the URL as both text and hyperlink
62 local($_) = @_;
63 s/$any_next_pair_pr_rx/<code><a href="\2">\2<\/a><\/code>/;
64 $_;
65}
66
67sub do_cmd_manpage{
68 # two parameters: \manpage{name}{section}
69 local($_) = @_;
70 local($any_next_pair_pr_rx3) = "$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP";
71 s/$next_pair_pr_rx$any_next_pair_pr_rx3/<em>\2<\/em>(\4)/;
72 $_;
73}
Fred Drakec384d751996-11-11 16:04:35 +000074
Guido van Rossum9e93fb61994-01-25 20:06:09 +000075sub do_cmd_kbd{
76 local($_) = @_;
Fred Drake7c4cba81997-12-03 19:45:08 +000077 s/$any_next_pair_pr_rx/<kbd>\2<\/kbd>/;
Guido van Rossum9e93fb61994-01-25 20:06:09 +000078 $_;
79}
80
81sub do_cmd_key{
82 local($_) = @_;
Fred Drake7c4cba81997-12-03 19:45:08 +000083 s/$any_next_pair_pr_rx/<tt>\2<\/tt>/;
Guido van Rossum9e93fb61994-01-25 20:06:09 +000084 $_;
85}
86
87sub do_cmd_var{
88 local($_) = @_;
Fred Drakebceaf351998-01-22 16:13:44 +000089 s/$any_next_pair_pr_rx/<em>\2<\/em>/;
Guido van Rossum9e93fb61994-01-25 20:06:09 +000090 $_;
91}
92
93sub do_cmd_dfn{
94 local($_) = @_;
Fred Drake7c4cba81997-12-03 19:45:08 +000095 s/$any_next_pair_pr_rx/<i><dfn>\2<\/dfn><\/i>/;
Guido van Rossum9e93fb61994-01-25 20:06:09 +000096 $_;
97}
98
99sub do_cmd_emph{
100 local($_) = @_;
Fred Drake7c4cba81997-12-03 19:45:08 +0000101 s/$any_next_pair_pr_rx/<em>\2<\/em>/;
Guido van Rossum9e93fb61994-01-25 20:06:09 +0000102 $_;
103}
104
105sub do_cmd_strong{
106 local($_) = @_;
Fred Drake1af9e791998-01-12 23:15:29 +0000107 s/$any_next_pair_pr_rx/<b>\2<\/b>/;
Guido van Rossum9e93fb61994-01-25 20:06:09 +0000108 $_;
109}
110
Fred Drake7c4cba81997-12-03 19:45:08 +0000111# file and samp are at the end of this file since they screw up fontlock.
112
Guido van Rossum9e93fb61994-01-25 20:06:09 +0000113# index commands
114
115sub do_cmd_indexii{
116 local($_) = @_;
117 s/$next_pair_pr_rx//o;
118 local($br_id1, $str1) = ($1, $2);
119 s/$next_pair_pr_rx//o;
120 local($br_id2, $str2) = ($1, $2);
121 join('', &make_index_entry($br_id1, "$str1 $str2"),
122 &make_index_entry($br_id2, "$str2, $str1"), $_);
123}
124
125sub do_cmd_indexiii{
126 local($_) = @_;
127 s/$next_pair_pr_rx//o;
128 local($br_id1, $str1) = ($1, $2);
129 s/$next_pair_pr_rx//o;
130 local($br_id2, $str2) = ($1, $2);
131 s/$next_pair_pr_rx//o;
132 local($br_id3, $str3) = ($1, $2);
133 join('', &make_index_entry($br_id1, "$str1 $str2 $str3"),
134 &make_index_entry($br_id2, "$str2 $str3, $str1"),
135 &make_index_entry($br_id3, "$str3, $str1 $str2"),
Fred Drake72df9bc1997-12-16 21:13:20 +0000136 $_);
Guido van Rossum9e93fb61994-01-25 20:06:09 +0000137}
138
139sub do_cmd_indexiv{
140 local($_) = @_;
141 s/$next_pair_pr_rx//o;
142 local($br_id1, $str1) = ($1, $2);
143 s/$next_pair_pr_rx//o;
144 local($br_id2, $str2) = ($1, $2);
145 s/$next_pair_pr_rx//o;
146 local($br_id3, $str3) = ($1, $2);
147 s/$next_pair_pr_rx//o;
148 local($br_id4, $str4) = ($1, $2);
149 join('', &make_index_entry($br_id1, "$str1 $str2 $str3 $str4"),
150 &make_index_entry($br_id2, "$str2 $str3 $str4, $str1"),
151 &make_index_entry($br_id3, "$str3 $str4, $str1 $str2"),
152 &make_index_entry($br_id4, "$str4, $str1 $str2 $str3"),
Fred Drake72df9bc1997-12-16 21:13:20 +0000153 $_);
Guido van Rossum9e93fb61994-01-25 20:06:09 +0000154}
155
156sub do_cmd_ttindex{
157 &do_cmd_index(@_);
158}
159
160sub my_typed_index_helper{
161 local($word, $_) = @_;
162 s/$next_pair_pr_rx//o;
163 local($br_id, $str) = ($1, $2);
164 join('', &make_index_entry($br_id, "$str $word"),
165 &make_index_entry($br_id, "$word, $str"), $_);
166}
167
168sub do_cmd_stindex{ &my_typed_index_helper('statement', @_); }
Guido van Rossum9e93fb61994-01-25 20:06:09 +0000169sub do_cmd_opindex{ &my_typed_index_helper('operator', @_); }
170sub do_cmd_exindex{ &my_typed_index_helper('exception', @_); }
171sub do_cmd_obindex{ &my_typed_index_helper('object', @_); }
172
173sub my_parword_index_helper{
174 local($word, $_) = @_;
175 s/$next_pair_pr_rx//o;
176 local($br_id, $str) = ($1, $2);
Fred Drake72df9bc1997-12-16 21:13:20 +0000177 &make_index_entry($br_id, "$str ($word)") . $_;
Guido van Rossum9e93fb61994-01-25 20:06:09 +0000178}
179
Fred Drake84818d71997-12-17 02:59:39 +0000180sub make_mod_index_entry {
181 local($br_id,$str,$define) = @_;
Fred Drakeab0b65d1998-01-13 04:05:11 +0000182 local($halfref) = &make_half_href("$CURRENT_FILE#$br_id");
183 # If TITLE is not yet available (i.e the \index command is in the title
184 # of the current section), use $ref_before.
Fred Drake84818d71997-12-17 02:59:39 +0000185 $TITLE = $ref_before unless $TITLE;
186 # Save the reference
Fred Drakeab0b65d1998-01-13 04:05:11 +0000187 if ($define eq "DEF") {
188 local($nstr,$garbage) = split / /, $str, 2;
189 $Modules{$nstr} .= $halfref;
190 }
Fred Drake84818d71997-12-17 02:59:39 +0000191 $str = &gen_index_id($str, $define);
Fred Drakeab0b65d1998-01-13 04:05:11 +0000192 $index{$str} .= $halfref;
Fred Drake8da9e6a1997-12-18 14:14:16 +0000193 "<a name=\"$br_id\">$anchor_invisible_mark<\/a>";
Fred Drake84818d71997-12-17 02:59:39 +0000194}
195
196sub my_module_index_helper{
197 local($word, $_, $define) = @_;
198 s/$next_pair_pr_rx//o;
199 local($br_id, $str) = ($1, $2);
200 &make_mod_index_entry($br_id, "<tt>$str</tt> ($word module)",
201 $define) . $_;
202}
203
Guido van Rossum9e93fb61994-01-25 20:06:09 +0000204sub do_cmd_bifuncindex{ &my_parword_index_helper('built-in function', @_); }
Fred Drake84818d71997-12-17 02:59:39 +0000205sub do_cmd_bimodindex{ &my_module_index_helper('built-in', @_, 'DEF'); }
206sub do_cmd_stmodindex{ &my_module_index_helper('standard', @_, 'DEF'); }
Guido van Rossum9e93fb61994-01-25 20:06:09 +0000207sub do_cmd_bifuncindex{ &my_parword_index_helper('standard module', @_); }
208
Fred Drake84818d71997-12-17 02:59:39 +0000209sub do_cmd_refbimodindex{ &my_module_index_helper('built-in', @_, 'REF'); }
210sub do_cmd_refstmodindex{ &my_module_index_helper('standard', @_, 'REF'); }
Fred Drake72df9bc1997-12-16 21:13:20 +0000211
Fred Drakec384d751996-11-11 16:04:35 +0000212sub do_cmd_nodename{ &do_cmd_label(@_); }
213
Fred Drake1af9e791998-01-12 23:15:29 +0000214sub init_myformat{
215 # XXX need some way for this to be called after &initialise;
216 # <<2>>...<<2>>
217 $any_next_pair_rx3 = "$O(\\d+)$C([\\s\\S]*)$O\\3$C";
218 $any_next_pair_rx5 = "$O(\\d+)$C([\\s\\S]*)$O\\5$C";
219 $any_next_pair_rx7 = "$O(\\d+)$C([\\s\\S]*)$O\\7$C";
220 $any_next_pair_rx9 = "$O(\\d+)$C([\\s\\S]*)$O\\9$C";
221 # <#2#>...<#2#>
222 $any_next_pair_pr_rx_3 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP";
223 $any_next_pair_pr_rx_5 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\5$CP";
224 $any_next_pair_pr_rx_7 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\7$CP";
225 $any_next_pair_pr_rx_9 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\9$CP";
226 $new_command{"indexsubitem"} = "";
227}
228
229&init_myformat;
Fred Drakec384d751996-11-11 16:04:35 +0000230
231sub get_indexsubitem{
232 local($result) = $new_command{"indexsubitem"};
233 #print "\nget_indexsubitem ==> $result\n";
Fred Drake9597daf1997-12-22 22:37:34 +0000234 $result ? " $result" : '';
Fred Drakec384d751996-11-11 16:04:35 +0000235}
236
Fred Drake84818d71997-12-17 02:59:39 +0000237# similar to make_index_entry(), but includes the string in the result
238# instead of the dummy filler.
239#
240sub make_str_index_entry {
241 local($br_id,$str) = @_;
242 # If TITLE is not yet available (i.e the \index command is in the title
243 # of the current section), use $ref_before.
244 $TITLE = $ref_before unless $TITLE;
245 # Save the reference
246 local($nstr) = &gen_index_id($str, '');
247 $index{$nstr} .= &make_half_href("$CURRENT_FILE#$br_id");
248 "<a name=\"$br_id\">$str<\/a>";
249}
250
Fred Drake7a7480d1996-10-29 15:56:57 +0000251sub do_env_cfuncdesc{
252 local($_) = @_;
Fred Drake7c4cba81997-12-03 19:45:08 +0000253 local($return_type,$function_name,$arg_list,$idx) = ('', '', '', '');
Fred Drake7a7480d1996-10-29 15:56:57 +0000254 local($cfuncdesc_rx) =
Fred Drakec384d751996-11-11 16:04:35 +0000255 "$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5";
Fred Drake7a7480d1996-10-29 15:56:57 +0000256 $* = 1;
257 if (/$cfuncdesc_rx/o) {
258 $return_type = "$2";
259 $function_name = "$4";
260 $arg_list = "$6";
Fred Drake7c4cba81997-12-03 19:45:08 +0000261 $idx = &make_str_index_entry($3,
Fred Drake9597daf1997-12-22 22:37:34 +0000262 "<tt>$function_name</tt>" . &get_indexsubitem);
Fred Drake7a7480d1996-10-29 15:56:57 +0000263 }
264 $* = 0;
Fred Drake1af9e791998-01-12 23:15:29 +0000265 "<dl><dt>$return_type <b>$idx</b>" .
Fred Drake7c4cba81997-12-03 19:45:08 +0000266 "(<var>$arg_list</var>)\n<dd>$'\n</dl>"
Fred Drake7a7480d1996-10-29 15:56:57 +0000267}
268
Fred Drake9dcc5a91997-10-13 22:04:17 +0000269sub do_env_ctypedesc{
270 local($_) = @_;
271 local($type_name) = ('');
272 local($cfuncdesc_rx) =
273 "$next_pair_rx";
274 $* = 1;
275 if (/$cfuncdesc_rx/o) {
276 $type_name = "$2";
Fred Drake7c4cba81997-12-03 19:45:08 +0000277 $idx = &make_str_index_entry($1,
Fred Drake9597daf1997-12-22 22:37:34 +0000278 "<tt>$type_name</tt>" . &get_indexsubitem);
Fred Drake9dcc5a91997-10-13 22:04:17 +0000279 }
280 $* = 0;
Fred Drake1af9e791998-01-12 23:15:29 +0000281 "<dl><dt><b>$idx</b>\n<dd>$'\n</dl>"
Fred Drake9dcc5a91997-10-13 22:04:17 +0000282}
283
284sub do_env_cvardesc{
285 local($_) = @_;
Fred Drake7c4cba81997-12-03 19:45:08 +0000286 local($var_type,$var_name,$idx) = ('', '', '');
Fred Drake1af9e791998-01-12 23:15:29 +0000287 local($cfuncdesc_rx) = "$next_pair_rx$any_next_pair_rx3";
Fred Drake9dcc5a91997-10-13 22:04:17 +0000288 $* = 1;
289 if (/$cfuncdesc_rx/o) {
290 $var_type = "$2";
291 $var_name = "$4";
Fred Drake9597daf1997-12-22 22:37:34 +0000292 $idx = &make_str_index_entry($3,"<tt>$var_name</tt>" . &get_indexsubitem);
Fred Drake9dcc5a91997-10-13 22:04:17 +0000293 }
294 $* = 0;
Fred Drake1af9e791998-01-12 23:15:29 +0000295 "<dl><dt>$var_type <b>$idx</b>\n" .
Fred Drake7c4cba81997-12-03 19:45:08 +0000296 "<dd>$'\n</dl>";
Fred Drake9dcc5a91997-10-13 22:04:17 +0000297}
298
Fred Drakec384d751996-11-11 16:04:35 +0000299sub do_env_funcdesc{
300 local($_) = @_;
Fred Drake7c4cba81997-12-03 19:45:08 +0000301 local($function_name,$arg_list,$idx) = ('', '', '');
Fred Drakec384d751996-11-11 16:04:35 +0000302 local($funcdesc_rx) = "$next_pair_rx$any_next_pair_rx3";
303 $* = 1;
304 if (/$funcdesc_rx/o) {
305 $function_name = "$2";
306 $arg_list = "$4";
Fred Drake7c4cba81997-12-03 19:45:08 +0000307 $idx = &make_str_index_entry($3,
Fred Drake9597daf1997-12-22 22:37:34 +0000308 "<tt>$function_name</tt>" . &get_indexsubitem);
Fred Drakec384d751996-11-11 16:04:35 +0000309 }
310 $* = 0;
Fred Drake1af9e791998-01-12 23:15:29 +0000311 "<dl><dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>$'\n</dl>";
312}
313
314sub do_cmd_funcline{
315 local($_) = @_;
316 local($funcdesc_rx) = "$next_pair_pr_rx$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP";
317
318 s/$funcdesc_rx//o;
319 local($br_id, $function_name, $arg_list) = ($3, $2, $4);
320 local($idx) = &make_str_index_entry($br_id, "<tt>$function_name</tt>");
321
322 "<dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>" . $_;
Fred Drake7c4cba81997-12-03 19:45:08 +0000323}
324
325sub do_env_opcodedesc{
326 local($_) = @_;
327 local($opcode_name,$arg_list,$stuff,$idx) = ('', '', '', '');
328 local($opcodedesc_rx) = "$next_pair_rx$any_next_pair_rx3";
329 $* = 1;
330 if (/$opcodedesc_rx/o) {
331 $opcode_name = "$2";
332 $arg_list = "$4";
333 $idx = &make_str_index_entry($3,
334 "<tt>$opcode_name</tt> (byte code instruction)");
335 }
336 $* = 0;
Fred Drake1af9e791998-01-12 23:15:29 +0000337 $stuff = "<dl><dt><b>$idx</b>";
Fred Drake7c4cba81997-12-03 19:45:08 +0000338 if ($arg_list) {
339 $stuff = "$stuff&nbsp;&nbsp;&nbsp;&nbsp;<var>$arg_list</var>";
340 }
341 $stuff . "\n<dd>$'\n</dl>";
Fred Drakec384d751996-11-11 16:04:35 +0000342}
343
344sub do_env_datadesc{
345 local($_) = @_;
Fred Drake7c4cba81997-12-03 19:45:08 +0000346 local($data_name,$idx) = ('', '');
Fred Drakec384d751996-11-11 16:04:35 +0000347 local($datadesc_rx) = "$next_pair_rx";
348 $* = 1;
349 if (/$datadesc_rx/o) {
350 $data_name = "$2";
Fred Drake7c4cba81997-12-03 19:45:08 +0000351 $idx = &make_str_index_entry($3,
Fred Drake9597daf1997-12-22 22:37:34 +0000352 "<tt>$data_name</tt>" . &get_indexsubitem);
Fred Drakec384d751996-11-11 16:04:35 +0000353 }
354 $* = 0;
Fred Drake1af9e791998-01-12 23:15:29 +0000355 "<dl><dt><b>$idx</b>\n<dd>$'\n</dl>"
356}
357
358sub do_cmd_dataline{
359 local($_) = @_;
360
361 s/$next_pair_pr_rx//o;
362 local($br_id, $data_name) = ($1, $2);
363 local($idx) = &make_str_index_entry($br_id, "<tt>$data_name</tt>");
364
365 "<dt><b>$idx</b>\n<dd>" . $_;
Fred Drakec384d751996-11-11 16:04:35 +0000366}
367
368sub do_env_excdesc{ &do_env_datadesc(@_); }
369
Fred Drake9597daf1997-12-22 22:37:34 +0000370@col_aligns = ("<td>", "<td>", "<td>");
371
372sub setup_column_alignments{
373 local($_) = @_;
374 local($j1,$a1,$a2,$a3,$j4) = split(/[|]/,$_);
Fred Drake1af9e791998-01-12 23:15:29 +0000375 local($th1,$th2,$th3) = ('<th>', '<th>', '<th>');
Fred Drake9597daf1997-12-22 22:37:34 +0000376 $col_aligns[0] = (($a1 eq "c") ? "<td align=center>" : "<td>");
377 $col_aligns[1] = (($a2 eq "c") ? "<td align=center>" : "<td>");
378 $col_aligns[2] = (($a3 eq "c") ? "<td align=center>" : "<td>");
Fred Drake1af9e791998-01-12 23:15:29 +0000379 # return the aligned header start tags; only used for \begin{tableiii?}
380 $th1 = (($a1 eq "l") ? "<th align=left>"
381 : ($a1 eq "r" ? "<th align=right>" : "<th>"));
382 $th2 = (($a2 eq "l") ? "<th align=left>"
383 : ($a2 eq "r" ? "<th align=right>" : "<th>"));
384 $th3 = (($a3 eq "l") ? "<th align=left>"
385 : ($a3 eq "r" ? "<th align=right>" : "<th>"));
386 ($th1, $th2, $th3);
Fred Drake9597daf1997-12-22 22:37:34 +0000387}
388
389sub do_env_tableii{
390 local($_) = @_;
391 local($font,$h1,$h2) = ('', '', '');
392 local($tableiii_rx) =
393 "$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5$any_next_pair_rx7";
394 $* = 1;
395 if (/$tableiii_rx/o) {
Fred Drake9597daf1997-12-22 22:37:34 +0000396 $font = $4;
397 $h1 = $6;
398 $h2 = $8;
399 }
Fred Drake1af9e791998-01-12 23:15:29 +0000400 local($th1,$th2,$th3) = &setup_column_alignments($2);
Fred Drake9597daf1997-12-22 22:37:34 +0000401 $globals{"lineifont"} = $font;
Fred Drake1af9e791998-01-12 23:15:29 +0000402 "<table border align=center>\n <tr>$th1$h1</th>\n $th2$h2</th>$'\n"
Fred Drake9597daf1997-12-22 22:37:34 +0000403 . "</table>";
404}
405
406sub do_cmd_lineii{
407 local($_) = @_;
408 s/$next_pair_pr_rx//o;
409 local($c1) = $2;
410 s/$next_pair_pr_rx//o;
411 local($c2) = $2;
412 local($font) = $globals{"lineifont"};
413 local($c1align, $c2align) = @col_aligns[0,1];
414 "<tr>$c1align<$font>$c1</$font></td>\n"
415 . " $c2align$c2</td>$'";
416}
417
418sub do_env_tableiii{
419 local($_) = @_;
420 local($font,$h1,$h2,$h3) = ('', '', '', '');
Fred Drake1af9e791998-01-12 23:15:29 +0000421
Fred Drake9597daf1997-12-22 22:37:34 +0000422 local($tableiii_rx) =
423 "$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5$any_next_pair_rx7"
424 . "$any_next_pair_rx9";
425 $* = 1;
426 if (/$tableiii_rx/o) {
Fred Drake9597daf1997-12-22 22:37:34 +0000427 $font = $4;
428 $h1 = $6;
429 $h2 = $8;
430 $h3 = $10;
431 }
Fred Drake1af9e791998-01-12 23:15:29 +0000432 local($th1,$th2,$th3) = &setup_column_alignments($2);
Fred Drake9597daf1997-12-22 22:37:34 +0000433 $globals{"lineifont"} = $font;
Fred Drake1af9e791998-01-12 23:15:29 +0000434 "<table border align=center>\n <tr>$th1$h1</th>\n $th2$h2</th>"
435 . "\n $th3$h3</th>$'\n"
Fred Drake9597daf1997-12-22 22:37:34 +0000436 . "</table>";
437}
438
439sub do_cmd_lineiii{
440 local($_) = @_;
441 s/$next_pair_pr_rx//o;
442 local($c1) = $2;
443 s/$next_pair_pr_rx//o;
444 local($c2) = $2;
445 s/$next_pair_pr_rx//o;
446 local($c3) = $2;
447 local($font) = $globals{"lineifont"};
448 local($c1align, $c2align, $c3align) = @col_aligns;
449 "<tr>$c1align<$font>$c1</$font></td>\n"
450 . " $c2align$c2</td>\n"
451 . " $c3align$c3</td>$'";
452}
453
Fred Drake9dcc5a91997-10-13 22:04:17 +0000454sub do_env_seealso{
Fred Drakebceaf351998-01-22 16:13:44 +0000455 "<p><b>See Also:</b></p>\n" . @_[0];
Fred Drake9dcc5a91997-10-13 22:04:17 +0000456}
457
458sub do_cmd_seemodule{
459 local($_) = @_;
460 local($any_next_pair_pr_rx3) = "$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP";
Fred Drake7c4cba81997-12-03 19:45:08 +0000461 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 +0000462 $_;
463}
464
465sub do_cmd_seetext{
Fred Drakebceaf351998-01-22 16:13:44 +0000466 "<p>" . @_[0];
Fred Drake9dcc5a91997-10-13 22:04:17 +0000467}
468
Fred Drake7c4cba81997-12-03 19:45:08 +0000469# These are located down here since they screw up fontlock.
470
471sub do_cmd_file{
472 local($_) = @_;
473 s/$any_next_pair_pr_rx/`<code>\2<\/code>'/;
474 $_;
475}
476
477sub do_cmd_samp{
478 local($_) = @_;
479 s/$any_next_pair_pr_rx/`<samp>\2<\/samp>'/;
480 $_;
481}
482
Guido van Rossum9e93fb61994-01-25 20:06:09 +00004831; # This must be the last line