annotate Doc/perl/python.perl @ 10127:bafcd7b62327 legacy-trunk

Back out some of the fine tuning; something in all that interacted badly in practice and botched the whole thing. Wasn't obvious when looking at the local effects (which worked), but completely broke entire pages. ;-(
author Fred Drake <fdrake@acm.org>
date Tue, 09 Feb 1999 15:31:52 +0000
parents 9184862bd8d1
children 0dd4fafefd6c
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
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
26 sub swallow_newline{
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
27 s/[\n]?//o;
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
28 }
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
29
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 # 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
32 # (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
33 # 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
34 #
d2d82f7b419a do_cmd_let(): Simple implementation to allow \let to be used to establish
Fred Drake <fdrake@acm.org>
parents: 8342
diff changeset
35 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
36 local($_) = @_;
d2d82f7b419a do_cmd_let(): Simple implementation to allow \let to be used to establish
Fred Drake <fdrake@acm.org>
parents: 8342
diff changeset
37 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
38 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
39 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
40 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
41 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
42 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
43 }
8346
1b393db00b1a Extend handling for \let a bit, to also allow \let\something=<character>. We
Fred Drake <fdrake@acm.org>
parents: 8344
diff changeset
44 else {
1b393db00b1a Extend handling for \let a bit, to also allow \let\something=<character>. We
Fred Drake <fdrake@acm.org>
parents: 8344
diff changeset
45 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
46 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
47 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
48 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
49 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
50 }
1b393db00b1a Extend handling for \let a bit, to also allow \let\something=<character>. We
Fred Drake <fdrake@acm.org>
parents: 8344
diff changeset
51 else {
1b393db00b1a Extend handling for \let a bit, to also allow \let\something=<character>. We
Fred Drake <fdrake@acm.org>
parents: 8344
diff changeset
52 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
53 }
1b393db00b1a Extend handling for \let a bit, to also allow \let\something=<character>. We
Fred Drake <fdrake@acm.org>
parents: 8344
diff changeset
54 }
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
55 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
56 }
d2d82f7b419a do_cmd_let(): Simple implementation to allow \let to be used to establish
Fred Drake <fdrake@acm.org>
parents: 8342
diff changeset
57
d2d82f7b419a do_cmd_let(): Simple implementation to allow \let to be used to establish
Fred Drake <fdrake@acm.org>
parents: 8342
diff changeset
58
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
59 # 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
60
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_ABC{ 'ABC' . @_[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_UNIX{ 'Unix'. @_[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_ASCII{ 'ASCII' . @_[0]; }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
64 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
65 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
66 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
67 sub do_cmd_EOF{ 'EOF' . @_[0]; }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
68 sub do_cmd_NULL{ '<tt>NULL</tt>' . @_[0]; }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
69
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
70 sub do_cmd_e{ '&#92;' . @_[0]; }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
71
8342
22815a0b1267 Added support for \developer, \developers, \developersaddress.
Fred Drake <fdrake@acm.org>
parents: 8294
diff changeset
72 $DEVELOPER_ADDRESS = '';
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
73 $PYTHON_VERSION = '';
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
74
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
75 sub do_cmd_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
76 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
77 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
78 $PYTHON_VERSION = next_argument();
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
79 return $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
80 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
81
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
82 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
83 local($_) = @_;
8342
22815a0b1267 Added support for \developer, \developers, \developersaddress.
Fred Drake <fdrake@acm.org>
parents: 8294
diff changeset
84 $DEVELOPER_ADDRESS = next_argument();
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
85 return $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
86 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
87
8344
d2d82f7b419a do_cmd_let(): Simple implementation to allow \let to be used to establish
Fred Drake <fdrake@acm.org>
parents: 8342
diff changeset
88 #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
89 #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
90 #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
91
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
92 sub do_cmd_hackscore{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
93 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
94 next_argument();
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
95 return '_' . $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
96 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
97
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
98 sub use_wrappers{
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
99 local($_,$before,$after) = @_;
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
100 my $stuff = next_argument();
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
101 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
102 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
103
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
104 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
105 return use_wrappers(@_[0], '<font face="sans-serif">', '</font>');
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
106 }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
107 sub use_italics{
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
108 return use_wrappers(@_[0], '<i>', '</i>');
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
109 }
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
110
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
111 sub do_cmd_optional{
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
112 return use_wrappers(@_[0], "</var><big>\[</big><var>",
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
113 "</var><big>\]</big><var>");
7802
dffe1e470e6c Match python.sty a little better.
Fred Drake <fdrake@acm.org>
parents: 7798
diff changeset
114 }
dffe1e470e6c Match python.sty a little better.
Fred Drake <fdrake@acm.org>
parents: 7798
diff changeset
115
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
116 # Logical formatting (some based on texinfo), needs to be converted to
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
117 # minimalist HTML. The "minimalist" is primarily to reduce the size of
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
118 # output files for users that read them over the network rather than
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
119 # 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
120
10100
9184862bd8d1 More magic to tighten up a little of the formatting.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
121 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
122 sub do_cmd_makevar{ return @_[0]; }
10127
bafcd7b62327 Back out some of the fine tuning; something in all that interacted
Fred Drake <fdrake@acm.org>
parents: 10100
diff changeset
123 sub do_cmd_code{ return use_wrappers(@_[0], '<tt>', '</tt>'); }
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
124 sub do_cmd_module{ return do_cmd_code(@_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
125 sub do_cmd_keyword{ return do_cmd_code(@_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
126 sub do_cmd_exception{ return do_cmd_code(@_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
127 sub do_cmd_class{ return do_cmd_code(@_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
128 sub do_cmd_function{ return do_cmd_code(@_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
129 sub do_cmd_constant{ return do_cmd_code(@_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
130 sub do_cmd_member{ return do_cmd_code(@_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
131 sub do_cmd_method{ return do_cmd_code(@_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
132 sub do_cmd_cfunction{ return do_cmd_code(@_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
133 sub do_cmd_cdata{ return do_cmd_code(@_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
134 sub do_cmd_ctype{ return do_cmd_code(@_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
135 sub do_cmd_regexp{ return do_cmd_code(@_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
136 sub do_cmd_character{ return do_cmd_samp(@_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
137 sub do_cmd_program{ return do_cmd_strong(@_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
138 sub do_cmd_email{ return use_sans_serif(@_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
139 sub do_cmd_mimetype{ return use_sans_serif(@_); }
10127
bafcd7b62327 Back out some of the fine tuning; something in all that interacted
Fred Drake <fdrake@acm.org>
parents: 10100
diff changeset
140 sub do_cmd_var{ return use_wrappers(@_[0], "<i>", "</i>"); }
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
141 sub do_cmd_dfn{ return use_italics(@_); } # make an index entry?
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
142 sub do_cmd_emph{ return use_italics(@_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
143 sub do_cmd_file{ return use_wrappers(@_[0], '"<tt>', '</tt>"'); }
10127
bafcd7b62327 Back out some of the fine tuning; something in all that interacted
Fred Drake <fdrake@acm.org>
parents: 10100
diff changeset
144 sub do_cmd_samp{ return use_wrappers(@_[0], '"<tt>', '</tt>"'); }
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
145 sub do_cmd_kbd{ return use_wrappers(@_[0], '<kbd>', '</kbd>'); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
146 sub do_cmd_strong{ return use_wrappers(@_[0], '<b>', '</b>'); }
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
147
9867
c95fff8f180a do_cmd_refmodule(): New function to support new \refmodule macro.
Fred Drake <fdrake@acm.org>
parents: 9848
diff changeset
148 sub do_cmd_refmodule{
c95fff8f180a do_cmd_refmodule(): New function to support new \refmodule macro.
Fred Drake <fdrake@acm.org>
parents: 9848
diff changeset
149 # 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
150 local($_) = @_;
c95fff8f180a do_cmd_refmodule(): New function to support new \refmodule macro.
Fred Drake <fdrake@acm.org>
parents: 9848
diff changeset
151 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
152 my $module = next_argument();
c95fff8f180a do_cmd_refmodule(): New function to support new \refmodule macro.
Fred Drake <fdrake@acm.org>
parents: 9848
diff changeset
153 $key = $module
c95fff8f180a do_cmd_refmodule(): New function to support new \refmodule macro.
Fred Drake <fdrake@acm.org>
parents: 9848
diff changeset
154 unless $key;
c95fff8f180a do_cmd_refmodule(): New function to support new \refmodule macro.
Fred Drake <fdrake@acm.org>
parents: 9848
diff changeset
155 return "<tt><a href=\"module-$key.html\">$module</a></tt>" . $_;
c95fff8f180a do_cmd_refmodule(): New function to support new \refmodule macro.
Fred Drake <fdrake@acm.org>
parents: 9848
diff changeset
156 }
c95fff8f180a do_cmd_refmodule(): New function to support new \refmodule macro.
Fred Drake <fdrake@acm.org>
parents: 9848
diff changeset
157
7779
1c420699d58a Implemented one more special markup item.
Fred Drake <fdrake@acm.org>
parents: 7760
diff changeset
158 sub do_cmd_newsgroup{
1c420699d58a Implemented one more special markup item.
Fred Drake <fdrake@acm.org>
parents: 7760
diff changeset
159 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
160 my $newsgroup = next_argument();
7779
1c420699d58a Implemented one more special markup item.
Fred Drake <fdrake@acm.org>
parents: 7760
diff changeset
161 my $stuff = "<a href=\"news:$newsgroup\"><font face=sans-serif>"
1c420699d58a Implemented one more special markup item.
Fred Drake <fdrake@acm.org>
parents: 7760
diff changeset
162 . "$newsgroup</font></a>";
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
163 return $stuff . $_;
7779
1c420699d58a Implemented one more special markup item.
Fred Drake <fdrake@acm.org>
parents: 7760
diff changeset
164 }
7671
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
165
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
166 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
167 local($_) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
168 my $envvar = next_argument();
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
169 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
170 # 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
171 # 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
172 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
173 $ahref);
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
174 add_index_entry("$envvar@\$$envvar", $ahref);
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
175 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
176 }
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
177
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
178
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
179 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
180 # 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
181 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
182 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
183 $url =~ s/~/&#126;/g;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
184 return "<a href=\"$url\"><font face=sans-serif>$url</font></a>" . $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
185 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
186
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
187 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
188 # 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
189 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
190 my $page = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
191 my $section = next_argument();
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
192 return "<i>$page</i>($section)" . $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
193 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
194
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
195 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
196 local($_) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
197 my $rfcnumber = next_argument();
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
198 my $id = "rfcref-" . ++$global{'max_id'};
9700
9701c50c6946 do_cmd_rfc(): Make the "RFC ###" a hyperlink to the master RFC
Fred Drake <fdrake@acm.org>
parents: 9404
diff changeset
199 my $href =
9701c50c6946 do_cmd_rfc(): Make the "RFC ###" a hyperlink to the master RFC
Fred Drake <fdrake@acm.org>
parents: 9404
diff changeset
200 "http://info.internet.isi.edu/in-notes/rfc/files/rfc$rfcnumber.txt";
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
201 # Save the reference
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
202 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
203 $index{$nstr} .= make_half_href("$CURRENT_FILE#$id");
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
204 return "<a name=\"$id\"\nhref=\"$href\">RFC $rfcnumber</a>" .$_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
205 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
206
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
207 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
208 # 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
209 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
210 my $release = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
211 my $reason = next_argument();
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
212 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
213 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
214
8763
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
215 sub do_cmd_versionadded{
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
216 # one parameter: \versionadded{version}
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
217 local($_) = @_;
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
218 my $release = next_argument();
10077
80b215249b17 Make \versionadded and \versionchanged less prominant -- neither bold
Fred Drake <fdrake@acm.org>
parents: 9867
diff changeset
219 return "\nNew in version $release.\n" . $_;
8763
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
220 }
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
221
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
222 sub do_cmd_versionchanged{
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
223 # one parameter: \versionchanged{version}
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
224 local($_) = @_;
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
225 my $release = next_argument();
10077
80b215249b17 Make \versionadded and \versionchanged less prominant -- neither bold
Fred Drake <fdrake@acm.org>
parents: 9867
diff changeset
226 return "\nChanged in version $release.\n" . $_;
8763
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
227 }
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
228
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
229 # file and samp are at the end of this file since they screw up fontlock.
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
230
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
231 # index commands
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
232
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
233 $INDEX_SUBITEM = "";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
234
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
235 sub get_indexsubitem{
9769
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
236 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
237 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
238
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
239 sub do_cmd_setindexsubitem{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
240 local($_) = @_;
9769
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
241 my $subitem = next_argument();
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
242 $INDEX_SUBITEM = $subitem;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
243 return $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
244 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
245
7671
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
246 sub do_cmd_withsubitem{
9769
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
247 # 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
248 # 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
249 # 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
250 #
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
251 local($_) = @_;
9769
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
252 my $oldsubitem = $INDEX_SUBITEM;
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
253 $INDEX_SUBITEM = next_argument();
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
254 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
255 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
256 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
257 return
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
258 $stuff
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
259 . "\\setindexsubitem$marker$oldsubitem$marker"
9769
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
260 . $_;
7671
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
261 }
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
262
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
263 # This is the prologue macro which is required to start writing the
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
264 # mod\jobname.idx file; we can just ignore it.
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
265 #
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
266 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
267
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
268 # 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
269 #
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
270 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
271 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
272 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
273 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
274
5eafd3eda0af Remove option to strip out <tt>...</tt> from index entry text; this is now
Fred Drake <fdrake@acm.org>
parents: 7906
diff changeset
275 # 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
276 # 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
277 #
5eafd3eda0af Remove option to strip out <tt>...</tt> from index entry text; this is now
Fred Drake <fdrake@acm.org>
parents: 7906
diff changeset
278 $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
279
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
280 sub write_idxfile{
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
281 my ($ahref, $str) = @_;
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
282 print IDXFILE $ahref, $IDXFILE_FIELD_SEP, $str, "\n";
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
283 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
284
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
285
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
286 sub gen_link{
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
287 my($node,$target) = @_;
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
288 print INTLABELS "\$internal_labels{\"$target\"} = \"$URL/$node\";\n";
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
289 return "<a href=\"$node#$target\">";
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
290 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
291
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
292 sub make_index_entry{
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
293 my($str) = @_;
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
294 my($name,$aname,$ahref) = new_link_info();
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
295 add_index_entry($str, $ahref);
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
296 return "$aname$anchor_invisible_mark</a>";
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
297 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
298
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
299 sub add_index_entry{
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
300 # 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
301 my($str,$ahref) = @_;
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
302 $str = gen_index_id($str, '');
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
303 $index{$str} .= $ahref;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
304 write_idxfile($ahref, $str);
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
305 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
306
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
307 sub new_link_info{
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
308 my $name = "l2h-" . ++$globals{'max_id'};
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
309 my $aname = '<a name="' . $name . '">';
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
310 my $ahref = gen_link($CURRENT_FILE, $name);
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
311 return ($name, $aname, $ahref);
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
312 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
313
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
314 sub do_cmd_index{
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
315 local($_) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
316 my $str = next_argument();
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
317 swallow_newline();
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
318 #
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
319 my($name,$aname,$ahref) = new_link_info();
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
320 add_index_entry("$str", $ahref);
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
321 return "$aname$anchor_invisible_mark</a>" . $_;
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
322 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
323
8294
35ea0c073ea3 do_cmd_kwindex(): Re-implement now that \kwindex is used again (ref man).
Fred Drake <fdrake@acm.org>
parents: 8194
diff changeset
324 sub do_cmd_kwindex{
35ea0c073ea3 do_cmd_kwindex(): Re-implement now that \kwindex is used again (ref man).
Fred Drake <fdrake@acm.org>
parents: 8194
diff changeset
325 local($_) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
326 my $str = next_argument();
8294
35ea0c073ea3 do_cmd_kwindex(): Re-implement now that \kwindex is used again (ref man).
Fred Drake <fdrake@acm.org>
parents: 8194
diff changeset
327 #
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
328 my($name,$aname,$ahref) = new_link_info();
8294
35ea0c073ea3 do_cmd_kwindex(): Re-implement now that \kwindex is used again (ref man).
Fred Drake <fdrake@acm.org>
parents: 8194
diff changeset
329 add_index_entry("<tt>$str</tt>!keyword", $ahref);
35ea0c073ea3 do_cmd_kwindex(): Re-implement now that \kwindex is used again (ref man).
Fred Drake <fdrake@acm.org>
parents: 8194
diff changeset
330 add_index_entry("keyword!<tt>$str</tt>", $ahref);
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
331 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
332 }
35ea0c073ea3 do_cmd_kwindex(): Re-implement now that \kwindex is used again (ref man).
Fred Drake <fdrake@acm.org>
parents: 8194
diff changeset
333
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
334 sub do_cmd_indexii{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
335 local($_) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
336 my $str1 = next_argument();
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
337 my $str2 = next_argument();
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
338 #
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
339 my($name,$aname,$ahref) = new_link_info();
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
340 add_index_entry("$str1!$str2", $ahref);
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
341 add_index_entry("$str2!$str1", $ahref);
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
342 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
343 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
344
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
345 sub do_cmd_indexiii{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
346 local($_) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
347 my $str1 = next_argument();
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
348 my $str2 = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
349 my $str3 = next_argument();
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
350 #
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
351 my($name,$aname,$ahref) = new_link_info();
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
352 add_index_entry("$str1!$str2 $str3", $ahref);
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
353 add_index_entry("$str2!$str3, $str1", $ahref);
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
354 add_index_entry("$str3!$str1 $str2", $ahref);
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
355 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
356 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
357
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
358 sub do_cmd_indexiv{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
359 local($_) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
360 my $str1 = next_argument();
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
361 my $str2 = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
362 my $str3 = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
363 my $str4 = next_argument();
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
364 #
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
365 my($name,$aname,$ahref) = new_link_info();
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
366 add_index_entry("$str1!$str2 $str3 $str4", $ahref);
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
367 add_index_entry("$str2!$str3 $str4, $str1", $ahref);
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
368 add_index_entry("$str3!$str4, $str1 $str2", $ahref);
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
369 add_index_entry("$str4!$$str1 $str2 $str3", $ahref);
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
370 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
371 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
372
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
373 sub do_cmd_ttindex{
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
374 local($_) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
375 my $str = next_argument();
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
376 my $entry = $str . get_indexsubitem();
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
377 swallow_newline();
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
378 return make_index_entry($entry) . $_;
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
379 }
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
380
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
381 sub my_typed_index_helper{
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
382 local($word,$_) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
383 my $str = next_argument();
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
384 swallow_newline();
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
385 #
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
386 my($name,$aname,$ahref) = new_link_info();
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
387 add_index_entry("$str $word", $ahref);
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
388 add_index_entry("$word!$str", $ahref);
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
389 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
390 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
391
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
392 sub do_cmd_stindex{ return my_typed_index_helper('statement', @_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
393 sub do_cmd_opindex{ return my_typed_index_helper('operator', @_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
394 sub do_cmd_exindex{ return my_typed_index_helper('exception', @_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
395 sub do_cmd_obindex{ return my_typed_index_helper('object', @_); }
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
396
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
397 sub my_parword_index_helper{
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
398 local($word,$_) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
399 my $str = next_argument();
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
400 swallow_newline();
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
401 return make_index_entry("$str ($word)") . $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
402 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
403
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
404
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
405 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
406 my($str,$define) = @_;
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
407 my($name,$aname,$ahref) = new_link_info();
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
408 # equivalent of add_index_entry() using $define instead of ''
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
409 $str = gen_index_id($str, $define);
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
410 $index{$str} .= $ahref;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
411 write_idxfile($ahref, $str);
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
412
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
413 if ($define eq 'DEF') {
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
414 # add to the module index
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
415 my($nstr,$garbage) = split / /, $str, 2;
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
416 $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
417 }
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
418 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
419 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
420
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
421 $THIS_MODULE = '';
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
422 $THIS_CLASS = '';
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
423
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
424 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
425 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
426 my $section_tag = join('', @curr_sec_id);
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
427 $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
428 $THIS_MODULE = "$name";
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
429 return make_mod_index_entry("<tt>$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
430 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
431
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
432 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
433 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
434 my $name = next_argument();
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
435 swallow_newline();
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
436 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
437 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
438
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
439 sub ref_module_index_helper{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
440 local($word, $_) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
441 my $str = next_argument();
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
442 swallow_newline();
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
443 $word = "$word " if $word;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
444 return make_mod_index_entry("<tt>$str</tt> (${word}module)", 'REF') . $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
445 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
446
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
447 sub do_cmd_bifuncindex{
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
448 local($_) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
449 my $str = next_argument();
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
450 my $fname = "<tt>$str()</tt>";
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
451 swallow_newline();
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
452 return make_index_entry("$fname (built-in function)") . $_;
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
453 }
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
454
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
455 sub do_cmd_modindex{ return my_module_index_helper('', @_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
456 sub do_cmd_bimodindex{ return my_module_index_helper('built-in', @_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
457 sub do_cmd_exmodindex{ return my_module_index_helper('extension', @_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
458 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
459
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
460 # these should be adjusted a bit....
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
461 sub do_cmd_refmodindex{ return ref_module_index_helper('', @_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
462 sub do_cmd_refbimodindex{ return ref_module_index_helper('built-in', @_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
463 sub do_cmd_refexmodindex{ return ref_module_index_helper('extension', @_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
464 sub do_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
465
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
466 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
467
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
468 sub init_myformat{
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
469 # $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
470 $anchor_mark = '';
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
471 $icons{'anchor_mark'} = '';
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
472 }
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
473 init_myformat();
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
474
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
475 # similar to make_index_entry(), but includes the string in the result
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
476 # 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
477 #
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
478 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
479 my($str) = @_;
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
480 my($name,$aname,$ahref) = new_link_info();
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
481 add_index_entry($str, $ahref);
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
482 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
483 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
484
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
485 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
486 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
487 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
488 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
489 my $arg_list = next_argument();
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
490 my $idx = make_str_index_entry("<tt>$function_name()</tt>"
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
491 . get_indexsubitem());
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
492 $idx =~ s/ \(.*\)//;
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
493 $idx =~ s/\(\)//; # ????
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
494 return "<dl><dt>$return_type <b>$idx</b>"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
495 . "(<var>$arg_list</var>)\n<dd>"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
496 . $_
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
497 . '</dl>';
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
498 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
499
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
500 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
501 local($_) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
502 my $type_name = next_argument();
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
503 my $idx = make_str_index_entry("<tt>$type_name</tt>" . get_indexsubitem());
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
504 $idx =~ s/ \(.*\)//;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
505 return "<dl><dt><b>$idx</b>\n<dd>"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
506 . $_
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
507 . '</dl>'
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
508 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
509
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
510 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
511 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
512 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
513 my $var_name = next_argument();
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
514 my $idx = make_str_index_entry("<tt>$var_name</tt>" . get_indexsubitem());
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
515 $idx =~ s/ \(.*\)//;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
516 return "<dl><dt>$var_type <b>$idx</b>\n"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
517 . '<dd>'
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
518 . $_
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
519 . '</dl>';
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
520 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
521
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
522 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
523 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
524 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
525 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
526 my $idx = make_str_index_entry("<tt>$function_name()</tt>"
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
527 . get_indexsubitem());
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
528 $idx =~ s/ \(.*\)//;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
529 $idx =~ s/\(\)<\/tt>/<\/tt>/;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
530 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
531 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
532
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
533 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
534 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
535 my $function_name = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
536 my $arg_list = next_argument();
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
537 return "<dl><dt><b><tt>$function_name</tt></b> (<var>$arg_list</var>)\n"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
538 . "<dd>"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
539 . $_ . '</dl>';
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
540 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
541
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
542 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
543 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
544 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
545 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
546 my $idx = make_str_index_entry("<tt>$function_name()</tt>"
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
547 . get_indexsubitem());
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
548 $idx =~ s/\(\)//;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
549 return "<dt><b>$idx</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
550 }
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 # 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
553 # 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
554 # module.
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
555 #
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
556 $INDEX_OPCODES = 0;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
557
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
558 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
559 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
560 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
561 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
562 my $idx;
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
563 if ($INDEX_OPCODES) {
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
564 $idx = make_str_index_entry(
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
565 "<tt>$opcode_name</tt> (byte code instruction)");
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
566 $idx =~ s/ \(byte code instruction\)//;
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
567 }
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
568 else {
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
569 $idx = "<tt>$opcode_name</tt>";
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
570 }
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
571 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
572 if ($arg_list) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
573 $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
574 }
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
575 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
576 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
577
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
578 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
579 local($_) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
580 my $dataname = next_argument();
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
581 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
582 $idx =~ s/ \(.*\)//;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
583 return "<dl><dt><b>$idx</b>\n<dd>"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
584 . $_
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
585 . '</dl>';
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
586 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
587
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
588 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
589 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
590 my $idx = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
591 if (! $STRING_INDEX_TT) {
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
592 $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
593 }
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
594 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
595 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
596
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
597 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
598 local($_) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
599 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
600 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
601 $idx =~ s/ \(.*\)//;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
602 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
603 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
604
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
605 sub do_env_excdesc{
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
606 local($_) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
607 my $excname = next_argument();
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
608 my $idx = make_str_index_entry("<tt>$excname</tt>");
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
609 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
610 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
611
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
612 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
613
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
614
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
615 sub do_env_classdesc{
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
616 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
617 $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
618 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
619 $idx = make_str_index_entry(
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
620 "<tt>$THIS_CLASS</tt> (class in $THIS_MODULE)" );
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
621 $idx =~ s/ \(.*\)//;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
622 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
623 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
624
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
625
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
626 sub do_env_methoddesc{
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
627 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
628 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
629 $class_name = $THIS_CLASS
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
630 unless $class_name;
9848
e19cd8ec20a2 do_cmd_methodline(): Fixed reference to method name when generating
Fred Drake <fdrake@acm.org>
parents: 9775
diff changeset
631 my $method = next_argument();
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
632 my $arg_list = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
633 my $extra = '';
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
634 if ($class_name) {
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
635 $extra = " ($class_name method)";
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
636 }
9848
e19cd8ec20a2 do_cmd_methodline(): Fixed reference to method name when generating
Fred Drake <fdrake@acm.org>
parents: 9775
diff changeset
637 my $idx = make_str_index_entry("<tt>$method()</tt>$extra");
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
638 $idx =~ s/ \(.*\)//;
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
639 $idx =~ s/\(\)//;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
640 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
641 }
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
642
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
643
9769
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
644 sub do_cmd_methodline{
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
645 local($_) = @_;
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
646 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
647 $class_name = $THIS_CLASS
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
648 unless $class_name;
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
649 my $method = next_argument();
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
650 my $arg_list = next_argument();
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
651 my $extra = '';
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
652 if ($class_name) {
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
653 $extra = " ($class_name method)";
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
654 }
9848
e19cd8ec20a2 do_cmd_methodline(): Fixed reference to method name when generating
Fred Drake <fdrake@acm.org>
parents: 9775
diff changeset
655 my $idx = make_str_index_entry("<tt>$method()</tt>$extra");
9769
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
656 $idx =~ s/ \(.*\)//;
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
657 $idx =~ s/\(\)//;
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
658 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
659 . $_;
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
660 }
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
661
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
662
9085
e943f9c09901 do_cmd_methodlineni(): New function, needed because the ref. manual now
Fred Drake <fdrake@acm.org>
parents: 8917
diff changeset
663 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
664 local($_) = @_;
e943f9c09901 do_cmd_methodlineni(): New function, needed because the ref. manual now
Fred Drake <fdrake@acm.org>
parents: 8917
diff changeset
665 next_optional_argument();
e943f9c09901 do_cmd_methodlineni(): New function, needed because the ref. manual now
Fred Drake <fdrake@acm.org>
parents: 8917
diff changeset
666 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
667 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
668 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
669 . $_;
e943f9c09901 do_cmd_methodlineni(): New function, needed because the ref. manual now
Fred Drake <fdrake@acm.org>
parents: 8917
diff changeset
670 }
e943f9c09901 do_cmd_methodlineni(): New function, needed because the ref. manual now
Fred Drake <fdrake@acm.org>
parents: 8917
diff changeset
671
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
672 sub do_env_methoddescni{
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
673 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
674 next_optional_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
675 my $method = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
676 my $arg_list = next_argument();
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
677 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
678 . $_
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
679 . '</dl>';
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
680 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
681
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
682
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
683 sub do_env_memberdesc{
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
684 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
685 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
686 my $member = next_argument();
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
687 $class = $THIS_CLASS
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
688 unless $class;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
689 my $extra = '';
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
690 $extra = " ($class_name attribute)"
8027
f5326d358662 Fix typo. (What I get for trying to fix bugs at home and running conversions
Fred Drake <fdrake@acm.org>
parents: 8026
diff changeset
691 if (!($class eq ''));
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
692 my $idx = make_str_index_entry("<tt>$member</tt>$extra");
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
693 $idx =~ s/ \(.*\)//;
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
694 $idx =~ s/\(\)//;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
695 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
696 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
697
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
698
8086
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
699 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
700 local($_) = @_;
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
701 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
702 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
703 $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
704 unless $class;
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
705 my $extra = '';
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
706 $extra = " ($class_name attribute)"
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
707 if (!($class eq ''));
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
708 my $idx = make_str_index_entry("<tt>$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
709 $idx =~ s/ \(.*\)//;
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
710 $idx =~ s/\(\)//;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
711 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
712 }
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
713
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
714 sub do_env_memberdescni{
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
715 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
716 next_optional_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
717 my $member = next_argument();
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
718 return "<dl><dt><b>$member</b>\n<dd>" . $_ . '</dl>';
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
719 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
720
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
721
8086
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
722 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
723 local($_) = @_;
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
724 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
725 my $member = next_argument();
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
726 return "<dt><b>$member</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
727 }
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
728
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
729 @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
730
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
731 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
732 local($_) = @_;
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
733 my($a1,$a2,$a3,$a4) = split(/[|]/,$_);
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
734 my($th1,$th2,$th3,$th4) = ('<th>', '<th>', '<th>', '<th>');
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
735 $col_aligns[0] = (($a1 eq 'c') ? '<td align=center>' : '<td>');
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
736 $col_aligns[1] = (($a2 eq 'c') ? '<td align=center>' : '<td>');
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
737 $col_aligns[2] = (($a3 eq 'c') ? '<td align=center>' : '<td>');
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
738 $col_aligns[3] = (($a4 eq 'c') ? '<td align=center>' : '<td>');
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
739 # return the aligned header start tags; only used for \begin{tableiii?}
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
740 $th1 = (($a1 eq 'l') ? '<th align=left>'
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
741 : ($a1 eq 'r' ? '<th align=right>' : '<th>'));
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
742 $th2 = (($a2 eq 'l') ? '<th align=left>'
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
743 : ($a2 eq 'r' ? '<th align=right>' : '<th>'));
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
744 $th3 = (($a3 eq 'l') ? '<th align=left>'
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
745 : ($a3 eq 'r' ? '<th align=right>' : '<th>'));
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
746 $th4 = (($a4 eq 'l') ? '<th align=left>'
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
747 : ($a4 eq 'r' ? '<th align=right>' : '<th>'));
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
748 return ($th1, $th2, $th3, $th4);
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
749 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
750
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
751 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
752 local($_) = @_;
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
753 my($th1,$th2,$th3,$th4) = setup_column_alignments(next_argument());
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
754 my $font = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
755 my $h1 = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
756 my $h2 = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
757 $font = ''
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
758 if ($font eq 'textrm');
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
759 $globals{'lineifont'} = $font;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
760 return '<table border align=center>'
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
761 . "\n <tr>$th1<b>$h1</b></th>"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
762 . "\n $th2<b>$h2</b></th>"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
763 . $_
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
764 . "\n</table>";
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
765 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
766
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
767 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
768 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
769 my $c1 = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
770 my $c2 = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
771 my($font,$sfont,$efont) = ($globals{'lineifont'}, '', '');
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
772 if ($font) {
7937
f223bf61b4ee do_cmd_lineii(),
Fred Drake <fdrake@acm.org>
parents: 7909
diff changeset
773 $sfont = "<$font>";
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
774 $efont = "</$font>";
49f11eb4eb9a This fixes a (minor) problem discovered by AMK when you don't want any
Fred Drake <fdrake@acm.org>
parents: 7779
diff changeset
775 }
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
776 my($c1align,$c2align) = @col_aligns[0,1];
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
777 return "<tr>$c1align$sfont$c1$efont</td>\n"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
778 . " $c2align$c2</td>"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
779 . $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
780 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
781
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
782 sub do_env_tableiii{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
783 local($_) = @_;
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
784 my($th1,$th2,$th3,$th4) = setup_column_alignments(next_argument());
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
785 my $font = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
786 my $h1 = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
787 my $h2 = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
788 my $h3 = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
789 $font = ''
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
790 if ($font eq 'textrm');
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
791 $globals{'lineifont'} = $font;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
792 return '<table border align=center>'
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
793 . "\n <tr>$th1<b>$h1</b></th>"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
794 . "\n $th2<b>$h2</b></th>"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
795 . "\n $th3<b>$h3</b></th>"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
796 . $_
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
797 . "\n</table>";
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
798 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
799
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
800 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
801 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
802 my $c1 = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
803 my $c2 = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
804 my $c3 = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
805 my($font,$sfont,$efont) = ($globals{'lineifont'}, '', '');
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
806 if ($font) {
7937
f223bf61b4ee do_cmd_lineii(),
Fred Drake <fdrake@acm.org>
parents: 7909
diff changeset
807 $sfont = "<$font>";
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
808 $efont = "</$font>";
49f11eb4eb9a This fixes a (minor) problem discovered by AMK when you don't want any
Fred Drake <fdrake@acm.org>
parents: 7779
diff changeset
809 }
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
810 my($c1align,$c2align,$c3align) = @col_aligns[0,1,2];
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
811 return "<tr>$c1align$sfont$c1$efont</td>\n"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
812 . " $c2align$c2</td>\n"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
813 . " $c3align$c3</td>"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
814 . $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
815 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
816
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
817 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
818 local($_) = @_;
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
819 my($th1,$th2,$th3,$th4) = setup_column_alignments(next_argument());
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
820 my $font = next_argument();
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
821 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
822 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
823 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
824 my $h4 = next_argument();
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
825 $font = ''
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
826 if ($font eq 'textrm');
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
827 $globals{'lineifont'} = $font;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
828 return '<table border align=center>'
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
829 . "\n <tr>$th1<b>$h1</b></th>"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
830 . "\n $th2<b>$h2</b></th>"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
831 . "\n $th3<b>$h3</b></th>"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
832 . "\n $th4<b>$h4</b></th>"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
833 . $_
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
834 . "\n</table>";
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
835 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
836
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
837 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
838 local($_) = @_;
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
839 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
840 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
841 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
842 my $c4 = next_argument();
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
843 my($font,$sfont,$efont) = ($globals{'lineifont'}, '', '');
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
844 if ($font) {
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
845 $sfont = "<$font>";
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
846 $efont = "</$font>";
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
847 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
848 my($c1align,$c2align,$c3align,$c4align) = @col_aligns;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
849 return "<tr>$c1align$sfont$c1$efont</td>\n"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
850 . " $c2align$c2</td>\n"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
851 . " $c3align$c3</td>\n"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
852 . " $c4align$c4</td>"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
853 . $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
854 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
855
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
856 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
857 local($_) = @_;
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
858 my $the_title = '';
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
859 if ($t_title) {
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
860 $the_title .= "<h1 align=center>$t_title</h1>";
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
861 } else { write_warnings("\nThis document has no title."); }
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
862 $the_title .= "\n<center>";
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
863 if ($t_author) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
864 if ($t_authorURL) {
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
865 my $href = translate_commands($t_authorURL);
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
866 $href = make_named_href('author', $href, "<strong>${t_author}</strong>");
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
867 $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
868 } else {
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
869 $the_title .= "\n<p><strong>$t_author</strong></p>";
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
870 }
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
871 } 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
872 if ($t_institute) {
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
873 $the_title .= "\n<p>$t_institute</p>";}
8342
22815a0b1267 Added support for \developer, \developers, \developersaddress.
Fred Drake <fdrake@acm.org>
parents: 8294
diff changeset
874 if ($DEVELOPER_ADDRESS) {
22815a0b1267 Added support for \developer, \developers, \developersaddress.
Fred Drake <fdrake@acm.org>
parents: 8294
diff changeset
875 $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
876 if ($t_affil) {
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
877 $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
878 if ($t_date) {
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
879 $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
880 if ($PYTHON_VERSION) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
881 $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
882 $the_title .= "</p>"
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
883 }
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
884 $the_title .= "\n</center>";
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
885 if ($t_address) {
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
886 $the_title .= "\n<p>$t_address</p>";
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
887 } 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
888 if ($t_email) {
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
889 $the_title .= "\n<p>$t_email</p>";
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
890 }# else { $the_title .= "</p>" }
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
891 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
892 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
893
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
894
8397
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
895 #
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
896 # 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
897 #
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
898
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
899 require SynopsisTable;
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
900
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
901 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
902 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
903 $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
904 $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
905 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
906 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
907
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
908 %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
909
fba8455dcb54 Fix up the synopsis table stuff so it gets things right at each chapter,
Fred Drake <fdrake@acm.org>
parents: 8754
diff changeset
910 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
911 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
912 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
913 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
914 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
915 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
916 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
917 }
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
918 }
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
919 $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
920 $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
921 return $st;
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
922 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
923
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
924 sub do_cmd_moduleauthor{
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
925 local($_) = @_;
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
926 next_argument();
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
927 next_argument();
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
928 return $_;
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
929 }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
930
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
931 sub do_cmd_sectionauthor{
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
932 local($_) = @_;
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
933 next_argument();
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
934 next_argument();
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
935 return $_;
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
936 }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
937
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
938 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
939 local($_) = @_;
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
940 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
941 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
942 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
943 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
944 #
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
945 $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
946 $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
947 $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
948 define_module($type, $name);
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
949 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
950 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
951
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
952 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
953 local($_) = @_;
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
954 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
955 $st->set_synopsis($THIS_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
956 swallow_newline();
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
957 return $_;
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
958 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
959
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
960 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
961 local($_) = @_;
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
962 my $chap = get_chapter_id();
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
963 return "<tex2htmllocalmoduletable><$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
964 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
965
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
966 sub process_all_localmoduletables{
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
967 while (/<tex2htmllocalmoduletable><(\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
968 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
969 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
970 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
971 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
972 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
973 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
974 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
975
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
976
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
977 #
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
978 # "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
979 #
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
980
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
981 sub do_env_seealso{
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
982 return "<p><b>See Also:</b></p>\n" . @_[0];
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
983 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
984
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
985 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
986 # 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
987 # 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
988 local($_) = @_;
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
989 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
990 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
991 my $text = next_argument();
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
992 $key = $module
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
993 unless $key;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
994 return "<p>Module <tt><b><a href=\"module-$key.html\">$module</a></b></tt>"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
995 . "&nbsp;&nbsp;&nbsp;($text)</p>"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
996 . $_;
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
997 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
998
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
999 sub do_cmd_seetext{
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1000 return '<p>' . @_[0];
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1001 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1002
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1003
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1004 #
8397
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1005 # Definition list support.
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1006 #
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1007
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1008 sub do_env_definitions{
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1009 local($_) = @_;
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1010 swallow_newline();
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1011 return "<dl>$_</dl>\n";
8397
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1012 }
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1013
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1014 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
1015 local($_) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
1016 my $term = next_argument();
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
1017 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
1018 swallow_newline();
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1019 # could easily add an index entry here...
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1020 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
1021 }
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1022
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1023
10100
9184862bd8d1 More magic to tighten up a little of the formatting.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
1024 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
1025 code # {}
9184862bd8d1 More magic to tighten up a little of the formatting.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
1026 samp # {}
9184862bd8d1 More magic to tighten up a little of the formatting.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
1027 _RAW_ARG_DEFERRED_CMDS_
9184862bd8d1 More magic to tighten up a little of the formatting.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
1028
9184862bd8d1 More magic to tighten up a little of the formatting.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
1029
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1030 1; # This must be the last line