annotate Doc/perl/python.perl @ 9848:e19cd8ec20a2 legacy-trunk

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