annotate Doc/perl/python.perl @ 7671:0cf2ffaf4bd7 legacy-trunk

Bring this up to date. Some things still don't work right.
author Fred Drake <fdrake@acm.org>
date Thu, 12 Mar 1998 21:03:26 +0000
parents 0f565c7fe4bb
children 56dcfc27710a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1 # python.perl by Fred L. Drake, Jr. <fdrake@acm.org> -*- perl -*-
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
2 #
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
3 # Heavily based on Guido van Rossum's myformat.perl (now obsolete).
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
4 #
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
5 # Extension to LaTeX2HTML for documents using myformat.sty.
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
6 # Subroutines of the form do_cmd_<name> here define translations
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
7 # for LaTeX commands \<name> defined in the corresponding .sty file.
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
8
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
9 package main;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
10
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
11
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
12 # words typeset in a special way (not in HTML though)
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
13
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
14 sub do_cmd_ABC{ 'ABC' . @_[0]; }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
15 sub do_cmd_UNIX{ 'Unix'. @_[0]; }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
16 sub do_cmd_ASCII{ 'ASCII' . @_[0]; }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
17 sub do_cmd_POSIX{ 'POSIX' . @_[0]; }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
18 sub do_cmd_C{ 'C' . @_[0]; }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
19 sub do_cmd_Cpp{ 'C++' . @_[0]; }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
20 sub do_cmd_EOF{ 'EOF' . @_[0]; }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
21 sub do_cmd_NULL{ '<tt>NULL</tt>' . @_[0]; }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
22
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
23 sub do_cmd_e{ '&#92;' . @_[0]; }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
24
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
25 $AUTHOR_ADDRESS = '';
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
26 $PYTHON_VERSION = '';
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
27
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
28 sub do_cmd_version{ $PYTHON_VERSION . @_[0]; }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
29 sub do_cmd_release{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
30 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
31 s/$any_next_pair_pr_rx//;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
32 $PYTHON_VERSION = "$2";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
33 $_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
34 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
35
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
36 sub do_cmd_authoraddress{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
37 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
38 s/$any_next_pair_pr_rx//;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
39 $AUTHOR_ADDRESS = "$2";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
40 $_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
41 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
42
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
43 sub do_cmd_hackscore{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
44 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
45 s/$any_next_pair_pr_rx/_/;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
46 $_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
47 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
48
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
49 sub do_cmd_optional{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
50 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
51 s/$any_next_pair_pr_rx/<\/var><big>\[<\/big><var>\2<\/var><big>\]<\/big><var>/;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
52 $_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
53 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
54
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
55 sub do_cmd_varvars{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
56 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
57 s/$any_next_pair_pr_rx/<var>\2<\/var>/;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
58 $_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
59 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
60
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
61 # texinfo-like formatting commands: \code{...} etc.
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
62
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
63 sub do_cmd_code{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
64 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
65 s/$any_next_pair_pr_rx/<tt>\2<\/tt>/;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
66 $_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
67 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
68
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
69 sub do_cmd_sectcode{ &do_cmd_code(@_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
70 sub do_cmd_module{ &do_cmd_code(@_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
71 sub do_cmd_keyword{ &do_cmd_code(@_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
72 sub do_cmd_exception{ &do_cmd_code(@_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
73 sub do_cmd_class{ &do_cmd_code(@_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
74 sub do_cmd_function{ &do_cmd_code(@_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
75 sub do_cmd_constant{ &do_cmd_code(@_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
76 sub do_cmd_member{ &do_cmd_code(@_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
77 sub do_cmd_method{ &do_cmd_code(@_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
78 sub do_cmd_email{ &do_cmd_code(@_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
79 sub do_cmd_program{ &do_cmd_code(@_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
80 sub do_cmd_cfunction{ &do_cmd_code(@_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
81 sub do_cmd_cdata{ &do_cmd_code(@_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
82 sub do_cmd_ctype{ &do_cmd_code(@_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
83
7671
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
84 sub do_cmd_character{ &do_cmd_samp(@_); }
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
85
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
86 sub do_cmd_regexp{
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
87 local($_) = @_;
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
88 s|$next_pair_pr_rx|<tt>\2</tt>|;
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
89 $_;
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
90 }
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
91
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
92 sub do_cmd_envvar{
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
93 local($_) = @_;
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
94 s/$next_pair_pr_rx/\$\2/;
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
95 $_;
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
96 }
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
97
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
98 sub do_cmd_mimetype{
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
99 local($_) = @_;
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
100 s|$next_pair_pr_rx|<font face=sans-serif>\2</font>|;
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
101 $_;
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
102 }
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
103
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
104 sub do_cmd_email{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
105 local($_) = @_;
7671
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
106 s|$any_next_pair_pr_rx|<tt><font face=sans-serif>\2</font></tt>|;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
107 $_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
108 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
109
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
110 sub do_cmd_url{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
111 # use the URL as both text and hyperlink
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
112 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
113 s/$any_next_pair_pr_rx//;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
114 local($url) = $2;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
115 $url =~ s/~/&#126;/g;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
116 "<tt><font face=sans-serif><a href=\"$url\">$url</a></font></tt>" . $_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
117 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
118
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
119 sub do_cmd_manpage{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
120 # two parameters: \manpage{name}{section}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
121 local($_) = @_;
7671
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
122 local($any_next_pair_pr_rx3) = "$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP";
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
123 s/$next_pair_pr_rx$any_next_pair_pr_rx3/<i>\2<\/i>(\4)/;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
124 $_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
125 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
126
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
127 sub do_cmd_rfc{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
128 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
129 s/$next_pair_pr_rx//;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
130 local($br_id,$rfcnumber) = ($1, $2);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
131
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
132 # Save the reference
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
133 local($nstr) = &gen_index_id("RFC!RFC $rfcnumber", '');
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
134 $index{$nstr} .= &make_half_href("$CURRENT_FILE#$br_id");
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
135 "<a name=\"$br_id\">RFC $rfcnumber<\/a>" .$_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
136 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
137
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
138 sub do_cmd_kbd{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
139 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
140 s/$any_next_pair_pr_rx/<kbd>\2<\/kbd>/;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
141 $_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
142 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
143
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
144 sub do_cmd_key{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
145 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
146 s/$any_next_pair_pr_rx/<tt>\2<\/tt>/;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
147 $_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
148 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
149
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
150 sub do_cmd_var{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
151 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
152 s/$any_next_pair_pr_rx/<i>\2<\/i>/;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
153 $_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
154 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
155
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
156 sub do_cmd_dfn{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
157 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
158 s/$any_next_pair_pr_rx/<i>\2<\/i>/;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
159 $_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
160 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
161
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
162 sub do_cmd_emph{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
163 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
164 s/$any_next_pair_pr_rx/<i>\2<\/i>/;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
165 $_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
166 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
167
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
168 sub do_cmd_strong{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
169 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
170 s/$any_next_pair_pr_rx/<b>\2<\/b>/;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
171 $_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
172 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
173
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
174 sub do_cmd_deprecated{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
175 # two parameters: \deprecated{version}{whattodo}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
176 local($_) = @_;
7671
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
177 local($any_next_pair_pr_rx3) = "$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP";
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
178 local($release,$action) = ($2, $4);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
179 s/$next_pair_pr_rx$any_next_pair_pr_rx3//;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
180 "<b>Deprecated since release $release.</b>"
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
181 . "\n$action<p>"
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
182 . $_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
183 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
184
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
185 # file and samp are at the end of this file since they screw up fontlock.
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
186
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
187 # index commands
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
188
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
189 $INDEX_SUBITEM = "";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
190
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
191 sub get_indexsubitem{
7671
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
192 #$INDEX_SUBITEM ? " $INDEX_SUBITEM" : '';
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
193 '';
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
194 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
195
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
196 sub do_cmd_setindexsubitem{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
197 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
198 s/$any_next_pair_pr_rx//;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
199 $INDEX_SUBITEM = $2;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
200 $_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
201 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
202
7671
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
203 sub do_cmd_withsubitem{
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
204 # We can't really do the right right thing, because LaTeX2HTML doesn't
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
205 # do things in the right order, but we need to at least strip this stuff
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
206 # out, and leave anything that the second argument expanded out to.
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
207 #
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
208 local($_) = @_;
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
209 s/$next_pair_pr_rx$any_next_pair_pr_rx3/\4/;
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
210 $_;
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
211 }
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
212
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
213 sub do_cmd_makemodindex{ @_[0]; }
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
214
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
215 sub do_cmd_indexii{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
216 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
217 s/$next_pair_pr_rx//o;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
218 local($br_id1, $str1) = ($1, $2);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
219 s/$next_pair_pr_rx//o;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
220 local($br_id2, $str2) = ($1, $2);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
221 join('', &make_index_entry($br_id1, "$str1 $str2"),
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
222 &make_index_entry($br_id2, "$str2, $str1"), $_);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
223 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
224
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
225 sub do_cmd_indexiii{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
226 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
227 s/$next_pair_pr_rx//o;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
228 local($br_id1, $str1) = ($1, $2);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
229 s/$next_pair_pr_rx//o;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
230 local($br_id2, $str2) = ($1, $2);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
231 s/$next_pair_pr_rx//o;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
232 local($br_id3, $str3) = ($1, $2);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
233 join('', &make_index_entry($br_id1, "$str1 $str2 $str3"),
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
234 &make_index_entry($br_id2, "$str2 $str3, $str1"),
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
235 &make_index_entry($br_id3, "$str3, $str1 $str2"),
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
236 $_);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
237 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
238
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
239 sub do_cmd_indexiv{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
240 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
241 s/$next_pair_pr_rx//o;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
242 local($br_id1, $str1) = ($1, $2);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
243 s/$next_pair_pr_rx//o;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
244 local($br_id2, $str2) = ($1, $2);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
245 s/$next_pair_pr_rx//o;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
246 local($br_id3, $str3) = ($1, $2);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
247 s/$next_pair_pr_rx//o;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
248 local($br_id4, $str4) = ($1, $2);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
249 join('', &make_index_entry($br_id1, "$str1 $str2 $str3 $str4"),
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
250 &make_index_entry($br_id2, "$str2 $str3 $str4, $str1"),
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
251 &make_index_entry($br_id3, "$str3 $str4, $str1 $str2"),
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
252 &make_index_entry($br_id4, "$str4, $str1 $str2 $str3"),
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
253 $_);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
254 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
255
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
256 sub do_cmd_ttindex{ &do_cmd_index(@_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
257
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
258 sub my_typed_index_helper{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
259 local($word, $_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
260 s/$next_pair_pr_rx//o;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
261 local($br_id, $str) = ($1, $2);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
262 join('', &make_index_entry($br_id, "$str $word"),
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
263 &make_index_entry($br_id, "$word, $str"), $_);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
264 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
265
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
266 sub do_cmd_stindex{ &my_typed_index_helper('statement', @_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
267 sub do_cmd_opindex{ &my_typed_index_helper('operator', @_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
268 sub do_cmd_exindex{ &my_typed_index_helper('exception', @_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
269 sub do_cmd_obindex{ &my_typed_index_helper('object', @_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
270
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
271 sub my_parword_index_helper{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
272 local($word, $_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
273 s/$next_pair_pr_rx//o;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
274 local($br_id, $str) = ($1, $2);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
275 &make_index_entry($br_id, "$str ($word)") . $_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
276 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
277
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
278
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
279 # Set this to true to strip out the <tt>...</tt> from index entries;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
280 # this is analogous to using the second definition of \idxcode{} from
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
281 # myformat.sty.
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
282 #
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
283 # It is used from &make_mod_index_entry() and &make_str_index_entry().
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
284 #
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
285 $STRIP_INDEX_TT = 0;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
286
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
287 sub make_mod_index_entry{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
288 local($br_id,$str,$define) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
289 local($halfref) = &make_half_href("$CURRENT_FILE#$br_id");
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
290 # If TITLE is not yet available (i.e the \index command is in the title
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
291 # of the current section), use $ref_before.
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
292 $TITLE = $ref_before unless $TITLE;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
293 # Save the reference
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
294 if ($define eq "DEF") {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
295 local($nstr,$garbage) = split / /, $str, 2;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
296 $Modules{$nstr} .= $halfref;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
297 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
298 $str = &gen_index_id($str, $define);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
299 if ($STRIP_INDEX_TT) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
300 $str =~ s/<tt>(.*)<\/tt>/\1/;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
301 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
302 $index{$str} .= $halfref;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
303 "<a name=\"$br_id\">$anchor_invisible_mark<\/a>";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
304 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
305
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
306 sub my_module_index_helper{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
307 local($word, $_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
308 s/$next_pair_pr_rx[\n]*//o;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
309 local($br_id, $str) = ($1, $2);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
310 local($section_tag) = join('', @curr_sec_id);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
311 $word = "$word " if $word;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
312 &make_mod_index_entry("SECTION$section_tag",
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
313 "<tt>$str</tt> (${word}module)", 'DEF');
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
314 $_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
315 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
316
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
317 sub ref_module_index_helper{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
318 local($word, $_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
319 s/$next_pair_pr_rx//o;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
320 local($br_id, $str) = ($1, $2);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
321 $word = "$word " if $word;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
322 &make_mod_index_entry($br_id, "<tt>$str</tt> (${word}module)", 'REF') . $_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
323 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
324
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
325 sub do_cmd_bifuncindex{ &my_parword_index_helper('built-in function', @_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
326 sub do_cmd_modindex{ &my_module_index_helper('', @_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
327 sub do_cmd_bimodindex{ &my_module_index_helper('built-in', @_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
328 sub do_cmd_exmodindex{ &my_module_index_helper('extension', @_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
329 sub do_cmd_stmodindex{ &my_module_index_helper('standard', @_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
330
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
331 # these should be adjusted a bit....
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
332 sub do_cmd_refmodindex{ &ref_module_index_helper('', @_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
333 sub do_cmd_refbimodindex{ &ref_module_index_helper('built-in', @_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
334 sub do_cmd_refexmodindex{ &ref_module_index_helper('extension', @_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
335 sub do_cmd_refstmodindex{ &ref_module_index_helper('standard', @_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
336
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
337 sub do_cmd_nodename{ &do_cmd_label(@_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
338
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
339 sub init_myformat{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
340 # XXX need some way for this to be called after &initialise; ???
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
341 $anchor_mark = '';
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
342 $icons{'anchor_mark'} = '';
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
343 # <<2>>...<<2>>
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
344 $any_next_pair_rx3 = "$O(\\d+)$C([\\s\\S]*)$O\\3$C";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
345 $any_next_pair_rx5 = "$O(\\d+)$C([\\s\\S]*)$O\\5$C";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
346 $any_next_pair_rx7 = "$O(\\d+)$C([\\s\\S]*)$O\\7$C";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
347 $any_next_pair_rx9 = "$O(\\d+)$C([\\s\\S]*)$O\\9$C";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
348 # <#2#>...<#2#>
7671
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
349 $any_next_pair_pr_rx3 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP";
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
350 $any_next_pair_pr_rx5 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\5$CP";
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
351 $any_next_pair_pr_rx7 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\7$CP";
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
352 $any_next_pair_pr_rx9 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\9$CP";
7539
7830e1de9817 Comment out the attempt to get index-related stuff processed in the right
Fred Drake <fdrake@acm.org>
parents: 7527
diff changeset
353 # if (defined &process_commands_wrap_deferred) {
7830e1de9817 Comment out the attempt to get index-related stuff processed in the right
Fred Drake <fdrake@acm.org>
parents: 7527
diff changeset
354 # &process_commands_wrap_deferred(<<THESE_COMMANDS);
7830e1de9817 Comment out the attempt to get index-related stuff processed in the right
Fred Drake <fdrake@acm.org>
parents: 7527
diff changeset
355 # indexii # {} # {}
7830e1de9817 Comment out the attempt to get index-related stuff processed in the right
Fred Drake <fdrake@acm.org>
parents: 7527
diff changeset
356 # indexiii # {} # {} # {}
7830e1de9817 Comment out the attempt to get index-related stuff processed in the right
Fred Drake <fdrake@acm.org>
parents: 7527
diff changeset
357 # indexiv # {} # {} # {} # {}
7830e1de9817 Comment out the attempt to get index-related stuff processed in the right
Fred Drake <fdrake@acm.org>
parents: 7527
diff changeset
358 # exindex # {}
7830e1de9817 Comment out the attempt to get index-related stuff processed in the right
Fred Drake <fdrake@acm.org>
parents: 7527
diff changeset
359 # obindex # {}
7830e1de9817 Comment out the attempt to get index-related stuff processed in the right
Fred Drake <fdrake@acm.org>
parents: 7527
diff changeset
360 # opindex # {}
7830e1de9817 Comment out the attempt to get index-related stuff processed in the right
Fred Drake <fdrake@acm.org>
parents: 7527
diff changeset
361 # stindex # {}
7830e1de9817 Comment out the attempt to get index-related stuff processed in the right
Fred Drake <fdrake@acm.org>
parents: 7527
diff changeset
362 # ttindex # {}
7830e1de9817 Comment out the attempt to get index-related stuff processed in the right
Fred Drake <fdrake@acm.org>
parents: 7527
diff changeset
363 # bifuncindex # {}
7830e1de9817 Comment out the attempt to get index-related stuff processed in the right
Fred Drake <fdrake@acm.org>
parents: 7527
diff changeset
364 # modindex # {}
7830e1de9817 Comment out the attempt to get index-related stuff processed in the right
Fred Drake <fdrake@acm.org>
parents: 7527
diff changeset
365 # bimodindex # {}
7830e1de9817 Comment out the attempt to get index-related stuff processed in the right
Fred Drake <fdrake@acm.org>
parents: 7527
diff changeset
366 # exmodindex # {}
7830e1de9817 Comment out the attempt to get index-related stuff processed in the right
Fred Drake <fdrake@acm.org>
parents: 7527
diff changeset
367 # stmodindex # {}
7830e1de9817 Comment out the attempt to get index-related stuff processed in the right
Fred Drake <fdrake@acm.org>
parents: 7527
diff changeset
368 # refmodindex # {}
7830e1de9817 Comment out the attempt to get index-related stuff processed in the right
Fred Drake <fdrake@acm.org>
parents: 7527
diff changeset
369 # refbimodindex # {}
7830e1de9817 Comment out the attempt to get index-related stuff processed in the right
Fred Drake <fdrake@acm.org>
parents: 7527
diff changeset
370 # refexmodindex # {}
7830e1de9817 Comment out the attempt to get index-related stuff processed in the right
Fred Drake <fdrake@acm.org>
parents: 7527
diff changeset
371 # refstmodindex # {}
7830e1de9817 Comment out the attempt to get index-related stuff processed in the right
Fred Drake <fdrake@acm.org>
parents: 7527
diff changeset
372 # rfc # {}
7830e1de9817 Comment out the attempt to get index-related stuff processed in the right
Fred Drake <fdrake@acm.org>
parents: 7527
diff changeset
373 # THESE_COMMANDS
7830e1de9817 Comment out the attempt to get index-related stuff processed in the right
Fred Drake <fdrake@acm.org>
parents: 7527
diff changeset
374 # }
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
375 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
376
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
377 &init_myformat;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
378
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
379 # similar to make_index_entry(), but includes the string in the result
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
380 # instead of the dummy filler.
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
381 #
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
382 sub make_str_index_entry{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
383 local($br_id,$str) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
384 # If TITLE is not yet available (i.e the \index command is in the title
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
385 # of the current section), use $ref_before.
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
386 $TITLE = $ref_before unless $TITLE;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
387 # Save the reference
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
388 local($nstr) = &gen_index_id($str, '');
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
389 if ($STRIP_INDEX_TT) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
390 $nstr =~ s/<tt>(.*)<\/tt>/\1/;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
391 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
392 $index{$nstr} .= &make_half_href("$CURRENT_FILE#$br_id");
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
393 "<a name=\"$br_id\">$str<\/a>";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
394 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
395
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
396 # Changed from the stock version to indent {verbatim} sections,
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
397 # and make them smaller, to better match the LaTeX version:
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
398
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
399 # (Used with LaTeX2HTML 96.1*)
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
400 sub replace_verbatim {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
401 # Modifies $_
7563
59b1ab01c286 For verbatim text, don't bounce down a size.
Fred Drake <fdrake@acm.org>
parents: 7539
diff changeset
402 local($prefix,$suffix) = ("\n<p><dl><dd><pre>\n", "</pre></dl>");
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
403 s/$verbatim_mark(verbatim)(\d+)/$prefix$verbatim{$2}$suffix/go;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
404 s/$verbatim_mark(rawhtml)(\d+)/$verbatim{$2}/ego; # Raw HTML
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
405 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
406
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
407 # (Used with LaTeX2HTML 98.1)
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
408 sub replace_verbatim_hook{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
409 # Modifies $_
7563
59b1ab01c286 For verbatim text, don't bounce down a size.
Fred Drake <fdrake@acm.org>
parents: 7539
diff changeset
410 local($prefix,$suffix) = ("\n<p><dl><dd>", "</dl>");
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
411 s/$math_verbatim_rx/&put_comment("MATH: ".$verbatim{$1})/eg;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
412 s/$verbatim_mark(\w*[vV]erbatim\*?)(\d+)\#/$prefix$verbatim{$2}$suffix/go;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
413 # Raw HTML, but replacements may have protected characters
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
414 s/$verbatim_mark(rawhtml)(\d+)#/&unprotect_raw_html($verbatim{$2})/eg;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
415 s/$verbatim_mark$keepcomments(\d+)#/$verbatim{$2}/ego; # Raw TeX
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
416 s/$unfinished_mark$keepcomments(\d+)#/$verbatim{$2}/ego; # Raw TeX
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
417 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
418
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
419 sub do_env_cfuncdesc{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
420 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
421 local($return_type,$function_name,$arg_list,$idx) = ('', '', '', '');
7671
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
422 local($any_next_pair_rx3) = "$O(\\d+)$C([\\s\\S]*)$O\\3$C";
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
423 local($any_next_pair_rx5) = "$O(\\d+)$C([\\s\\S]*)$O\\5$C";
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
424 local($cfuncdesc_rx) =
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
425 "$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
426 if (/$cfuncdesc_rx/o) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
427 $return_type = "$2";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
428 $function_name = "$4";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
429 $arg_list = "$6";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
430 $idx = &make_str_index_entry($3,
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
431 "<tt>$function_name</tt>" . &get_indexsubitem);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
432 $idx =~ s/ \(.*\)//;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
433 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
434 "<dl><dt>$return_type <b>$idx</b>"
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
435 . "(<var>$arg_list</var>)\n<dd>$'\n</dl>"
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
436 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
437
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
438 sub do_env_ctypedesc{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
439 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
440 local($type_name) = ('');
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
441 local($cfuncdesc_rx) = "$next_pair_rx";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
442 if (/$cfuncdesc_rx/o) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
443 $type_name = "$2";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
444 $idx = &make_str_index_entry($1,
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
445 "<tt>$type_name</tt>" . &get_indexsubitem);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
446 $idx =~ s/ \(.*\)//;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
447 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
448 "<dl><dt><b>$idx</b>\n<dd>$'\n</dl>"
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
449 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
450
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
451 sub do_env_cvardesc{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
452 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
453 local($var_type,$var_name,$idx) = ('', '', '');
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
454 local($cfuncdesc_rx) = "$next_pair_rx$any_next_pair_rx3";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
455 if (/$cfuncdesc_rx/o) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
456 $var_type = "$2";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
457 $var_name = "$4";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
458 $idx = &make_str_index_entry($3,
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
459 "<tt>$var_name</tt>" . &get_indexsubitem);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
460 $idx =~ s/ \(.*\)//;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
461 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
462 "<dl><dt>$var_type <b>$idx</b>\n"
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
463 . "<dd>$'\n</dl>";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
464 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
465
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
466 sub do_env_funcdesc{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
467 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
468 local($function_name,$arg_list,$idx) = ('', '', '');
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
469 local($funcdesc_rx) = "$next_pair_rx$any_next_pair_rx3";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
470 if (/$funcdesc_rx/o) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
471 $function_name = "$2";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
472 $arg_list = "$4";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
473 $idx = &make_str_index_entry($3,
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
474 "<tt>$function_name</tt>" . &get_indexsubitem);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
475 $idx =~ s/ \(.*\)//;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
476 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
477 "<dl><dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>$'\n</dl>";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
478 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
479
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
480 sub do_env_funcdescni{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
481 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
482 local($function_name,$arg_list,$idx) = ('', '', '');
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
483 local($funcdesc_rx) = "$next_pair_rx$any_next_pair_rx3";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
484 if (/$funcdesc_rx/o) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
485 $function_name = "$2";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
486 $arg_list = "$4";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
487 if ($STRIP_INDEX_TT) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
488 $idx = $function_name; }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
489 else {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
490 $idx = "<tt>$function_name</tt>"; }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
491 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
492 "<dl><dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>$'\n</dl>";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
493 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
494
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
495 sub do_cmd_funcline{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
496 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
497 local($funcdesc_rx) = "$next_pair_pr_rx$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
498
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
499 s/$funcdesc_rx//o;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
500 local($br_id, $function_name, $arg_list) = ($3, $2, $4);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
501 local($idx) = &make_str_index_entry($br_id, "<tt>$function_name</tt>");
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
502
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
503 "<dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>" . $_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
504 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
505
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
506 # Change this flag to index the opcode entries. I don't think it's very
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
507 # useful to index them, since they're only presented to describe the dis
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
508 # module.
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
509 #
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
510 $INDEX_OPCODES = 0;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
511
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
512 sub do_env_opcodedesc{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
513 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
514 local($opcode_name,$arg_list,$stuff,$idx) = ('', '', '', '');
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
515 local($opcodedesc_rx) = "$next_pair_rx$any_next_pair_rx3";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
516 if (/$opcodedesc_rx/o) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
517 $opcode_name = "$2";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
518 $arg_list = "$4";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
519 if ($INDEX_OPCODES) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
520 $idx = &make_str_index_entry($3,
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
521 "<tt>$opcode_name</tt> (byte code instruction)");
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
522 $idx =~ s/ \(byte code instruction\)//;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
523 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
524 else {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
525 $idx = "<tt>$opcode_name</tt>";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
526 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
527 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
528 $stuff = "<dl><dt><b>$idx</b>";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
529 if ($arg_list) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
530 $stuff .= "&nbsp;&nbsp;&nbsp;&nbsp;<var>$arg_list</var>";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
531 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
532 $stuff . "\n<dd>$'\n</dl>";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
533 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
534
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
535 sub do_env_datadesc{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
536 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
537 local($idx) = '';
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
538 if (/$next_pair_rx/o) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
539 $idx = &make_str_index_entry($1, "<tt>$2</tt>" . &get_indexsubitem);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
540 $idx =~ s/ \(.*\)//;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
541 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
542 "<dl><dt><b>$idx</b>\n<dd>$'\n</dl>"
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
543 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
544
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
545 sub do_env_datadescni{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
546 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
547 local($idx) = '';
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
548 if (/$next_pair_rx/o) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
549 if ($STRING_INDEX_TT) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
550 $idx = "$2"; }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
551 else {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
552 $idx = "<tt>$2</tt>"; }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
553 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
554 "<dl><dt><b>$idx</b>\n<dd>$'\n</dl>"
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
555 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
556
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
557 sub do_cmd_dataline{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
558 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
559
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
560 s/$next_pair_pr_rx//o;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
561 local($br_id, $data_name) = ($1, $2);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
562 local($idx) = &make_str_index_entry($br_id, "<tt>$data_name</tt>"
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
563 . &get_indexsubitem);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
564 $idx =~ s/ \(.*\)//;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
565
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
566 "<dt><b>$idx</b>\n<dd>" . $_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
567 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
568
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
569 sub do_env_excdesc{ &do_env_datadesc(@_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
570 sub do_env_classdesc{ &do_env_funcdesc(@_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
571 sub do_env_fulllineitems{ &do_env_itemize(@_); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
572
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
573
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
574 @col_aligns = ("<td>", "<td>", "<td>");
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
575
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
576 sub setup_column_alignments{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
577 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
578 local($j1,$a1,$a2,$a3,$j4) = split(/[|]/,$_);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
579 local($th1,$th2,$th3) = ('<th>', '<th>', '<th>');
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
580 $col_aligns[0] = (($a1 eq "c") ? "<td align=center>" : "<td>");
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
581 $col_aligns[1] = (($a2 eq "c") ? "<td align=center>" : "<td>");
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
582 $col_aligns[2] = (($a3 eq "c") ? "<td align=center>" : "<td>");
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
583 # return the aligned header start tags; only used for \begin{tableiii?}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
584 $th1 = (($a1 eq "l") ? "<th align=left>"
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
585 : ($a1 eq "r" ? "<th align=right>" : "<th>"));
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
586 $th2 = (($a2 eq "l") ? "<th align=left>"
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
587 : ($a2 eq "r" ? "<th align=right>" : "<th>"));
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
588 $th3 = (($a3 eq "l") ? "<th align=left>"
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
589 : ($a3 eq "r" ? "<th align=right>" : "<th>"));
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
590 ($th1, $th2, $th3);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
591 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
592
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
593 sub do_env_tableii{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
594 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
595 local($font,$h1,$h2) = ('', '', '');
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
596 local($tableiii_rx) =
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
597 "$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5$any_next_pair_rx7";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
598 if (/$tableiii_rx/o) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
599 $font = $4;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
600 $h1 = $6;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
601 $h2 = $8;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
602 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
603 local($th1,$th2,$th3) = &setup_column_alignments($2);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
604 $globals{"lineifont"} = $font;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
605 "<table border align=center>"
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
606 . "\n <tr>$th1<b>$h1</b></th>"
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
607 . "\n $th2<b>$h2</b></th>$'"
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
608 . "\n</table>";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
609 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
610
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
611 sub do_cmd_lineii{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
612 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
613 s/$next_pair_pr_rx//o;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
614 local($c1) = $2;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
615 s/$next_pair_pr_rx//o;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
616 local($c2) = $2;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
617 local($font) = $globals{"lineifont"};
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
618 local($c1align, $c2align) = @col_aligns[0,1];
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
619 "<tr>$c1align<$font>$c1</$font></td>\n"
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
620 . " $c2align$c2</td>$'";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
621 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
622
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
623 sub do_env_tableiii{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
624 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
625 local($font,$h1,$h2,$h3) = ('', '', '', '');
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
626
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
627 local($tableiii_rx) =
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
628 "$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5$any_next_pair_rx7"
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
629 . "$any_next_pair_rx9";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
630 if (/$tableiii_rx/o) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
631 $font = $4;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
632 $h1 = $6;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
633 $h2 = $8;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
634 $h3 = $10;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
635 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
636 local($th1,$th2,$th3) = &setup_column_alignments($2);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
637 $globals{"lineifont"} = $font;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
638 "<table border align=center>"
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
639 . "\n <tr>$th1<b>$h1</b></th>"
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
640 . "\n $th2<b>$h2</b></th>"
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
641 . "\n $th3<b>$h3</b></th>$'"
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
642 . "\n</table>";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
643 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
644
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
645 sub do_cmd_lineiii{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
646 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
647 s/$next_pair_pr_rx//o;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
648 local($c1) = $2;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
649 s/$next_pair_pr_rx//o;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
650 local($c2) = $2;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
651 s/$next_pair_pr_rx//o;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
652 local($c3) = $2;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
653 local($font) = $globals{"lineifont"};
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
654 local($c1align, $c2align, $c3align) = @col_aligns;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
655 "<tr>$c1align<$font>$c1</$font></td>\n"
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
656 . " $c2align$c2</td>\n"
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
657 . " $c3align$c3</td>$'";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
658 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
659
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
660 sub do_env_seealso{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
661 "<p><b>See Also:</b></p>\n" . @_[0];
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
662 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
663
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
664 sub do_cmd_seemodule{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
665 # Insert the right magic to jump to the module definition. This should
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
666 # work most of the time, at least for repeat builds....
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
667 local($_) = @_;
7581
0f565c7fe4bb Misc. revisions to LaTeX2HTML support.
Fred Drake <fdrake@acm.org>
parents: 7563
diff changeset
668 local($opt_arg) = "(\\[([^\\]]*)])?";
0f565c7fe4bb Misc. revisions to LaTeX2HTML support.
Fred Drake <fdrake@acm.org>
parents: 7563
diff changeset
669 # local($any_next_pair_pr_rx3) = "$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP";
7671
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
670 # local($any_next_pair_pr_rx5) = "$OP(\\d+)$CP([\\s\\S]*)$OP\\5$CP";
7581
0f565c7fe4bb Misc. revisions to LaTeX2HTML support.
Fred Drake <fdrake@acm.org>
parents: 7563
diff changeset
671 s/$opt_arg$any_next_pair_pr_rx3$any_next_pair_pr_rx5//;
0f565c7fe4bb Misc. revisions to LaTeX2HTML support.
Fred Drake <fdrake@acm.org>
parents: 7563
diff changeset
672 local($module,$text,$key) = ($4, $6, $2);
0f565c7fe4bb Misc. revisions to LaTeX2HTML support.
Fred Drake <fdrake@acm.org>
parents: 7563
diff changeset
673 $key = $module if not $key;
0f565c7fe4bb Misc. revisions to LaTeX2HTML support.
Fred Drake <fdrake@acm.org>
parents: 7563
diff changeset
674 "<p>Module <tt><b><a href=\"module-$key.html\">$module</a></b></tt>"
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
675 . "&nbsp;&nbsp;&nbsp;($text)</p>"
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
676 . $_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
677 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
678
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
679 sub do_cmd_seetext{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
680 "<p>" . @_[0];
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
681 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
682
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
683
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
684 sub do_cmd_maketitle {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
685 local($_) = @_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
686 local($the_title) = '';
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
687 if ($t_title) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
688 $the_title .= "<h1 align=\"center\">$t_title</h1>";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
689 } else { &write_warnings("\nThis document has no title."); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
690 if ($t_author) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
691 if ($t_authorURL) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
692 local($href) = &translate_commands($t_authorURL);
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
693 $href = &make_named_href('author', $href, "<strong>${t_author}</strong>");
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
694 $the_title .= "\n<p align=\"center\">$href</p>";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
695 } else {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
696 $the_title .= "\n<p align=\"center\"><strong>$t_author</strong></p>";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
697 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
698 } else { &write_warnings("\nThere is no author for this document."); }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
699 if ($t_institute) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
700 $the_title .= "\n<p align=\"center\"><small>$t_institute</small></p>";}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
701 if ($AUTHOR_ADDRESS) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
702 $the_title .= "\n<p align=\"center\"><small>$AUTHOR_ADDRESS";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
703 $the_title .= "</small></p>";}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
704 if ($t_affil) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
705 $the_title .= "\n<p align=\"center\"><i>$t_affil</i></p>";}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
706 if ($t_date) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
707 $the_title .= "\n<p align=\"center\"><strong>$t_date</strong>";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
708 if ($PYTHON_VERSION) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
709 $the_title .= "<br><strong>Release $PYTHON_VERSION</strong>";}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
710 $the_title .= "</p>"
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
711 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
712 if ($t_address) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
713 $the_title .= "<br>\n<p align=\"left\"><small>$t_address</small></p>";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
714 } else { $the_title .= "\n<p align=\"left\">"}
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
715 if ($t_email) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
716 $the_title .= "\n<p align=\"left\"><small>$t_email</small></p>";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
717 } else { $the_title .= "</p>" }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
718 $the_title . "<p><hr>\n" . $_ ;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
719 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
720
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
721
7671
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
722 sub do_cmd_inputindex{
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
723 local($_) = @_;
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
724 s/$next_pair_pr_rx//;
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
725 &do_cmd_input($2);
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
726 }
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
727
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
728
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
729 # These are located down here since they screw up fontlock. -- used to.
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
730
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
731 sub do_cmd_file{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
732 # This uses a weird HTML construct to adjust the font to be
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
733 # reasonable match that used in the printed form as much as
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
734 # possible. The expected behavior is that a browser that doesn't
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
735 # understand "<font face=...>" markup will use courier (or whatever
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
736 # the font is for <tt>).
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
737 local($_) = @_;
7539
7830e1de9817 Comment out the attempt to get index-related stuff processed in the right
Fred Drake <fdrake@acm.org>
parents: 7527
diff changeset
738 s/$any_next_pair_pr_rx/\"<tt>\2<\/tt>\"/;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
739 $_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
740 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
741
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
742 sub do_cmd_samp{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
743 local($_) = @_;
7539
7830e1de9817 Comment out the attempt to get index-related stuff processed in the right
Fred Drake <fdrake@acm.org>
parents: 7527
diff changeset
744 s/$any_next_pair_pr_rx/\"<tt>\2<\/tt>\"/;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
745 $_;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
746 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
747
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
748 1; # This must be the last line