Mercurial > cpython-lru_cache-weakref
annotate Doc/perl/python.perl @ 7760:6bfa650f311d legacy-trunk
Lots and lots and lots.....
Implemented some new features of python.sty for methods & members.
Fixed some bugs.
Cleaned up some perl code and made some basic regular expressions more robust.
| author | Fred Drake <fdrake@acm.org> |
|---|---|
| date | Fri, 27 Mar 1998 05:16:10 +0000 |
| parents | 56dcfc27710a |
| children | 1c420699d58a |
| 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{ '\' . @_[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($_) = @_; |
| 7711 | 31 s/$next_pair_pr_rx//; |
|
7527
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($_) = @_; |
| 7711 | 38 s/$next_pair_pr_rx//; |
|
7527
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($_) = @_; |
| 7711 | 45 s/$next_pair_pr_rx/_/; |
|
7527
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($_) = @_; |
| 7711 | 51 s|$next_pair_pr_rx|</var><big>\[</big><var>\2</var><big>\]</big><var>|; |
|
7527
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($_) = @_; |
| 7711 | 57 s|$next_pair_pr_rx|<var>\2</var>|; |
|
7527
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 |
| 7711 | 61 # Logical formatting (some based on texinfo), needs to be converted to |
| 62 # minimalist HTML. The "minimalist" is primarily to reduce the size of | |
| 63 # output files for users that read them over the network rather than | |
| 64 # from local repositories. | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
65 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
66 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
|
67 local($_) = @_; |
| 7711 | 68 s|$next_pair_pr_rx|<tt>\2</tt>|; |
| 69 $_; | |
| 70 } | |
| 71 | |
| 72 sub use_sans_serif{ | |
| 73 local($_) = @_; | |
| 74 s|$next_pair_pr_rx|<font face=sans-serif>\2</font>|; | |
| 75 $_; | |
| 76 } | |
| 77 | |
| 78 sub use_italics{ | |
| 79 local($_) = @_; | |
| 80 s|$next_pair_pr_rx|<i>\2</i>|; | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
81 $_; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
82 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
83 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
84 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
|
85 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
|
86 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
|
87 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
|
88 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
|
89 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
|
90 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
|
91 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
|
92 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
|
93 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
|
94 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
|
95 sub do_cmd_ctype{ &do_cmd_code(@_); } |
| 7711 | 96 sub do_cmd_regexp{ &do_cmd_code(@_); } |
| 97 sub do_cmd_key{ &do_cmd_code(@_); } | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
98 |
|
7671
0cf2ffaf4bd7
Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents:
7581
diff
changeset
|
99 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
|
100 |
| 7711 | 101 sub do_cmd_program{ &do_cmd_strong(@_); } |
| 102 | |
| 103 sub do_cmd_email{ &use_sans_serif(@_); } | |
| 104 sub do_cmd_mimetype{ &use_sans_serif(@_); } | |
| 105 | |
| 106 sub do_cmd_var{ &use_italics(@_); } | |
| 7760 | 107 sub do_cmd_dfn{ &use_italics(@_); } # make an index entry? |
| 7711 | 108 sub do_cmd_emph{ &use_italics(@_); } |
| 109 | |
|
7671
0cf2ffaf4bd7
Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents:
7581
diff
changeset
|
110 |
|
0cf2ffaf4bd7
Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents:
7581
diff
changeset
|
111 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
|
112 local($_) = @_; |
| 7760 | 113 s/$next_pair_pr_rx//; |
| 114 my($br_id,$envvar) = ($1, $2); | |
| 115 my($name,$aname,$ahref) = link_info($br_id); | |
| 116 add_index_entry("environment variables!$envvar@\$$envvar", $ahref); | |
| 117 add_index_entry("$envvar@\$$envvar", $ahref); | |
| 118 "$aname\$$envvar</a>" . $_; | |
|
7671
0cf2ffaf4bd7
Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents:
7581
diff
changeset
|
119 } |
|
0cf2ffaf4bd7
Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents:
7581
diff
changeset
|
120 |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
121 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
|
122 # 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
|
123 local($_) = @_; |
| 7711 | 124 s/$next_pair_pr_rx//; |
| 125 my $url = $2; | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
126 $url =~ s/~/~/g; |
| 7711 | 127 "<a href=\"$url\"><font face=sans-serif>$url</font></a>" . $_; |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
128 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
129 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
130 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
|
131 # 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
|
132 local($_) = @_; |
| 7760 | 133 my $rx = "$next_pair_pr_rx$any_next_pair_pr_rx3"; |
| 134 s|$rx|<i>\2</i>(\4)|; | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
135 $_; |
|
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_rfc{ |
|
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/$next_pair_pr_rx//; |
| 7711 | 141 my($br_id,$rfcnumber) = ($1, $2); |
|
7527
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 # Save the reference |
| 7711 | 144 my $nstr = &gen_index_id("RFC!RFC $rfcnumber", ''); |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
145 $index{$nstr} .= &make_half_href("$CURRENT_FILE#$br_id"); |
| 7711 | 146 "<a name=$br_id>RFC $rfcnumber</a>" .$_; |
|
7527
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 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
|
150 local($_) = @_; |
| 7711 | 151 s|$next_pair_pr_rx|<kbd>\2</kbd>|; |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
152 $_; |
|
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 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
|
156 local($_) = @_; |
| 7711 | 157 s|$next_pair_pr_rx|<b>\2</b>|; |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
158 $_; |
|
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 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
|
162 # 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
|
163 local($_) = @_; |
| 7760 | 164 my $rx = "$next_pair_pr_rx$any_next_pair_pr_rx3"; |
| 165 s|$rx|<b>Deprecated since release \2.</b>\n\4<p>|; | |
| 166 $_; | |
|
7527
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 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
169 # 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
|
170 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
171 # index commands |
|
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 $INDEX_SUBITEM = ""; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
174 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
175 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
|
176 #$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
|
177 ''; |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
178 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
179 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
180 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
|
181 local($_) = @_; |
| 7711 | 182 s/$next_pair_pr_rx//; |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
183 $INDEX_SUBITEM = $2; |
|
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 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
186 |
|
7671
0cf2ffaf4bd7
Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents:
7581
diff
changeset
|
187 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
|
188 # 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
|
189 # 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
|
190 # 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
|
191 # |
|
0cf2ffaf4bd7
Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents:
7581
diff
changeset
|
192 local($_) = @_; |
| 7711 | 193 my $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
|
194 s/$next_pair_pr_rx$any_next_pair_pr_rx3/\4/; |
| 7760 | 195 $INDEX_SUBITEM = $2; |
|
7671
0cf2ffaf4bd7
Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents:
7581
diff
changeset
|
196 $_; |
|
0cf2ffaf4bd7
Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents:
7581
diff
changeset
|
197 } |
|
0cf2ffaf4bd7
Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents:
7581
diff
changeset
|
198 |
|
0cf2ffaf4bd7
Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents:
7581
diff
changeset
|
199 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
|
200 |
| 7760 | 201 # We're in the document subdirectory when this happens! |
| 202 open(IDXFILE, ">index.dat") || die "\n$!\n"; | |
| 203 open(INTLABELS, ">intlabels.pl") || die "\n$!\n"; | |
| 204 print INTLABELS | |
| 205 "%internal_labels = ();\n1; # hack in case there are no entries\n\n"; | |
| 206 | |
| 207 sub gen_target_name{ | |
| 208 "l2h-" . @_[0]; | |
| 209 } | |
| 210 | |
| 211 sub gen_target{ | |
| 212 "<a name=\"" . @_[0] . "\">"; | |
| 213 } | |
| 214 | |
| 215 sub gen_link{ | |
| 216 my($node,$target) = @_; | |
| 217 print INTLABELS "\$internal_labels{\"$target\"} = \"$URL/$node\";\n"; | |
| 218 "<a href=\"$node#$target\">"; | |
| 219 } | |
| 220 | |
| 221 sub make_index_entry{ | |
| 222 my($br_id,$str) = @_; | |
| 223 my($name,$aname,$ahref) = link_info($br_id); | |
| 224 add_index_entry($str, $ahref); | |
| 225 "$aname$anchor_invisible_mark</a>"; | |
| 226 } | |
| 227 | |
| 228 sub add_index_entry{ | |
| 229 # add an entry to the index structures; ignore the return value | |
| 230 my($str,$ahref) = @_; | |
| 231 $str = gen_index_id($str, ''); | |
| 232 $index{$str} .= $ahref; | |
| 233 print IDXFILE $ahref, "\0", $str, "\n"; | |
| 234 } | |
| 235 | |
| 236 sub link_info{ | |
| 237 my $name = gen_target_name(@_[0]); | |
| 238 my $aname = gen_target($name); | |
| 239 my $ahref = gen_link($CURRENT_FILE, $name); | |
| 240 return ($name, $aname, $ahref); | |
| 241 } | |
| 242 | |
| 243 sub do_cmd_index{ | |
| 244 local($_) = @_; | |
| 245 s/$next_pair_pr_rx[\n]?//o; | |
| 246 my($br_id,$str) = ($1, $2); | |
| 247 # | |
| 248 my($name,$aname,$ahref) = link_info($br_id); | |
| 249 add_index_entry("$str", $ahref); | |
| 250 "$aname$anchor_invisible_mark</a>" . $_; | |
| 251 } | |
| 252 | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
253 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
|
254 local($_) = @_; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
255 s/$next_pair_pr_rx//o; |
| 7711 | 256 my($br_id1,$str1) = ($1, $2); |
| 7760 | 257 s/$next_pair_pr_rx[\n]?//o; |
| 7711 | 258 my($br_id2,$str2) = ($1, $2); |
| 7760 | 259 # |
| 260 my($name,$aname,$ahref) = link_info($br_id1); | |
| 261 add_index_entry("$str1!$str2", $ahref); | |
| 262 add_index_entry("$str2!$str1", $ahref); | |
| 263 "$aname$anchor_invisible_mark</a>" . $_; | |
|
7527
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_indexiii{ |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
267 local($_) = @_; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
268 s/$next_pair_pr_rx//o; |
| 7711 | 269 my($br_id1,$str1) = ($1, $2); |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
270 s/$next_pair_pr_rx//o; |
| 7711 | 271 my($br_id2,$str2) = ($1, $2); |
| 7760 | 272 s/$next_pair_pr_rx[\n]?//o; |
| 7711 | 273 my($br_id3,$str3) = ($1, $2); |
| 7760 | 274 # |
| 275 my($name,$aname,$ahref) = link_info($br_id1); | |
| 276 add_index_entry("$str1!$str2 $str3", $ahref); | |
| 277 add_index_entry("$str2!$str3, $str1", $ahref); | |
| 278 add_index_entry("$str3!$str1 $str2", $ahref); | |
| 279 "$aname$anchor_invisible_mark</a>" . $_; | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
280 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
281 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
282 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
|
283 local($_) = @_; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
284 s/$next_pair_pr_rx//o; |
| 7711 | 285 my($br_id1,$str1) = ($1, $2); |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
286 s/$next_pair_pr_rx//o; |
| 7711 | 287 my($br_id2,$str2) = ($1, $2); |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
288 s/$next_pair_pr_rx//o; |
| 7711 | 289 my($br_id3,$str3) = ($1, $2); |
| 7760 | 290 s/$next_pair_pr_rx[\n]?//o; |
| 7711 | 291 my($br_id4,$str4) = ($1, $2); |
| 7760 | 292 # |
| 293 my($name,$aname,$ahref) = link_info($br_id1); | |
| 294 add_index_entry("$str1!$str2 $str3 $str4", $ahref); | |
| 295 add_index_entry("$str2!$str3 $str4, $str1", $ahref); | |
| 296 add_index_entry("$str3!$str4, $str1 $str2", $ahref); | |
| 297 add_index_entry("$str4!$$str1 $str2 $str3", $ahref); | |
| 298 "$aname$anchor_invisible_mark</a>" . $_; | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
299 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
300 |
| 7711 | 301 sub do_cmd_ttindex{ |
| 302 local($_) = @_; | |
| 7760 | 303 s/$next_pair_pr_rx[\n]?//; |
| 7711 | 304 my($br_id,$str) = ($1, $2); |
| 305 &make_index_entry($br_id, $str . &get_indexsubitem) . $_; | |
| 306 } | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
307 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
308 sub my_typed_index_helper{ |
| 7711 | 309 local($word,$_) = @_; |
| 7760 | 310 s/$next_pair_pr_rx[\n]?//o; |
| 7711 | 311 my($br_id,$str) = ($1, $2); |
| 7760 | 312 # |
| 313 my($name,$aname,$ahref) = link_info($br_id1); | |
| 314 add_index_entry("$str $word", $ahref); | |
| 315 add_index_entry("$word!$str", $ahref); | |
| 316 "$aname$anchor_invisible_mark</a>" . $_; | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
317 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
318 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
319 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
|
320 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
|
321 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
|
322 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
|
323 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
324 sub my_parword_index_helper{ |
| 7711 | 325 local($word,$_) = @_; |
| 7760 | 326 s/$next_pair_pr_rx[\n]?//o; |
| 7711 | 327 my($br_id,$str) = ($1, $2); |
| 7760 | 328 make_index_entry($br_id, "$str ($word)") . $_; |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
329 } |
|
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 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
332 # 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
|
333 # 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
|
334 # myformat.sty. |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
335 # |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
336 # 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
|
337 # |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
338 $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
|
339 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
340 sub make_mod_index_entry{ |
| 7711 | 341 my($br_id,$str,$define) = @_; |
| 7760 | 342 my($name,$aname,$ahref) = link_info($br_id); |
| 343 $str =~ s|<tt>(.*)</tt>|\1| | |
| 344 if $STRIP_INDEX_TT; | |
| 345 # equivalent of add_index_entry() using $define instead of '' | |
| 346 $str = gen_index_id($str, $define); | |
| 347 $index{$str} .= $ahref; | |
| 348 print IDXFILE $ahref, "\0", $str, "\n"; | |
| 349 | |
| 7711 | 350 if ($define eq 'DEF') { |
| 7760 | 351 # add to the module index |
| 7711 | 352 my($nstr,$garbage) = split / /, $str, 2; |
| 7760 | 353 $Modules{$nstr} .= $ahref; |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
354 } |
| 7760 | 355 "$aname$anchor_invisible_mark</a>"; |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
356 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
357 |
| 7711 | 358 $THIS_MODULE = ''; |
| 7760 | 359 $THIS_CLASS = ''; |
| 7711 | 360 |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
361 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
|
362 local($word, $_) = @_; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
363 s/$next_pair_pr_rx[\n]*//o; |
| 7711 | 364 my($br_id, $str) = ($1, $2); |
| 365 my $section_tag = join('', @curr_sec_id); | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
366 $word = "$word " if $word; |
| 7711 | 367 $THIS_MODULE = "$str"; |
| 7760 | 368 make_mod_index_entry("SECTION$section_tag", |
| 369 "<tt>$str</tt> (${word}module)", 'DEF') . $_; | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
370 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
371 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
372 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
|
373 local($word, $_) = @_; |
| 7760 | 374 s/$next_pair_pr_rx[\n]?//o; |
| 7711 | 375 my($br_id, $str) = ($1, $2); |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
376 $word = "$word " if $word; |
| 7760 | 377 make_mod_index_entry($br_id, "<tt>$str</tt> (${word}module)", 'REF') . $_; |
|
7527
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 |
| 7711 | 380 sub do_cmd_bifuncindex{ |
| 381 local($_) = @_; | |
| 7760 | 382 s/$next_pair_pr_rx[\n]?//o; |
| 7711 | 383 my($br_id,$str,$fname) = ($1, $2, "<tt>$2()</tt>"); |
| 384 $fname = "$str()" | |
| 385 if $STRIP_INDEX_TT; | |
| 7760 | 386 make_index_entry($br_id, "$fname (built-in function)") . $_; |
| 7711 | 387 } |
| 388 | |
| 7760 | 389 sub do_cmd_modindex{ my_module_index_helper('', @_); } |
| 390 sub do_cmd_bimodindex{ my_module_index_helper('built-in', @_); } | |
| 391 sub do_cmd_exmodindex{ my_module_index_helper('extension', @_); } | |
| 392 sub do_cmd_stmodindex{ my_module_index_helper('standard', @_); } | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
393 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
394 # these should be adjusted a bit.... |
| 7760 | 395 sub do_cmd_refmodindex{ ref_module_index_helper('', @_); } |
| 396 sub do_cmd_refbimodindex{ ref_module_index_helper('built-in', @_); } | |
| 397 sub do_cmd_refexmodindex{ ref_module_index_helper('extension', @_); } | |
| 398 sub do_cmd_refstmodindex{ ref_module_index_helper('standard', @_); } | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
399 |
| 7760 | 400 sub do_cmd_nodename{ do_cmd_label(@_); } |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
401 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
402 sub init_myformat{ |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
403 # 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
|
404 $anchor_mark = ''; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
405 $icons{'anchor_mark'} = ''; |
| 7760 | 406 my $cmark = "(?:$comment_mark)?"; |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
407 # <<2>>...<<2>> |
| 7760 | 408 $next_pair_rx = "^[\\s\n%]*$O(\\d+)$C([\\s\\S]*)$O\\1$C"; |
| 409 $any_next_pair_rx3 = "[\\s\n%]*$O(\\d+)$C([\\s\\S]*)$O\\3$C"; | |
| 410 $any_next_pair_rx5 = "[\\s\n%]*$O(\\d+)$C([\\s\\S]*)$O\\5$C"; | |
| 411 $any_next_pair_rx7 = "[\\s\n%]*$O(\\d+)$C([\\s\\S]*)$O\\7$C"; | |
| 412 $any_next_pair_rx9 = "[\\s\n%]*$O(\\d+)$C([\\s\\S]*)$O\\9$C"; | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
413 # <#2#>...<#2#> |
| 7760 | 414 $next_pair_pr_rx = "^[\\s\n%]*$OP(\\d+)$CP([\\s\\S]*)$OP\\1$CP$cmark"; |
| 415 $any_next_pair_pr_rx3 = "[\\s\n%]*$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP$cmark"; | |
| 416 $any_next_pair_pr_rx5 = "[\\s\n%]*$OP(\\d+)$CP([\\s\\S]*)$OP\\5$CP$cmark"; | |
| 417 $any_next_pair_pr_rx7 = "[\\s\n%]*$OP(\\d+)$CP([\\s\\S]*)$OP\\7$CP$cmark"; | |
| 418 $any_next_pair_pr_rx9 = "[\\s\n%]*$OP(\\d+)$CP([\\s\\S]*)$OP\\9$CP$cmark"; | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
419 } |
| 7760 | 420 init_myformat(); |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
421 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
422 # 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
|
423 # 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
|
424 # |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
425 sub make_str_index_entry{ |
| 7711 | 426 my($br_id,$str) = @_; |
| 7760 | 427 my($name,$aname,$ahref) = link_info($br_id); |
| 428 $str =~ s|<tt>(.*)</tt>|\1| | |
| 429 if $STRIP_INDEX_TT; | |
| 430 add_index_entry($str, $ahref); | |
| 431 "$aname$str</a>"; | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
432 } |
|
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 # 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
|
435 # 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
|
436 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
437 # (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
|
438 sub replace_verbatim { |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
439 # Modifies $_ |
| 7711 | 440 my($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
|
441 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
|
442 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
|
443 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
444 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
445 # (Used with LaTeX2HTML 98.1) |
| 7760 | 446 # The HTML this produces is bad; the <PRE> is on the outside of the <dl>, |
| 447 # but I haven't found a workaround yet. | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
448 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
|
449 # Modifies $_ |
| 7711 | 450 my($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
|
451 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
|
452 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
|
453 # 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
|
454 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
|
455 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
|
456 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
|
457 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
458 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
459 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
|
460 local($_) = @_; |
| 7711 | 461 my($return_type,$function_name,$arg_list,$idx) = ('', '', '', ''); |
| 462 my $any_next_pair_rx3 = "$O(\\d+)$C([\\s\\S]*)$O\\3$C"; | |
| 463 my $any_next_pair_rx5 = "$O(\\d+)$C([\\s\\S]*)$O\\5$C"; | |
| 464 my $cfuncdesc_rx = "$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5"; | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
465 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
|
466 $return_type = "$2"; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
467 $function_name = "$4"; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
468 $arg_list = "$6"; |
| 7760 | 469 $idx = make_str_index_entry($3, |
| 7711 | 470 "<tt>$function_name()</tt>" . &get_indexsubitem); |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
471 $idx =~ s/ \(.*\)//; |
| 7711 | 472 $idx =~ s/\(\)//; |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
473 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
474 "<dl><dt>$return_type <b>$idx</b>" |
| 7760 | 475 . "(<var>$arg_list</var>)\n<dd>$'</dl>" |
|
7527
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 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
478 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
|
479 local($_) = @_; |
| 7711 | 480 my $type_name = (''); |
| 481 my $cfuncdesc_rx = "$next_pair_rx"; | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
482 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
|
483 $type_name = "$2"; |
| 7760 | 484 $idx = make_str_index_entry($1, |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
485 "<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
|
486 $idx =~ s/ \(.*\)//; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
487 } |
| 7760 | 488 "<dl><dt><b>$idx</b>\n<dd>$'</dl>" |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
489 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
490 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
491 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
|
492 local($_) = @_; |
| 7711 | 493 my($var_type,$var_name,$idx) = ('', '', ''); |
| 494 my $cfuncdesc_rx = "$next_pair_rx$any_next_pair_rx3"; | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
495 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
|
496 $var_type = "$2"; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
497 $var_name = "$4"; |
| 7760 | 498 $idx = make_str_index_entry($3, |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
499 "<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
|
500 $idx =~ s/ \(.*\)//; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
501 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
502 "<dl><dt>$var_type <b>$idx</b>\n" |
| 7760 | 503 . "<dd>$'</dl>"; |
|
7527
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 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
|
507 local($_) = @_; |
| 7711 | 508 my($function_name,$arg_list,$idx) = ('', '', ''); |
| 509 my $funcdesc_rx = "$next_pair_rx$any_next_pair_rx3"; | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
510 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
|
511 $function_name = "$2"; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
512 $arg_list = "$4"; |
| 7760 | 513 $idx = make_str_index_entry($3, "<tt>$function_name()</tt>" |
| 7711 | 514 . &get_indexsubitem); |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
515 $idx =~ s/ \(.*\)//; |
| 7711 | 516 $idx =~ s/\(\)//; |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
517 } |
| 7760 | 518 "<dl><dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>$'</dl>"; |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
519 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
520 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
521 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
|
522 local($_) = @_; |
| 7711 | 523 my($function_name,$arg_list,$idx) = ('', '', ''); |
| 524 my $funcdesc_rx = "$next_pair_rx$any_next_pair_rx3"; | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
525 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
|
526 $function_name = "$2"; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
527 $arg_list = "$4"; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
528 if ($STRIP_INDEX_TT) { |
| 7711 | 529 $idx = "$function_name"; } |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
530 else { |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
531 $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
|
532 } |
| 7760 | 533 "<dl><dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>$'</dl>"; |
|
7527
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 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
536 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
|
537 local($_) = @_; |
| 7711 | 538 my $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
|
539 |
| 7711 | 540 s/$next_pair_pr_rx//o; |
| 541 my $function_name = $2; | |
| 542 s/$next_pair_pr_rx//o; | |
| 543 my($br_id,$arg_list) = ($1, $2); | |
| 7760 | 544 my $idx = make_str_index_entry($br_id, "<tt>$function_name()</tt>" |
| 545 . &get_indexsubitem); | |
| 7711 | 546 $idx =~ s/\(\)//; |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
547 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
548 "<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
|
549 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
550 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
551 # 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
|
552 # 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
|
553 # module. |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
554 # |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
555 $INDEX_OPCODES = 0; |
|
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_env_opcodedesc{ |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
558 local($_) = @_; |
| 7711 | 559 my($opcode_name,$arg_list,$stuff,$idx) = ('', '', '', ''); |
| 560 my $opcodedesc_rx = "$next_pair_rx$any_next_pair_rx3"; | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
561 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
|
562 $opcode_name = "$2"; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
563 $arg_list = "$4"; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
564 if ($INDEX_OPCODES) { |
| 7760 | 565 $idx = make_str_index_entry($3, |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
566 "<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
|
567 $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
|
568 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
569 else { |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
570 $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
|
571 } |
|
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 $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
|
574 if ($arg_list) { |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
575 $stuff .= " <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
|
576 } |
| 7760 | 577 $stuff . "\n<dd>$'</dl>"; |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
578 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
579 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
580 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
|
581 local($_) = @_; |
| 7711 | 582 my $idx = ''; |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
583 if (/$next_pair_rx/o) { |
| 7760 | 584 $idx = make_str_index_entry($1, "<tt>$2</tt>" . &get_indexsubitem); |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
585 $idx =~ s/ \(.*\)//; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
586 } |
| 7760 | 587 "<dl><dt><b>$idx</b>\n<dd>$'</dl>" |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
588 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
589 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
590 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
|
591 local($_) = @_; |
| 7711 | 592 my $idx = ''; |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
593 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
|
594 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
|
595 $idx = "$2"; } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
596 else { |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
597 $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
|
598 } |
| 7760 | 599 "<dl><dt><b>$idx</b>\n<dd>$'</dl>" |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
600 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
601 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
602 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
|
603 local($_) = @_; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
604 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
605 s/$next_pair_pr_rx//o; |
| 7711 | 606 my($br_id, $data_name) = ($1, $2); |
| 7760 | 607 my $idx = make_str_index_entry($br_id, "<tt>$data_name</tt>" |
| 608 . &get_indexsubitem); | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
609 $idx =~ s/ \(.*\)//; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
610 |
| 7760 | 611 "<dt><b>$idx</b><dd>" . $_; |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
612 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
613 |
| 7760 | 614 sub do_env_excdesc{ |
| 615 local($_) = @_; | |
| 616 /$next_pair_rx/o; | |
| 617 my($br_id,$excname,$rest) = ($1, $2, $'); | |
| 618 my $idx = make_str_index_entry($br_id, | |
| 619 "<tt>$excname</tt> (exception in $THIS_MODULE)"); | |
| 620 $idx =~ s/ \(.*\)//; | |
| 621 "<dl><dt><b>$idx</b>\n<dd>$rest</dl>" | |
| 622 } | |
| 623 | |
| 624 sub do_env_fulllineitems{ do_env_itemize(@_); } | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
625 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
626 |
| 7711 | 627 sub do_env_classdesc{ |
| 628 local($_) = @_; | |
| 7760 | 629 my($class_name,$arg_list,$idx) = ('', '', ''); |
| 7711 | 630 my $funcdesc_rx = "$next_pair_rx$any_next_pair_rx3"; |
| 631 if (/$funcdesc_rx/o) { | |
| 7760 | 632 $class_name = "$2"; |
| 7711 | 633 $arg_list = "$4"; |
| 7760 | 634 $THIS_CLASS = $class_name; |
| 635 $idx = make_str_index_entry($3, | |
| 636 "<tt>$class_name</tt> (class in $THIS_MODULE)" ); | |
| 7711 | 637 $idx =~ s/ \(.*\)//; |
| 638 } | |
| 7760 | 639 "<dl><dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>$'</dl>"; |
| 640 } | |
| 641 | |
| 642 | |
| 643 sub do_env_methoddesc{ | |
| 644 local($_) = @_; | |
| 645 my($class_name,$arg_list,$idx,$extra); | |
| 646 # Predefined $opt_arg_rx & $optional_arg_rx don't work because they | |
| 647 # require the argument to be there. | |
| 648 my $opt_arg_rx = "^\\s*(\\[([^]]*)\\])?"; | |
| 649 my $funcdesc_rx = "$opt_arg_rx$any_next_pair_rx3$any_next_pair_rx5"; | |
| 650 if (/$funcdesc_rx/o) { | |
| 651 $class_name = $2; | |
| 652 $class_name = $THIS_CLASS | |
| 653 unless $class_name; | |
| 654 $method_name = $4; | |
| 655 $arg_list = $6; | |
| 656 if ($class_name) { | |
| 657 $extra = " ($class_name method)"; | |
| 658 } | |
| 659 $idx = make_str_index_entry($3, "<tt>$method_name()</tt>$extra"); | |
| 660 $idx =~ s/ \(.*\)//; | |
| 661 $idx =~ s/\(\)//; | |
| 662 } | |
| 663 "<dl><dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>$'</dl>"; | |
| 7711 | 664 } |
| 665 | |
| 7760 | 666 |
| 667 sub do_env_methoddescni{ | |
| 668 local($_) = @_; | |
| 669 # Predefined $opt_arg_rx & $optional_arg_rx don't work because they | |
| 670 # require the argument to be there. | |
| 671 my $opt_arg_rx = "^\\s*(\\[([^]]*)\\])?"; | |
| 672 my $funcdesc_rx = "$opt_arg_rx$any_next_pair_rx3$any_next_pair_rx5"; | |
| 673 /$funcdesc_rx/o; | |
| 674 my $method = $4; | |
| 675 my $arg_list = $6; | |
| 676 "<dl><dt><b>$method</b> (<var>$arg_list</var>)\n<dd>$'</dl>"; | |
| 677 } | |
| 678 | |
| 679 | |
| 680 sub do_env_memberdesc{ | |
| 681 local($_) = @_; | |
| 682 # Predefined $opt_arg_rx & $optional_arg_rx don't work because they | |
| 683 # require the argument to be there. | |
| 684 my $opt_arg_rx = "^\\s*(\\[([^]]*)\\])?"; | |
| 685 my $funcdesc_rx = "$opt_arg_rx$any_next_pair_rx3$any_next_pair_rx5"; | |
| 686 /$funcdesc_rx/o; | |
| 687 my($class,$member,$arg_list) = ($2, $4, $6); | |
| 688 $class = $THIS_CLASS | |
| 689 unless $class; | |
| 690 $extra = " ($class_name attribute)" | |
| 691 if $class; | |
| 692 my $idx = make_str_index_entry($3, "<tt>$member()</tt>$extra"); | |
| 693 $idx =~ s/ \(.*\)//; | |
| 694 $idx =~ s/\(\)//; | |
| 695 "<dl><dt><b>$idx</b>\n<dd>$'</dl>"; | |
| 696 } | |
| 697 | |
| 698 | |
| 699 sub do_env_memberdescni{ | |
| 700 local($_) = @_; | |
| 701 # Predefined $opt_arg_rx & $optional_arg_rx don't work because they | |
| 702 # require the argument to be there. | |
| 703 my $opt_arg_rx = "^\\s*(\\[([^]]*)\\])?"; | |
| 704 my $funcdesc_rx = "$opt_arg_rx$any_next_pair_rx3"; | |
| 705 /$funcdesc_rx/o; | |
| 706 my $member = $4; | |
| 707 "<dl><dt><b>$member</b>\n<dd>$'</dl>"; | |
| 708 } | |
| 709 | |
| 710 | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
711 @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
|
712 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
713 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
|
714 local($_) = @_; |
| 7711 | 715 my($j1,$a1,$a2,$a3,$j4) = split(/[|]/,$_); |
| 716 my($th1,$th2,$th3) = ('<th>', '<th>', '<th>'); | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
717 $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
|
718 $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
|
719 $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
|
720 # 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
|
721 $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
|
722 : ($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
|
723 $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
|
724 : ($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
|
725 $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
|
726 : ($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
|
727 ($th1, $th2, $th3); |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
728 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
729 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
730 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
|
731 local($_) = @_; |
| 7711 | 732 my($font,$h1,$h2) = ('', '', ''); |
| 733 my $tableiii_rx = | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
734 "$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
|
735 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
|
736 $font = $4; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
737 $h1 = $6; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
738 $h2 = $8; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
739 } |
| 7760 | 740 my($th1,$th2,$th3) = setup_column_alignments($2); |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
741 $globals{"lineifont"} = $font; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
742 "<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
|
743 . "\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
|
744 . "\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
|
745 . "\n</table>"; |
|
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 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
|
749 local($_) = @_; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
750 s/$next_pair_pr_rx//o; |
| 7711 | 751 my $c1 = $2; |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
752 s/$next_pair_pr_rx//o; |
| 7711 | 753 my $c2 = $2; |
| 754 my $font = $globals{"lineifont"}; | |
| 755 my($c1align,$c2align) = @col_aligns[0,1]; | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
756 "<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
|
757 . " $c2align$c2</td>$'"; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
758 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
759 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
760 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
|
761 local($_) = @_; |
| 7711 | 762 my($font,$h1,$h2,$h3) = ('', '', '', ''); |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
763 |
| 7711 | 764 my $tableiii_rx = |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
765 "$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
|
766 . "$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
|
767 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
|
768 $font = $4; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
769 $h1 = $6; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
770 $h2 = $8; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
771 $h3 = $10; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
772 } |
| 7760 | 773 my($th1,$th2,$th3) = setup_column_alignments($2); |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
774 $globals{"lineifont"} = $font; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
775 "<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
|
776 . "\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
|
777 . "\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
|
778 . "\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
|
779 . "\n</table>"; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
780 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
781 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
782 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
|
783 local($_) = @_; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
784 s/$next_pair_pr_rx//o; |
| 7711 | 785 my $c1 = $2; |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
786 s/$next_pair_pr_rx//o; |
| 7711 | 787 my $c2 = $2; |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
788 s/$next_pair_pr_rx//o; |
| 7711 | 789 my $c3 = $2; |
| 790 my $font = $globals{"lineifont"}; | |
| 791 my($c1align, $c2align, $c3align) = @col_aligns; | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
792 "<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
|
793 . " $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
|
794 . " $c3align$c3</td>$'"; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
795 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
796 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
797 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
|
798 "<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
|
799 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
800 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
801 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
|
802 # 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
|
803 # 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
|
804 local($_) = @_; |
| 7711 | 805 my $any_next_pair_pr_rx3 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP"; |
| 806 my $any_next_pair_pr_rx5 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\5$CP"; | |
| 807 # Predefined $opt_arg_rx & $optional_arg_rx don't work because they | |
| 808 # require the argument to be there. | |
| 809 my $opt_arg_rx = "^\\s*(\\[([^]]*)\\])?"; | |
| 810 s/$opt_arg_rx$any_next_pair_pr_rx3$any_next_pair_pr_rx5//; | |
| 811 my($key,$module,$text) = ($2, $4, $6); | |
| 812 $key = $module unless $key; | |
|
7581
0f565c7fe4bb
Misc. revisions to LaTeX2HTML support.
Fred Drake <fdrake@acm.org>
parents:
7563
diff
changeset
|
813 "<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
|
814 . " ($text)</p>" |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
815 . $_; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
816 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
817 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
818 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
|
819 "<p>" . @_[0]; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
820 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
821 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
822 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
823 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
|
824 local($_) = @_; |
| 7711 | 825 my $the_title = ''; |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
826 if ($t_title) { |
| 7711 | 827 $the_title .= "<h1 align=center>$t_title</h1>"; |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
828 } else { &write_warnings("\nThis document has no title."); } |
| 7711 | 829 $the_title .= "\n<center>"; |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
830 if ($t_author) { |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
831 if ($t_authorURL) { |
| 7711 | 832 my $href = &translate_commands($t_authorURL); |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
833 $href = &make_named_href('author', $href, "<strong>${t_author}</strong>"); |
| 7711 | 834 $the_title .= "\n<p>$href</p>"; |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
835 } else { |
| 7711 | 836 $the_title .= "\n<p><strong>$t_author</strong></p>"; |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
837 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
838 } 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
|
839 if ($t_institute) { |
| 7711 | 840 $the_title .= "\n<p>$t_institute</p>";} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
841 if ($AUTHOR_ADDRESS) { |
| 7711 | 842 $the_title .= "\n<p>$AUTHOR_ADDRESS</p>";} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
843 if ($t_affil) { |
| 7711 | 844 $the_title .= "\n<p><i>$t_affil</i></p>";} |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
845 if ($t_date) { |
| 7711 | 846 $the_title .= "\n<p><strong>$t_date</strong>"; |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
847 if ($PYTHON_VERSION) { |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
848 $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
|
849 $the_title .= "</p>" |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
850 } |
| 7711 | 851 $the_title .= "\n</center>"; |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
852 if ($t_address) { |
| 7711 | 853 $the_title .= "\n<p>$t_address</p>"; |
| 854 } else { $the_title .= "\n<p>"} | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
855 if ($t_email) { |
| 7711 | 856 $the_title .= "\n<p>$t_email</p>"; |
| 857 }# else { $the_title .= "</p>" } | |
| 858 $the_title . "<hr>\n" . $_ ; | |
|
7527
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
859 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
860 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
861 |
| 7760 | 862 # sub do_cmd_indexlabel{ |
| 863 # "genindex" . @_[0]; | |
| 864 # } | |
| 7711 | 865 |
|
7671
0cf2ffaf4bd7
Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents:
7581
diff
changeset
|
866 |
|
0cf2ffaf4bd7
Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents:
7581
diff
changeset
|
867 # 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
|
868 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
869 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
|
870 # 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
|
871 # 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
|
872 # 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
|
873 # 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
|
874 # 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
|
875 local($_) = @_; |
| 7711 | 876 s|$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
|
877 $_; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
878 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
879 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
880 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
|
881 local($_) = @_; |
| 7711 | 882 s|$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
|
883 $_; |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
884 } |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
885 |
|
26a8771a4cfd
Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
886 1; # This must be the last line |
