annotate Doc/perl/python.perl @ 12637:69481cde511d legacy-trunk

do_cmd_seeurl(): New function.
author Fred Drake <fdrake@acm.org>
date Tue, 09 May 2000 16:17:51 +0000
parents bef675dc11cc
children 59e494c0802f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1 # python.perl by Fred L. Drake, Jr. <fdrake@acm.org> -*- perl -*-
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
2 #
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
3 # Heavily based on Guido van Rossum's myformat.perl (now obsolete).
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
4 #
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
5 # Extension to LaTeX2HTML for documents using myformat.sty.
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
6 # Subroutines of the form do_cmd_<name> here define translations
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
7 # for LaTeX commands \<name> defined in the corresponding .sty file.
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
8
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
9 package main;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
10
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
11
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
12 sub next_argument{
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
13 my $param;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
14 $param = missing_braces()
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
15 unless ((s/$next_pair_pr_rx/$param=$2;''/eo)
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
16 ||(s/$next_pair_rx/$param=$2;''/eo));
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
17 return $param;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
18 }
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
19
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
20 sub next_optional_argument{
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
21 my($param,$rx) = ('', "^\\s*(\\[([^]]*)\\])?");
8086
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
22 s/$rx/$param=$2;''/eo;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
23 return $param;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
24 }
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
25
8344
d2d82f7b419a do_cmd_let(): Simple implementation to allow \let to be used to establish
Fred Drake <fdrake@acm.org>
parents: 8342
diff changeset
26
d2d82f7b419a do_cmd_let(): Simple implementation to allow \let to be used to establish
Fred Drake <fdrake@acm.org>
parents: 8342
diff changeset
27 # This is a fairly simple hack; it supports \let when it is used to create
d2d82f7b419a do_cmd_let(): Simple implementation to allow \let to be used to establish
Fred Drake <fdrake@acm.org>
parents: 8342
diff changeset
28 # (or redefine) a macro to exactly be some other macro: \let\newname=\oldname.
8349
4172da91441a Revise comment about \let support a little to more accurately reflect the
Fred Drake <fdrake@acm.org>
parents: 8346
diff changeset
29 # Many possible uses of \let aren't supported or aren't supported correctly.
8344
d2d82f7b419a do_cmd_let(): Simple implementation to allow \let to be used to establish
Fred Drake <fdrake@acm.org>
parents: 8342
diff changeset
30 #
d2d82f7b419a do_cmd_let(): Simple implementation to allow \let to be used to establish
Fred Drake <fdrake@acm.org>
parents: 8342
diff changeset
31 sub do_cmd_let{
d2d82f7b419a do_cmd_let(): Simple implementation to allow \let to be used to establish
Fred Drake <fdrake@acm.org>
parents: 8342
diff changeset
32 local($_) = @_;
d2d82f7b419a do_cmd_let(): Simple implementation to allow \let to be used to establish
Fred Drake <fdrake@acm.org>
parents: 8342
diff changeset
33 my $matched = 0;
8346
1b393db00b1a Extend handling for \let a bit, to also allow \let\something=<character>. We
Fred Drake <fdrake@acm.org>
parents: 8344
diff changeset
34 s/[\\]([a-zA-Z]+)\s*(=\s*)?[\\]([a-zA-Z]*)/$matched=1; ''/e;
8344
d2d82f7b419a do_cmd_let(): Simple implementation to allow \let to be used to establish
Fred Drake <fdrake@acm.org>
parents: 8342
diff changeset
35 if ($matched) {
d2d82f7b419a do_cmd_let(): Simple implementation to allow \let to be used to establish
Fred Drake <fdrake@acm.org>
parents: 8342
diff changeset
36 my($new, $old) = ($1, $3);
d2d82f7b419a do_cmd_let(): Simple implementation to allow \let to be used to establish
Fred Drake <fdrake@acm.org>
parents: 8342
diff changeset
37 eval "sub do_cmd_$new { do_cmd_$old" . '(@_); }';
d2d82f7b419a do_cmd_let(): Simple implementation to allow \let to be used to establish
Fred Drake <fdrake@acm.org>
parents: 8342
diff changeset
38 print "\ndefining handler for \\$new using \\$old\n";
d2d82f7b419a do_cmd_let(): Simple implementation to allow \let to be used to establish
Fred Drake <fdrake@acm.org>
parents: 8342
diff changeset
39 }
8346
1b393db00b1a Extend handling for \let a bit, to also allow \let\something=<character>. We
Fred Drake <fdrake@acm.org>
parents: 8344
diff changeset
40 else {
1b393db00b1a Extend handling for \let a bit, to also allow \let\something=<character>. We
Fred Drake <fdrake@acm.org>
parents: 8344
diff changeset
41 s/[\\]([a-zA-Z]+)\s*(=\s*)?([^\\])/$matched=1; ''/es;
1b393db00b1a Extend handling for \let a bit, to also allow \let\something=<character>. We
Fred Drake <fdrake@acm.org>
parents: 8344
diff changeset
42 if ($matched) {
1b393db00b1a Extend handling for \let a bit, to also allow \let\something=<character>. We
Fred Drake <fdrake@acm.org>
parents: 8344
diff changeset
43 my($new, $char) = ($1, $3);
1b393db00b1a Extend handling for \let a bit, to also allow \let\something=<character>. We
Fred Drake <fdrake@acm.org>
parents: 8344
diff changeset
44 eval "sub do_cmd_$new { \"\\$char\" . \@_[0]; }";
1b393db00b1a Extend handling for \let a bit, to also allow \let\something=<character>. We
Fred Drake <fdrake@acm.org>
parents: 8344
diff changeset
45 print "\ndefining handler for \\$new to insert '$char'\n";
1b393db00b1a Extend handling for \let a bit, to also allow \let\something=<character>. We
Fred Drake <fdrake@acm.org>
parents: 8344
diff changeset
46 }
1b393db00b1a Extend handling for \let a bit, to also allow \let\something=<character>. We
Fred Drake <fdrake@acm.org>
parents: 8344
diff changeset
47 else {
1b393db00b1a Extend handling for \let a bit, to also allow \let\something=<character>. We
Fred Drake <fdrake@acm.org>
parents: 8344
diff changeset
48 write_warnings("Could not interpret \\let construct...");
1b393db00b1a Extend handling for \let a bit, to also allow \let\something=<character>. We
Fred Drake <fdrake@acm.org>
parents: 8344
diff changeset
49 }
1b393db00b1a Extend handling for \let a bit, to also allow \let\something=<character>. We
Fred Drake <fdrake@acm.org>
parents: 8344
diff changeset
50 }
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
51 return $_;
8344
d2d82f7b419a do_cmd_let(): Simple implementation to allow \let to be used to establish
Fred Drake <fdrake@acm.org>
parents: 8342
diff changeset
52 }
d2d82f7b419a do_cmd_let(): Simple implementation to allow \let to be used to establish
Fred Drake <fdrake@acm.org>
parents: 8342
diff changeset
53
d2d82f7b419a do_cmd_let(): Simple implementation to allow \let to be used to establish
Fred Drake <fdrake@acm.org>
parents: 8342
diff changeset
54
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
55 # 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
56
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
57 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
58 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
59 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
60 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
61 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
62 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
63 sub do_cmd_EOF{ 'EOF' . @_[0]; }
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
64 sub do_cmd_NULL{ '<tt class="constant">NULL</tt>' . @_[0]; }
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_e{ '&#92;' . @_[0]; }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
67
8342
22815a0b1267 Added support for \developer, \developers, \developersaddress.
Fred Drake <fdrake@acm.org>
parents: 8294
diff changeset
68 $DEVELOPER_ADDRESS = '';
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
69 $PYTHON_VERSION = '';
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
70
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
71 sub do_cmd_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
72 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
73 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
74 $PYTHON_VERSION = next_argument();
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
75 return $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
76 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
77
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
78 sub do_cmd_authoraddress{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
79 local($_) = @_;
8342
22815a0b1267 Added support for \developer, \developers, \developersaddress.
Fred Drake <fdrake@acm.org>
parents: 8294
diff changeset
80 $DEVELOPER_ADDRESS = next_argument();
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
81 return $_;
7527
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
8344
d2d82f7b419a do_cmd_let(): Simple implementation to allow \let to be used to establish
Fred Drake <fdrake@acm.org>
parents: 8342
diff changeset
84 #sub do_cmd_developer{ do_cmd_author(@_[0]); }
d2d82f7b419a do_cmd_let(): Simple implementation to allow \let to be used to establish
Fred Drake <fdrake@acm.org>
parents: 8342
diff changeset
85 #sub do_cmd_developers{ do_cmd_author(@_[0]); }
d2d82f7b419a do_cmd_let(): Simple implementation to allow \let to be used to establish
Fred Drake <fdrake@acm.org>
parents: 8342
diff changeset
86 #sub do_cmd_developersaddress{ do_cmd_authoraddress(@_[0]); }
8342
22815a0b1267 Added support for \developer, \developers, \developersaddress.
Fred Drake <fdrake@acm.org>
parents: 8294
diff changeset
87
7527
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_hackscore{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
89 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
90 next_argument();
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
91 return '_' . $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
92 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
93
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
94 sub use_wrappers{
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
95 local($_,$before,$after) = @_;
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
96 my $stuff = next_argument();
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
97 return $before . $stuff . $after . $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
98 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
99
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
100 sub use_sans_serif{
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
101 return use_wrappers(@_[0], '<font face="sans-serif">', '</font>');
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
102 }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
103 sub use_italics{
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
104 return use_wrappers(@_[0], '<i>', '</i>');
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
105 }
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
106
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
107 sub do_cmd_optional{
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
108 return use_wrappers(@_[0], "</var><big>\[</big><var>",
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
109 "</var><big>\]</big><var>");
7802
dffe1e470e6c Match python.sty a little better.
Fred Drake <fdrake@acm.org>
parents: 7798
diff changeset
110 }
dffe1e470e6c Match python.sty a little better.
Fred Drake <fdrake@acm.org>
parents: 7798
diff changeset
111
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
112 # Logical formatting (some based on texinfo), needs to be converted to
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
113 # minimalist HTML. The "minimalist" is primarily to reduce the size of
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
114 # output files for users that read them over the network rather than
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
115 # 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
116
10464
f74ef1971bd1 Remove \platformof support, since it's been removed from the LaTeX
Fred Drake <fdrake@acm.org>
parents: 10327
diff changeset
117 # \file and \samp are at the end of this file since they screw up fontlock.
f74ef1971bd1 Remove \platformof support, since it's been removed from the LaTeX
Fred Drake <fdrake@acm.org>
parents: 10327
diff changeset
118
10100
9184862bd8d1 More magic to tighten up a little of the formatting.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
119 sub do_cmd_pytype{ return @_[0]; }
9184862bd8d1 More magic to tighten up a little of the formatting.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
120 sub do_cmd_makevar{ return @_[0]; }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
121 sub do_cmd_code{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
122 return use_wrappers(@_[0], '<code>', '</code>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
123 sub do_cmd_module{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
124 return use_wrappers(@_[0], '<tt class="module">', '</tt>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
125 sub do_cmd_keyword{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
126 return use_wrappers(@_[0], '<tt class="keyword">', '</tt>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
127 sub do_cmd_exception{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
128 return use_wrappers(@_[0], '<tt class="exception">', '</tt>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
129 sub do_cmd_class{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
130 return use_wrappers(@_[0], '<tt class="class">', '</tt>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
131 sub do_cmd_function{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
132 return use_wrappers(@_[0], '<tt class="function">', '</tt>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
133 sub do_cmd_constant{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
134 return use_wrappers(@_[0], '<tt class="constant">', '</tt>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
135 sub do_cmd_member{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
136 return use_wrappers(@_[0], '<tt class="member">', '</tt>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
137 sub do_cmd_method{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
138 return use_wrappers(@_[0], '<tt class="method">', '</tt>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
139 sub do_cmd_cfunction{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
140 return use_wrappers(@_[0], '<tt class="cfunction">', '</tt>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
141 sub do_cmd_cdata{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
142 return use_wrappers(@_[0], '<tt class="cdata">', '</tt>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
143 sub do_cmd_ctype{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
144 return use_wrappers(@_[0], '<tt class="ctype">', '</tt>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
145 sub do_cmd_regexp{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
146 return use_wrappers(@_[0], '<tt class="regexp">', '</tt>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
147 sub do_cmd_character{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
148 return use_wrappers(@_[0], '"<tt class="character">', '</tt>"'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
149 sub do_cmd_program{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
150 return use_wrappers(@_[0], '<b class="program">', '</b>'); }
11449
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
151 sub do_cmd_programopt{
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
152 return use_wrappers(@_[0], '<b class="programopt">', '</b>'); }
12376
6ce6c23acd14 do_cmd_longprogramopt(): New function.
Fred Drake <fdrake@acm.org>
parents: 12350
diff changeset
153 sub do_cmd_longprogramopt{
6ce6c23acd14 do_cmd_longprogramopt(): New function.
Fred Drake <fdrake@acm.org>
parents: 12350
diff changeset
154 # note that the --- will be later converted to -- by LaTeX2HTML
6ce6c23acd14 do_cmd_longprogramopt(): New function.
Fred Drake <fdrake@acm.org>
parents: 12350
diff changeset
155 return use_wrappers(@_[0], '<b class="programopt">---', '</b>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
156 sub do_cmd_email{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
157 return use_wrappers(@_[0], '<span class="email">', '</span>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
158 sub do_cmd_mimetype{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
159 return use_wrappers(@_[0], '<span class="mimetype">', '</span>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
160 sub do_cmd_var{
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
161 return use_wrappers(@_[0], "<var>", "</var>"); }
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
162 sub do_cmd_dfn{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
163 return use_wrappers(@_[0], '<i class="dfn">', '</i>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
164 sub do_cmd_emph{
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
165 return use_italics(@_); }
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
166 sub do_cmd_file{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
167 return use_wrappers(@_[0],
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
168 '<font class="file" face="sans-serif">',
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
169 '</font>'); }
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
170 sub do_cmd_filenq{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
171 return do_cmd_file(@_[0]); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
172 sub do_cmd_samp{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
173 return use_wrappers(@_[0], '"<tt class="samp">', '</tt>"'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
174 sub do_cmd_kbd{
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
175 return use_wrappers(@_[0], '<kbd>', '</kbd>'); }
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
176 sub do_cmd_strong{
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
177 return use_wrappers(@_[0], '<b>', '</b>'); }
10464
f74ef1971bd1 Remove \platformof support, since it's been removed from the LaTeX
Fred Drake <fdrake@acm.org>
parents: 10327
diff changeset
178 sub do_cmd_textbf{
f74ef1971bd1 Remove \platformof support, since it's been removed from the LaTeX
Fred Drake <fdrake@acm.org>
parents: 10327
diff changeset
179 return use_wrappers(@_[0], '<b>', '</b>'); }
f74ef1971bd1 Remove \platformof support, since it's been removed from the LaTeX
Fred Drake <fdrake@acm.org>
parents: 10327
diff changeset
180 sub do_cmd_textit{
f74ef1971bd1 Remove \platformof support, since it's been removed from the LaTeX
Fred Drake <fdrake@acm.org>
parents: 10327
diff changeset
181 return use_wrappers(@_[0], '<i>', '</i>'); }
f74ef1971bd1 Remove \platformof support, since it's been removed from the LaTeX
Fred Drake <fdrake@acm.org>
parents: 10327
diff changeset
182
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
183
9867
c95fff8f180a do_cmd_refmodule(): New function to support new \refmodule macro.
Fred Drake <fdrake@acm.org>
parents: 9848
diff changeset
184 sub do_cmd_refmodule{
c95fff8f180a do_cmd_refmodule(): New function to support new \refmodule macro.
Fred Drake <fdrake@acm.org>
parents: 9848
diff changeset
185 # Insert the right magic to jump to the module definition.
c95fff8f180a do_cmd_refmodule(): New function to support new \refmodule macro.
Fred Drake <fdrake@acm.org>
parents: 9848
diff changeset
186 local($_) = @_;
c95fff8f180a do_cmd_refmodule(): New function to support new \refmodule macro.
Fred Drake <fdrake@acm.org>
parents: 9848
diff changeset
187 my $key = next_optional_argument();
c95fff8f180a do_cmd_refmodule(): New function to support new \refmodule macro.
Fred Drake <fdrake@acm.org>
parents: 9848
diff changeset
188 my $module = next_argument();
c95fff8f180a do_cmd_refmodule(): New function to support new \refmodule macro.
Fred Drake <fdrake@acm.org>
parents: 9848
diff changeset
189 $key = $module
c95fff8f180a do_cmd_refmodule(): New function to support new \refmodule macro.
Fred Drake <fdrake@acm.org>
parents: 9848
diff changeset
190 unless $key;
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
191 return "<tt class='module'><a href='module-$key.html'>$module</a></tt>"
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
192 . $_;
9867
c95fff8f180a do_cmd_refmodule(): New function to support new \refmodule macro.
Fred Drake <fdrake@acm.org>
parents: 9848
diff changeset
193 }
c95fff8f180a do_cmd_refmodule(): New function to support new \refmodule macro.
Fred Drake <fdrake@acm.org>
parents: 9848
diff changeset
194
7779
1c420699d58a Implemented one more special markup item.
Fred Drake <fdrake@acm.org>
parents: 7760
diff changeset
195 sub do_cmd_newsgroup{
1c420699d58a Implemented one more special markup item.
Fred Drake <fdrake@acm.org>
parents: 7760
diff changeset
196 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
197 my $newsgroup = next_argument();
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
198 my $stuff = "<span class='newsgroup'><a href='news:$newsgroup'>"
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
199 . "$newsgroup</a></span>";
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
200 return $stuff . $_;
7779
1c420699d58a Implemented one more special markup item.
Fred Drake <fdrake@acm.org>
parents: 7760
diff changeset
201 }
7671
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
202
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
203 sub do_cmd_envvar{
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
204 local($_) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
205 my $envvar = next_argument();
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
206 my($name,$aname,$ahref) = new_link_info();
7909
5eafd3eda0af Remove option to strip out <tt>...</tt> from index entry text; this is now
Fred Drake <fdrake@acm.org>
parents: 7906
diff changeset
207 # The <tt> here is really to keep buildindex.py from making
5eafd3eda0af Remove option to strip out <tt>...</tt> from index entry text; this is now
Fred Drake <fdrake@acm.org>
parents: 7906
diff changeset
208 # the variable name case-insensitive.
5eafd3eda0af Remove option to strip out <tt>...</tt> from index entry text; this is now
Fred Drake <fdrake@acm.org>
parents: 7906
diff changeset
209 add_index_entry("environment variables!$envvar@<tt>\$$envvar</tt>",
5eafd3eda0af Remove option to strip out <tt>...</tt> from index entry text; this is now
Fred Drake <fdrake@acm.org>
parents: 7906
diff changeset
210 $ahref);
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
211 add_index_entry("$envvar@\$$envvar", $ahref);
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
212 $aname =~ s/<a/<a class="envvar"/;
11316
00d577e44d34 Remove some <SPAN> elements that were used only to carry a CLASS
Fred Drake <fdrake@acm.org>
parents: 11313
diff changeset
213 return "$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
214 }
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
215
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
216 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
217 # 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
218 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
219 my $url = next_argument();
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
220 $url =~ s/~/&#126;/g;
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
221 return "<a class=\"url\" href=\"$url\">$url</a>" . $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
222 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
223
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
224 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
225 # 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
226 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
227 my $page = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
228 my $section = next_argument();
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
229 return "<span class='manpage'><i>$page</i>($section)</span>" . $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
230 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
231
12499
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
232 sub get_rfc_url{
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
233 my $rfcnum = sprintf("%04d", @_[0]);
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
234 return "http://www.ietf.org/rfc/rfc$rfcnum.txt";
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
235 }
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
236
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
237 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
238 local($_) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
239 my $rfcnumber = next_argument();
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
240 my $id = "rfcref-" . ++$global{'max_id'};
12499
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
241 my $href = get_rfc_url($rfcnumber);
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
242 # Save the reference
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
243 my $nstr = gen_index_id("RFC!RFC $rfcnumber", '');
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
244 $index{$nstr} .= make_half_href("$CURRENT_FILE#$id");
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
245 return ("<a class=\"rfc\" name=\"$id\"\nhref=\"$href\">RFC $rfcnumber</a>"
11313
b1bb6d7a335f do_cmd_rfc(): Simplify the generated markup.
Fred Drake <fdrake@acm.org>
parents: 11123
diff changeset
246 . $_);
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
247 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
248
11449
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
249 sub do_cmd_citetitle{
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
250 local($_) = @_;
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
251 my $url = next_optional_argument();
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
252 my $title = next_argument();
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
253 my $repl = '';
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
254 if ($url) {
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
255 $repl = ("<em class='citetitle'><a\n"
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
256 . " href='$url'\n"
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
257 . " title='$title'\n"
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
258 . " >$title</a></em>");
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
259 }
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
260 else {
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
261 $repl = "<em class='citetitle'\n >$title</em>";
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
262 }
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
263 return $repl . $_;
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
264 }
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
265
7527
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_deprecated{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
267 # 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
268 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
269 my $release = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
270 my $reason = next_argument();
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
271 return "<b>Deprecated since release $release.</b>\n$reason<p>" . $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
272 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
273
8763
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
274 sub do_cmd_versionadded{
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
275 # one parameter: \versionadded{version}
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
276 local($_) = @_;
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
277 my $release = next_argument();
10077
80b215249b17 Make \versionadded and \versionchanged less prominant -- neither bold
Fred Drake <fdrake@acm.org>
parents: 9867
diff changeset
278 return "\nNew in version $release.\n" . $_;
8763
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
279 }
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
280
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
281 sub do_cmd_versionchanged{
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
282 # one parameter: \versionchanged{version}
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
283 local($_) = @_;
12551
bef675dc11cc do_cmd_versionchanged():
Fred Drake <fdrake@acm.org>
parents: 12499
diff changeset
284 my $explanation = next_optional_argument();
8763
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
285 my $release = next_argument();
12551
bef675dc11cc do_cmd_versionchanged():
Fred Drake <fdrake@acm.org>
parents: 12499
diff changeset
286 my $text = "\nChanged in version $release.\n";
bef675dc11cc do_cmd_versionchanged():
Fred Drake <fdrake@acm.org>
parents: 12499
diff changeset
287 if ($release) {
bef675dc11cc do_cmd_versionchanged():
Fred Drake <fdrake@acm.org>
parents: 12499
diff changeset
288 $text = "\nChanged in version $release:\n$explanation.\n";
bef675dc11cc do_cmd_versionchanged():
Fred Drake <fdrake@acm.org>
parents: 12499
diff changeset
289 }
bef675dc11cc do_cmd_versionchanged():
Fred Drake <fdrake@acm.org>
parents: 12499
diff changeset
290 return $text . $_;
8763
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
291 }
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
292
10327
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
293 #
10464
f74ef1971bd1 Remove \platformof support, since it's been removed from the LaTeX
Fred Drake <fdrake@acm.org>
parents: 10327
diff changeset
294 # These function handle platform dependency tracking.
10327
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
295 #
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
296 sub do_cmd_platform{
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
297 local($_) = @_;
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
298 my $platform = next_argument();
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
299 $ModulePlatforms{"<tt class='module'>$THIS_MODULE</tt>"} = $platform;
10327
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
300 $platform = "Macintosh"
10637
bed15a015c1c Fix some remaining index & consistency nits. (Many data member
Fred Drake <fdrake@acm.org>
parents: 10598
diff changeset
301 if $platform eq 'Mac';
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
302 return "\n<p class='availability'>Availability: <span"
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
303 . "\n class='platform'>$platform</span>.</p>\n" . $_;
10327
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
304 }
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
305
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
306 $IGNORE_PLATFORM_ANNOTATION = '';
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
307 sub do_cmd_ignorePlatformAnnotation{
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
308 local($_) = @_;
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
309 $IGNORE_PLATFORM_ANNOTATION = next_argument();
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
310 return $_;
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
311 }
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
312
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
313
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
314 # index commands
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
315
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
316 $INDEX_SUBITEM = "";
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 sub get_indexsubitem{
9769
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
319 return $INDEX_SUBITEM ? " $INDEX_SUBITEM" : '';
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
320 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
321
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_setindexsubitem{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
323 local($_) = @_;
10138
b21915e6589e Fix up some routines to coordinate the "indexsubitem" stuff so that
Fred Drake <fdrake@acm.org>
parents: 10128
diff changeset
324 $INDEX_SUBITEM = next_argument();
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
325 return $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
326 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
327
7671
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
328 sub do_cmd_withsubitem{
9769
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
329 # We can't really do the right thing, because LaTeX2HTML doesn't
7671
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
330 # 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
331 # 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
332 #
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
333 local($_) = @_;
9769
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
334 my $oldsubitem = $INDEX_SUBITEM;
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
335 $INDEX_SUBITEM = next_argument();
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
336 my $stuff = next_argument();
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
337 my $br_id = ++$globals{'max_id'};
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
338 my $marker = "$O$br_id$C";
9769
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
339 return
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
340 $stuff
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
341 . "\\setindexsubitem$marker$oldsubitem$marker"
9769
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
342 . $_;
7671
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
343 }
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
344
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
345 # This is the prologue macro which is required to start writing the
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
346 # mod\jobname.idx file; we can just ignore it. (Defining this suppresses
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
347 # a warning that \makemodindex is unknown.)
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
348 #
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
349 sub do_cmd_makemodindex{ return @_[0]; }
7671
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
350
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
351 # We're in the document subdirectory when this happens!
7909
5eafd3eda0af Remove option to strip out <tt>...</tt> from index entry text; this is now
Fred Drake <fdrake@acm.org>
parents: 7906
diff changeset
352 #
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
353 open(IDXFILE, '>index.dat') || die "\n$!\n";
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
354 open(INTLABELS, '>intlabels.pl') || die "\n$!\n";
7909
5eafd3eda0af Remove option to strip out <tt>...</tt> from index entry text; this is now
Fred Drake <fdrake@acm.org>
parents: 7906
diff changeset
355 print INTLABELS "%internal_labels = ();\n";
5eafd3eda0af Remove option to strip out <tt>...</tt> from index entry text; this is now
Fred Drake <fdrake@acm.org>
parents: 7906
diff changeset
356 print INTLABELS "1; # hack in case there are no entries\n\n";
5eafd3eda0af Remove option to strip out <tt>...</tt> from index entry text; this is now
Fred Drake <fdrake@acm.org>
parents: 7906
diff changeset
357
5eafd3eda0af Remove option to strip out <tt>...</tt> from index entry text; this is now
Fred Drake <fdrake@acm.org>
parents: 7906
diff changeset
358 # Using \0 for this is bad because we can't use common tools to work with the
5eafd3eda0af Remove option to strip out <tt>...</tt> from index entry text; this is now
Fred Drake <fdrake@acm.org>
parents: 7906
diff changeset
359 # resulting files. Things like grep can be useful with this stuff!
5eafd3eda0af Remove option to strip out <tt>...</tt> from index entry text; this is now
Fred Drake <fdrake@acm.org>
parents: 7906
diff changeset
360 #
5eafd3eda0af Remove option to strip out <tt>...</tt> from index entry text; this is now
Fred Drake <fdrake@acm.org>
parents: 7906
diff changeset
361 $IDXFILE_FIELD_SEP = "\1";
5eafd3eda0af Remove option to strip out <tt>...</tt> from index entry text; this is now
Fred Drake <fdrake@acm.org>
parents: 7906
diff changeset
362
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
363 sub write_idxfile{
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
364 my ($ahref, $str) = @_;
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
365 print IDXFILE $ahref, $IDXFILE_FIELD_SEP, $str, "\n";
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
366 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
367
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
368
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
369 sub gen_link{
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
370 my($node,$target) = @_;
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
371 print INTLABELS "\$internal_labels{\"$target\"} = \"$URL/$node\";\n";
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
372 return "<a href='$node#$target'>";
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
373 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
374
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
375 sub add_index_entry{
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
376 # add an entry to the index structures; ignore the return value
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
377 my($str,$ahref) = @_;
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
378 $str = gen_index_id($str, '');
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
379 $index{$str} .= $ahref;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
380 write_idxfile($ahref, $str);
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
381 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
382
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
383 sub new_link_info{
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
384 my $name = "l2h-" . ++$globals{'max_id'};
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
385 my $aname = "<a name='$name'>";
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
386 my $ahref = gen_link($CURRENT_FILE, $name);
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
387 return ($name, $aname, $ahref);
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
388 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
389
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
390 $IndexMacroPattern = '';
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
391 sub define_indexing_macro{
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
392 my $count = @_;
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
393 my $i = 0;
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
394 for (; $i < $count; ++$i) {
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
395 my $name = @_[$i];
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
396 my $cmd = "idx_cmd_$name";
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
397 die "\nNo function $cmd() defined!\n"
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
398 if (!defined &$cmd);
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
399 eval ("sub do_cmd_$name { return process_index_macros("
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
400 . "\@_[0], '$name'); }");
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
401 if (length($IndexMacroPattern) == 0) {
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
402 $IndexMacroPattern = "$name";
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
403 }
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
404 else {
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
405 $IndexMacroPattern .= "|$name";
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
406 }
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
407 }
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
408 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
409
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
410 $DEBUG_INDEXING = 0;
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
411 sub process_index_macros{
8294
35ea0c073ea3 do_cmd_kwindex(): Re-implement now that \kwindex is used again (ref man).
Fred Drake <fdrake@acm.org>
parents: 8194
diff changeset
412 local($_) = @_;
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
413 my $cmdname = @_[1]; # This is what triggered us in the first place;
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
414 # we know it's real, so just process it.
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
415 my($name,$aname,$ahref) = new_link_info();
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
416 my $cmd = "idx_cmd_$cmdname";
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
417 print "\nIndexing: \\$cmdname"
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
418 if $DEBUG_INDEXING;
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
419 &$cmd($ahref); # modifies $_ and adds index entries
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
420 while (/^[\s\n]*\\($IndexMacroPattern)</) {
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
421 $cmdname = "$1";
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
422 print " \\$cmdname"
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
423 if $DEBUG_INDEXING;
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
424 $cmd = "idx_cmd_$cmdname";
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
425 if (!defined &$cmd) {
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
426 last;
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
427 }
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
428 else {
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
429 s/^[\s\n]*\\$cmdname//;
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
430 &$cmd($ahref);
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
431 }
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
432 }
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
433 return "$aname$anchor_invisible_mark</a>" . $_;
8294
35ea0c073ea3 do_cmd_kwindex(): Re-implement now that \kwindex is used again (ref man).
Fred Drake <fdrake@acm.org>
parents: 8194
diff changeset
434 }
35ea0c073ea3 do_cmd_kwindex(): Re-implement now that \kwindex is used again (ref man).
Fred Drake <fdrake@acm.org>
parents: 8194
diff changeset
435
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
436 define_indexing_macro('index');
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
437 sub idx_cmd_index{
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
438 my $str = next_argument();
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
439 add_index_entry("$str", @_[0]);
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
440 }
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
441
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
442 define_indexing_macro('kwindex');
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
443 sub idx_cmd_kwindex{
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
444 my $str = next_argument();
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
445 add_index_entry("<tt>$str</tt>!keyword", @_[0]);
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
446 add_index_entry("keyword!<tt>$str</tt>", @_[0]);
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
447 }
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
448
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
449 define_indexing_macro('indexii');
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
450 sub idx_cmd_indexii{
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
451 my $str1 = next_argument();
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
452 my $str2 = next_argument();
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
453 add_index_entry("$str1!$str2", @_[0]);
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
454 add_index_entry("$str2!$str1", @_[0]);
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
455 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
456
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
457 define_indexing_macro('indexiii');
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
458 sub idx_cmd_indexiii{
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
459 my $str1 = next_argument();
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
460 my $str2 = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
461 my $str3 = next_argument();
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
462 add_index_entry("$str1!$str2 $str3", @_[0]);
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
463 add_index_entry("$str2!$str3, $str1", @_[0]);
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
464 add_index_entry("$str3!$str1 $str2", @_[0]);
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
465 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
466
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
467 define_indexing_macro('indexiv');
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
468 sub idx_cmd_indexiv{
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
469 my $str1 = next_argument();
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
470 my $str2 = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
471 my $str3 = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
472 my $str4 = next_argument();
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
473 add_index_entry("$str1!$str2 $str3 $str4", @_[0]);
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
474 add_index_entry("$str2!$str3 $str4, $str1", @_[0]);
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
475 add_index_entry("$str3!$str4, $str1 $str2", @_[0]);
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
476 add_index_entry("$str4!$$str1 $str2 $str3", @_[0]);
7527
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
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
479 define_indexing_macro('ttindex');
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
480 sub idx_cmd_ttindex{
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
481 my $str = next_argument();
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
482 my $entry = $str . get_indexsubitem();
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
483 add_index_entry($entry, @_[0]);
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
484 }
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
485
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
486 sub my_typed_index_helper{
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
487 my($word,$ahref) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
488 my $str = next_argument();
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
489 add_index_entry("$str $word", $ahref);
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
490 add_index_entry("$word!$str", $ahref);
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
491 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
492
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
493 define_indexing_macro('stindex', 'opindex', 'exindex', 'obindex');
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
494 sub idx_cmd_stindex{ my_typed_index_helper('statement', @_[0]); }
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
495 sub idx_cmd_opindex{ my_typed_index_helper('operator', @_[0]); }
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
496 sub idx_cmd_exindex{ my_typed_index_helper('exception', @_[0]); }
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
497 sub idx_cmd_obindex{ my_typed_index_helper('object', @_[0]); }
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
498
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
499 define_indexing_macro('bifuncindex');
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
500 sub idx_cmd_bifuncindex{
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
501 my $str = next_argument();
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
502 add_index_entry("<tt class='function'>$str()</tt> (built-in function)",
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
503 @_[0]);
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
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
507 sub make_mod_index_entry{
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
508 my($str,$define) = @_;
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
509 my($name,$aname,$ahref) = new_link_info();
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
510 # equivalent of add_index_entry() using $define instead of ''
10138
b21915e6589e Fix up some routines to coordinate the "indexsubitem" stuff so that
Fred Drake <fdrake@acm.org>
parents: 10128
diff changeset
511 $ahref =~ s/\#[-_a-zA-Z0-9]*\"/\"/
b21915e6589e Fix up some routines to coordinate the "indexsubitem" stuff so that
Fred Drake <fdrake@acm.org>
parents: 10128
diff changeset
512 if ($define eq 'DEF');
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
513 $str = gen_index_id($str, $define);
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
514 $index{$str} .= $ahref;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
515 write_idxfile($ahref, $str);
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
516
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
517 if ($define eq 'DEF') {
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
518 # add to the module index
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
519 $str =~ /(<tt.*<\/tt>)/;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
520 my $nstr = $1;
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
521 $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
522 }
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
523 return "$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
524 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
525
10327
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
526
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
527 $THIS_MODULE = '';
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
528 $THIS_CLASS = '';
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
529
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
530 sub define_module{
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
531 my($word,$name) = @_;
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
532 my $section_tag = join('', @curr_sec_id);
10857
1aa80f5bf9ac define_module(): Check the module type for validity before using.
Fred Drake <fdrake@acm.org>
parents: 10849
diff changeset
533 if ($word ne "built-in" && $word ne "extension"
1aa80f5bf9ac define_module(): Check the module type for validity before using.
Fred Drake <fdrake@acm.org>
parents: 10849
diff changeset
534 && $word ne "standard" && $word ne "") {
1aa80f5bf9ac define_module(): Check the module type for validity before using.
Fred Drake <fdrake@acm.org>
parents: 10849
diff changeset
535 write_warnings("Bad module type '$word'"
1aa80f5bf9ac define_module(): Check the module type for validity before using.
Fred Drake <fdrake@acm.org>
parents: 10849
diff changeset
536 . " for \\declaremodule (module $name)");
1aa80f5bf9ac define_module(): Check the module type for validity before using.
Fred Drake <fdrake@acm.org>
parents: 10849
diff changeset
537 $word = "";
1aa80f5bf9ac define_module(): Check the module type for validity before using.
Fred Drake <fdrake@acm.org>
parents: 10849
diff changeset
538 }
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
539 $word = "$word " if $word;
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
540 $THIS_MODULE = "$name";
10138
b21915e6589e Fix up some routines to coordinate the "indexsubitem" stuff so that
Fred Drake <fdrake@acm.org>
parents: 10128
diff changeset
541 $INDEX_SUBITEM = "(in $name)";
b21915e6589e Fix up some routines to coordinate the "indexsubitem" stuff so that
Fred Drake <fdrake@acm.org>
parents: 10128
diff changeset
542 print "[$name]";
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
543 return make_mod_index_entry(
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
544 "<tt class='module'>$name</tt> (${word}module)", 'DEF');
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
545 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
546
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
547 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
548 local($word, $_) = @_;
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
549 my $name = next_argument();
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
550 return define_module($word, $name) . $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
551 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
552
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
553 sub do_cmd_modindex{ return my_module_index_helper('', @_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
554 sub do_cmd_bimodindex{ return my_module_index_helper('built-in', @_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
555 sub do_cmd_exmodindex{ return my_module_index_helper('extension', @_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
556 sub do_cmd_stmodindex{ return 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
557
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
558 sub ref_module_index_helper{
12499
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
559 my($word, $ahref) = @_;
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
560 my $str = next_argument();
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
561 $word = "$word " if $word;
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
562 $str = "<tt class='module'>$str</tt> (${word}module)";
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
563 # can't use add_index_entry() since the 2nd arg to gen_index_id() is used;
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
564 # just inline it all here
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
565 $str = gen_index_id($str, 'REF');
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
566 $index{$str} .= $ahref;
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
567 write_idxfile($ahref, $str);
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
568 }
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
569
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
570 # these should be adjusted a bit....
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
571 define_indexing_macro('refmodindex', 'refbimodindex',
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
572 'refexmodindex', 'refstmodindex');
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
573 sub idx_cmd_refmodindex{ return ref_module_index_helper('', @_); }
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
574 sub idx_cmd_refbimodindex{ return ref_module_index_helper('built-in', @_); }
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
575 sub idx_cmd_refexmodindex{ return ref_module_index_helper('extension', @_); }
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
576 sub idx_cmd_refstmodindex{ return 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
577
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
578 sub do_cmd_nodename{ return 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
579
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
580 sub init_myformat{
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
581 # $anchor_invisible_mark = '';
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
582 $anchor_mark = '';
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
583 $icons{'anchor_mark'} = '';
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
584 }
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
585 init_myformat();
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
586
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
587 # Create an index entry, but include the string in the target anchor
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
588 # 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
589 #
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
590 sub make_str_index_entry{
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
591 my($str) = @_;
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
592 my($name,$aname,$ahref) = new_link_info();
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
593 add_index_entry($str, $ahref);
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
594 return "$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
595 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
596
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
597 $REFCOUNTS_LOADED = 0;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
598
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
599 sub load_refcounts{
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
600 $REFCOUNTS_LOADED = 1;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
601
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
602 use File::Basename;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
603 my $myname, $mydir, $myext;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
604 ($myname, $mydir, $myext) = fileparse(__FILE__, '\..*');
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
605 chop $mydir; # remove trailing '/'
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
606 ($myname, $mydir, $myext) = fileparse($mydir, '\..*');
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
607 chop $mydir; # remove trailing '/'
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
608 $mydir = getcwd() . "$dd$mydir"
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
609 unless $mydir =~ s|^/|/|;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
610 local $_;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
611 my $filename = "$mydir${dd}api${dd}refcounts.dat";
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
612 open(REFCOUNT_FILE, "<$filename") || die "\n$!\n";
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
613 print "[loading API refcount data]";
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
614 while (<REFCOUNT_FILE>) {
12350
c59bdc7fd8a6 load_refcounts(),
Fred Drake <fdrake@acm.org>
parents: 12343
diff changeset
615 if (/([a-zA-Z0-9_]+):PyObject\*:([a-zA-Z0-9_]*):(0|[-+]1|null):(.*)$/) {
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
616 my($func, $param, $count, $comment) = ($1, $2, $3, $4);
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
617 #print "\n$func($param) --> $count";
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
618 $REFCOUNTS{"$func:$param"} = $count;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
619 }
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
620 }
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
621 }
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
622
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
623 sub get_refcount{
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
624 my ($func, $param) = @_;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
625 load_refcounts()
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
626 unless $REFCOUNTS_LOADED;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
627 return $REFCOUNTS{"$func:$param"};
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
628 }
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
629
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
630 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
631 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
632 my $return_type = next_argument();
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
633 my $function_name = next_argument();
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
634 my $arg_list = next_argument();
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
635 my $idx = make_str_index_entry(
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
636 "<tt class='cfunction'>$function_name()</tt>" . get_indexsubitem());
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
637 $idx =~ s/ \(.*\)//;
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
638 $idx =~ s/\(\)//; # ????
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
639 my $result_rc = get_refcount($function_name, '');
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
640 my $rcinfo = '';
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
641 if ($result_rc eq '+1') {
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
642 $rcinfo = '<span class="label">Return value:</span>'
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
643 . "\n <span class=\"value\">New reference.</span>";
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
644 }
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
645 elsif ($result_rc eq '0') {
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
646 $rcinfo = '<span class="label">Return value:</span>'
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
647 . "\n <span class=\"value\">Borrowed reference.</span>";
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
648 }
12350
c59bdc7fd8a6 load_refcounts(),
Fred Drake <fdrake@acm.org>
parents: 12343
diff changeset
649 elsif ($result_rc eq 'null') {
c59bdc7fd8a6 load_refcounts(),
Fred Drake <fdrake@acm.org>
parents: 12343
diff changeset
650 $rcinfo = '<span class="label">Return value:</span>'
c59bdc7fd8a6 load_refcounts(),
Fred Drake <fdrake@acm.org>
parents: 12343
diff changeset
651 . "\n <span class=\"value\">Always NULL.</span>";
c59bdc7fd8a6 load_refcounts(),
Fred Drake <fdrake@acm.org>
parents: 12343
diff changeset
652 }
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
653 if ($rcinfo ne '') {
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
654 $rcinfo = "\n<div class=\"refcount-info\">\n $rcinfo\n</div>";
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
655 }
10138
b21915e6589e Fix up some routines to coordinate the "indexsubitem" stuff so that
Fred Drake <fdrake@acm.org>
parents: 10128
diff changeset
656 return "<dl><dt>$return_type <b>$idx</b> (<var>$arg_list</var>)\n<dd>"
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
657 . $rcinfo
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
658 . $_
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
659 . '</dl>';
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
660 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
661
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
662 sub do_env_csimplemacrodesc{
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
663 local($_) = @_;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
664 my $name = next_argument();
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
665 my $idx = make_str_index_entry("<tt class='macro'>$name</tt>");
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
666 return "<dl><dt><b>$idx</b>\n<dd>"
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
667 . $_
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
668 . '</dl>'
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
669 }
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
670
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
671 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
672 local($_) = @_;
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
673 my $index_name = next_optional_argument();
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
674 my $type_name = next_argument();
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
675 $index_name = $type_name
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
676 unless $index_name;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
677 my($name,$aname,$ahref) = new_link_info();
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
678 add_index_entry("<tt class='ctype'>$index_name</tt> (C type)", $ahref);
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
679 return "<dl><dt><b><tt class='ctype'>$aname$type_name</a></tt></b>\n<dd>"
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
680 . $_
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
681 . '</dl>'
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
682 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
683
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
684 sub do_env_cvardesc{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
685 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
686 my $var_type = next_argument();
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
687 my $var_name = next_argument();
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
688 my $idx = make_str_index_entry("<tt class='cdata'>$var_name</tt>"
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
689 . get_indexsubitem());
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
690 $idx =~ s/ \(.*\)//;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
691 return "<dl><dt>$var_type <b>$idx</b>\n"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
692 . '<dd>'
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
693 . $_
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
694 . '</dl>';
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
695 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
696
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
697 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
698 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
699 my $function_name = next_argument();
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
700 my $arg_list = next_argument();
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
701 my $idx = make_str_index_entry("<tt class='function'>$function_name()</tt>"
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
702 . get_indexsubitem());
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
703 $idx =~ s/ \(.*\)//;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
704 $idx =~ s/\(\)<\/tt>/<\/tt>/;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
705 return "<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
706 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
707
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
708 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
709 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
710 my $function_name = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
711 my $arg_list = next_argument();
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
712 return "<dl><dt><b><tt class='function'>$function_name</tt></b>"
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
713 . " (<var>$arg_list</var>)\n"
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
714 . '<dd>'
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
715 . $_
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
716 . '</dl>';
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
717 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
718
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
719 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
720 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
721 my $function_name = next_argument();
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
722 my $arg_list = next_argument();
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
723 my $prefix = "<tt class='function'>$function_name()</tt>";
10641
f6ec4a9cb0b3 do_cmd_funcline(): Remove some bogus generated stuff from the output
Fred Drake <fdrake@acm.org>
parents: 10637
diff changeset
724 my $idx = make_str_index_entry($prefix . get_indexsubitem());
f6ec4a9cb0b3 do_cmd_funcline(): Remove some bogus generated stuff from the output
Fred Drake <fdrake@acm.org>
parents: 10637
diff changeset
725 $prefix =~ s/\(\)//;
f6ec4a9cb0b3 do_cmd_funcline(): Remove some bogus generated stuff from the output
Fred Drake <fdrake@acm.org>
parents: 10637
diff changeset
726
f6ec4a9cb0b3 do_cmd_funcline(): Remove some bogus generated stuff from the output
Fred Drake <fdrake@acm.org>
parents: 10637
diff changeset
727 return "<dt><b>$prefix</b> (<var>$arg_list</var>)\n<dd>" . $_;
7527
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
11123
2eb2879d567f do_cmd_funclineni(): New function; non-indexing form of \funcline.
Fred Drake <fdrake@acm.org>
parents: 10857
diff changeset
730 sub do_cmd_funclineni{
2eb2879d567f do_cmd_funclineni(): New function; non-indexing form of \funcline.
Fred Drake <fdrake@acm.org>
parents: 10857
diff changeset
731 local($_) = @_;
2eb2879d567f do_cmd_funclineni(): New function; non-indexing form of \funcline.
Fred Drake <fdrake@acm.org>
parents: 10857
diff changeset
732 my $function_name = next_argument();
2eb2879d567f do_cmd_funclineni(): New function; non-indexing form of \funcline.
Fred Drake <fdrake@acm.org>
parents: 10857
diff changeset
733 my $arg_list = next_argument();
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
734 my $prefix = "<tt class='function'>$function_name</tt>";
11123
2eb2879d567f do_cmd_funclineni(): New function; non-indexing form of \funcline.
Fred Drake <fdrake@acm.org>
parents: 10857
diff changeset
735
2eb2879d567f do_cmd_funclineni(): New function; non-indexing form of \funcline.
Fred Drake <fdrake@acm.org>
parents: 10857
diff changeset
736 return "<dt><b>$prefix</b> (<var>$arg_list</var>)\n<dd>" . $_;
2eb2879d567f do_cmd_funclineni(): New function; non-indexing form of \funcline.
Fred Drake <fdrake@acm.org>
parents: 10857
diff changeset
737 }
2eb2879d567f do_cmd_funclineni(): New function; non-indexing form of \funcline.
Fred Drake <fdrake@acm.org>
parents: 10857
diff changeset
738
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
739 # 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
740 # 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
741 # module.
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
742 #
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
743 $INDEX_OPCODES = 0;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
744
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
745 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
746 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
747 my $opcode_name = next_argument();
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
748 my $arg_list = next_argument();
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
749 my $idx;
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
750 if ($INDEX_OPCODES) {
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
751 $idx = make_str_index_entry("<tt class='opcode'>$opcode_name</tt>"
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
752 . " (byte code instruction)");
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
753 $idx =~ s/ \(byte code instruction\)//;
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
754 }
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
755 else {
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
756 $idx = "<tt class='opcode'>$opcode_name</tt>";
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
757 }
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
758 my $stuff = "<dl><dt><b>$idx</b>";
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
759 if ($arg_list) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
760 $stuff .= "&nbsp;&nbsp;&nbsp;&nbsp;<var>$arg_list</var>";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
761 }
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
762 return $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
763 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
764
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
765 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
766 local($_) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
767 my $dataname = next_argument();
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
768 my $idx = make_str_index_entry("<tt>$dataname</tt>" . get_indexsubitem());
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
769 $idx =~ s/ \(.*\)//;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
770 return "<dl><dt><b>$idx</b>\n<dd>"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
771 . $_
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
772 . '</dl>';
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
773 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
774
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
775 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
776 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
777 my $idx = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
778 if (! $STRING_INDEX_TT) {
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
779 $idx = "<tt>$idx</tt>";
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
780 }
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
781 return "<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
782 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
783
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
784 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
785 local($_) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
786 my $data_name = next_argument();
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
787 my $idx = make_str_index_entry("<tt>$data_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
788 $idx =~ s/ \(.*\)//;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
789 return "<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
790 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
791
12343
be5100afa1b7 do_cmd_datalineni(): New function, to implement the non-indexing form
Fred Drake <fdrake@acm.org>
parents: 12217
diff changeset
792 sub do_cmd_datalineni{
be5100afa1b7 do_cmd_datalineni(): New function, to implement the non-indexing form
Fred Drake <fdrake@acm.org>
parents: 12217
diff changeset
793 local($_) = @_;
be5100afa1b7 do_cmd_datalineni(): New function, to implement the non-indexing form
Fred Drake <fdrake@acm.org>
parents: 12217
diff changeset
794 my $data_name = next_argument();
be5100afa1b7 do_cmd_datalineni(): New function, to implement the non-indexing form
Fred Drake <fdrake@acm.org>
parents: 12217
diff changeset
795 return "<dt><b><tt>$data_name</tt></b><dd>" . $_;
be5100afa1b7 do_cmd_datalineni(): New function, to implement the non-indexing form
Fred Drake <fdrake@acm.org>
parents: 12217
diff changeset
796 }
be5100afa1b7 do_cmd_datalineni(): New function, to implement the non-indexing form
Fred Drake <fdrake@acm.org>
parents: 12217
diff changeset
797
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
798 sub do_env_excdesc{
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
799 local($_) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
800 my $excname = next_argument();
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
801 my $idx = make_str_index_entry("<tt class='exception'>$excname</tt>");
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
802 return "<dl><dt><b>$idx</b>\n<dd>" . $_ . '</dl>'
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
803 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
804
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
805 sub do_env_fulllineitems{ return 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
806
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
807
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
808 sub do_env_classdesc{
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
809 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
810 $THIS_CLASS = next_argument();
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
811 my $arg_list = next_argument();
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
812 $idx = make_str_index_entry(
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
813 "<tt class='class'>$THIS_CLASS</tt> (class in $THIS_MODULE)" );
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
814 $idx =~ s/ \(.*\)//;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
815 return "<dl><dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>" . $_ . '</dl>';
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
816 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
817
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
818
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
819 sub do_env_methoddesc{
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
820 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
821 my $class_name = next_optional_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
822 $class_name = $THIS_CLASS
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
823 unless $class_name;
9848
e19cd8ec20a2 do_cmd_methodline(): Fixed reference to method name when generating
Fred Drake <fdrake@acm.org>
parents: 9775
diff changeset
824 my $method = next_argument();
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
825 my $arg_list = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
826 my $extra = '';
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
827 if ($class_name) {
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
828 $extra = " ($class_name method)";
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
829 }
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
830 my $idx = make_str_index_entry("<tt class='method'>$method()</tt>$extra");
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
831 $idx =~ s/ \(.*\)//;
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
832 $idx =~ s/\(\)//;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
833 return "<dl><dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>" . $_ . '</dl>';
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
834 }
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
835
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
836
9769
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
837 sub do_cmd_methodline{
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
838 local($_) = @_;
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
839 my $class_name = next_optional_argument();
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
840 $class_name = $THIS_CLASS
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
841 unless $class_name;
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
842 my $method = next_argument();
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
843 my $arg_list = next_argument();
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
844 my $extra = '';
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
845 if ($class_name) {
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
846 $extra = " ($class_name method)";
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
847 }
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
848 my $idx = make_str_index_entry("<tt class='method'>$method()</tt>$extra");
9769
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
849 $idx =~ s/ \(.*\)//;
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
850 $idx =~ s/\(\)//;
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
851 return "<dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>"
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
852 . $_;
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
853 }
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
854
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
855
9085
e943f9c09901 do_cmd_methodlineni(): New function, needed because the ref. manual now
Fred Drake <fdrake@acm.org>
parents: 8917
diff changeset
856 sub do_cmd_methodlineni{
e943f9c09901 do_cmd_methodlineni(): New function, needed because the ref. manual now
Fred Drake <fdrake@acm.org>
parents: 8917
diff changeset
857 local($_) = @_;
e943f9c09901 do_cmd_methodlineni(): New function, needed because the ref. manual now
Fred Drake <fdrake@acm.org>
parents: 8917
diff changeset
858 next_optional_argument();
e943f9c09901 do_cmd_methodlineni(): New function, needed because the ref. manual now
Fred Drake <fdrake@acm.org>
parents: 8917
diff changeset
859 my $method = next_argument();
e943f9c09901 do_cmd_methodlineni(): New function, needed because the ref. manual now
Fred Drake <fdrake@acm.org>
parents: 8917
diff changeset
860 my $arg_list = next_argument();
e943f9c09901 do_cmd_methodlineni(): New function, needed because the ref. manual now
Fred Drake <fdrake@acm.org>
parents: 8917
diff changeset
861 return "<dt><b>$method</b> (<var>$arg_list</var>)\n<dd>"
e943f9c09901 do_cmd_methodlineni(): New function, needed because the ref. manual now
Fred Drake <fdrake@acm.org>
parents: 8917
diff changeset
862 . $_;
e943f9c09901 do_cmd_methodlineni(): New function, needed because the ref. manual now
Fred Drake <fdrake@acm.org>
parents: 8917
diff changeset
863 }
e943f9c09901 do_cmd_methodlineni(): New function, needed because the ref. manual now
Fred Drake <fdrake@acm.org>
parents: 8917
diff changeset
864
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
865 sub do_env_methoddescni{
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
866 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
867 next_optional_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
868 my $method = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
869 my $arg_list = next_argument();
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
870 return "<dl><dt><b>$method</b> (<var>$arg_list</var>)\n<dd>"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
871 . $_
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
872 . '</dl>';
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
873 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
874
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
875
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
876 sub do_env_memberdesc{
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
877 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
878 my $class = next_optional_argument();
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
879 my $member = next_argument();
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
880 $class = $THIS_CLASS
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
881 unless $class;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
882 my $extra = '';
10637
bed15a015c1c Fix some remaining index & consistency nits. (Many data member
Fred Drake <fdrake@acm.org>
parents: 10598
diff changeset
883 $extra = " ($class attribute)"
bed15a015c1c Fix some remaining index & consistency nits. (Many data member
Fred Drake <fdrake@acm.org>
parents: 10598
diff changeset
884 if ($class ne '');
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
885 my $idx = make_str_index_entry("<tt class='member'>$member</tt>$extra");
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
886 $idx =~ s/ \(.*\)//;
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
887 $idx =~ s/\(\)//;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
888 return "<dl><dt><b>$idx</b>\n<dd>" . $_ . '</dl>';
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
889 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
890
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
891
8086
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
892 sub do_cmd_memberline{
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
893 local($_) = @_;
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
894 my $class = next_optional_argument();
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
895 my $member = next_argument();
8086
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
896 $class = $THIS_CLASS
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
897 unless $class;
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
898 my $extra = '';
10637
bed15a015c1c Fix some remaining index & consistency nits. (Many data member
Fred Drake <fdrake@acm.org>
parents: 10598
diff changeset
899 $extra = " ($class attribute)"
bed15a015c1c Fix some remaining index & consistency nits. (Many data member
Fred Drake <fdrake@acm.org>
parents: 10598
diff changeset
900 if ($class ne '');
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
901 my $idx = make_str_index_entry("<tt class='member'>$member</tt>$extra");
8086
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
902 $idx =~ s/ \(.*\)//;
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
903 $idx =~ s/\(\)//;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
904 return "<dt><b>$idx</b><dd>" . $_;
8086
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
905 }
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
906
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
907 sub do_env_memberdescni{
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
908 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
909 next_optional_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
910 my $member = next_argument();
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
911 return "<dl><dt><b><tt class='member'>$member</tt></b>\n<dd>"
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
912 . $_
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
913 . '</dl>';
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
914 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
915
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
916
8086
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
917 sub do_cmd_memberlineni{
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
918 local($_) = @_;
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
919 next_optional_argument();
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
920 my $member = next_argument();
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
921 return "<dt><b><tt class='member'>$member</tt></b><dd>" . $_;
8086
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
922 }
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
923
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
924 @col_aligns = ('<td>', '<td>', '<td>', '<td>');
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
925
10149
959e81b39b81 Make table headers the same color as the navigation bars so they stand
Fred Drake <fdrake@acm.org>
parents: 10138
diff changeset
926 $TABLE_HEADER_BGCOLOR = $NAV_BGCOLOR;
959e81b39b81 Make table headers the same color as the navigation bars so they stand
Fred Drake <fdrake@acm.org>
parents: 10138
diff changeset
927
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
928 sub fix_font{
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
929 # do a little magic on a font name to get the right behavior in the first
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
930 # column of the output table
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
931 my $font = @_[0];
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
932 if ($font eq 'textrm') {
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
933 $font = '';
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
934 }
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
935 elsif ($font eq 'file' || $font eq 'filenq') {
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
936 $font = 'tt class="file"';
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
937 }
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
938 elsif ($font eq 'member') {
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
939 $font = 'tt class="member"';
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
940 }
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
941 return $font;
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
942 }
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
943
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
944 sub figure_column_alignment{
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
945 my $a = @_[0];
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
946 my $mark = substr($a, 0, 1);
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
947 my $r = '';
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
948 if ($mark eq 'c')
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
949 { $r = ' align="center"'; }
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
950 elsif ($mark eq 'r')
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
951 { $r = ' align="right"'; }
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
952 elsif ($mark eq 'l')
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
953 { $r = ' align="left"'; }
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
954 elsif ($mark eq 'p')
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
955 { $r = ' align="left"'; }
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
956 return $r;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
957 }
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
958
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
959 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
960 local($_) = @_;
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
961 my($s1,$s2,$s3,$s4) = split(/[|]/,$_);
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
962 my $a1 = figure_column_alignment($s1);
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
963 my $a2 = figure_column_alignment($s2);
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
964 my $a3 = figure_column_alignment($s3);
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
965 my $a4 = figure_column_alignment($s4);
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
966 $col_aligns[0] = "<td$a1 valign=\"baseline\">";
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
967 $col_aligns[1] = "<td$a2>";
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
968 $col_aligns[2] = "<td$a3>";
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
969 $col_aligns[3] = "<td$a4>";
10767
e37074b6e78c do_cmd_seetext(): Clean up so we get proper nesting of <div>s. This
Fred Drake <fdrake@acm.org>
parents: 10641
diff changeset
970 # return the aligned header start tags
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
971 return ("<th$a1>", "<th$a2>", "<th$a3>", "<th$a4>");
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
972 }
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
973
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
974 sub get_table_col1_fonts{
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
975 my $font = $globals{'lineifont'};
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
976 my ($sfont,$efont) = ('', '');
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
977 if ($font) {
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
978 $sfont = "<$font>";
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
979 $efont = "</$font>";
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
980 $efont =~ s/ .*>/>/;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
981 }
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
982 return ($font, $sfont, $efont);
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
983 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
984
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
985 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
986 local($_) = @_;
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
987 my($th1,$th2,$th3,$th4) = setup_column_alignments(next_argument());
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
988 my $font = fix_font(next_argument());
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
989 my $h1 = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
990 my $h2 = next_argument();
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
991 s/[\s\n]+//;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
992 $globals{'lineifont'} = $font;
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
993 my $a1 = $col_aligns[0];
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
994 my $a2 = $col_aligns[1];
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
995 s/\\lineii</\\lineii[$a1|$a2]</g;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
996 return '<table border align="center" style="border-collapse: collapse">'
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
997 . "\n <thead>"
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
998 . "\n <tr$TABLE_HEADER_BGCOLOR>"
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
999 . "\n $th1<b>$h1</b>\&nbsp;</th>"
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1000 . "\n $th2<b>$h2</b>\&nbsp;</th>"
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1001 . "\n </thead>"
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1002 . "\n <tbody valign='baseline'>"
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1003 . $_
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1004 . "\n </tbody>"
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1005 . "\n</table>";
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1006 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1007
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1008 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
1009 local($_) = @_;
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1010 my $aligns = next_optional_argument();
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1011 my $c1 = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1012 my $c2 = next_argument();
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1013 s/[\s\n]+//;
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1014 my($font,$sfont,$efont) = get_table_col1_fonts();
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1015 $c2 = '&nbsp;' if ($c2 eq '');
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1016 my($c1align,$c2align) = split('\|', $aligns);
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1017 my $padding = '';
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1018 if ($c1align =~ /align="right"/) {
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1019 $padding = '&nbsp;';
7798
49f11eb4eb9a This fixes a (minor) problem discovered by AMK when you don't want any
Fred Drake <fdrake@acm.org>
parents: 7779
diff changeset
1020 }
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1021 return "\n <tr>$c1align$sfont$c1$efont$padding</td>\n"
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1022 . " $c2align$c2</td>"
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1023 . $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1024 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1025
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1026 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
1027 local($_) = @_;
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1028 my($th1,$th2,$th3,$th4) = setup_column_alignments(next_argument());
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1029 my $font = fix_font(next_argument());
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1030 my $h1 = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1031 my $h2 = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1032 my $h3 = next_argument();
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1033 s/[\s\n]+//;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1034 $globals{'lineifont'} = $font;
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1035 my $a1 = $col_aligns[0];
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1036 my $a2 = $col_aligns[1];
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1037 my $a3 = $col_aligns[2];
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1038 s/\\lineiii</\\lineiii[$a1|$a2|$a3]</g;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1039 return '<table border align="center" style="border-collapse: collapse">'
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1040 . "\n <thead>"
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1041 . "\n <tr$TABLE_HEADER_BGCOLOR>"
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1042 . "\n $th1<b>$h1</b>\&nbsp;</th>"
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1043 . "\n $th2<b>$h2</b>\&nbsp;</th>"
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1044 . "\n $th3<b>$h3</b>\&nbsp;</th>"
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1045 . "\n </thead>"
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1046 . "\n <tbody valign='baseline'>"
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1047 . $_
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1048 . "\n </tbody>"
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1049 . "\n</table>";
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1050 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1051
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1052 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
1053 local($_) = @_;
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1054 my $aligns = next_optional_argument();
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1055 my $c1 = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1056 my $c2 = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1057 my $c3 = next_argument();
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1058 s/[\s\n]+//;
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1059 my($font,$sfont,$efont) = get_table_col1_fonts();
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1060 $c3 = '&nbsp;' if ($c3 eq '');
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1061 my($c1align,$c2align,$c3align) = split('\|', $aligns);
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1062 my $padding = '';
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1063 if ($c1align =~ /align="right"/) {
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1064 $padding = '&nbsp;';
7798
49f11eb4eb9a This fixes a (minor) problem discovered by AMK when you don't want any
Fred Drake <fdrake@acm.org>
parents: 7779
diff changeset
1065 }
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1066 return "\n <tr>$c1align$sfont$c1$efont$padding</td>\n"
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1067 . " $c2align$c2</td>\n"
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1068 . " $c3align$c3</td>"
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1069 . $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1070 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1071
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1072 sub do_env_tableiv{
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1073 local($_) = @_;
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1074 my($th1,$th2,$th3,$th4) = setup_column_alignments(next_argument());
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1075 my $font = fix_font(next_argument());
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1076 my $h1 = next_argument();
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1077 my $h2 = next_argument();
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1078 my $h3 = next_argument();
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1079 my $h4 = next_argument();
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1080 s/[\s\n]+//;
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1081 $globals{'lineifont'} = $font;
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1082 my $a1 = $col_aligns[0];
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1083 my $a2 = $col_aligns[1];
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1084 my $a3 = $col_aligns[2];
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1085 my $a4 = $col_aligns[3];
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1086 s/\\lineiv</\\lineiv[$a1|$a2|$a3|$a4]</g;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1087 return '<table border align="center" style="border-collapse: collapse">'
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1088 . "\n <thead>"
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1089 . "\n <tr$TABLE_HEADER_BGCOLOR>"
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1090 . "\n $th1<b>$h1</b>\&nbsp;</th>"
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1091 . "\n $th2<b>$h2</b>\&nbsp;</th>"
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1092 . "\n $th3<b>$h3</b>\&nbsp;</th>"
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1093 . "\n $th4<b>$h4</b>\&nbsp;</th>"
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1094 . "\n </thead>"
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1095 . "\n <tbody valign='baseline'>"
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1096 . $_
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1097 . "\n </tbody>"
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1098 . "\n</table>";
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1099 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1100
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1101 sub do_cmd_lineiv{
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1102 local($_) = @_;
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1103 my $aligns = next_optional_argument();
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1104 my $c1 = next_argument();
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1105 my $c2 = next_argument();
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1106 my $c3 = next_argument();
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1107 my $c4 = next_argument();
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1108 s/[\s\n]+//;
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1109 my($font,$sfont,$efont) = get_table_col1_fonts();
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1110 $c4 = '&nbsp;' if ($c4 eq '');
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1111 my($c1align,$c2align,$c3align,$c4align) = split('\|', $aligns);
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1112 my $padding = '';
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1113 if ($c1align =~ /align="right"/) {
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1114 $padding = '&nbsp;';
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1115 }
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1116 return "\n <tr>$c1align$sfont$c1$efont$padding</td>\n"
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1117 . " $c2align$c2</td>\n"
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1118 . " $c3align$c3</td>\n"
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1119 . " $c4align$c4</td>"
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1120 . $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1121 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1122
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1123 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
1124 local($_) = @_;
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1125 my $the_title = "\n<div class='titlepage'><center>";
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1126 if ($t_title) {
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
1127 $the_title .= "\n<h1>$t_title</h1>";
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1128 } else { write_warnings("\nThis document has no title."); }
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1129 if ($t_author) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1130 if ($t_authorURL) {
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1131 my $href = translate_commands($t_authorURL);
10128
0dd4fafefd6c do_cmd_maketitle(): Small nit in creating the "title page".
Fred Drake <fdrake@acm.org>
parents: 10127
diff changeset
1132 $href = make_named_href('author', $href,
0dd4fafefd6c do_cmd_maketitle(): Small nit in creating the "title page".
Fred Drake <fdrake@acm.org>
parents: 10127
diff changeset
1133 "<b><font size='+2'>$t_author</font></b>");
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
1134 $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
1135 } else {
10128
0dd4fafefd6c do_cmd_maketitle(): Small nit in creating the "title page".
Fred Drake <fdrake@acm.org>
parents: 10127
diff changeset
1136 $the_title .= ("\n<p><b><font size='+2'>$t_author</font></b></p>");
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1137 }
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1138 } else { write_warnings("\nThere is no author for this document."); }
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1139 if ($t_institute) {
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
1140 $the_title .= "\n<p>$t_institute</p>";}
8342
22815a0b1267 Added support for \developer, \developers, \developersaddress.
Fred Drake <fdrake@acm.org>
parents: 8294
diff changeset
1141 if ($DEVELOPER_ADDRESS) {
22815a0b1267 Added support for \developer, \developers, \developersaddress.
Fred Drake <fdrake@acm.org>
parents: 8294
diff changeset
1142 $the_title .= "\n<p>$DEVELOPER_ADDRESS</p>";}
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1143 if ($t_affil) {
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
1144 $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
1145 if ($t_date) {
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
1146 $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
1147 if ($PYTHON_VERSION) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1148 $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
1149 $the_title .= "</p>"
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1150 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1151 if ($t_address) {
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
1152 $the_title .= "\n<p>$t_address</p>";
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
1153 } 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
1154 if ($t_email) {
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
1155 $the_title .= "\n<p>$t_email</p>";
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
1156 }# else { $the_title .= "</p>" }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
1157 $the_title .= "\n</center></div>";
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1158 return $the_title . $_ ;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1159 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1160
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1161
8397
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1162 #
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1163 # Module synopsis support
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1164 #
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1165
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1166 require SynopsisTable;
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1167
8756
fba8455dcb54 Fix up the synopsis table stuff so it gets things right at each chapter,
Fred Drake <fdrake@acm.org>
parents: 8754
diff changeset
1168 sub get_chapter_id(){
fba8455dcb54 Fix up the synopsis table stuff so it gets things right at each chapter,
Fred Drake <fdrake@acm.org>
parents: 8754
diff changeset
1169 my $id = do_cmd_thechapter('');
8820
9b0dda9a558b get_chapter_id(): Separate two aspects of string replacement to allow the
Fred Drake <fdrake@acm.org>
parents: 8780
diff changeset
1170 $id =~ s/<SPAN CLASS="arabic">(\d+)<\/SPAN>/\1/;
9b0dda9a558b get_chapter_id(): Separate two aspects of string replacement to allow the
Fred Drake <fdrake@acm.org>
parents: 8780
diff changeset
1171 $id =~ s/\.//;
8756
fba8455dcb54 Fix up the synopsis table stuff so it gets things right at each chapter,
Fred Drake <fdrake@acm.org>
parents: 8754
diff changeset
1172 return $id;
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1173 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1174
8756
fba8455dcb54 Fix up the synopsis table stuff so it gets things right at each chapter,
Fred Drake <fdrake@acm.org>
parents: 8754
diff changeset
1175 %ModuleSynopses = ('chapter' => 'SynopsisTable instance');
fba8455dcb54 Fix up the synopsis table stuff so it gets things right at each chapter,
Fred Drake <fdrake@acm.org>
parents: 8754
diff changeset
1176
fba8455dcb54 Fix up the synopsis table stuff so it gets things right at each chapter,
Fred Drake <fdrake@acm.org>
parents: 8754
diff changeset
1177 sub get_synopsis_table($){
fba8455dcb54 Fix up the synopsis table stuff so it gets things right at each chapter,
Fred Drake <fdrake@acm.org>
parents: 8754
diff changeset
1178 my($chap) = @_;
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1179 my $st = $ModuleSynopses{$chap};
8756
fba8455dcb54 Fix up the synopsis table stuff so it gets things right at each chapter,
Fred Drake <fdrake@acm.org>
parents: 8754
diff changeset
1180 my $key;
fba8455dcb54 Fix up the synopsis table stuff so it gets things right at each chapter,
Fred Drake <fdrake@acm.org>
parents: 8754
diff changeset
1181 foreach $key (keys %ModuleSynopses) {
fba8455dcb54 Fix up the synopsis table stuff so it gets things right at each chapter,
Fred Drake <fdrake@acm.org>
parents: 8754
diff changeset
1182 if ($key eq $chap) {
fba8455dcb54 Fix up the synopsis table stuff so it gets things right at each chapter,
Fred Drake <fdrake@acm.org>
parents: 8754
diff changeset
1183 return $ModuleSynopses{$chap};
fba8455dcb54 Fix up the synopsis table stuff so it gets things right at each chapter,
Fred Drake <fdrake@acm.org>
parents: 8754
diff changeset
1184 }
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1185 }
8756
fba8455dcb54 Fix up the synopsis table stuff so it gets things right at each chapter,
Fred Drake <fdrake@acm.org>
parents: 8754
diff changeset
1186 $st = SynopsisTable->new();
fba8455dcb54 Fix up the synopsis table stuff so it gets things right at each chapter,
Fred Drake <fdrake@acm.org>
parents: 8754
diff changeset
1187 $ModuleSynopses{$chap} = $st;
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1188 return $st;
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1189 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1190
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1191 sub do_cmd_moduleauthor{
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1192 local($_) = @_;
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1193 next_argument();
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1194 next_argument();
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1195 return $_;
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1196 }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1197
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1198 sub do_cmd_sectionauthor{
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1199 local($_) = @_;
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1200 next_argument();
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1201 next_argument();
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1202 return $_;
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1203 }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1204
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1205 sub do_cmd_declaremodule{
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1206 local($_) = @_;
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1207 my $key = next_optional_argument();
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1208 my $type = next_argument();
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1209 my $name = next_argument();
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1210 my $st = get_synopsis_table(get_chapter_id());
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1211 #
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1212 $key = $name unless $key;
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1213 $type = 'built-in' if $type eq 'builtin';
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1214 $st->declare($name, $key, $type);
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1215 define_module($type, $name);
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1216 return anchor_label("module-$key",$CURRENT_FILE,$_)
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1217 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1218
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1219 sub do_cmd_modulesynopsis{
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1220 local($_) = @_;
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1221 my $st = get_synopsis_table(get_chapter_id());
10598
c8759ba83552 Fix problem of LaTeX leakage in the module synopsis tables at the
Fred Drake <fdrake@acm.org>
parents: 10464
diff changeset
1222 $st->set_synopsis($THIS_MODULE, translate_commands(next_argument()));
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1223 return $_;
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1224 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1225
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1226 sub do_cmd_localmoduletable{
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1227 local($_) = @_;
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1228 my $chap = get_chapter_id();
10327
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
1229 return "<tex2html-localmoduletable><$chap>\\tableofchildlinks[off]" . $_;
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1230 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1231
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1232 sub process_all_localmoduletables{
10327
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
1233 while (/<tex2html-localmoduletable><(\d+)>/) {
8756
fba8455dcb54 Fix up the synopsis table stuff so it gets things right at each chapter,
Fred Drake <fdrake@acm.org>
parents: 8754
diff changeset
1234 my $match = $&;
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1235 my $chap = $1;
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1236 my $st = get_synopsis_table($chap);
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1237 my $data = $st->tohtml();
8756
fba8455dcb54 Fix up the synopsis table stuff so it gets things right at each chapter,
Fred Drake <fdrake@acm.org>
parents: 8754
diff changeset
1238 s/$match/$data/;
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1239 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1240 }
10327
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
1241 sub process_python_state{
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
1242 process_all_localmoduletables();
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
1243 }
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1244
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1245
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1246 #
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1247 # "See also:" -- references placed at the end of a \section
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1248 #
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1249
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1250 sub do_env_seealso{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1251 return "<div class='seealso'>\n "
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1252 . "<p class='heading'><b>See Also:</b></p>\n"
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
1253 . @_[0]
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
1254 . '</div>';
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1255 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1256
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1257 sub do_cmd_seemodule{
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1258 # Insert the right magic to jump to the module definition. This should
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1259 # work most of the time, at least for repeat builds....
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1260 local($_) = @_;
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1261 my $key = next_optional_argument();
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1262 my $module = next_argument();
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1263 my $text = next_argument();
10846
b7378df3db56 Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents: 10777
diff changeset
1264 my $period = '.';
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1265 $key = $module
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1266 unless $key;
10846
b7378df3db56 Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents: 10777
diff changeset
1267 if ($text =~ /\.$/) {
b7378df3db56 Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents: 10777
diff changeset
1268 $period = '';
b7378df3db56 Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents: 10777
diff changeset
1269 }
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1270 return '<dl compact class="seemodule">'
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1271 . "\n <dt>Module <b><tt class='module'><a href='module-$key.html'>"
10846
b7378df3db56 Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents: 10777
diff changeset
1272 . "$module</a></tt>:</b>"
b7378df3db56 Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents: 10777
diff changeset
1273 . "\n <dd>$text$period\n </dl>"
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
1274 . $_;
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1275 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1276
12499
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
1277 sub do_cmd_seerfc{
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
1278 local($_) = @_;
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
1279 my $rfcnum = next_argument();
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
1280 my $title = next_argument();
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
1281 my $text = next_argument();
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
1282 my $url = get_rfc_url($rfcnum);
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
1283 return '<dl compact class="seerfc">'
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
1284 . "\n <dt><a href=\"$url\""
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
1285 . "\n title=\"$title\""
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
1286 . "\n >RFC $rfcnum, <em>$title</em></a>:"
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
1287 . "\n <dd>$text\n </dl>"
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
1288 . $_;
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
1289 }
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
1290
12637
69481cde511d do_cmd_seeurl(): New function.
Fred Drake <fdrake@acm.org>
parents: 12551
diff changeset
1291 sub do_cmd_seeurl{
69481cde511d do_cmd_seeurl(): New function.
Fred Drake <fdrake@acm.org>
parents: 12551
diff changeset
1292 local($_) = @_;
69481cde511d do_cmd_seeurl(): New function.
Fred Drake <fdrake@acm.org>
parents: 12551
diff changeset
1293 my $url = next_argument();
69481cde511d do_cmd_seeurl(): New function.
Fred Drake <fdrake@acm.org>
parents: 12551
diff changeset
1294 my $text = next_argument();
69481cde511d do_cmd_seeurl(): New function.
Fred Drake <fdrake@acm.org>
parents: 12551
diff changeset
1295 return '<dl compact class="seeurl">'
69481cde511d do_cmd_seeurl(): New function.
Fred Drake <fdrake@acm.org>
parents: 12551
diff changeset
1296 . "\n <dt><a href=\"$url\""
69481cde511d do_cmd_seeurl(): New function.
Fred Drake <fdrake@acm.org>
parents: 12551
diff changeset
1297 . "\n class=\"url\">$url</a>"
69481cde511d do_cmd_seeurl(): New function.
Fred Drake <fdrake@acm.org>
parents: 12551
diff changeset
1298 . "\n <dd>$text\n </dl>"
69481cde511d do_cmd_seeurl(): New function.
Fred Drake <fdrake@acm.org>
parents: 12551
diff changeset
1299 . $_;
69481cde511d do_cmd_seeurl(): New function.
Fred Drake <fdrake@acm.org>
parents: 12551
diff changeset
1300 }
69481cde511d do_cmd_seeurl(): New function.
Fred Drake <fdrake@acm.org>
parents: 12551
diff changeset
1301
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1302 sub do_cmd_seetext{
10767
e37074b6e78c do_cmd_seetext(): Clean up so we get proper nesting of <div>s. This
Fred Drake <fdrake@acm.org>
parents: 10641
diff changeset
1303 local($_) = @_;
e37074b6e78c do_cmd_seetext(): Clean up so we get proper nesting of <div>s. This
Fred Drake <fdrake@acm.org>
parents: 10641
diff changeset
1304 my $content = next_argument();
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1305 return '<div class="seetext"><p>' . $content . '</div>' . $_;
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1306 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1307
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1308
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1309 #
8397
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1310 # Definition list support.
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1311 #
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1312
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1313 sub do_env_definitions{
12499
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
1314 return "<dl class='definitions'>" . @_[0] . "</dl>\n";
8397
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1315 }
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1316
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1317 sub do_cmd_term{
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1318 local($_) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
1319 my $term = next_argument();
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
1320 my($name,$aname,$ahref) = new_link_info();
8397
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1321 # could easily add an index entry here...
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1322 return "<dt><b>$aname" . $term . "</a></b>\n<dd>" . $_;
8397
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1323 }
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1324
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1325
10100
9184862bd8d1 More magic to tighten up a little of the formatting.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
1326 process_commands_wrap_deferred(<<_RAW_ARG_DEFERRED_CMDS_);
9184862bd8d1 More magic to tighten up a little of the formatting.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
1327 code # {}
10138
b21915e6589e Fix up some routines to coordinate the "indexsubitem" stuff so that
Fred Drake <fdrake@acm.org>
parents: 10128
diff changeset
1328 declaremodule # [] # {} # {}
b21915e6589e Fix up some routines to coordinate the "indexsubitem" stuff so that
Fred Drake <fdrake@acm.org>
parents: 10128
diff changeset
1329 memberline # [] # {}
b21915e6589e Fix up some routines to coordinate the "indexsubitem" stuff so that
Fred Drake <fdrake@acm.org>
parents: 10128
diff changeset
1330 methodline # [] # {} # {}
b21915e6589e Fix up some routines to coordinate the "indexsubitem" stuff so that
Fred Drake <fdrake@acm.org>
parents: 10128
diff changeset
1331 modulesynopsis # {}
10327
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
1332 platform # {}
10100
9184862bd8d1 More magic to tighten up a little of the formatting.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
1333 samp # {}
10138
b21915e6589e Fix up some routines to coordinate the "indexsubitem" stuff so that
Fred Drake <fdrake@acm.org>
parents: 10128
diff changeset
1334 setindexsubitem # {}
10157
13239b48c469 Minor fix that helps out with the index.
Fred Drake <fdrake@acm.org>
parents: 10149
diff changeset
1335 withsubitem # {} # {}
10100
9184862bd8d1 More magic to tighten up a little of the formatting.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
1336 _RAW_ARG_DEFERRED_CMDS_
9184862bd8d1 More magic to tighten up a little of the formatting.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
1337
9184862bd8d1 More magic to tighten up a little of the formatting.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
1338
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1339 1; # This must be the last line