blob: b1d609baba1a53cc653caef977ed72820499be66 [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 if (/$cfuncdesc_rx/o) {
257 $return_type = "$2";
258 $function_name = "$4";
259 $arg_list = "$6";
Fred Drake7c4cba81997-12-03 19:45:08 +0000260 $idx = &make_str_index_entry($3,
Fred Drake9597daf1997-12-22 22:37:34 +0000261 "<tt>$function_name</tt>" . &get_indexsubitem);
Fred Drake7a7480d1996-10-29 15:56:57 +0000262 }
Fred Drake1af9e791998-01-12 23:15:29 +0000263 "<dl><dt>$return_type <b>$idx</b>" .
Fred Drake7c4cba81997-12-03 19:45:08 +0000264 "(<var>$arg_list</var>)\n<dd>$'\n</dl>"
Fred Drake7a7480d1996-10-29 15:56:57 +0000265}
266
Fred Drake9dcc5a91997-10-13 22:04:17 +0000267sub do_env_ctypedesc{
268 local($_) = @_;
269 local($type_name) = ('');
270 local($cfuncdesc_rx) =
271 "$next_pair_rx";
Fred Drake9dcc5a91997-10-13 22:04:17 +0000272 if (/$cfuncdesc_rx/o) {
273 $type_name = "$2";
Fred Drake7c4cba81997-12-03 19:45:08 +0000274 $idx = &make_str_index_entry($1,
Fred Drake9597daf1997-12-22 22:37:34 +0000275 "<tt>$type_name</tt>" . &get_indexsubitem);
Fred Drake9dcc5a91997-10-13 22:04:17 +0000276 }
Fred Drake1af9e791998-01-12 23:15:29 +0000277 "<dl><dt><b>$idx</b>\n<dd>$'\n</dl>"
Fred Drake9dcc5a91997-10-13 22:04:17 +0000278}
279
280sub do_env_cvardesc{
281 local($_) = @_;
Fred Drake7c4cba81997-12-03 19:45:08 +0000282 local($var_type,$var_name,$idx) = ('', '', '');
Fred Drake1af9e791998-01-12 23:15:29 +0000283 local($cfuncdesc_rx) = "$next_pair_rx$any_next_pair_rx3";
Fred Drake9dcc5a91997-10-13 22:04:17 +0000284 if (/$cfuncdesc_rx/o) {
285 $var_type = "$2";
286 $var_name = "$4";
Fred Drake9597daf1997-12-22 22:37:34 +0000287 $idx = &make_str_index_entry($3,"<tt>$var_name</tt>" . &get_indexsubitem);
Fred Drake9dcc5a91997-10-13 22:04:17 +0000288 }
Fred Drake1af9e791998-01-12 23:15:29 +0000289 "<dl><dt>$var_type <b>$idx</b>\n" .
Fred Drake7c4cba81997-12-03 19:45:08 +0000290 "<dd>$'\n</dl>";
Fred Drake9dcc5a91997-10-13 22:04:17 +0000291}
292
Fred Drakec384d751996-11-11 16:04:35 +0000293sub do_env_funcdesc{
294 local($_) = @_;
Fred Drake7c4cba81997-12-03 19:45:08 +0000295 local($function_name,$arg_list,$idx) = ('', '', '');
Fred Drakec384d751996-11-11 16:04:35 +0000296 local($funcdesc_rx) = "$next_pair_rx$any_next_pair_rx3";
Fred Drakec384d751996-11-11 16:04:35 +0000297 if (/$funcdesc_rx/o) {
298 $function_name = "$2";
299 $arg_list = "$4";
Fred Drake7c4cba81997-12-03 19:45:08 +0000300 $idx = &make_str_index_entry($3,
Fred Drake9597daf1997-12-22 22:37:34 +0000301 "<tt>$function_name</tt>" . &get_indexsubitem);
Fred Drakec384d751996-11-11 16:04:35 +0000302 }
Fred Drake1af9e791998-01-12 23:15:29 +0000303 "<dl><dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>$'\n</dl>";
304}
305
306sub do_cmd_funcline{
307 local($_) = @_;
308 local($funcdesc_rx) = "$next_pair_pr_rx$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP";
309
310 s/$funcdesc_rx//o;
311 local($br_id, $function_name, $arg_list) = ($3, $2, $4);
312 local($idx) = &make_str_index_entry($br_id, "<tt>$function_name</tt>");
313
314 "<dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>" . $_;
Fred Drake7c4cba81997-12-03 19:45:08 +0000315}
316
317sub do_env_opcodedesc{
318 local($_) = @_;
319 local($opcode_name,$arg_list,$stuff,$idx) = ('', '', '', '');
320 local($opcodedesc_rx) = "$next_pair_rx$any_next_pair_rx3";
Fred Drake7c4cba81997-12-03 19:45:08 +0000321 if (/$opcodedesc_rx/o) {
322 $opcode_name = "$2";
323 $arg_list = "$4";
324 $idx = &make_str_index_entry($3,
325 "<tt>$opcode_name</tt> (byte code instruction)");
Fred Drake301ad2e1998-01-22 18:14:39 +0000326 $idx =~ s/ \(byte code instruction\)//;
Fred Drake7c4cba81997-12-03 19:45:08 +0000327 }
Fred Drake1af9e791998-01-12 23:15:29 +0000328 $stuff = "<dl><dt><b>$idx</b>";
Fred Drake7c4cba81997-12-03 19:45:08 +0000329 if ($arg_list) {
Fred Drake301ad2e1998-01-22 18:14:39 +0000330 $stuff .= "&nbsp;&nbsp;&nbsp;&nbsp;<var>$arg_list</var>";
Fred Drake7c4cba81997-12-03 19:45:08 +0000331 }
332 $stuff . "\n<dd>$'\n</dl>";
Fred Drakec384d751996-11-11 16:04:35 +0000333}
334
335sub do_env_datadesc{
336 local($_) = @_;
Fred Drake301ad2e1998-01-22 18:14:39 +0000337 local($idx) = '';
338 if (/$next_pair_rx/o) {
339 $idx = &make_str_index_entry($1, "<tt>$2</tt>" . &get_indexsubitem);
Fred Drakec384d751996-11-11 16:04:35 +0000340 }
Fred Drake1af9e791998-01-12 23:15:29 +0000341 "<dl><dt><b>$idx</b>\n<dd>$'\n</dl>"
342}
343
344sub do_cmd_dataline{
345 local($_) = @_;
346
347 s/$next_pair_pr_rx//o;
348 local($br_id, $data_name) = ($1, $2);
349 local($idx) = &make_str_index_entry($br_id, "<tt>$data_name</tt>");
350
351 "<dt><b>$idx</b>\n<dd>" . $_;
Fred Drakec384d751996-11-11 16:04:35 +0000352}
353
354sub do_env_excdesc{ &do_env_datadesc(@_); }
355
Fred Drake9597daf1997-12-22 22:37:34 +0000356@col_aligns = ("<td>", "<td>", "<td>");
357
358sub setup_column_alignments{
359 local($_) = @_;
360 local($j1,$a1,$a2,$a3,$j4) = split(/[|]/,$_);
Fred Drake1af9e791998-01-12 23:15:29 +0000361 local($th1,$th2,$th3) = ('<th>', '<th>', '<th>');
Fred Drake9597daf1997-12-22 22:37:34 +0000362 $col_aligns[0] = (($a1 eq "c") ? "<td align=center>" : "<td>");
363 $col_aligns[1] = (($a2 eq "c") ? "<td align=center>" : "<td>");
364 $col_aligns[2] = (($a3 eq "c") ? "<td align=center>" : "<td>");
Fred Drake1af9e791998-01-12 23:15:29 +0000365 # return the aligned header start tags; only used for \begin{tableiii?}
366 $th1 = (($a1 eq "l") ? "<th align=left>"
367 : ($a1 eq "r" ? "<th align=right>" : "<th>"));
368 $th2 = (($a2 eq "l") ? "<th align=left>"
369 : ($a2 eq "r" ? "<th align=right>" : "<th>"));
370 $th3 = (($a3 eq "l") ? "<th align=left>"
371 : ($a3 eq "r" ? "<th align=right>" : "<th>"));
372 ($th1, $th2, $th3);
Fred Drake9597daf1997-12-22 22:37:34 +0000373}
374
375sub do_env_tableii{
376 local($_) = @_;
377 local($font,$h1,$h2) = ('', '', '');
378 local($tableiii_rx) =
379 "$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5$any_next_pair_rx7";
Fred Drake9597daf1997-12-22 22:37:34 +0000380 if (/$tableiii_rx/o) {
Fred Drake9597daf1997-12-22 22:37:34 +0000381 $font = $4;
382 $h1 = $6;
383 $h2 = $8;
384 }
Fred Drake1af9e791998-01-12 23:15:29 +0000385 local($th1,$th2,$th3) = &setup_column_alignments($2);
Fred Drake9597daf1997-12-22 22:37:34 +0000386 $globals{"lineifont"} = $font;
Fred Drake1af9e791998-01-12 23:15:29 +0000387 "<table border align=center>\n <tr>$th1$h1</th>\n $th2$h2</th>$'\n"
Fred Drake9597daf1997-12-22 22:37:34 +0000388 . "</table>";
389}
390
391sub do_cmd_lineii{
392 local($_) = @_;
393 s/$next_pair_pr_rx//o;
394 local($c1) = $2;
395 s/$next_pair_pr_rx//o;
396 local($c2) = $2;
397 local($font) = $globals{"lineifont"};
398 local($c1align, $c2align) = @col_aligns[0,1];
399 "<tr>$c1align<$font>$c1</$font></td>\n"
400 . " $c2align$c2</td>$'";
401}
402
403sub do_env_tableiii{
404 local($_) = @_;
405 local($font,$h1,$h2,$h3) = ('', '', '', '');
Fred Drake1af9e791998-01-12 23:15:29 +0000406
Fred Drake9597daf1997-12-22 22:37:34 +0000407 local($tableiii_rx) =
408 "$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5$any_next_pair_rx7"
409 . "$any_next_pair_rx9";
Fred Drake9597daf1997-12-22 22:37:34 +0000410 if (/$tableiii_rx/o) {
Fred Drake9597daf1997-12-22 22:37:34 +0000411 $font = $4;
412 $h1 = $6;
413 $h2 = $8;
414 $h3 = $10;
415 }
Fred Drake1af9e791998-01-12 23:15:29 +0000416 local($th1,$th2,$th3) = &setup_column_alignments($2);
Fred Drake9597daf1997-12-22 22:37:34 +0000417 $globals{"lineifont"} = $font;
Fred Drake1af9e791998-01-12 23:15:29 +0000418 "<table border align=center>\n <tr>$th1$h1</th>\n $th2$h2</th>"
419 . "\n $th3$h3</th>$'\n"
Fred Drake9597daf1997-12-22 22:37:34 +0000420 . "</table>";
421}
422
423sub do_cmd_lineiii{
424 local($_) = @_;
425 s/$next_pair_pr_rx//o;
426 local($c1) = $2;
427 s/$next_pair_pr_rx//o;
428 local($c2) = $2;
429 s/$next_pair_pr_rx//o;
430 local($c3) = $2;
431 local($font) = $globals{"lineifont"};
432 local($c1align, $c2align, $c3align) = @col_aligns;
433 "<tr>$c1align<$font>$c1</$font></td>\n"
434 . " $c2align$c2</td>\n"
435 . " $c3align$c3</td>$'";
436}
437
Fred Drake9dcc5a91997-10-13 22:04:17 +0000438sub do_env_seealso{
Fred Drakebceaf351998-01-22 16:13:44 +0000439 "<p><b>See Also:</b></p>\n" . @_[0];
Fred Drake9dcc5a91997-10-13 22:04:17 +0000440}
441
442sub do_cmd_seemodule{
443 local($_) = @_;
444 local($any_next_pair_pr_rx3) = "$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP";
Fred Drake7c4cba81997-12-03 19:45:08 +0000445 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 +0000446 $_;
447}
448
449sub do_cmd_seetext{
Fred Drakebceaf351998-01-22 16:13:44 +0000450 "<p>" . @_[0];
Fred Drake9dcc5a91997-10-13 22:04:17 +0000451}
452
Fred Drake7c4cba81997-12-03 19:45:08 +0000453# These are located down here since they screw up fontlock.
454
455sub do_cmd_file{
456 local($_) = @_;
457 s/$any_next_pair_pr_rx/`<code>\2<\/code>'/;
458 $_;
459}
460
461sub do_cmd_samp{
462 local($_) = @_;
463 s/$any_next_pair_pr_rx/`<samp>\2<\/samp>'/;
464 $_;
465}
466
Guido van Rossum9e93fb61994-01-25 20:06:09 +00004671; # This must be the last line