1 # python.perl by Fred L. Drake, Jr. <fdrake@acm.org> -*- perl -*-
3 # Heavily based on Guido van Rossum's myformat.perl (now obsolete).
5 # Extension to LaTeX2HTML for documents using myformat.sty.
6 # Subroutines of the form do_cmd_<name> here define translations
7 # for LaTeX commands \<name> defined in the corresponding .sty file.
12 # words typeset in a special way (not in HTML though)
14 sub do_cmd_ABC
{ 'ABC' . @_[0]; }
15 sub do_cmd_UNIX
{ 'Unix'. @_[0]; }
16 sub do_cmd_ASCII
{ 'ASCII' . @_[0]; }
17 sub do_cmd_POSIX
{ 'POSIX' . @_[0]; }
18 sub do_cmd_C
{ 'C' . @_[0]; }
19 sub do_cmd_Cpp
{ 'C++' . @_[0]; }
20 sub do_cmd_EOF
{ 'EOF' . @_[0]; }
21 sub do_cmd_NULL
{ '<tt>NULL</tt>' . @_[0]; }
23 sub do_cmd_e
{ '\' . @_[0]; }
28 sub do_cmd_version
{ $PYTHON_VERSION . @_[0]; }
32 $PYTHON_VERSION = "$2";
36 sub do_cmd_authoraddress
{
39 $AUTHOR_ADDRESS = "$2";
45 s/$next_pair_pr_rx/_/;
51 s
|$next_pair_pr_rx|</var><big>\[</big
><var
>\
2</var><big>\]</big
><var
>|;
57 s
|$next_pair_pr_rx|<var
>\
2</var
>|;
63 s
|$next_pair_pr_rx|\
2|;
67 sub do_cmd_pytype
{ use_current
(@_); }
68 sub do_cmd_makevar
{ use_current
(@_); }
70 # Logical formatting (some based on texinfo), needs to be converted to
71 # minimalist HTML. The "minimalist" is primarily to reduce the size of
72 # output files for users that read them over the network rather than
73 # from local repositories.
77 s
|$next_pair_pr_rx|<tt
>\
2</tt
>|;
83 s
|$next_pair_pr_rx|<font face
=sans
-serif
>\
2</font
>|;
89 s
|$next_pair_pr_rx|<i
>\
2</i
>|;
93 sub do_cmd_sectcode
{ &do_cmd_code
(@_); }
94 sub do_cmd_module
{ &do_cmd_code
(@_); }
95 sub do_cmd_keyword
{ &do_cmd_code
(@_); }
96 sub do_cmd_exception
{ &do_cmd_code
(@_); }
97 sub do_cmd_class
{ &do_cmd_code
(@_); }
98 sub do_cmd_function
{ &do_cmd_code
(@_); }
99 sub do_cmd_constant
{ &do_cmd_code
(@_); }
100 sub do_cmd_member
{ &do_cmd_code
(@_); }
101 sub do_cmd_method
{ &do_cmd_code
(@_); }
102 sub do_cmd_cfunction
{ &do_cmd_code
(@_); }
103 sub do_cmd_cdata
{ &do_cmd_code
(@_); }
104 sub do_cmd_ctype
{ &do_cmd_code
(@_); }
105 sub do_cmd_regexp
{ &do_cmd_code
(@_); }
106 sub do_cmd_key
{ &do_cmd_code
(@_); }
108 sub do_cmd_character
{ &do_cmd_samp
(@_); }
110 sub do_cmd_program
{ &do_cmd_strong
(@_); }
112 sub do_cmd_email
{ &use_sans_serif
(@_); }
113 sub do_cmd_mimetype
{ &use_sans_serif
(@_); }
115 sub do_cmd_var
{ &use_italics
(@_); }
116 sub do_cmd_dfn
{ &use_italics
(@_); } # make an index entry?
117 sub do_cmd_emph
{ &use_italics
(@_); }
119 sub do_cmd_newsgroup
{
121 s/$next_pair_pr_rx//o;
123 my $stuff = "<a href=\"news:$newsgroup\"><font face=sans-serif>"
124 . "$newsgroup</font></a>";
130 s/$next_pair_pr_rx//;
131 my($br_id,$envvar) = ($1, $2);
132 my($name,$aname,$ahref) = link_info
($br_id);
133 # The <tt> here is really to keep buildindex.py from making
134 # the variable name case-insensitive.
135 add_index_entry
("environment variables!$envvar@<tt>\$$envvar</tt>",
137 add_index_entry
("$envvar@\$$envvar", $ahref);
138 "$aname\$$envvar</a>" . $_;
142 # use the URL as both text and hyperlink
144 s/$next_pair_pr_rx//;
146 $url =~ s/~/~/g;
147 "<a href=\"$url\"><font face=sans-serif>$url</font></a>" . $_;
151 # two parameters: \manpage{name}{section}
153 my $rx = "$next_pair_pr_rx$any_next_pair_pr_rx3";
154 s
|$rx|<i
>\
2</i
>(\
4)|;
160 s/$next_pair_pr_rx//;
161 my($br_id,$rfcnumber) = ($1, $2);
164 my $nstr = &gen_index_id
("RFC!RFC $rfcnumber", '');
165 $index{$nstr} .= &make_half_href
("$CURRENT_FILE#$br_id");
166 "<a name=$br_id>RFC $rfcnumber</a>" .$_;
171 s
|$next_pair_pr_rx|<kbd
>\
2</kbd
>|;
177 s
|$next_pair_pr_rx|<b
>\
2</b
>|;
181 sub do_cmd_deprecated
{
182 # two parameters: \deprecated{version}{whattodo}
184 my $rx = "$next_pair_pr_rx$any_next_pair_pr_rx3";
185 s
|$rx|<b
>Deprecated since release \
2.</b
>\n\
4<p
>|;
189 # file and samp are at the end of this file since they screw up fontlock.
195 sub get_indexsubitem
{
196 #$INDEX_SUBITEM ? " $INDEX_SUBITEM" : '';
200 sub do_cmd_setindexsubitem
{
202 s/$next_pair_pr_rx//;
207 sub do_cmd_withsubitem
{
208 # We can't really do the right right thing, because LaTeX2HTML doesn't
209 # do things in the right order, but we need to at least strip this stuff
210 # out, and leave anything that the second argument expanded out to.
213 my $any_next_pair_pr_rx3 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP";
214 s/$next_pair_pr_rx$any_next_pair_pr_rx3/\4/;
219 sub do_cmd_makemodindex
{ @_[0]; }
221 # We're in the document subdirectory when this happens!
223 open(IDXFILE
, ">index.dat") || die "\n$!\n";
224 open(INTLABELS
, ">intlabels.pl") || die "\n$!\n";
225 print INTLABELS
"%internal_labels = ();\n";
226 print INTLABELS
"1; # hack in case there are no entries\n\n";
228 # Using \0 for this is bad because we can't use common tools to work with the
229 # resulting files. Things like grep can be useful with this stuff!
231 $IDXFILE_FIELD_SEP = "\1";
239 "<a name=\"" . @_[0] . "\">";
243 my($node,$target) = @_;
244 print INTLABELS
"\$internal_labels{\"$target\"} = \"$URL/$node\";\n";
245 "<a href=\"$node#$target\">";
248 sub make_index_entry
{
249 my($br_id,$str) = @_;
250 my($name,$aname,$ahref) = link_info
($br_id);
251 add_index_entry
($str, $ahref);
252 "$aname$anchor_invisible_mark</a>";
256 # add an entry to the index structures; ignore the return value
257 my($str,$ahref) = @_;
258 $str = gen_index_id
($str, '');
259 $index{$str} .= $ahref;
260 print IDXFILE
$ahref, $IDXFILE_FIELD_SEP, $str, "\n";
264 my $name = gen_target_name
(@_[0]);
265 my $aname = gen_target
($name);
266 my $ahref = gen_link
($CURRENT_FILE, $name);
267 return ($name, $aname, $ahref);
272 s/$next_pair_pr_rx[\n]?//o;
273 my($br_id,$str) = ($1, $2);
275 my($name,$aname,$ahref) = link_info
($br_id);
276 add_index_entry
("$str", $ahref);
277 "$aname$anchor_invisible_mark</a>" . $_;
282 s/$next_pair_pr_rx//o;
283 my($br_id1,$str1) = ($1, $2);
284 s/$next_pair_pr_rx[\n]?//o;
285 my($br_id2,$str2) = ($1, $2);
287 my($name,$aname,$ahref) = link_info
($br_id1);
288 add_index_entry
("$str1!$str2", $ahref);
289 add_index_entry
("$str2!$str1", $ahref);
290 "$aname$anchor_invisible_mark</a>" . $_;
295 s/$next_pair_pr_rx//o;
296 my($br_id1,$str1) = ($1, $2);
297 s/$next_pair_pr_rx//o;
298 my($br_id2,$str2) = ($1, $2);
299 s/$next_pair_pr_rx[\n]?//o;
300 my($br_id3,$str3) = ($1, $2);
302 my($name,$aname,$ahref) = link_info
($br_id1);
303 add_index_entry
("$str1!$str2 $str3", $ahref);
304 add_index_entry
("$str2!$str3, $str1", $ahref);
305 add_index_entry
("$str3!$str1 $str2", $ahref);
306 "$aname$anchor_invisible_mark</a>" . $_;
311 s/$next_pair_pr_rx//o;
312 my($br_id1,$str1) = ($1, $2);
313 s/$next_pair_pr_rx//o;
314 my($br_id2,$str2) = ($1, $2);
315 s/$next_pair_pr_rx//o;
316 my($br_id3,$str3) = ($1, $2);
317 s/$next_pair_pr_rx[\n]?//o;
318 my($br_id4,$str4) = ($1, $2);
320 my($name,$aname,$ahref) = link_info
($br_id1);
321 add_index_entry
("$str1!$str2 $str3 $str4", $ahref);
322 add_index_entry
("$str2!$str3 $str4, $str1", $ahref);
323 add_index_entry
("$str3!$str4, $str1 $str2", $ahref);
324 add_index_entry
("$str4!$$str1 $str2 $str3", $ahref);
325 "$aname$anchor_invisible_mark</a>" . $_;
330 s/$next_pair_pr_rx[\n]?//;
331 my($br_id,$str) = ($1, $2);
332 &make_index_entry
($br_id, $str . &get_indexsubitem
) . $_;
335 sub my_typed_index_helper
{
336 local($word,$_) = @_;
337 s/$next_pair_pr_rx[\n]?//o;
338 my($br_id,$str) = ($1, $2);
340 my($name,$aname,$ahref) = link_info
($br_id1);
341 add_index_entry
("$str $word", $ahref);
342 add_index_entry
("$word!$str", $ahref);
343 "$aname$anchor_invisible_mark</a>" . $_;
346 sub do_cmd_stindex
{ &my_typed_index_helper
('statement', @_); }
347 sub do_cmd_opindex
{ &my_typed_index_helper
('operator', @_); }
348 sub do_cmd_exindex
{ &my_typed_index_helper
('exception', @_); }
349 sub do_cmd_obindex
{ &my_typed_index_helper
('object', @_); }
351 sub my_parword_index_helper
{
352 local($word,$_) = @_;
353 s/$next_pair_pr_rx[\n]?//o;
354 my($br_id,$str) = ($1, $2);
355 make_index_entry
($br_id, "$str ($word)") . $_;
359 sub make_mod_index_entry
{
360 my($br_id,$str,$define) = @_;
361 my($name,$aname,$ahref) = link_info
($br_id);
362 # equivalent of add_index_entry() using $define instead of ''
363 $str = gen_index_id
($str, $define);
364 $index{$str} .= $ahref;
365 print IDXFILE
$ahref, $IDXFILE_FIELD_SEP, $str, "\n";
367 if ($define eq 'DEF') {
368 # add to the module index
369 my($nstr,$garbage) = split / /, $str, 2;
370 $Modules{$nstr} .= $ahref;
372 "$aname$anchor_invisible_mark</a>";
378 sub my_module_index_helper
{
379 local($word, $_) = @_;
380 s/$next_pair_pr_rx[\n]*//o;
381 my($br_id, $str) = ($1, $2);
382 my $section_tag = join('', @curr_sec_id);
383 $word = "$word " if $word;
384 $THIS_MODULE = "$str";
385 make_mod_index_entry
("SECTION$section_tag",
386 "<tt>$str</tt> (${word}module)", 'DEF') . $_;
389 sub ref_module_index_helper
{
390 local($word, $_) = @_;
391 s/$next_pair_pr_rx[\n]?//o;
392 my($br_id, $str) = ($1, $2);
393 $word = "$word " if $word;
394 make_mod_index_entry
($br_id, "<tt>$str</tt> (${word}module)", 'REF') . $_;
397 sub do_cmd_bifuncindex
{
399 s/$next_pair_pr_rx[\n]?//o;
400 my($br_id,$str,$fname) = ($1, $2, "<tt>$2()</tt>");
401 make_index_entry
($br_id, "$fname (built-in function)") . $_;
404 sub do_cmd_modindex
{ my_module_index_helper
('', @_); }
405 sub do_cmd_bimodindex
{ my_module_index_helper
('built-in', @_); }
406 sub do_cmd_exmodindex
{ my_module_index_helper
('extension', @_); }
407 sub do_cmd_stmodindex
{ my_module_index_helper
('standard', @_); }
409 # these should be adjusted a bit....
410 sub do_cmd_refmodindex
{ ref_module_index_helper
('', @_); }
411 sub do_cmd_refbimodindex
{ ref_module_index_helper
('built-in', @_); }
412 sub do_cmd_refexmodindex
{ ref_module_index_helper
('extension', @_); }
413 sub do_cmd_refstmodindex
{ ref_module_index_helper
('standard', @_); }
415 sub do_cmd_nodename
{ do_cmd_label
(@_); }
418 # XXX need some way for this to be called after &initialise; ???
420 $icons{'anchor_mark'} = '';
421 my $cmark = "(?:$comment_mark)?";
423 $next_pair_rx = "^[\\s\n%]*$O(\\d+)$C([\\s\\S]*)$O\\1$C";
424 $any_next_pair_rx3 = "[\\s\n%]*$O(\\d+)$C([\\s\\S]*)$O\\3$C";
425 $any_next_pair_rx5 = "[\\s\n%]*$O(\\d+)$C([\\s\\S]*)$O\\5$C";
426 $any_next_pair_rx7 = "[\\s\n%]*$O(\\d+)$C([\\s\\S]*)$O\\7$C";
427 $any_next_pair_rx9 = "[\\s\n%]*$O(\\d+)$C([\\s\\S]*)$O\\9$C";
429 $next_pair_pr_rx = "^[\\s\n%]*$OP(\\d+)$CP([\\s\\S]*)$OP\\1$CP$cmark";
430 $any_next_pair_pr_rx3 = "[\\s\n%]*$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP$cmark";
431 $any_next_pair_pr_rx5 = "[\\s\n%]*$OP(\\d+)$CP([\\s\\S]*)$OP\\5$CP$cmark";
432 $any_next_pair_pr_rx7 = "[\\s\n%]*$OP(\\d+)$CP([\\s\\S]*)$OP\\7$CP$cmark";
433 $any_next_pair_pr_rx9 = "[\\s\n%]*$OP(\\d+)$CP([\\s\\S]*)$OP\\9$CP$cmark";
437 # similar to make_index_entry(), but includes the string in the result
438 # instead of the dummy filler.
440 sub make_str_index_entry
{
441 my($br_id,$str) = @_;
442 my($name,$aname,$ahref) = link_info
($br_id);
443 add_index_entry
($str, $ahref);
447 sub do_env_cfuncdesc
{
449 my($return_type,$function_name,$arg_list,$idx) = ('', '', '', '');
450 my $any_next_pair_rx3 = "$O(\\d+)$C([\\s\\S]*)$O\\3$C";
451 my $any_next_pair_rx5 = "$O(\\d+)$C([\\s\\S]*)$O\\5$C";
452 my $cfuncdesc_rx = "$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5";
453 if (/$cfuncdesc_rx/o) {
455 $function_name = "$4";
457 $idx = make_str_index_entry
($3,
458 "<tt>$function_name()</tt>" . &get_indexsubitem
);
462 "<dl><dt>$return_type <b>$idx</b>"
463 . "(<var>$arg_list</var>)\n<dd>$'</dl>"
466 sub do_env_ctypedesc
{
468 my $type_name = ('');
469 my $cfuncdesc_rx = "$next_pair_rx";
470 if (/$cfuncdesc_rx/o) {
472 $idx = make_str_index_entry
($1,
473 "<tt>$type_name</tt>" . &get_indexsubitem
);
476 "<dl><dt><b>$idx</b>\n<dd>$'</dl>"
481 my($var_type,$var_name,$idx) = ('', '', '');
482 my $cfuncdesc_rx = "$next_pair_rx$any_next_pair_rx3";
483 if (/$cfuncdesc_rx/o) {
486 $idx = make_str_index_entry
($3,
487 "<tt>$var_name</tt>" . &get_indexsubitem
);
490 "<dl><dt>$var_type <b>$idx</b>\n"
496 my($function_name,$arg_list,$idx) = ('', '', '');
497 my $funcdesc_rx = "$next_pair_rx$any_next_pair_rx3";
498 if (/$funcdesc_rx/o) {
499 $function_name = "$2";
501 $idx = make_str_index_entry
($3, "<tt>$function_name()</tt>"
502 . &get_indexsubitem
);
506 "<dl><dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>$'</dl>";
509 sub do_env_funcdescni
{
511 my($function_name,$arg_list,$idx) = ('', '', '');
512 my $funcdesc_rx = "$next_pair_rx$any_next_pair_rx3";
513 if (/$funcdesc_rx/o) {
514 $function_name = "$2";
516 $idx = "<tt>$function_name</tt>";
518 "<dl><dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>$'</dl>";
523 my $any_next_pair_pr_rx3 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP";
525 s/$next_pair_pr_rx//o;
526 my $function_name = $2;
527 s/$next_pair_pr_rx//o;
528 my($br_id,$arg_list) = ($1, $2);
529 my $idx = make_str_index_entry
($br_id, "<tt>$function_name()</tt>"
530 . &get_indexsubitem
);
533 "<dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>" . $_;
536 # Change this flag to index the opcode entries. I don't think it's very
537 # useful to index them, since they're only presented to describe the dis
542 sub do_env_opcodedesc
{
544 my($opcode_name,$arg_list,$stuff,$idx) = ('', '', '', '');
545 my $opcodedesc_rx = "$next_pair_rx$any_next_pair_rx3";
546 if (/$opcodedesc_rx/o) {
549 if ($INDEX_OPCODES) {
550 $idx = make_str_index_entry
($3,
551 "<tt>$opcode_name</tt> (byte code instruction)");
552 $idx =~ s/ \(byte code instruction\)//;
555 $idx = "<tt>$opcode_name</tt>";
558 $stuff = "<dl><dt><b>$idx</b>";
560 $stuff .= " <var>$arg_list</var>";
562 $stuff . "\n<dd>$'</dl>";
568 if (/$next_pair_rx/o) {
569 $idx = make_str_index_entry
($1, "<tt>$2</tt>" . &get_indexsubitem
);
572 "<dl><dt><b>$idx</b>\n<dd>$'</dl>"
575 sub do_env_datadescni
{
578 if (/$next_pair_rx/o) {
579 if ($STRING_INDEX_TT) {
582 $idx = "<tt>$2</tt>"; }
584 "<dl><dt><b>$idx</b>\n<dd>$'</dl>"
590 s/$next_pair_pr_rx//o;
591 my($br_id, $data_name) = ($1, $2);
592 my $idx = make_str_index_entry
($br_id, "<tt>$data_name</tt>"
593 . &get_indexsubitem
);
596 "<dt><b>$idx</b><dd>" . $_;
602 my($br_id,$excname,$rest) = ($1, $2, $');
603 my $idx = make_str_index_entry($br_id, "<tt>$excname</tt>");
604 "<dl><dt><b>$idx</b>\n<dd>$rest</dl>"
607 sub do_env_fulllineitems{ do_env_itemize(@_); }
610 sub do_env_classdesc{
612 my($class_name,$arg_list,$idx) = ('', '', '');
613 my $funcdesc_rx = "$next_pair_rx$any_next_pair_rx3";
614 if (/$funcdesc_rx/o) {
617 $THIS_CLASS = $class_name;
618 $idx = make_str_index_entry($3,
619 "<tt>$class_name</tt> (class in $THIS_MODULE)" );
622 "<dl><dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>$'</dl
>";
626 sub do_env_methoddesc{
628 my($class_name,$arg_list,$idx,$extra);
629 # Predefined $opt_arg_rx & $optional_arg_rx don't work because they
630 # require the argument to be there.
631 my $opt_arg_rx = "^\\s
*(\\[([^]]*)\\])?
";
632 my $funcdesc_rx = "$opt_arg_rx$any_next_pair_rx3$any_next_pair_rx5";
633 if (/$funcdesc_rx/o) {
635 $class_name = $THIS_CLASS
640 $extra = " ($class_name method
)";
642 $idx = make_str_index_entry($3, "<tt
>$method_name()</tt
>$extra");
646 "<dl
><dt
><b
>$idx</b> (<var>$arg_list</var
>)\n<dd
>$'</dl>";
650 sub do_env_methoddescni{
652 # Predefined $opt_arg_rx & $optional_arg_rx don't work because they
653 # require the argument to be there.
654 my $opt_arg_rx = "^\\s*(\\[([^]]*)\\])?";
655 my $funcdesc_rx = "$opt_arg_rx$any_next_pair_rx3$any_next_pair_rx5";
659 "<dl><dt><b>$method</b> (<var>$arg_list</var>)\n<dd>$'</dl>";
663 sub do_env_memberdesc
{
665 # Predefined $opt_arg_rx & $optional_arg_rx don't work because they
666 # require the argument to be there.
667 my $opt_arg_rx = "^\\s*(\\[([^]]*)\\])?";
668 my $funcdesc_rx = "$opt_arg_rx$any_next_pair_rx3";
670 my($class,$member) = ($2, $4);
673 $extra = " ($class_name attribute)"
674 if (!($class eq ''));
675 my $idx = make_str_index_entry
($3, "<tt>$member</tt>$extra");
678 "<dl><dt><b>$idx</b>\n<dd>" . $_ . "</dl>";
682 sub do_env_memberdescni
{
684 # Predefined $opt_arg_rx & $optional_arg_rx don't work because they
685 # require the argument to be there.
686 my $opt_arg_rx = "^\\s*(\\[([^]]*)\\])?";
687 my $funcdesc_rx = "$opt_arg_rx$any_next_pair_rx3";
690 "<dl><dt><b>$member</b>\n<dd>$'</dl>";
694 @col_aligns = ("<td>", "<td>", "<td>");
696 sub setup_column_alignments
{
698 my($a1,$a2,$a3) = split(/[|]/,$_);
699 my($th1,$th2,$th3) = ('<th>', '<th>', '<th>');
700 $col_aligns[0] = (($a1 eq "c") ?
"<td align=center>" : "<td>");
701 $col_aligns[1] = (($a2 eq "c") ?
"<td align=center>" : "<td>");
702 $col_aligns[2] = (($a3 eq "c") ?
"<td align=center>" : "<td>");
703 # return the aligned header start tags; only used for \begin{tableiii?}
704 $th1 = (($a1 eq "l") ?
"<th align=left>"
705 : ($a1 eq "r" ?
"<th align=right>" : "<th>"));
706 $th2 = (($a2 eq "l") ?
"<th align=left>"
707 : ($a2 eq "r" ?
"<th align=right>" : "<th>"));
708 $th3 = (($a3 eq "l") ?
"<th align=left>"
709 : ($a3 eq "r" ?
"<th align=right>" : "<th>"));
715 my($font,$h1,$h2) = ('', '', '');
717 "$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5$any_next_pair_rx7";
718 if (/$tableiii_rx/o) {
721 if ($font eq 'textrm');
725 my($th1,$th2,$th3) = setup_column_alignments
($2);
726 $globals{"lineifont"} = $font;
727 "<table border align=center>"
728 . "\n <tr>$th1<b>$h1</b></th>"
729 . "\n $th2<b>$h2</b></th>$'"
735 s/$next_pair_pr_rx//o;
737 s/$next_pair_pr_rx//o;
738 my($c2,$font,$sfont,$efont) = ($2, $globals{"lineifont"}, '', '');
743 my($c1align,$c2align) = @col_aligns[0,1];
744 "<tr>$c1align$sfont$c1$efont</td>\n"
745 . " $c2align$c2</td>$'";
750 my($font,$h1,$h2,$h3) = ('', '', '', '');
753 "$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5$any_next_pair_rx7"
754 . "$any_next_pair_rx9";
755 if (/$tableiii_rx/o) {
758 if ($font eq 'textrm');
763 my($th1,$th2,$th3) = setup_column_alignments
($2);
764 $globals{"lineifont"} = $font;
765 "<table border align=center>"
766 . "\n <tr>$th1<b>$h1</b></th>"
767 . "\n $th2<b>$h2</b></th>"
768 . "\n $th3<b>$h3</b></th>$'"
774 s/$next_pair_pr_rx//o;
776 s/$next_pair_pr_rx//o;
778 s/$next_pair_pr_rx//o;
779 my($c3,$font,$sfont,$efont) = ($2, $globals{"lineifont"}, '', '');
784 my($c1align, $c2align, $c3align) = @col_aligns;
785 "<tr>$c1align$sfont$c1$efont</td>\n"
786 . " $c2align$c2</td>\n"
787 . " $c3align$c3</td>$'";
791 "<p><b>See Also:</b></p>\n" . @_[0];
794 sub do_cmd_seemodule
{
795 # Insert the right magic to jump to the module definition. This should
796 # work most of the time, at least for repeat builds....
798 my $any_next_pair_pr_rx3 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP";
799 my $any_next_pair_pr_rx5 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\5$CP";
800 # Predefined $opt_arg_rx & $optional_arg_rx don't work because they
801 # require the argument to be there.
802 my $opt_arg_rx = "^\\s*(\\[([^]]*)\\])?";
803 s/$opt_arg_rx$any_next_pair_pr_rx3$any_next_pair_pr_rx5//;
804 my($key,$module,$text) = ($2, $4, $6);
805 $key = $module unless $key;
806 "<p>Module <tt><b><a href=\"module-$key.html\">$module</a></b></tt>"
807 . " ($text)</p>"
816 sub do_cmd_maketitle
{
820 $the_title .= "<h1 align=center>$t_title</h1>";
821 } else { &write_warnings
("\nThis document has no title."); }
822 $the_title .= "\n<center>";
825 my $href = &translate_commands
($t_authorURL);
826 $href = &make_named_href
('author', $href, "<strong>${t_author}</strong>");
827 $the_title .= "\n<p>$href</p>";
829 $the_title .= "\n<p><strong>$t_author</strong></p>";
831 } else { &write_warnings
("\nThere is no author for this document."); }
833 $the_title .= "\n<p>$t_institute</p>";}
834 if ($AUTHOR_ADDRESS) {
835 $the_title .= "\n<p>$AUTHOR_ADDRESS</p>";}
837 $the_title .= "\n<p><i>$t_affil</i></p>";}
839 $the_title .= "\n<p><strong>$t_date</strong>";
840 if ($PYTHON_VERSION) {
841 $the_title .= "<br><strong>Release $PYTHON_VERSION</strong>";}
844 $the_title .= "\n</center>";
846 $the_title .= "\n<p>$t_address</p>";
847 } else { $the_title .= "\n<p>"}
849 $the_title .= "\n<p>$t_email</p>";
850 }# else { $the_title .= "</p>" }
851 $the_title . "<hr>\n" . $_ ;
855 # sub do_cmd_indexlabel{
856 # "genindex" . @_[0];
860 # These are located down here since they screw up fontlock. -- used to.
863 # This uses a weird HTML construct to adjust the font to be
864 # reasonable match that used in the printed form as much as
865 # possible. The expected behavior is that a browser that doesn't
866 # understand "<font face=...>" markup will use courier (or whatever
867 # the font is for <tt>).
869 s
|$next_pair_pr_rx|\"<tt
>\
2</tt
>\"|;
875 s
|$next_pair_pr_rx|\"<tt
>\
2</tt
>\"|;
879 1; # This must be the last line