annotate Doc/perl/python.perl @ 25644:199f0f6a8a36 2.2

Back-port part of 1.128 from the trunk: \productioncont: Replace leading spaces with   so that it's possible to control the indentation of continuation lines.
author Fred Drake <fdrake@acm.org>
date Mon, 07 Oct 2002 16:18:57 +0000
parents 74de86418284
children 9c7aa43b21a9
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
14970
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
11 use File::Basename;
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
12
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
13
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
14 sub next_argument{
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
15 my $param;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
16 $param = missing_braces()
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
17 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
18 ||(s/$next_pair_rx/$param=$2;''/eo));
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
19 return $param;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
20 }
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
21
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
22 sub next_optional_argument{
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
23 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
24 s/$rx/$param=$2;''/eo;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
25 return $param;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
26 }
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
27
14970
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
28 sub make_icon_filename($){
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
29 my($myname, $mydir, $myext) = fileparse(@_[0], '\..*');
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
30 chop $mydir;
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
31 if ($mydir eq '.') {
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
32 $mydir = $ICONSERVER;
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
33 }
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
34 $myext = ".$IMAGE_TYPE"
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
35 unless $myext;
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
36 return "$mydir$dd$myname$myext";
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
37 }
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
38
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
39 sub get_link_icon($){
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
40 my $url = @_[0];
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
41 if ($OFF_SITE_LINK_ICON && ($url =~ /^[-a-zA-Z0-9.]+:/)) {
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
42 # absolute URL; assume it points off-site
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
43 my $icon = make_icon_filename($OFF_SITE_LINK_ICON);
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
44 return (" <img src=\"$icon\"\n"
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
45 . ' border="0" class="offsitelink"'
14987
bbe09cccb49b $OFF_SITE_LINK_ICON: Don't define here; simply defining it overrides a
Fred Drake <fdrake@acm.org>
parents: 14970
diff changeset
46 . ($OFF_SITE_LINK_ICON_HEIGHT
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
47 ? " height=\"$OFF_SITE_LINK_ICON_HEIGHT\""
14987
bbe09cccb49b $OFF_SITE_LINK_ICON: Don't define here; simply defining it overrides a
Fred Drake <fdrake@acm.org>
parents: 14970
diff changeset
48 : '')
bbe09cccb49b $OFF_SITE_LINK_ICON: Don't define here; simply defining it overrides a
Fred Drake <fdrake@acm.org>
parents: 14970
diff changeset
49 . ($OFF_SITE_LINK_ICON_WIDTH
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
50 ? " width=\"$OFF_SITE_LINK_ICON_WIDTH\""
14987
bbe09cccb49b $OFF_SITE_LINK_ICON: Don't define here; simply defining it overrides a
Fred Drake <fdrake@acm.org>
parents: 14970
diff changeset
51 : '')
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
52 . " alt=\"[off-site link]\"\n"
14970
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
53 . " >");
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
54 }
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
55 return '';
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
56 }
8344
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 # 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
59 # (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
60 # 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
61 #
d2d82f7b419a do_cmd_let(): Simple implementation to allow \let to be used to establish
Fred Drake <fdrake@acm.org>
parents: 8342
diff changeset
62 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
63 local($_) = @_;
d2d82f7b419a do_cmd_let(): Simple implementation to allow \let to be used to establish
Fred Drake <fdrake@acm.org>
parents: 8342
diff changeset
64 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
65 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
66 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
67 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
68 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
69 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
70 }
8346
1b393db00b1a Extend handling for \let a bit, to also allow \let\something=<character>. We
Fred Drake <fdrake@acm.org>
parents: 8344
diff changeset
71 else {
1b393db00b1a Extend handling for \let a bit, to also allow \let\something=<character>. We
Fred Drake <fdrake@acm.org>
parents: 8344
diff changeset
72 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
73 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
74 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
75 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
76 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
77 }
1b393db00b1a Extend handling for \let a bit, to also allow \let\something=<character>. We
Fred Drake <fdrake@acm.org>
parents: 8344
diff changeset
78 else {
1b393db00b1a Extend handling for \let a bit, to also allow \let\something=<character>. We
Fred Drake <fdrake@acm.org>
parents: 8344
diff changeset
79 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
80 }
1b393db00b1a Extend handling for \let a bit, to also allow \let\something=<character>. We
Fred Drake <fdrake@acm.org>
parents: 8344
diff changeset
81 }
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
82 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
83 }
d2d82f7b419a do_cmd_let(): Simple implementation to allow \let to be used to establish
Fred Drake <fdrake@acm.org>
parents: 8342
diff changeset
84
d2d82f7b419a do_cmd_let(): Simple implementation to allow \let to be used to establish
Fred Drake <fdrake@acm.org>
parents: 8342
diff changeset
85
12928
59e494c0802f do_cmd_textasciitilde(): New function.
Fred Drake <fdrake@acm.org>
parents: 12637
diff changeset
86 # the older version of LaTeX2HTML we use doesn't support this, but we use it:
59e494c0802f do_cmd_textasciitilde(): New function.
Fred Drake <fdrake@acm.org>
parents: 12637
diff changeset
87
22260
d30797e5cc1a Change the way \textasciitilde is implemented so it works more consistently
Fred Drake <fdrake@acm.org>
parents: 21418
diff changeset
88 sub do_cmd_textasciitilde{ '&#126;' . @_[0]; }
17602
f63f749364ef The (fairly recent) \textasciicircum is not supported by LaTeX2HTML; add
Fred Drake <fdrake@acm.org>
parents: 17561
diff changeset
89 sub do_cmd_textasciicircum{ '^' . @_[0]; }
18231
f9261904cebb Added support for our new \infinity and \plusminus macros, and the
Fred Drake <fdrake@acm.org>
parents: 18185
diff changeset
90 sub do_cmd_textbar{ '|' . @_[0]; }
f9261904cebb Added support for our new \infinity and \plusminus macros, and the
Fred Drake <fdrake@acm.org>
parents: 18185
diff changeset
91 sub do_cmd_infinity{ '&infin;' . @_[0]; }
f9261904cebb Added support for our new \infinity and \plusminus macros, and the
Fred Drake <fdrake@acm.org>
parents: 18185
diff changeset
92 sub do_cmd_plusminus{ '&plusmn;' . @_[0]; }
18426
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
93 sub do_cmd_menuselection{ @_[0]; }
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
94 sub do_cmd_sub{ ' > ' . @_[0]; }
12928
59e494c0802f do_cmd_textasciitilde(): New function.
Fred Drake <fdrake@acm.org>
parents: 12637
diff changeset
95
59e494c0802f do_cmd_textasciitilde(): New function.
Fred Drake <fdrake@acm.org>
parents: 12637
diff changeset
96
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
97 # 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
98
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
99 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
100 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
101 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
102 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
103 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
104 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
105 sub do_cmd_EOF{ 'EOF' . @_[0]; }
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
106 sub do_cmd_NULL{ '<tt class="constant">NULL</tt>' . @_[0]; }
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
107
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
108 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
109
8342
22815a0b1267 Added support for \developer, \developers, \developersaddress.
Fred Drake <fdrake@acm.org>
parents: 8294
diff changeset
110 $DEVELOPER_ADDRESS = '';
14556
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
111 $SHORT_VERSION = '';
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
112 $RELEASE_INFO = '';
15322
d17ba141480a Rename $PYTHON_VERSION to $PACKAGE_VERSION; this is the version number for
Fred Drake <fdrake@acm.org>
parents: 14987
diff changeset
113 $PACKAGE_VERSION = '';
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
114
15322
d17ba141480a Rename $PYTHON_VERSION to $PACKAGE_VERSION; this is the version number for
Fred Drake <fdrake@acm.org>
parents: 14987
diff changeset
115 sub do_cmd_version{ $PACKAGE_VERSION . @_[0]; }
14556
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
116 sub do_cmd_shortversion{ $SHORT_VERSION . @_[0]; }
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
117 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
118 local($_) = @_;
15322
d17ba141480a Rename $PYTHON_VERSION to $PACKAGE_VERSION; this is the version number for
Fred Drake <fdrake@acm.org>
parents: 14987
diff changeset
119 $PACKAGE_VERSION = next_argument();
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
120 return $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
121 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
122
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
123 sub do_cmd_setreleaseinfo{
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
124 local($_) = @_;
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
125 $RELEASE_INFO = next_argument();
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
126 return $_;
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
127 }
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
128
14556
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
129 sub do_cmd_setshortversion{
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
130 local($_) = @_;
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
131 $SHORT_VERSION = next_argument();
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
132 return $_;
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
133 }
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
134
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
135 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
136 local($_) = @_;
8342
22815a0b1267 Added support for \developer, \developers, \developersaddress.
Fred Drake <fdrake@acm.org>
parents: 8294
diff changeset
137 $DEVELOPER_ADDRESS = next_argument();
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
138 return $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
139 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
140
8344
d2d82f7b419a do_cmd_let(): Simple implementation to allow \let to be used to establish
Fred Drake <fdrake@acm.org>
parents: 8342
diff changeset
141 #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
142 #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
143 #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
144
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
145 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
146 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
147 next_argument();
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
148 return '_' . $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
149 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
150
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
151 sub use_wrappers{
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
152 local($_,$before,$after) = @_;
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
153 my $stuff = next_argument();
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
154 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
155 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
156
14556
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
157 $IN_DESC_HANDLER = 0;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
158 sub do_cmd_optional{
14556
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
159 if ($IN_DESC_HANDLER) {
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
160 return use_wrappers(@_[0], "</var><big>\[</big><var>",
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
161 "</var><big>\]</big><var>");
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
162 }
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
163 else {
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
164 return use_wrappers(@_[0], "<big>\[</big>", "<big>\]</big>");
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
165 }
7802
dffe1e470e6c Match python.sty a little better.
Fred Drake <fdrake@acm.org>
parents: 7798
diff changeset
166 }
dffe1e470e6c Match python.sty a little better.
Fred Drake <fdrake@acm.org>
parents: 7798
diff changeset
167
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
168 # Logical formatting (some based on texinfo), needs to be converted to
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
169 # minimalist HTML. The "minimalist" is primarily to reduce the size of
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
170 # output files for users that read them over the network rather than
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
171 # 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
172
10464
f74ef1971bd1 Remove \platformof support, since it's been removed from the LaTeX
Fred Drake <fdrake@acm.org>
parents: 10327
diff changeset
173 # \file and \samp are at the end of this file since they screw up fontlock.
f74ef1971bd1 Remove \platformof support, since it's been removed from the LaTeX
Fred Drake <fdrake@acm.org>
parents: 10327
diff changeset
174
10100
9184862bd8d1 More magic to tighten up a little of the formatting.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
175 sub do_cmd_pytype{ return @_[0]; }
13831
c3783a33f84b do_cmd_moreargs(),
Fred Drake <fdrake@acm.org>
parents: 13077
diff changeset
176 sub do_cmd_makevar{
c3783a33f84b do_cmd_moreargs(),
Fred Drake <fdrake@acm.org>
parents: 13077
diff changeset
177 return use_wrappers(@_[0], '<span class="makevar">', '</span>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
178 sub do_cmd_code{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
179 return use_wrappers(@_[0], '<code>', '</code>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
180 sub do_cmd_module{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
181 return use_wrappers(@_[0], '<tt class="module">', '</tt>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
182 sub do_cmd_keyword{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
183 return use_wrappers(@_[0], '<tt class="keyword">', '</tt>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
184 sub do_cmd_exception{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
185 return use_wrappers(@_[0], '<tt class="exception">', '</tt>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
186 sub do_cmd_class{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
187 return use_wrappers(@_[0], '<tt class="class">', '</tt>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
188 sub do_cmd_function{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
189 return use_wrappers(@_[0], '<tt class="function">', '</tt>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
190 sub do_cmd_constant{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
191 return use_wrappers(@_[0], '<tt class="constant">', '</tt>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
192 sub do_cmd_member{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
193 return use_wrappers(@_[0], '<tt class="member">', '</tt>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
194 sub do_cmd_method{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
195 return use_wrappers(@_[0], '<tt class="method">', '</tt>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
196 sub do_cmd_cfunction{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
197 return use_wrappers(@_[0], '<tt class="cfunction">', '</tt>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
198 sub do_cmd_cdata{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
199 return use_wrappers(@_[0], '<tt class="cdata">', '</tt>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
200 sub do_cmd_ctype{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
201 return use_wrappers(@_[0], '<tt class="ctype">', '</tt>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
202 sub do_cmd_regexp{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
203 return use_wrappers(@_[0], '<tt class="regexp">', '</tt>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
204 sub do_cmd_character{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
205 return use_wrappers(@_[0], '"<tt class="character">', '</tt>"'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
206 sub do_cmd_program{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
207 return use_wrappers(@_[0], '<b class="program">', '</b>'); }
11449
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
208 sub do_cmd_programopt{
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
209 return use_wrappers(@_[0], '<b class="programopt">', '</b>'); }
12376
6ce6c23acd14 do_cmd_longprogramopt(): New function.
Fred Drake <fdrake@acm.org>
parents: 12350
diff changeset
210 sub do_cmd_longprogramopt{
6ce6c23acd14 do_cmd_longprogramopt(): New function.
Fred Drake <fdrake@acm.org>
parents: 12350
diff changeset
211 # note that the --- will be later converted to -- by LaTeX2HTML
6ce6c23acd14 do_cmd_longprogramopt(): New function.
Fred Drake <fdrake@acm.org>
parents: 12350
diff changeset
212 return use_wrappers(@_[0], '<b class="programopt">---', '</b>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
213 sub do_cmd_email{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
214 return use_wrappers(@_[0], '<span class="email">', '</span>'); }
18981
dac9cca49012 Define the \mailheader macro and document conventions for using it.
Fred Drake <fdrake@acm.org>
parents: 18683
diff changeset
215 sub do_cmd_mailheader{
20113
12a787fb71df Move the styling for the HTML version of \mailheader into the CSS file.
Fred Drake <fdrake@acm.org>
parents: 19412
diff changeset
216 return use_wrappers(@_[0], '<span class="mailheader">', ':</span>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
217 sub do_cmd_mimetype{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
218 return use_wrappers(@_[0], '<span class="mimetype">', '</span>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
219 sub do_cmd_var{
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
220 return use_wrappers(@_[0], "<var>", "</var>"); }
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
221 sub do_cmd_dfn{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
222 return use_wrappers(@_[0], '<i class="dfn">', '</i>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
223 sub do_cmd_emph{
14766
72860ef03171 use_sans_serif(),
Fred Drake <fdrake@acm.org>
parents: 14722
diff changeset
224 return use_wrappers(@_[0], '<i>', '</i>'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
225 sub do_cmd_file{
13831
c3783a33f84b do_cmd_moreargs(),
Fred Drake <fdrake@acm.org>
parents: 13077
diff changeset
226 return use_wrappers(@_[0], '<span class="file">', '</span>'); }
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
227 sub do_cmd_filenq{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
228 return do_cmd_file(@_[0]); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
229 sub do_cmd_samp{
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
230 return use_wrappers(@_[0], '"<tt class="samp">', '</tt>"'); }
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
231 sub do_cmd_kbd{
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
232 return use_wrappers(@_[0], '<kbd>', '</kbd>'); }
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
233 sub do_cmd_strong{
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
234 return use_wrappers(@_[0], '<b>', '</b>'); }
10464
f74ef1971bd1 Remove \platformof support, since it's been removed from the LaTeX
Fred Drake <fdrake@acm.org>
parents: 10327
diff changeset
235 sub do_cmd_textbf{
f74ef1971bd1 Remove \platformof support, since it's been removed from the LaTeX
Fred Drake <fdrake@acm.org>
parents: 10327
diff changeset
236 return use_wrappers(@_[0], '<b>', '</b>'); }
f74ef1971bd1 Remove \platformof support, since it's been removed from the LaTeX
Fred Drake <fdrake@acm.org>
parents: 10327
diff changeset
237 sub do_cmd_textit{
f74ef1971bd1 Remove \platformof support, since it's been removed from the LaTeX
Fred Drake <fdrake@acm.org>
parents: 10327
diff changeset
238 return use_wrappers(@_[0], '<i>', '</i>'); }
21418
571d5b7b746c Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents: 21409
diff changeset
239 # This can be changed/overridden for translations:
571d5b7b746c Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents: 21409
diff changeset
240 %NoticeNames = ('note' => 'Note:',
571d5b7b746c Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents: 21409
diff changeset
241 'warning' => 'Warning:',
571d5b7b746c Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents: 21409
diff changeset
242 );
571d5b7b746c Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents: 21409
diff changeset
243
20336
1b3ffdf12150 New markup: \note{...} and \warning{...}
Fred Drake <fdrake@acm.org>
parents: 20113
diff changeset
244 sub do_cmd_note{
21418
571d5b7b746c Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents: 21409
diff changeset
245 my $label = $NoticeNames{'note'};
571d5b7b746c Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents: 21409
diff changeset
246 return use_wrappers(
571d5b7b746c Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents: 21409
diff changeset
247 @_[0],
571d5b7b746c Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents: 21409
diff changeset
248 "<span class=\"note\"><b class=\"label\">$label</b>\n",
571d5b7b746c Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents: 21409
diff changeset
249 '</span>'); }
571d5b7b746c Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents: 21409
diff changeset
250 sub do_cmd_warning{
571d5b7b746c Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents: 21409
diff changeset
251 my $label = $NoticeNames{'warning'};
20336
1b3ffdf12150 New markup: \note{...} and \warning{...}
Fred Drake <fdrake@acm.org>
parents: 20113
diff changeset
252 return use_wrappers(
1b3ffdf12150 New markup: \note{...} and \warning{...}
Fred Drake <fdrake@acm.org>
parents: 20113
diff changeset
253 @_[0],
21418
571d5b7b746c Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents: 21409
diff changeset
254 "<span class=\"warning\"><b class=\"label\">$label</b>\n",
20336
1b3ffdf12150 New markup: \note{...} and \warning{...}
Fred Drake <fdrake@acm.org>
parents: 20113
diff changeset
255 '</span>'); }
21418
571d5b7b746c Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents: 21409
diff changeset
256
571d5b7b746c Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents: 21409
diff changeset
257 sub do_env_notice{
571d5b7b746c Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents: 21409
diff changeset
258 local($_) = @_;
571d5b7b746c Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents: 21409
diff changeset
259 my $notice = next_optional_argument();
571d5b7b746c Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents: 21409
diff changeset
260 if (!$notice) {
571d5b7b746c Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents: 21409
diff changeset
261 $notice = 'note';
571d5b7b746c Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents: 21409
diff changeset
262 }
571d5b7b746c Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents: 21409
diff changeset
263 my $label = $NoticeNames{$notice};
571d5b7b746c Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents: 21409
diff changeset
264 return ("<div class=\"$notice\"><b class=\"label\">$label</b>\n"
571d5b7b746c Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents: 21409
diff changeset
265 . $_
571d5b7b746c Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents: 21409
diff changeset
266 . '</div>');
571d5b7b746c Add a new environment for whole-paragraph (or longer) notes & warnings.
Fred Drake <fdrake@acm.org>
parents: 21409
diff changeset
267 }
10464
f74ef1971bd1 Remove \platformof support, since it's been removed from the LaTeX
Fred Drake <fdrake@acm.org>
parents: 10327
diff changeset
268
13831
c3783a33f84b do_cmd_moreargs(),
Fred Drake <fdrake@acm.org>
parents: 13077
diff changeset
269 sub do_cmd_moreargs{
c3783a33f84b do_cmd_moreargs(),
Fred Drake <fdrake@acm.org>
parents: 13077
diff changeset
270 return '...' . @_[0]; }
c3783a33f84b do_cmd_moreargs(),
Fred Drake <fdrake@acm.org>
parents: 13077
diff changeset
271 sub do_cmd_unspecified{
c3783a33f84b do_cmd_moreargs(),
Fred Drake <fdrake@acm.org>
parents: 13077
diff changeset
272 return '...' . @_[0]; }
c3783a33f84b do_cmd_moreargs(),
Fred Drake <fdrake@acm.org>
parents: 13077
diff changeset
273
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
274
9867
c95fff8f180a do_cmd_refmodule(): New function to support new \refmodule macro.
Fred Drake <fdrake@acm.org>
parents: 9848
diff changeset
275 sub do_cmd_refmodule{
c95fff8f180a do_cmd_refmodule(): New function to support new \refmodule macro.
Fred Drake <fdrake@acm.org>
parents: 9848
diff changeset
276 # Insert the right magic to jump to the module definition.
c95fff8f180a do_cmd_refmodule(): New function to support new \refmodule macro.
Fred Drake <fdrake@acm.org>
parents: 9848
diff changeset
277 local($_) = @_;
c95fff8f180a do_cmd_refmodule(): New function to support new \refmodule macro.
Fred Drake <fdrake@acm.org>
parents: 9848
diff changeset
278 my $key = next_optional_argument();
c95fff8f180a do_cmd_refmodule(): New function to support new \refmodule macro.
Fred Drake <fdrake@acm.org>
parents: 9848
diff changeset
279 my $module = next_argument();
c95fff8f180a do_cmd_refmodule(): New function to support new \refmodule macro.
Fred Drake <fdrake@acm.org>
parents: 9848
diff changeset
280 $key = $module
c95fff8f180a do_cmd_refmodule(): New function to support new \refmodule macro.
Fred Drake <fdrake@acm.org>
parents: 9848
diff changeset
281 unless $key;
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
282 return "<tt class=\"module\"><a href=\"module-$key.html\">$module</a></tt>"
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
283 . $_;
9867
c95fff8f180a do_cmd_refmodule(): New function to support new \refmodule macro.
Fred Drake <fdrake@acm.org>
parents: 9848
diff changeset
284 }
c95fff8f180a do_cmd_refmodule(): New function to support new \refmodule macro.
Fred Drake <fdrake@acm.org>
parents: 9848
diff changeset
285
7779
1c420699d58a Implemented one more special markup item.
Fred Drake <fdrake@acm.org>
parents: 7760
diff changeset
286 sub do_cmd_newsgroup{
1c420699d58a Implemented one more special markup item.
Fred Drake <fdrake@acm.org>
parents: 7760
diff changeset
287 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
288 my $newsgroup = next_argument();
14970
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
289 my $icon = get_link_icon("news:$newsgroup");
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
290 my $stuff = ("<a class=\"newsgroup\" href=\"news:$newsgroup\">"
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
291 . "$newsgroup$icon</a>");
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
292 return $stuff . $_;
7779
1c420699d58a Implemented one more special markup item.
Fred Drake <fdrake@acm.org>
parents: 7760
diff changeset
293 }
7671
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
294
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
295 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
296 local($_) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
297 my $envvar = next_argument();
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
298 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
299 # 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
300 # the variable name case-insensitive.
16114
44fd1a7cb279 Fix \seepep handling -- correct URL to the online PEP repository on SF is
Fred Drake <fdrake@acm.org>
parents: 15567
diff changeset
301 add_index_entry("environment variables!$envvar@<tt>$envvar</tt>",
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
302 $ahref);
16114
44fd1a7cb279 Fix \seepep handling -- correct URL to the online PEP repository on SF is
Fred Drake <fdrake@acm.org>
parents: 15567
diff changeset
303 add_index_entry("$envvar (environment variable)", $ahref);
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
304 $aname =~ s/<a/<a class="envvar"/;
16114
44fd1a7cb279 Fix \seepep handling -- correct URL to the online PEP repository on SF is
Fred Drake <fdrake@acm.org>
parents: 15567
diff changeset
305 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
306 }
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
307
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
308 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
309 # 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
310 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
311 my $url = next_argument();
14970
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
312 my $icon = get_link_icon($url);
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
313 $url =~ s/~/&#126;/g;
14970
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
314 return "<a class=\"url\" href=\"$url\">$url$icon</a>" . $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
315 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
316
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
317 sub do_cmd_manpage{
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
318 # 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
319 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
320 my $page = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
321 my $section = next_argument();
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
322 return "<span class=\"manpage\"><i>$page</i>($section)</span>" . $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
323 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
324
22775
74de86418284 Update the PEP URL format to point to python.org.
Fred Drake <fdrake@acm.org>
parents: 22316
diff changeset
325 $PEP_FORMAT = "http://www.python.org/peps/pep-%04d.html";
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
326 #$RFC_FORMAT = "http://www.ietf.org/rfc/rfc%04d.txt";
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
327 $RFC_FORMAT = "http://www.faqs.org/rfcs/rfc%d.html";
16114
44fd1a7cb279 Fix \seepep handling -- correct URL to the online PEP repository on SF is
Fred Drake <fdrake@acm.org>
parents: 15567
diff changeset
328
44fd1a7cb279 Fix \seepep handling -- correct URL to the online PEP repository on SF is
Fred Drake <fdrake@acm.org>
parents: 15567
diff changeset
329 sub get_rfc_url($$){
44fd1a7cb279 Fix \seepep handling -- correct URL to the online PEP repository on SF is
Fred Drake <fdrake@acm.org>
parents: 15567
diff changeset
330 my($rfcnum, $format) = @_;
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
331 return sprintf($format, $rfcnum);
14491
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
332 }
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
333
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
334 sub do_cmd_pep{
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
335 local($_) = @_;
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
336 my $rfcnumber = next_argument();
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
337 my $id = "rfcref-" . ++$global{'max_id'};
16114
44fd1a7cb279 Fix \seepep handling -- correct URL to the online PEP repository on SF is
Fred Drake <fdrake@acm.org>
parents: 15567
diff changeset
338 my $href = get_rfc_url($rfcnumber, $PEP_FORMAT);
14970
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
339 my $icon = get_link_icon($href);
14491
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
340 # Save the reference
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
341 my $nstr = gen_index_id("Python Enhancement Proposals!PEP $rfcnumber", '');
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
342 $index{$nstr} .= make_half_href("$CURRENT_FILE#$id");
14970
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
343 return ("<a class=\"rfc\" name=\"$id\"\nhref=\"$href\">PEP $rfcnumber"
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
344 . "$icon</a>" . $_);
14491
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
345 }
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
346
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
347 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
348 local($_) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
349 my $rfcnumber = next_argument();
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
350 my $id = "rfcref-" . ++$global{'max_id'};
16114
44fd1a7cb279 Fix \seepep handling -- correct URL to the online PEP repository on SF is
Fred Drake <fdrake@acm.org>
parents: 15567
diff changeset
351 my $href = get_rfc_url($rfcnumber, $RFC_FORMAT);
14970
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
352 my $icon = get_link_icon($href);
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
353 # Save the reference
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
354 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
355 $index{$nstr} .= make_half_href("$CURRENT_FILE#$id");
14970
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
356 return ("<a class=\"rfc\" name=\"$id\"\nhref=\"$href\">RFC $rfcnumber"
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
357 . "$icon</a>" . $_);
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
358 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
359
18426
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
360 sub do_cmd_ulink{
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
361 local($_) = @_;
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
362 my $text = next_argument();
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
363 my $url = next_argument();
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
364 return "<a class=\"ulink\" href=\"$url\"\n >$text</a>" . $_;
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
365 }
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
366
11449
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
367 sub do_cmd_citetitle{
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
368 local($_) = @_;
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
369 my $url = next_optional_argument();
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
370 my $title = next_argument();
14970
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
371 my $icon = get_link_icon($url);
11449
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
372 my $repl = '';
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
373 if ($url) {
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
374 $repl = ("<em class=\"citetitle\"><a\n"
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
375 . " href=\"$url\"\n"
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
376 . " title=\"$title\"\n"
14970
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
377 . " >$title$icon</a></em>");
11449
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
378 }
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
379 else {
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
380 $repl = "<em class=\"citetitle\"\n >$title</em>";
11449
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
381 }
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
382 return $repl . $_;
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
383 }
e0fe4c7a9eff do_cmd_programopt(): New function, similar to do_cmd_program().
Fred Drake <fdrake@acm.org>
parents: 11316
diff changeset
384
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
385 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
386 # 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
387 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
388 my $release = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
389 my $reason = next_argument();
16114
44fd1a7cb279 Fix \seepep handling -- correct URL to the online PEP repository on SF is
Fred Drake <fdrake@acm.org>
parents: 15567
diff changeset
390 return ('<div class="versionnote">'
44fd1a7cb279 Fix \seepep handling -- correct URL to the online PEP repository on SF is
Fred Drake <fdrake@acm.org>
parents: 15567
diff changeset
391 . "<b>Deprecated since release $release.</b>"
44fd1a7cb279 Fix \seepep handling -- correct URL to the online PEP repository on SF is
Fred Drake <fdrake@acm.org>
parents: 15567
diff changeset
392 . "\n$reason</div><p>"
44fd1a7cb279 Fix \seepep handling -- correct URL to the online PEP repository on SF is
Fred Drake <fdrake@acm.org>
parents: 15567
diff changeset
393 . $_);
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
394 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
395
17561
36232f543220 Added support for optional explanation parameter to the \versionadded
Fred Drake <fdrake@acm.org>
parents: 17429
diff changeset
396 sub versionnote{
36232f543220 Added support for optional explanation parameter to the \versionadded
Fred Drake <fdrake@acm.org>
parents: 17429
diff changeset
397 # one or two parameters: \versionnote[explanation]{version}
36232f543220 Added support for optional explanation parameter to the \versionadded
Fred Drake <fdrake@acm.org>
parents: 17429
diff changeset
398 my $type = @_[0];
36232f543220 Added support for optional explanation parameter to the \versionadded
Fred Drake <fdrake@acm.org>
parents: 17429
diff changeset
399 local $_ = @_[1];
36232f543220 Added support for optional explanation parameter to the \versionadded
Fred Drake <fdrake@acm.org>
parents: 17429
diff changeset
400 my $explanation = next_optional_argument();
36232f543220 Added support for optional explanation parameter to the \versionadded
Fred Drake <fdrake@acm.org>
parents: 17429
diff changeset
401 my $release = next_argument();
36232f543220 Added support for optional explanation parameter to the \versionadded
Fred Drake <fdrake@acm.org>
parents: 17429
diff changeset
402 my $text = "$type in version $release.";
36232f543220 Added support for optional explanation parameter to the \versionadded
Fred Drake <fdrake@acm.org>
parents: 17429
diff changeset
403 if ($explanation) {
36232f543220 Added support for optional explanation parameter to the \versionadded
Fred Drake <fdrake@acm.org>
parents: 17429
diff changeset
404 $text = "$type in version $release:\n$explanation.";
36232f543220 Added support for optional explanation parameter to the \versionadded
Fred Drake <fdrake@acm.org>
parents: 17429
diff changeset
405 }
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
406 return "\n<span class=\"versionnote\">$text</span>\n" . $_;
17561
36232f543220 Added support for optional explanation parameter to the \versionadded
Fred Drake <fdrake@acm.org>
parents: 17429
diff changeset
407 }
36232f543220 Added support for optional explanation parameter to the \versionadded
Fred Drake <fdrake@acm.org>
parents: 17429
diff changeset
408
8763
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
409 sub do_cmd_versionadded{
17561
36232f543220 Added support for optional explanation parameter to the \versionadded
Fred Drake <fdrake@acm.org>
parents: 17429
diff changeset
410 return versionnote('New', @_);
8763
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
411 }
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
412
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
413 sub do_cmd_versionchanged{
17561
36232f543220 Added support for optional explanation parameter to the \versionadded
Fred Drake <fdrake@acm.org>
parents: 17429
diff changeset
414 return versionnote('Changed', @_);
8763
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
415 }
55f790a5f64b do_cmd_versionadded(),
Fred Drake <fdrake@acm.org>
parents: 8756
diff changeset
416
10327
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
417 #
10464
f74ef1971bd1 Remove \platformof support, since it's been removed from the LaTeX
Fred Drake <fdrake@acm.org>
parents: 10327
diff changeset
418 # These function handle platform dependency tracking.
10327
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
419 #
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
420 sub do_cmd_platform{
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
421 local($_) = @_;
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
422 my $platform = next_argument();
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
423 $ModulePlatforms{"<tt class=\"module\">$THIS_MODULE</tt>"} = $platform;
10327
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
424 $platform = "Macintosh"
10637
bed15a015c1c Fix some remaining index & consistency nits. (Many data member
Fred Drake <fdrake@acm.org>
parents: 10598
diff changeset
425 if $platform eq 'Mac';
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
426 return "\n<p class=\"availability\">Availability: <span"
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
427 . "\n class=\"platform\">$platform</span>.</p>\n" . $_;
10327
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
428 }
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
429
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
430 $IGNORE_PLATFORM_ANNOTATION = '';
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
431 sub do_cmd_ignorePlatformAnnotation{
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
432 local($_) = @_;
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
433 $IGNORE_PLATFORM_ANNOTATION = next_argument();
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
434 return $_;
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
435 }
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
436
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
437
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
438 # index commands
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
439
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
440 $INDEX_SUBITEM = "";
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
441
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
442 sub get_indexsubitem{
9769
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
443 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
444 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
445
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
446 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
447 local($_) = @_;
10138
b21915e6589e Fix up some routines to coordinate the "indexsubitem" stuff so that
Fred Drake <fdrake@acm.org>
parents: 10128
diff changeset
448 $INDEX_SUBITEM = next_argument();
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
449 return $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
450 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
451
7671
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
452 sub do_cmd_withsubitem{
9769
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
453 # 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
454 # 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
455 # 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
456 #
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
457 local($_) = @_;
9769
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
458 my $oldsubitem = $INDEX_SUBITEM;
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
459 $INDEX_SUBITEM = next_argument();
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
460 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
461 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
462 my $marker = "$O$br_id$C";
21356
c67046ef5385 Remove crufty whitespace in a block of index entries.
Fred Drake <fdrake@acm.org>
parents: 21116
diff changeset
463 $stuff =~ s/^\s+//;
9769
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
464 return
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
465 $stuff
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
466 . "\\setindexsubitem$marker$oldsubitem$marker"
9769
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
467 . $_;
7671
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
468 }
0cf2ffaf4bd7 Bring this up to date. Some things still don't work right.
Fred Drake <fdrake@acm.org>
parents: 7581
diff changeset
469
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
470 # This is the prologue macro which is required to start writing the
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
471 # mod\jobname.idx file; we can just ignore it. (Defining this suppresses
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
472 # a warning that \makemodindex is unknown.)
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
473 #
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
474 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
475
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
476 # 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
477 #
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
478 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
479 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
480 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
481 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
482
5eafd3eda0af Remove option to strip out <tt>...</tt> from index entry text; this is now
Fred Drake <fdrake@acm.org>
parents: 7906
diff changeset
483 # 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
484 # 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
485 #
5eafd3eda0af Remove option to strip out <tt>...</tt> from index entry text; this is now
Fred Drake <fdrake@acm.org>
parents: 7906
diff changeset
486 $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
487
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
488 sub write_idxfile{
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
489 my ($ahref, $str) = @_;
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
490 print IDXFILE $ahref, $IDXFILE_FIELD_SEP, $str, "\n";
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
491 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
492
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
493
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
494 sub gen_link{
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
495 my($node,$target) = @_;
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
496 print INTLABELS "\$internal_labels{\"$target\"} = \"$URL/$node\";\n";
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
497 return "<a href=\"$node#$target\">";
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
498 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
499
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
500 sub add_index_entry{
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
501 # 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
502 my($str,$ahref) = @_;
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
503 $str = gen_index_id($str, '');
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
504 $index{$str} .= $ahref;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
505 write_idxfile($ahref, $str);
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
506 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
507
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
508 sub new_link_info{
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
509 my $name = "l2h-" . ++$globals{'max_id'};
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
510 my $aname = "<a name=\"$name\">";
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
511 my $ahref = gen_link($CURRENT_FILE, $name);
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
512 return ($name, $aname, $ahref);
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
513 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
514
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
515 $IndexMacroPattern = '';
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
516 sub define_indexing_macro{
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
517 my $count = @_;
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
518 my $i = 0;
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
519 for (; $i < $count; ++$i) {
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
520 my $name = @_[$i];
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
521 my $cmd = "idx_cmd_$name";
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
522 die "\nNo function $cmd() defined!\n"
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
523 if (!defined &$cmd);
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
524 eval ("sub do_cmd_$name { return process_index_macros("
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
525 . "\@_[0], '$name'); }");
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
526 if (length($IndexMacroPattern) == 0) {
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
527 $IndexMacroPattern = "$name";
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
528 }
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
529 else {
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
530 $IndexMacroPattern .= "|$name";
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
531 }
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
532 }
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
533 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
534
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
535 $DEBUG_INDEXING = 0;
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
536 sub process_index_macros{
8294
35ea0c073ea3 do_cmd_kwindex(): Re-implement now that \kwindex is used again (ref man).
Fred Drake <fdrake@acm.org>
parents: 8194
diff changeset
537 local($_) = @_;
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
538 my $cmdname = @_[1]; # This is what triggered us in the first place;
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
539 # we know it's real, so just process it.
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
540 my($name,$aname,$ahref) = new_link_info();
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
541 my $cmd = "idx_cmd_$cmdname";
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
542 print "\nIndexing: \\$cmdname"
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
543 if $DEBUG_INDEXING;
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
544 &$cmd($ahref); # modifies $_ and adds index entries
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
545 while (/^[\s\n]*\\($IndexMacroPattern)</) {
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
546 $cmdname = "$1";
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
547 print " \\$cmdname"
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
548 if $DEBUG_INDEXING;
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
549 $cmd = "idx_cmd_$cmdname";
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
550 if (!defined &$cmd) {
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
551 last;
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
552 }
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
553 else {
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
554 s/^[\s\n]*\\$cmdname//;
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
555 &$cmd($ahref);
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
556 }
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
557 }
16114
44fd1a7cb279 Fix \seepep handling -- correct URL to the online PEP repository on SF is
Fred Drake <fdrake@acm.org>
parents: 15567
diff changeset
558 if (/^[ \t\r\n]/) {
44fd1a7cb279 Fix \seepep handling -- correct URL to the online PEP repository on SF is
Fred Drake <fdrake@acm.org>
parents: 15567
diff changeset
559 $_ = substr($_, 1);
44fd1a7cb279 Fix \seepep handling -- correct URL to the online PEP repository on SF is
Fred Drake <fdrake@acm.org>
parents: 15567
diff changeset
560 }
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
561 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
562 }
35ea0c073ea3 do_cmd_kwindex(): Re-implement now that \kwindex is used again (ref man).
Fred Drake <fdrake@acm.org>
parents: 8194
diff changeset
563
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
564 define_indexing_macro('index');
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
565 sub idx_cmd_index{
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
566 my $str = next_argument();
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
567 add_index_entry("$str", @_[0]);
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
568 }
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
569
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
570 define_indexing_macro('kwindex');
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
571 sub idx_cmd_kwindex{
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
572 my $str = next_argument();
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
573 add_index_entry("<tt>$str</tt>!keyword", @_[0]);
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
574 add_index_entry("keyword!<tt>$str</tt>", @_[0]);
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
575 }
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
576
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
577 define_indexing_macro('indexii');
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
578 sub idx_cmd_indexii{
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
579 my $str1 = next_argument();
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
580 my $str2 = next_argument();
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
581 add_index_entry("$str1!$str2", @_[0]);
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
582 add_index_entry("$str2!$str1", @_[0]);
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
583 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
584
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
585 define_indexing_macro('indexiii');
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
586 sub idx_cmd_indexiii{
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
587 my $str1 = next_argument();
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
588 my $str2 = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
589 my $str3 = next_argument();
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
590 add_index_entry("$str1!$str2 $str3", @_[0]);
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
591 add_index_entry("$str2!$str3, $str1", @_[0]);
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
592 add_index_entry("$str3!$str1 $str2", @_[0]);
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
593 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
594
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
595 define_indexing_macro('indexiv');
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
596 sub idx_cmd_indexiv{
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
597 my $str1 = next_argument();
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
598 my $str2 = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
599 my $str3 = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
600 my $str4 = next_argument();
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
601 add_index_entry("$str1!$str2 $str3 $str4", @_[0]);
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
602 add_index_entry("$str2!$str3 $str4, $str1", @_[0]);
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
603 add_index_entry("$str3!$str4, $str1 $str2", @_[0]);
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
604 add_index_entry("$str4!$$str1 $str2 $str3", @_[0]);
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
605 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
606
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
607 define_indexing_macro('ttindex');
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
608 sub idx_cmd_ttindex{
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
609 my $str = next_argument();
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
610 my $entry = $str . get_indexsubitem();
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
611 add_index_entry($entry, @_[0]);
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
612 }
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
613
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
614 sub my_typed_index_helper{
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
615 my($word,$ahref) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
616 my $str = next_argument();
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
617 add_index_entry("$str $word", $ahref);
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
618 add_index_entry("$word!$str", $ahref);
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
619 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
620
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
621 define_indexing_macro('stindex', 'opindex', 'exindex', 'obindex');
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
622 sub idx_cmd_stindex{ my_typed_index_helper('statement', @_[0]); }
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
623 sub idx_cmd_opindex{ my_typed_index_helper('operator', @_[0]); }
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
624 sub idx_cmd_exindex{ my_typed_index_helper('exception', @_[0]); }
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
625 sub idx_cmd_obindex{ my_typed_index_helper('object', @_[0]); }
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
626
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
627 define_indexing_macro('bifuncindex');
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
628 sub idx_cmd_bifuncindex{
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
629 my $str = next_argument();
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
630 add_index_entry("<tt class=\"function\">$str()</tt> (built-in function)",
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
631 @_[0]);
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
632 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
633
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
634
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
635 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
636 my($str,$define) = @_;
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
637 my($name,$aname,$ahref) = new_link_info();
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
638 # equivalent of add_index_entry() using $define instead of ''
10138
b21915e6589e Fix up some routines to coordinate the "indexsubitem" stuff so that
Fred Drake <fdrake@acm.org>
parents: 10128
diff changeset
639 $ahref =~ s/\#[-_a-zA-Z0-9]*\"/\"/
b21915e6589e Fix up some routines to coordinate the "indexsubitem" stuff so that
Fred Drake <fdrake@acm.org>
parents: 10128
diff changeset
640 if ($define eq 'DEF');
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
641 $str = gen_index_id($str, $define);
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
642 $index{$str} .= $ahref;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
643 write_idxfile($ahref, $str);
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
644
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
645 if ($define eq 'DEF') {
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
646 # add to the module index
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
647 $str =~ /(<tt.*<\/tt>)/;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
648 my $nstr = $1;
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
649 $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
650 }
16114
44fd1a7cb279 Fix \seepep handling -- correct URL to the online PEP repository on SF is
Fred Drake <fdrake@acm.org>
parents: 15567
diff changeset
651 return "$aname$anchor_invisible_mark2</a>";
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
652 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
653
10327
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
654
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
655 $THIS_MODULE = '';
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
656 $THIS_CLASS = '';
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
657
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
658 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
659 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
660 my $section_tag = join('', @curr_sec_id);
10857
1aa80f5bf9ac define_module(): Check the module type for validity before using.
Fred Drake <fdrake@acm.org>
parents: 10849
diff changeset
661 if ($word ne "built-in" && $word ne "extension"
1aa80f5bf9ac define_module(): Check the module type for validity before using.
Fred Drake <fdrake@acm.org>
parents: 10849
diff changeset
662 && $word ne "standard" && $word ne "") {
1aa80f5bf9ac define_module(): Check the module type for validity before using.
Fred Drake <fdrake@acm.org>
parents: 10849
diff changeset
663 write_warnings("Bad module type '$word'"
1aa80f5bf9ac define_module(): Check the module type for validity before using.
Fred Drake <fdrake@acm.org>
parents: 10849
diff changeset
664 . " for \\declaremodule (module $name)");
1aa80f5bf9ac define_module(): Check the module type for validity before using.
Fred Drake <fdrake@acm.org>
parents: 10849
diff changeset
665 $word = "";
1aa80f5bf9ac define_module(): Check the module type for validity before using.
Fred Drake <fdrake@acm.org>
parents: 10849
diff changeset
666 }
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
667 $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
668 $THIS_MODULE = "$name";
15363
47d9fbe6537c define_module(): Change the "index sub-item" for definitions at module
Fred Drake <fdrake@acm.org>
parents: 15349
diff changeset
669 $INDEX_SUBITEM = "(in module $name)";
10138
b21915e6589e Fix up some routines to coordinate the "indexsubitem" stuff so that
Fred Drake <fdrake@acm.org>
parents: 10128
diff changeset
670 print "[$name]";
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
671 return make_mod_index_entry(
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
672 "<tt class=\"module\">$name</tt> (${word}module)", 'DEF');
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
673 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
674
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
675 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
676 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
677 my $name = next_argument();
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
678 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
679 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
680
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
681 sub do_cmd_modindex{ return my_module_index_helper('', @_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
682 sub do_cmd_bimodindex{ return my_module_index_helper('built-in', @_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
683 sub do_cmd_exmodindex{ return my_module_index_helper('extension', @_); }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
684 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
685
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
686 sub ref_module_index_helper{
12499
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
687 my($word, $ahref) = @_;
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
688 my $str = next_argument();
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
689 $word = "$word " if $word;
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
690 $str = "<tt class=\"module\">$str</tt> (${word}module)";
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
691 # can't use add_index_entry() since the 2nd arg to gen_index_id() is used;
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
692 # just inline it all here
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
693 $str = gen_index_id($str, 'REF');
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
694 $index{$str} .= $ahref;
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
695 write_idxfile($ahref, $str);
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
696 }
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
697
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
698 # these should be adjusted a bit....
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
699 define_indexing_macro('refmodindex', 'refbimodindex',
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
700 'refexmodindex', 'refstmodindex');
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
701 sub idx_cmd_refmodindex{ return ref_module_index_helper('', @_); }
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
702 sub idx_cmd_refbimodindex{ return ref_module_index_helper('built-in', @_); }
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
703 sub idx_cmd_refexmodindex{ return ref_module_index_helper('extension', @_); }
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
704 sub idx_cmd_refstmodindex{ return ref_module_index_helper('standard', @_); }
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
705
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
706 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
707
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
708 sub init_myformat{
16114
44fd1a7cb279 Fix \seepep handling -- correct URL to the online PEP repository on SF is
Fred Drake <fdrake@acm.org>
parents: 15567
diff changeset
709 $anchor_invisible_mark = '&nbsp;';
44fd1a7cb279 Fix \seepep handling -- correct URL to the online PEP repository on SF is
Fred Drake <fdrake@acm.org>
parents: 15567
diff changeset
710 $anchor_invisible_mark2 = '';
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
711 $anchor_mark = '';
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
712 $icons{'anchor_mark'} = '';
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
713 }
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
714 init_myformat();
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
715
10849
4da76f838a5e make_index_entry(): Remove. Not only did this override the
Fred Drake <fdrake@acm.org>
parents: 10846
diff changeset
716 # Create an index entry, but include the string in the target anchor
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
717 # 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
718 #
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
719 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
720 my($str) = @_;
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
721 my($name,$aname,$ahref) = new_link_info();
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
722 add_index_entry($str, $ahref);
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
723 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
724 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
725
18426
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
726
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
727 %TokenToTargetMapping = ();
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
728 %DefinedGrammars = ();
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
729 %BackpatchGrammarFiles = ();
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
730
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
731 sub do_cmd_token{
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
732 local($_) = @_;
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
733 my $token = next_argument();
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
734 my $target = $TokenToTargetMapping{"$CURRENT_GRAMMAR:$token"};
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
735 if ($token eq $CURRENT_TOKEN || $CURRENT_GRAMMAR eq '*') {
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
736 # recursive definition or display-only productionlist
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
737 return "$token";
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
738 }
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
739 if ($target eq '') {
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
740 $target = "<pyGrammarToken><$CURRENT_GRAMMAR><$token>";
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
741 if (! $BackpatchGrammarFiles{"$CURRENT_FILE"}) {
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
742 print "Adding '$CURRENT_FILE' to back-patch list.\n";
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
743 }
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
744 $BackpatchGrammarFiles{"$CURRENT_FILE"} = 1;
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
745 }
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
746 return "<a href=\"$target\">$token</a>" . $_;
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
747 }
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
748
19412
d4ba6e2aaae3 New \grammartoken markup, similar to \token but allowed everywhere.
Fred Drake <fdrake@acm.org>
parents: 19327
diff changeset
749 sub do_cmd_grammartoken{
d4ba6e2aaae3 New \grammartoken markup, similar to \token but allowed everywhere.
Fred Drake <fdrake@acm.org>
parents: 19327
diff changeset
750 return do_cmd_token(@_);
d4ba6e2aaae3 New \grammartoken markup, similar to \token but allowed everywhere.
Fred Drake <fdrake@acm.org>
parents: 19327
diff changeset
751 }
d4ba6e2aaae3 New \grammartoken markup, similar to \token but allowed everywhere.
Fred Drake <fdrake@acm.org>
parents: 19327
diff changeset
752
18426
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
753 sub do_env_productionlist{
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
754 local($_) = @_;
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
755 my $lang = next_optional_argument();
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
756 my $filename = "grammar-$lang.txt";
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
757 if ($lang eq '') {
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
758 $filename = 'grammar.txt';
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
759 }
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
760 local($CURRENT_GRAMMAR) = $lang;
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
761 $DefinedGrammars{$lang} .= $_;
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
762 return ("<dl><dd class=\"grammar\">\n"
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
763 . "<div class=\"productions\">\n"
21409
fdc0cf56ba9c The valign attribute to control the vertical alignment of a table cell should
Fred Drake <fdrake@acm.org>
parents: 21356
diff changeset
764 . "<table cellpadding=\"2\">\n"
18426
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
765 . translate_commands(translate_environments($_))
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
766 . "</table>\n"
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
767 . "</div>\n"
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
768 . (($lang eq '*')
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
769 ? ''
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
770 : ("<a class=\"grammar-footer\"\n"
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
771 . " href=\"$filename\" type=\"text/plain\"\n"
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
772 . " >Download entire grammar as text.</a>\n"))
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
773 . "</dd></dl>");
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
774 }
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
775
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
776 sub do_cmd_production{
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
777 local($_) = @_;
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
778 my $token = next_argument();
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
779 my $defn = next_argument();
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
780 my $lang = $CURRENT_GRAMMAR;
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
781 local($CURRENT_TOKEN) = $token;
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
782 if ($lang eq '*') {
21409
fdc0cf56ba9c The valign attribute to control the vertical alignment of a table cell should
Fred Drake <fdrake@acm.org>
parents: 21356
diff changeset
783 return ("<tr valign=\"baseline\">\n"
18426
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
784 . " <td><code>$token</code></td>\n"
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
785 . " <td>&nbsp;::=&nbsp;</td>\n"
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
786 . " <td><code>"
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
787 . translate_commands($defn)
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
788 . "</code></td></tr>"
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
789 . $_);
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
790 }
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
791 my $target;
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
792 if ($lang eq '') {
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
793 $target = "$CURRENT_FILE\#tok-$token";
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
794 }
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
795 else {
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
796 $target = "$CURRENT_FILE\#tok-$lang-$token";
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
797 }
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
798 $TokenToTargetMapping{"$CURRENT_GRAMMAR:$token"} = $target;
21409
fdc0cf56ba9c The valign attribute to control the vertical alignment of a table cell should
Fred Drake <fdrake@acm.org>
parents: 21356
diff changeset
799 return ("<tr valign=\"baseline\">\n"
18426
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
800 . " <td><code><a name=\"tok-$token\">$token</a></code></td>\n"
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
801 . " <td>&nbsp;::=&nbsp;</td>\n"
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
802 . " <td><code>"
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
803 . translate_commands($defn)
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
804 . "</code></td></tr>"
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
805 . $_);
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
806 }
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
807
22316
cc788b3b21b6 Revise the markup related to the grammar productions to increase the
Fred Drake <fdrake@acm.org>
parents: 22260
diff changeset
808 sub do_cmd_productioncont{
cc788b3b21b6 Revise the markup related to the grammar productions to increase the
Fred Drake <fdrake@acm.org>
parents: 22260
diff changeset
809 local($_) = @_;
cc788b3b21b6 Revise the markup related to the grammar productions to increase the
Fred Drake <fdrake@acm.org>
parents: 22260
diff changeset
810 my $defn = next_argument();
25644
199f0f6a8a36 Back-port part of 1.128 from the trunk:
Fred Drake <fdrake@acm.org>
parents: 22775
diff changeset
811 $defn =~ s/^( +)/'&nbsp;' x length $1/e;
22316
cc788b3b21b6 Revise the markup related to the grammar productions to increase the
Fred Drake <fdrake@acm.org>
parents: 22260
diff changeset
812 return ("<tr valign=\"baseline\">\n"
cc788b3b21b6 Revise the markup related to the grammar productions to increase the
Fred Drake <fdrake@acm.org>
parents: 22260
diff changeset
813 . " <td>&nbsp;</td>\n"
cc788b3b21b6 Revise the markup related to the grammar productions to increase the
Fred Drake <fdrake@acm.org>
parents: 22260
diff changeset
814 . " <td>&nbsp;</td>\n"
cc788b3b21b6 Revise the markup related to the grammar productions to increase the
Fred Drake <fdrake@acm.org>
parents: 22260
diff changeset
815 . " <td><code>"
cc788b3b21b6 Revise the markup related to the grammar productions to increase the
Fred Drake <fdrake@acm.org>
parents: 22260
diff changeset
816 . translate_commands($defn)
cc788b3b21b6 Revise the markup related to the grammar productions to increase the
Fred Drake <fdrake@acm.org>
parents: 22260
diff changeset
817 . "</code></td></tr>"
cc788b3b21b6 Revise the markup related to the grammar productions to increase the
Fred Drake <fdrake@acm.org>
parents: 22260
diff changeset
818 . $_);
cc788b3b21b6 Revise the markup related to the grammar productions to increase the
Fred Drake <fdrake@acm.org>
parents: 22260
diff changeset
819 }
cc788b3b21b6 Revise the markup related to the grammar productions to increase the
Fred Drake <fdrake@acm.org>
parents: 22260
diff changeset
820
18426
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
821 sub process_grammar_files{
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
822 my $lang;
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
823 my $filename;
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
824 local($_);
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
825 print "process_grammar_files()\n";
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
826 foreach $lang (keys %DefinedGrammars) {
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
827 $filename = "grammar-$lang.txt";
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
828 if ($lang eq '*') {
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
829 next;
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
830 }
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
831 if ($lang eq '') {
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
832 $filename = 'grammar.txt';
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
833 }
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
834 open(GRAMMAR, ">$filename") || die "\n$!\n";
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
835 print GRAMMAR strip_grammar_markup($DefinedGrammars{$lang});
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
836 close(GRAMMAR);
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
837 print "Wrote grammar file $filename\n";
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
838 }
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
839 my $PATTERN = '<pyGrammarToken><([^>]*)><([^>]*)>';
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
840 foreach $filename (keys %BackpatchGrammarFiles) {
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
841 print "\nBack-patching grammar links in $filename\n";
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
842 my $buffer;
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
843 open(GRAMMAR, "<$filename") || die "\n$!\n";
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
844 # read all of the file into the buffer
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
845 sysread(GRAMMAR, $buffer, 1024*1024);
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
846 close(GRAMMAR);
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
847 while ($buffer =~ /$PATTERN/) {
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
848 my($lang, $token) = ($1, $2);
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
849 my $target = $TokenToTargetMapping{"$lang:$token"};
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
850 my $source = "<pyGrammarToken><$lang><$token>";
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
851 $buffer =~ s/$source/$target/g;
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
852 }
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
853 open(GRAMMAR, ">$filename") || die "\n$!\n";
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
854 print GRAMMAR $buffer;
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
855 close(GRAMMAR);
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
856 }
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
857 }
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
858
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
859 sub strip_grammar_markup{
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
860 local($_) = @_;
22316
cc788b3b21b6 Revise the markup related to the grammar productions to increase the
Fred Drake <fdrake@acm.org>
parents: 22260
diff changeset
861 s/\\productioncont/ /g;
18426
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
862 s/\\production(<<\d+>>)(.+)\1/\n\2 ::= /g;
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
863 s/\\token(<<\d+>>)(.+)\1/\2/g;
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
864 s/\\e([^a-zA-Z])/\\\1/g;
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
865 s/<<\d+>>//g;
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
866 s/;SPMgt;/>/g;
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
867 s/;SPMlt;/</g;
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
868 s/;SPMquot;/\"/g;
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
869 return $_;
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
870 }
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
871
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
872
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
873 $REFCOUNTS_LOADED = 0;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
874
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
875 sub load_refcounts{
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
876 $REFCOUNTS_LOADED = 1;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
877
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
878 my $myname, $mydir, $myext;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
879 ($myname, $mydir, $myext) = fileparse(__FILE__, '\..*');
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
880 chop $mydir; # remove trailing '/'
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
881 ($myname, $mydir, $myext) = fileparse($mydir, '\..*');
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
882 chop $mydir; # remove trailing '/'
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
883 $mydir = getcwd() . "$dd$mydir"
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
884 unless $mydir =~ s|^/|/|;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
885 local $_;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
886 my $filename = "$mydir${dd}api${dd}refcounts.dat";
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
887 open(REFCOUNT_FILE, "<$filename") || die "\n$!\n";
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
888 print "[loading API refcount data]";
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
889 while (<REFCOUNT_FILE>) {
12350
c59bdc7fd8a6 load_refcounts(),
Fred Drake <fdrake@acm.org>
parents: 12343
diff changeset
890 if (/([a-zA-Z0-9_]+):PyObject\*:([a-zA-Z0-9_]*):(0|[-+]1|null):(.*)$/) {
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
891 my($func, $param, $count, $comment) = ($1, $2, $3, $4);
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
892 #print "\n$func($param) --> $count";
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
893 $REFCOUNTS{"$func:$param"} = $count;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
894 }
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
895 }
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
896 }
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
897
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
898 sub get_refcount{
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
899 my ($func, $param) = @_;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
900 load_refcounts()
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
901 unless $REFCOUNTS_LOADED;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
902 return $REFCOUNTS{"$func:$param"};
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
903 }
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
904
20678
61e8f01de821 Add yet more markup that let's a stylesheet pick out a small bit of the
Fred Drake <fdrake@acm.org>
parents: 20336
diff changeset
905
61e8f01de821 Add yet more markup that let's a stylesheet pick out a small bit of the
Fred Drake <fdrake@acm.org>
parents: 20336
diff changeset
906 $TLSTART = '<span class="typelabel">';
61e8f01de821 Add yet more markup that let's a stylesheet pick out a small bit of the
Fred Drake <fdrake@acm.org>
parents: 20336
diff changeset
907 $TLEND = '</span>';
61e8f01de821 Add yet more markup that let's a stylesheet pick out a small bit of the
Fred Drake <fdrake@acm.org>
parents: 20336
diff changeset
908
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
909 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
910 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
911 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
912 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
913 my $arg_list = next_argument();
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
914 my $idx = make_str_index_entry(
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
915 "<tt class=\"cfunction\">$function_name()</tt>" . get_indexsubitem());
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
916 $idx =~ s/ \(.*\)//;
13926
b6e07c272487 do_env_cfuncdesc(): Push as much of the generated HTML into one place
Fred Drake <fdrake@acm.org>
parents: 13899
diff changeset
917 $idx =~ s/\(\)//; # ???? - why both of these?
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
918 my $result_rc = get_refcount($function_name, '');
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
919 my $rcinfo = '';
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
920 if ($result_rc eq '+1') {
13926
b6e07c272487 do_env_cfuncdesc(): Push as much of the generated HTML into one place
Fred Drake <fdrake@acm.org>
parents: 13899
diff changeset
921 $rcinfo = 'New reference';
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
922 }
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
923 elsif ($result_rc eq '0') {
13926
b6e07c272487 do_env_cfuncdesc(): Push as much of the generated HTML into one place
Fred Drake <fdrake@acm.org>
parents: 13899
diff changeset
924 $rcinfo = 'Borrowed reference';
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
925 }
12350
c59bdc7fd8a6 load_refcounts(),
Fred Drake <fdrake@acm.org>
parents: 12343
diff changeset
926 elsif ($result_rc eq 'null') {
13926
b6e07c272487 do_env_cfuncdesc(): Push as much of the generated HTML into one place
Fred Drake <fdrake@acm.org>
parents: 13899
diff changeset
927 $rcinfo = 'Always <tt class="constant">NULL</tt>';
12350
c59bdc7fd8a6 load_refcounts(),
Fred Drake <fdrake@acm.org>
parents: 12343
diff changeset
928 }
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
929 if ($rcinfo ne '') {
13926
b6e07c272487 do_env_cfuncdesc(): Push as much of the generated HTML into one place
Fred Drake <fdrake@acm.org>
parents: 13899
diff changeset
930 $rcinfo = ( "\n<div class=\"refcount-info\">"
b6e07c272487 do_env_cfuncdesc(): Push as much of the generated HTML into one place
Fred Drake <fdrake@acm.org>
parents: 13899
diff changeset
931 . "\n <span class=\"label\">Return value:</span>"
b6e07c272487 do_env_cfuncdesc(): Push as much of the generated HTML into one place
Fred Drake <fdrake@acm.org>
parents: 13899
diff changeset
932 . "\n <span class=\"value\">$rcinfo.</span>"
b6e07c272487 do_env_cfuncdesc(): Push as much of the generated HTML into one place
Fred Drake <fdrake@acm.org>
parents: 13899
diff changeset
933 . "\n</div>");
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
934 }
17249
6d30552cb4f9 Remove the spurious space of uncertain origin from the output for function,
Fred Drake <fdrake@acm.org>
parents: 16966
diff changeset
935 return "<dl><dt>$return_type <b>$idx</b>(<var>$arg_list</var>)\n<dd>"
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
936 . $rcinfo
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
937 . $_
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
938 . '</dl>';
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
939 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
940
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
941 sub do_env_csimplemacrodesc{
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
942 local($_) = @_;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
943 my $name = next_argument();
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
944 my $idx = make_str_index_entry("<tt class=\"macro\">$name</tt>");
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
945 return "<dl><dt><b>$idx</b>\n<dd>"
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
946 . $_
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
947 . '</dl>'
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
948 }
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
949
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
950 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
951 local($_) = @_;
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
952 my $index_name = next_optional_argument();
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
953 my $type_name = next_argument();
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
954 $index_name = $type_name
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
955 unless $index_name;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
956 my($name,$aname,$ahref) = new_link_info();
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
957 add_index_entry("<tt class=\"ctype\">$index_name</tt> (C type)", $ahref);
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
958 return "<dl><dt><b><tt class=\"ctype\">$aname$type_name</a></tt></b>\n<dd>"
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
959 . $_
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
960 . '</dl>'
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
961 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
962
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
963 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
964 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
965 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
966 my $var_name = next_argument();
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
967 my $idx = make_str_index_entry("<tt class=\"cdata\">$var_name</tt>"
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
968 . get_indexsubitem());
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
969 $idx =~ s/ \(.*\)//;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
970 return "<dl><dt>$var_type <b>$idx</b>\n"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
971 . '<dd>'
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
972 . $_
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
973 . '</dl>';
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
974 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
975
14556
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
976 sub convert_args($){
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
977 local($IN_DESC_HANDLER) = 1;
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
978 local($_) = @_;
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
979 return translate_commands($_);
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
980 }
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
981
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
982 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
983 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
984 my $function_name = next_argument();
14556
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
985 my $arg_list = convert_args(next_argument());
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
986 my $idx = make_str_index_entry("<tt class=\"function\">$function_name()"
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
987 . '</tt>'
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
988 . get_indexsubitem());
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
989 $idx =~ s/ \(.*\)//;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
990 $idx =~ s/\(\)<\/tt>/<\/tt>/;
17249
6d30552cb4f9 Remove the spurious space of uncertain origin from the output for function,
Fred Drake <fdrake@acm.org>
parents: 16966
diff changeset
991 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
992 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
993
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
994 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
995 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
996 my $function_name = next_argument();
14556
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
997 my $arg_list = convert_args(next_argument());
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
998 return "<dl><dt><b><tt class=\"function\">$function_name</tt></b>"
17249
6d30552cb4f9 Remove the spurious space of uncertain origin from the output for function,
Fred Drake <fdrake@acm.org>
parents: 16966
diff changeset
999 . "(<var>$arg_list</var>)\n"
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
1000 . '<dd>'
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
1001 . $_
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
1002 . '</dl>';
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1003 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1004
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1005 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
1006 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1007 my $function_name = next_argument();
14556
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
1008 my $arg_list = convert_args(next_argument());
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1009 my $prefix = "<tt class=\"function\">$function_name()</tt>";
10641
f6ec4a9cb0b3 do_cmd_funcline(): Remove some bogus generated stuff from the output
Fred Drake <fdrake@acm.org>
parents: 10637
diff changeset
1010 my $idx = make_str_index_entry($prefix . get_indexsubitem());
f6ec4a9cb0b3 do_cmd_funcline(): Remove some bogus generated stuff from the output
Fred Drake <fdrake@acm.org>
parents: 10637
diff changeset
1011 $prefix =~ s/\(\)//;
f6ec4a9cb0b3 do_cmd_funcline(): Remove some bogus generated stuff from the output
Fred Drake <fdrake@acm.org>
parents: 10637
diff changeset
1012
17249
6d30552cb4f9 Remove the spurious space of uncertain origin from the output for function,
Fred Drake <fdrake@acm.org>
parents: 16966
diff changeset
1013 return "<dt><b>$prefix</b>(<var>$arg_list</var>)\n<dd>" . $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1014 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1015
11123
2eb2879d567f do_cmd_funclineni(): New function; non-indexing form of \funcline.
Fred Drake <fdrake@acm.org>
parents: 10857
diff changeset
1016 sub do_cmd_funclineni{
2eb2879d567f do_cmd_funclineni(): New function; non-indexing form of \funcline.
Fred Drake <fdrake@acm.org>
parents: 10857
diff changeset
1017 local($_) = @_;
2eb2879d567f do_cmd_funclineni(): New function; non-indexing form of \funcline.
Fred Drake <fdrake@acm.org>
parents: 10857
diff changeset
1018 my $function_name = next_argument();
14556
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
1019 my $arg_list = convert_args(next_argument());
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1020 my $prefix = "<tt class=\"function\">$function_name</tt>";
11123
2eb2879d567f do_cmd_funclineni(): New function; non-indexing form of \funcline.
Fred Drake <fdrake@acm.org>
parents: 10857
diff changeset
1021
17249
6d30552cb4f9 Remove the spurious space of uncertain origin from the output for function,
Fred Drake <fdrake@acm.org>
parents: 16966
diff changeset
1022 return "<dt><b>$prefix</b>(<var>$arg_list</var>)\n<dd>" . $_;
11123
2eb2879d567f do_cmd_funclineni(): New function; non-indexing form of \funcline.
Fred Drake <fdrake@acm.org>
parents: 10857
diff changeset
1023 }
2eb2879d567f do_cmd_funclineni(): New function; non-indexing form of \funcline.
Fred Drake <fdrake@acm.org>
parents: 10857
diff changeset
1024
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1025 # 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
1026 # 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
1027 # module.
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1028 #
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1029 $INDEX_OPCODES = 0;
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1030
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1031 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
1032 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1033 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
1034 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
1035 my $idx;
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1036 if ($INDEX_OPCODES) {
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1037 $idx = make_str_index_entry("<tt class=\"opcode\">$opcode_name</tt>"
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1038 . ' (byte code instruction)');
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1039 $idx =~ s/ \(byte code instruction\)//;
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1040 }
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1041 else {
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1042 $idx = "<tt class=\"opcode\">$opcode_name</tt>";
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1043 }
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1044 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
1045 if ($arg_list) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1046 $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
1047 }
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1048 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
1049 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1050
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1051 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
1052 local($_) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
1053 my $dataname = next_argument();
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
1054 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
1055 $idx =~ s/ \(.*\)//;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1056 return "<dl><dt><b>$idx</b>\n<dd>"
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1057 . $_
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1058 . '</dl>';
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1059 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1060
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1061 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
1062 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1063 my $idx = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1064 if (! $STRING_INDEX_TT) {
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1065 $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
1066 }
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1067 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
1068 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1069
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1070 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
1071 local($_) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
1072 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
1073 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
1074 $idx =~ s/ \(.*\)//;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1075 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
1076 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1077
12343
be5100afa1b7 do_cmd_datalineni(): New function, to implement the non-indexing form
Fred Drake <fdrake@acm.org>
parents: 12217
diff changeset
1078 sub do_cmd_datalineni{
be5100afa1b7 do_cmd_datalineni(): New function, to implement the non-indexing form
Fred Drake <fdrake@acm.org>
parents: 12217
diff changeset
1079 local($_) = @_;
be5100afa1b7 do_cmd_datalineni(): New function, to implement the non-indexing form
Fred Drake <fdrake@acm.org>
parents: 12217
diff changeset
1080 my $data_name = next_argument();
be5100afa1b7 do_cmd_datalineni(): New function, to implement the non-indexing form
Fred Drake <fdrake@acm.org>
parents: 12217
diff changeset
1081 return "<dt><b><tt>$data_name</tt></b><dd>" . $_;
be5100afa1b7 do_cmd_datalineni(): New function, to implement the non-indexing form
Fred Drake <fdrake@acm.org>
parents: 12217
diff changeset
1082 }
be5100afa1b7 do_cmd_datalineni(): New function, to implement the non-indexing form
Fred Drake <fdrake@acm.org>
parents: 12217
diff changeset
1083
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
1084 sub do_env_excdesc{
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
1085 local($_) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
1086 my $excname = next_argument();
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1087 my $idx = make_str_index_entry("<tt class=\"exception\">$excname</tt>");
20678
61e8f01de821 Add yet more markup that let's a stylesheet pick out a small bit of the
Fred Drake <fdrake@acm.org>
parents: 20336
diff changeset
1088 return ("<dl><dt><b>${TLSTART}exception$TLEND $idx</b>"
61e8f01de821 Add yet more markup that let's a stylesheet pick out a small bit of the
Fred Drake <fdrake@acm.org>
parents: 20336
diff changeset
1089 . "\n<dd>"
61e8f01de821 Add yet more markup that let's a stylesheet pick out a small bit of the
Fred Drake <fdrake@acm.org>
parents: 20336
diff changeset
1090 . $_
61e8f01de821 Add yet more markup that let's a stylesheet pick out a small bit of the
Fred Drake <fdrake@acm.org>
parents: 20336
diff changeset
1091 . '</dl>');
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
1092 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
1093
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1094 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
1095
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1096
14491
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1097 sub handle_classlike_descriptor{
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1098 local($_, $what) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1099 $THIS_CLASS = next_argument();
14556
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
1100 my $arg_list = convert_args(next_argument());
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
1101 $idx = make_str_index_entry(
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1102 "<tt class=\"$what\">$THIS_CLASS</tt> ($what in $THIS_MODULE)" );
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1103 $idx =~ s/ \(.*\)//;
20678
61e8f01de821 Add yet more markup that let's a stylesheet pick out a small bit of the
Fred Drake <fdrake@acm.org>
parents: 20336
diff changeset
1104 return ("<dl><dt><b>$TLSTART$what$TLEND $idx</b>"
61e8f01de821 Add yet more markup that let's a stylesheet pick out a small bit of the
Fred Drake <fdrake@acm.org>
parents: 20336
diff changeset
1105 . "(<var>$arg_list</var>)\n<dd>"
16966
38e17a089492 Label classes and exceptions explicitly in the documentation (for their
Fred Drake <fdrake@acm.org>
parents: 16114
diff changeset
1106 . $_
38e17a089492 Label classes and exceptions explicitly in the documentation (for their
Fred Drake <fdrake@acm.org>
parents: 16114
diff changeset
1107 . '</dl>');
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
1108 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
1109
14491
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1110 sub do_env_classdesc{
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1111 return handle_classlike_descriptor(@_[0], "class");
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1112 }
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1113
17778
b4b3657cb1fa Define a new environment, classdesc*, which can be used to document a
Fred Drake <fdrake@acm.org>
parents: 17602
diff changeset
1114 sub do_env_classdescstar{
b4b3657cb1fa Define a new environment, classdesc*, which can be used to document a
Fred Drake <fdrake@acm.org>
parents: 17602
diff changeset
1115 local($_) = @_;
b4b3657cb1fa Define a new environment, classdesc*, which can be used to document a
Fred Drake <fdrake@acm.org>
parents: 17602
diff changeset
1116 $THIS_CLASS = next_argument();
b4b3657cb1fa Define a new environment, classdesc*, which can be used to document a
Fred Drake <fdrake@acm.org>
parents: 17602
diff changeset
1117 $idx = make_str_index_entry(
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1118 "<tt class=\"class\">$THIS_CLASS</tt> (class in $THIS_MODULE)");
17778
b4b3657cb1fa Define a new environment, classdesc*, which can be used to document a
Fred Drake <fdrake@acm.org>
parents: 17602
diff changeset
1119 $idx =~ s/ \(.*\)//;
20678
61e8f01de821 Add yet more markup that let's a stylesheet pick out a small bit of the
Fred Drake <fdrake@acm.org>
parents: 20336
diff changeset
1120 return ("<dl><dt><b>${TLSTART}class$TLEND $idx</b>\n<dd>"
17778
b4b3657cb1fa Define a new environment, classdesc*, which can be used to document a
Fred Drake <fdrake@acm.org>
parents: 17602
diff changeset
1121 . $_
b4b3657cb1fa Define a new environment, classdesc*, which can be used to document a
Fred Drake <fdrake@acm.org>
parents: 17602
diff changeset
1122 . '</dl>');
b4b3657cb1fa Define a new environment, classdesc*, which can be used to document a
Fred Drake <fdrake@acm.org>
parents: 17602
diff changeset
1123 }
b4b3657cb1fa Define a new environment, classdesc*, which can be used to document a
Fred Drake <fdrake@acm.org>
parents: 17602
diff changeset
1124
14491
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1125 sub do_env_excclassdesc{
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1126 return handle_classlike_descriptor(@_[0], "exception");
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1127 }
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1128
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
1129
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
1130 sub do_env_methoddesc{
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
1131 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1132 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
1133 $class_name = $THIS_CLASS
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1134 unless $class_name;
9848
e19cd8ec20a2 do_cmd_methodline(): Fixed reference to method name when generating
Fred Drake <fdrake@acm.org>
parents: 9775
diff changeset
1135 my $method = next_argument();
14556
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
1136 my $arg_list = convert_args(next_argument());
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1137 my $extra = '';
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1138 if ($class_name) {
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1139 $extra = " ($class_name method)";
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
1140 }
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1141 my $idx = make_str_index_entry(
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1142 "<tt class=\"method\">$method()</tt>$extra");
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1143 $idx =~ s/ \(.*\)//;
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1144 $idx =~ s/\(\)//;
17249
6d30552cb4f9 Remove the spurious space of uncertain origin from the output for function,
Fred Drake <fdrake@acm.org>
parents: 16966
diff changeset
1145 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
1146 }
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
1147
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
1148
9769
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
1149 sub do_cmd_methodline{
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
1150 local($_) = @_;
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
1151 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
1152 $class_name = $THIS_CLASS
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
1153 unless $class_name;
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
1154 my $method = next_argument();
14556
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
1155 my $arg_list = convert_args(next_argument());
9769
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
1156 my $extra = '';
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
1157 if ($class_name) {
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
1158 $extra = " ($class_name method)";
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
1159 }
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1160 my $idx = make_str_index_entry(
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1161 "<tt class=\"method\">$method()</tt>$extra");
9769
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
1162 $idx =~ s/ \(.*\)//;
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
1163 $idx =~ s/\(\)//;
17249
6d30552cb4f9 Remove the spurious space of uncertain origin from the output for function,
Fred Drake <fdrake@acm.org>
parents: 16966
diff changeset
1164 return "<dt><b>$idx</b>(<var>$arg_list</var>)\n<dd>"
9769
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
1165 . $_;
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
1166 }
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
1167
e1508f72c610 do_cmd_methodline(): New function, implements indexing version of
Fred Drake <fdrake@acm.org>
parents: 9718
diff changeset
1168
9085
e943f9c09901 do_cmd_methodlineni(): New function, needed because the ref. manual now
Fred Drake <fdrake@acm.org>
parents: 8917
diff changeset
1169 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
1170 local($_) = @_;
e943f9c09901 do_cmd_methodlineni(): New function, needed because the ref. manual now
Fred Drake <fdrake@acm.org>
parents: 8917
diff changeset
1171 next_optional_argument();
e943f9c09901 do_cmd_methodlineni(): New function, needed because the ref. manual now
Fred Drake <fdrake@acm.org>
parents: 8917
diff changeset
1172 my $method = next_argument();
14556
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
1173 my $arg_list = convert_args(next_argument());
17249
6d30552cb4f9 Remove the spurious space of uncertain origin from the output for function,
Fred Drake <fdrake@acm.org>
parents: 16966
diff changeset
1174 return "<dt><b>$method</b>(<var>$arg_list</var>)\n<dd>"
9085
e943f9c09901 do_cmd_methodlineni(): New function, needed because the ref. manual now
Fred Drake <fdrake@acm.org>
parents: 8917
diff changeset
1175 . $_;
e943f9c09901 do_cmd_methodlineni(): New function, needed because the ref. manual now
Fred Drake <fdrake@acm.org>
parents: 8917
diff changeset
1176 }
e943f9c09901 do_cmd_methodlineni(): New function, needed because the ref. manual now
Fred Drake <fdrake@acm.org>
parents: 8917
diff changeset
1177
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
1178 sub do_env_methoddescni{
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
1179 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1180 next_optional_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1181 my $method = next_argument();
14556
4ac09e970828 do_cmd_shortversion(),
Fred Drake <fdrake@acm.org>
parents: 14521
diff changeset
1182 my $arg_list = convert_args(next_argument());
17249
6d30552cb4f9 Remove the spurious space of uncertain origin from the output for function,
Fred Drake <fdrake@acm.org>
parents: 16966
diff changeset
1183 return "<dl><dt><b>$method</b>(<var>$arg_list</var>)\n<dd>"
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1184 . $_
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1185 . '</dl>';
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
1186 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
1187
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
1188
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
1189 sub do_env_memberdesc{
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
1190 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1191 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
1192 my $member = next_argument();
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
1193 $class = $THIS_CLASS
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
1194 unless $class;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1195 my $extra = '';
10637
bed15a015c1c Fix some remaining index & consistency nits. (Many data member
Fred Drake <fdrake@acm.org>
parents: 10598
diff changeset
1196 $extra = " ($class attribute)"
bed15a015c1c Fix some remaining index & consistency nits. (Many data member
Fred Drake <fdrake@acm.org>
parents: 10598
diff changeset
1197 if ($class ne '');
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1198 my $idx = make_str_index_entry("<tt class=\"member\">$member</tt>$extra");
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
1199 $idx =~ s/ \(.*\)//;
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
1200 $idx =~ s/\(\)//;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1201 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
1202 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
1203
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
1204
8086
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
1205 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
1206 local($_) = @_;
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
1207 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
1208 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
1209 $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
1210 unless $class;
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
1211 my $extra = '';
10637
bed15a015c1c Fix some remaining index & consistency nits. (Many data member
Fred Drake <fdrake@acm.org>
parents: 10598
diff changeset
1212 $extra = " ($class attribute)"
bed15a015c1c Fix some remaining index & consistency nits. (Many data member
Fred Drake <fdrake@acm.org>
parents: 10598
diff changeset
1213 if ($class ne '');
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1214 my $idx = make_str_index_entry("<tt class=\"member\">$member</tt>$extra");
8086
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
1215 $idx =~ s/ \(.*\)//;
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
1216 $idx =~ s/\(\)//;
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1217 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
1218 }
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
1219
18683
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1220
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
1221 sub do_env_memberdescni{
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
1222 local($_) = @_;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1223 next_optional_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1224 my $member = next_argument();
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1225 return "<dl><dt><b><tt class=\"member\">$member</tt></b>\n<dd>"
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1226 . $_
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1227 . '</dl>';
7760
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
1228 }
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
1229
6bfa650f311d Lots and lots and lots.....
Fred Drake <fdrake@acm.org>
parents: 7711
diff changeset
1230
8086
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
1231 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
1232 local($_) = @_;
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
1233 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
1234 my $member = next_argument();
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1235 return "<dt><b><tt class=\"member\">$member</tt></b><dd>" . $_;
8086
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
1236 }
692be123f547 next_optional_argument(): Don't include the square brackets in the return
Fred Drake <fdrake@acm.org>
parents: 8074
diff changeset
1237
18683
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1238
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1239 @col_aligns = ('<td>', '<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
1240
19327
73f685db8c0c fix_font(): Instead of using a long if/elsif cluster, use a bloody
Fred Drake <fdrake@acm.org>
parents: 18981
diff changeset
1241 %FontConversions = ('cdata' => 'tt class="cdata"',
73f685db8c0c fix_font(): Instead of using a long if/elsif cluster, use a bloody
Fred Drake <fdrake@acm.org>
parents: 18981
diff changeset
1242 'character' => 'tt class="character"',
73f685db8c0c fix_font(): Instead of using a long if/elsif cluster, use a bloody
Fred Drake <fdrake@acm.org>
parents: 18981
diff changeset
1243 'class' => 'tt class="class"',
73f685db8c0c fix_font(): Instead of using a long if/elsif cluster, use a bloody
Fred Drake <fdrake@acm.org>
parents: 18981
diff changeset
1244 'command' => 'code',
73f685db8c0c fix_font(): Instead of using a long if/elsif cluster, use a bloody
Fred Drake <fdrake@acm.org>
parents: 18981
diff changeset
1245 'constant' => 'tt class="constant"',
73f685db8c0c fix_font(): Instead of using a long if/elsif cluster, use a bloody
Fred Drake <fdrake@acm.org>
parents: 18981
diff changeset
1246 'exception' => 'tt class="exception"',
73f685db8c0c fix_font(): Instead of using a long if/elsif cluster, use a bloody
Fred Drake <fdrake@acm.org>
parents: 18981
diff changeset
1247 'file' => 'tt class="file"',
73f685db8c0c fix_font(): Instead of using a long if/elsif cluster, use a bloody
Fred Drake <fdrake@acm.org>
parents: 18981
diff changeset
1248 'filenq' => 'tt class="file"',
73f685db8c0c fix_font(): Instead of using a long if/elsif cluster, use a bloody
Fred Drake <fdrake@acm.org>
parents: 18981
diff changeset
1249 'kbd' => 'kbd',
73f685db8c0c fix_font(): Instead of using a long if/elsif cluster, use a bloody
Fred Drake <fdrake@acm.org>
parents: 18981
diff changeset
1250 'member' => 'tt class="member"',
73f685db8c0c fix_font(): Instead of using a long if/elsif cluster, use a bloody
Fred Drake <fdrake@acm.org>
parents: 18981
diff changeset
1251 'programopt' => 'b',
73f685db8c0c fix_font(): Instead of using a long if/elsif cluster, use a bloody
Fred Drake <fdrake@acm.org>
parents: 18981
diff changeset
1252 'textrm' => '',
73f685db8c0c fix_font(): Instead of using a long if/elsif cluster, use a bloody
Fred Drake <fdrake@acm.org>
parents: 18981
diff changeset
1253 );
73f685db8c0c fix_font(): Instead of using a long if/elsif cluster, use a bloody
Fred Drake <fdrake@acm.org>
parents: 18981
diff changeset
1254
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1255 sub fix_font{
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1256 # do a little magic on a font name to get the right behavior in the first
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1257 # column of the output table
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1258 my $font = @_[0];
19327
73f685db8c0c fix_font(): Instead of using a long if/elsif cluster, use a bloody
Fred Drake <fdrake@acm.org>
parents: 18981
diff changeset
1259 if (defined $FontConversions{$font}) {
73f685db8c0c fix_font(): Instead of using a long if/elsif cluster, use a bloody
Fred Drake <fdrake@acm.org>
parents: 18981
diff changeset
1260 $font = $FontConversions{$font};
16114
44fd1a7cb279 Fix \seepep handling -- correct URL to the online PEP repository on SF is
Fred Drake <fdrake@acm.org>
parents: 15567
diff changeset
1261 }
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1262 return $font;
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1263 }
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1264
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1265 sub figure_column_alignment{
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1266 my $a = @_[0];
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1267 my $mark = substr($a, 0, 1);
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1268 my $r = '';
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1269 if ($mark eq 'c')
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1270 { $r = ' align="center"'; }
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1271 elsif ($mark eq 'r')
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1272 { $r = ' align="right"'; }
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1273 elsif ($mark eq 'l')
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1274 { $r = ' align="left"'; }
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1275 elsif ($mark eq 'p')
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1276 { $r = ' align="left"'; }
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1277 return $r;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1278 }
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1279
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1280 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
1281 local($_) = @_;
18683
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1282 my($s1,$s2,$s3,$s4,$a5) = split(/[|]/,$_);
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1283 my $a1 = figure_column_alignment($s1);
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1284 my $a2 = figure_column_alignment($s2);
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1285 my $a3 = figure_column_alignment($s3);
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1286 my $a4 = figure_column_alignment($s4);
18683
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1287 my $a5 = figure_column_alignment($s5);
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1288 $col_aligns[0] = "<td$a1 valign=\"baseline\">";
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1289 $col_aligns[1] = "<td$a2>";
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1290 $col_aligns[2] = "<td$a3>";
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1291 $col_aligns[3] = "<td$a4>";
18683
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1292 $col_aligns[4] = "<td$a5>";
10767
e37074b6e78c do_cmd_seetext(): Clean up so we get proper nesting of <div>s. This
Fred Drake <fdrake@acm.org>
parents: 10641
diff changeset
1293 # return the aligned header start tags
18683
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1294 return ("<th$a1>", "<th$a2>", "<th$a3>", "<th$a4>", "<th$a5>");
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1295 }
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1296
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1297 sub get_table_col1_fonts{
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1298 my $font = $globals{'lineifont'};
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1299 my ($sfont,$efont) = ('', '');
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1300 if ($font) {
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1301 $sfont = "<$font>";
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1302 $efont = "</$font>";
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1303 $efont =~ s/ .*>/>/;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1304 }
15459
a79d3624f845 A few small refinements to the table building code.
Fred Drake <fdrake@acm.org>
parents: 15363
diff changeset
1305 return ($sfont, $efont);
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1306 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1307
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1308 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
1309 local($_) = @_;
18683
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1310 my($th1,$th2,$th3,$th4,$th5) = setup_column_alignments(next_argument());
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1311 my $font = fix_font(next_argument());
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1312 my $h1 = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1313 my $h2 = next_argument();
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1314 s/[\s\n]+//;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1315 $globals{'lineifont'} = $font;
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1316 my $a1 = $col_aligns[0];
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1317 my $a2 = $col_aligns[1];
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1318 s/\\lineii</\\lineii[$a1|$a2]</g;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1319 return '<table border align="center" style="border-collapse: collapse">'
15349
0c19672d47bb Normalize the HTML generated for table headers.
Fred Drake <fdrake@acm.org>
parents: 15322
diff changeset
1320 . "\n <thead>"
0c19672d47bb Normalize the HTML generated for table headers.
Fred Drake <fdrake@acm.org>
parents: 15322
diff changeset
1321 . "\n <tr class=\"tableheader\">"
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1322 . "\n $th1<b>$h1</b>\&nbsp;</th>"
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1323 . "\n $th2<b>$h2</b>\&nbsp;</th>"
15349
0c19672d47bb Normalize the HTML generated for table headers.
Fred Drake <fdrake@acm.org>
parents: 15322
diff changeset
1324 . "\n </tr>"
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1325 . "\n </thead>"
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1326 . "\n <tbody valign=\"baseline\">"
15349
0c19672d47bb Normalize the HTML generated for table headers.
Fred Drake <fdrake@acm.org>
parents: 15322
diff changeset
1327 . $_
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1328 . "\n </tbody>"
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1329 . "\n</table>";
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1330 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1331
14722
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14556
diff changeset
1332 sub do_env_longtableii{
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14556
diff changeset
1333 return do_env_tableii(@_);
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14556
diff changeset
1334 }
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14556
diff changeset
1335
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1336 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
1337 local($_) = @_;
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1338 my $aligns = next_optional_argument();
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1339 my $c1 = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1340 my $c2 = next_argument();
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1341 s/[\s\n]+//;
15459
a79d3624f845 A few small refinements to the table building code.
Fred Drake <fdrake@acm.org>
parents: 15363
diff changeset
1342 my($sfont,$efont) = get_table_col1_fonts();
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1343 $c2 = '&nbsp;' if ($c2 eq '');
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1344 my($c1align,$c2align) = split('\|', $aligns);
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1345 my $padding = '';
15459
a79d3624f845 A few small refinements to the table building code.
Fred Drake <fdrake@acm.org>
parents: 15363
diff changeset
1346 if ($c1align =~ /align="right"/ || $c1 eq '') {
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1347 $padding = '&nbsp;';
7798
49f11eb4eb9a This fixes a (minor) problem discovered by AMK when you don't want any
Fred Drake <fdrake@acm.org>
parents: 7779
diff changeset
1348 }
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1349 return "\n <tr>$c1align$sfont$c1$efont$padding</td>\n"
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1350 . " $c2align$c2</td>"
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1351 . $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1352 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1353
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1354 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
1355 local($_) = @_;
18683
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1356 my($th1,$th2,$th3,$th4,$th5) = setup_column_alignments(next_argument());
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1357 my $font = fix_font(next_argument());
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1358 my $h1 = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1359 my $h2 = next_argument();
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1360 my $h3 = next_argument();
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1361 s/[\s\n]+//;
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1362 $globals{'lineifont'} = $font;
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1363 my $a1 = $col_aligns[0];
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1364 my $a2 = $col_aligns[1];
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1365 my $a3 = $col_aligns[2];
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1366 s/\\lineiii</\\lineiii[$a1|$a2|$a3]</g;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1367 return '<table border align="center" style="border-collapse: collapse">'
15349
0c19672d47bb Normalize the HTML generated for table headers.
Fred Drake <fdrake@acm.org>
parents: 15322
diff changeset
1368 . "\n <thead>"
0c19672d47bb Normalize the HTML generated for table headers.
Fred Drake <fdrake@acm.org>
parents: 15322
diff changeset
1369 . "\n <tr class=\"tableheader\">"
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1370 . "\n $th1<b>$h1</b>\&nbsp;</th>"
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1371 . "\n $th2<b>$h2</b>\&nbsp;</th>"
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1372 . "\n $th3<b>$h3</b>\&nbsp;</th>"
15349
0c19672d47bb Normalize the HTML generated for table headers.
Fred Drake <fdrake@acm.org>
parents: 15322
diff changeset
1373 . "\n </tr>"
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1374 . "\n </thead>"
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1375 . "\n <tbody valign=\"baseline\">"
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1376 . $_
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1377 . "\n </tbody>"
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1378 . "\n</table>";
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1379 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1380
14722
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14556
diff changeset
1381 sub do_env_longtableiii{
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14556
diff changeset
1382 return do_env_tableiii(@_);
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14556
diff changeset
1383 }
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14556
diff changeset
1384
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1385 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
1386 local($_) = @_;
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1387 my $aligns = next_optional_argument();
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1388 my $c1 = next_argument();
18683
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1389 my $c2 = next_argument();
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1390 my $c3 = next_argument();
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1391 s/[\s\n]+//;
15459
a79d3624f845 A few small refinements to the table building code.
Fred Drake <fdrake@acm.org>
parents: 15363
diff changeset
1392 my($sfont,$efont) = get_table_col1_fonts();
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1393 $c3 = '&nbsp;' if ($c3 eq '');
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1394 my($c1align,$c2align,$c3align) = split('\|', $aligns);
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1395 my $padding = '';
15459
a79d3624f845 A few small refinements to the table building code.
Fred Drake <fdrake@acm.org>
parents: 15363
diff changeset
1396 if ($c1align =~ /align="right"/ || $c1 eq '') {
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1397 $padding = '&nbsp;';
7798
49f11eb4eb9a This fixes a (minor) problem discovered by AMK when you don't want any
Fred Drake <fdrake@acm.org>
parents: 7779
diff changeset
1398 }
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1399 return "\n <tr>$c1align$sfont$c1$efont$padding</td>\n"
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1400 . " $c2align$c2</td>\n"
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1401 . " $c3align$c3</td>"
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1402 . $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1403 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1404
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1405 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
1406 local($_) = @_;
18683
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1407 my($th1,$th2,$th3,$th4,$th5) = setup_column_alignments(next_argument());
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1408 my $font = fix_font(next_argument());
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1409 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
1410 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
1411 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
1412 my $h4 = next_argument();
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1413 s/[\s\n]+//;
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1414 $globals{'lineifont'} = $font;
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1415 my $a1 = $col_aligns[0];
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1416 my $a2 = $col_aligns[1];
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1417 my $a3 = $col_aligns[2];
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1418 my $a4 = $col_aligns[3];
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1419 s/\\lineiv</\\lineiv[$a1|$a2|$a3|$a4]</g;
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1420 return '<table border align="center" style="border-collapse: collapse">'
15349
0c19672d47bb Normalize the HTML generated for table headers.
Fred Drake <fdrake@acm.org>
parents: 15322
diff changeset
1421 . "\n <thead>"
0c19672d47bb Normalize the HTML generated for table headers.
Fred Drake <fdrake@acm.org>
parents: 15322
diff changeset
1422 . "\n <tr class=\"tableheader\">"
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1423 . "\n $th1<b>$h1</b>\&nbsp;</th>"
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1424 . "\n $th2<b>$h2</b>\&nbsp;</th>"
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1425 . "\n $th3<b>$h3</b>\&nbsp;</th>"
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1426 . "\n $th4<b>$h4</b>\&nbsp;</th>"
15349
0c19672d47bb Normalize the HTML generated for table headers.
Fred Drake <fdrake@acm.org>
parents: 15322
diff changeset
1427 . "\n </tr>"
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1428 . "\n </thead>"
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1429 . "\n <tbody valign=\"baseline\">"
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1430 . $_
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1431 . "\n </tbody>"
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1432 . "\n</table>";
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1433 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1434
14722
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14556
diff changeset
1435 sub do_env_longtableiv{
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14556
diff changeset
1436 return do_env_tableiv(@_);
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14556
diff changeset
1437 }
4d2e9cf1eb20 Add new environments: longtableii, longtableiii, and longtableiv, to
Fred Drake <fdrake@acm.org>
parents: 14556
diff changeset
1438
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1439 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
1440 local($_) = @_;
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1441 my $aligns = next_optional_argument();
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1442 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
1443 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
1444 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
1445 my $c4 = next_argument();
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1446 s/[\s\n]+//;
15459
a79d3624f845 A few small refinements to the table building code.
Fred Drake <fdrake@acm.org>
parents: 15363
diff changeset
1447 my($sfont,$efont) = get_table_col1_fonts();
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1448 $c4 = '&nbsp;' if ($c4 eq '');
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1449 my($c1align,$c2align,$c3align,$c4align) = split('\|', $aligns);
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1450 my $padding = '';
15459
a79d3624f845 A few small refinements to the table building code.
Fred Drake <fdrake@acm.org>
parents: 15363
diff changeset
1451 if ($c1align =~ /align="right"/ || $c1 eq '') {
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1452 $padding = '&nbsp;';
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1453 }
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1454 return "\n <tr>$c1align$sfont$c1$efont$padding</td>\n"
10769
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1455 . " $c2align$c2</td>\n"
1af7a1467088 Control the layout of output tables a little better so they're easier
Fred Drake <fdrake@acm.org>
parents: 10767
diff changeset
1456 . " $c3align$c3</td>\n"
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1457 . " $c4align$c4</td>"
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1458 . $_;
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1459 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1460
18683
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1461 sub do_env_tablev{
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1462 local($_) = @_;
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1463 my($th1,$th2,$th3,$th4,$th5) = setup_column_alignments(next_argument());
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1464 my $font = fix_font(next_argument());
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1465 my $h1 = next_argument();
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1466 my $h2 = next_argument();
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1467 my $h3 = next_argument();
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1468 my $h4 = next_argument();
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1469 my $h5 = next_argument();
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1470 s/[\s\n]+//;
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1471 $globals{'lineifont'} = $font;
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1472 my $a1 = $col_aligns[0];
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1473 my $a2 = $col_aligns[1];
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1474 my $a3 = $col_aligns[2];
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1475 my $a4 = $col_aligns[3];
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1476 my $a5 = $col_aligns[4];
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1477 s/\\linev</\\linev[$a1|$a2|$a3|$a4|$a5]</g;
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1478 return '<table border align="center" style="border-collapse: collapse">'
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1479 . "\n <thead>"
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1480 . "\n <tr class=\"tableheader\">"
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1481 . "\n $th1<b>$h1</b>\&nbsp;</th>"
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1482 . "\n $th2<b>$h2</b>\&nbsp;</th>"
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1483 . "\n $th3<b>$h3</b>\&nbsp;</th>"
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1484 . "\n $th4<b>$h4</b>\&nbsp;</th>"
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1485 . "\n $th5<b>$h5</b>\&nbsp;</th>"
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1486 . "\n </tr>"
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1487 . "\n </thead>"
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1488 . "\n <tbody valign=\"baseline\">"
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1489 . $_
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1490 . "\n </tbody>"
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1491 . "\n</table>";
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1492 }
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1493
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1494 sub do_env_longtablev{
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1495 return do_env_tablev(@_);
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1496 }
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1497
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1498 sub do_cmd_linev{
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1499 local($_) = @_;
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1500 my $aligns = next_optional_argument();
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1501 my $c1 = next_argument();
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1502 my $c2 = next_argument();
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1503 my $c3 = next_argument();
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1504 my $c4 = next_argument();
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1505 my $c5 = next_argument();
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1506 s/[\s\n]+//;
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1507 my($sfont,$efont) = get_table_col1_fonts();
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1508 $c5 = '&nbsp;' if ($c5 eq '');
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1509 my($c1align,$c2align,$c3align,$c4align,$c5align) = split('\|', $aligns);
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1510 my $padding = '';
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1511 if ($c1align =~ /align="right"/ || $c1 eq '') {
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1512 $padding = '&nbsp;';
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1513 }
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1514 return "\n <tr>$c1align$sfont$c1$efont$padding</td>\n"
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1515 . " $c2align$c2</td>\n"
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1516 . " $c3align$c3</td>\n"
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1517 . " $c4align$c4</td>\n"
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1518 . " $c5align$c5</td>"
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1519 . $_;
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1520 }
8ca70c9c1971 Define new markup for 5-column tables.
Fred Drake <fdrake@acm.org>
parents: 18426
diff changeset
1521
14285
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1522
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1523 # These can be used to control the title page appearance;
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1524 # they need a little bit of documentation.
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1525 #
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1526 # If $TITLE_PAGE_GRAPHIC is set, it should be the name of a file in the
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1527 # $ICONSERVER directory, or include path information (other than "./"). The
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1528 # default image type will be assumed if an extension is not provided.
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1529 #
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1530 # If specified, the "title page" will contain two colums: one containing the
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1531 # title/author/etc., and the other containing the graphic. Use the other
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1532 # four variables listed here to control specific details of the layout; all
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1533 # are optional.
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1534 #
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1535 # $TITLE_PAGE_GRAPHIC = "my-company-logo";
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1536 # $TITLE_PAGE_GRAPHIC_COLWIDTH = "30%";
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1537 # $TITLE_PAGE_GRAPHIC_WIDTH = 150;
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1538 # $TITLE_PAGE_GRAPHIC_HEIGHT = 150;
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1539 # $TITLE_PAGE_GRAPHIC_ON_RIGHT = 0;
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1540
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1541 sub make_my_titlepage() {
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1542 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
1543 if ($t_title) {
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
1544 $the_title .= "\n<h1>$t_title</h1>";
14285
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1545 }
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1546 else {
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1547 write_warnings("\nThis document has no title.");
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1548 }
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1549 if ($t_author) {
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1550 if ($t_authorURL) {
8074
d0ff41746a26 New helper functions to help deal with parameter parsing.
Fred Drake <fdrake@acm.org>
parents: 8031
diff changeset
1551 my $href = translate_commands($t_authorURL);
10128
0dd4fafefd6c do_cmd_maketitle(): Small nit in creating the "title page".
Fred Drake <fdrake@acm.org>
parents: 10127
diff changeset
1552 $href = make_named_href('author', $href,
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1553 "<b><font size=\"+2\">$t_author"
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1554 . '</font></b>');
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
1555 $the_title .= "\n<p>$href</p>";
14285
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1556 }
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1557 else {
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1558 $the_title .= ("\n<p><b><font size=\"+2\">$t_author"
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1559 . '</font></b></p>');
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1560 }
14285
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1561 }
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1562 else {
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1563 write_warnings("\nThere is no author for this document.");
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1564 }
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1565 if ($t_institute) {
14285
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1566 $the_title .= "\n<p>$t_institute</p>";
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1567 }
8342
22815a0b1267 Added support for \developer, \developers, \developersaddress.
Fred Drake <fdrake@acm.org>
parents: 8294
diff changeset
1568 if ($DEVELOPER_ADDRESS) {
14285
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1569 $the_title .= "\n<p>$DEVELOPER_ADDRESS</p>";
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1570 }
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1571 if ($t_affil) {
14285
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1572 $the_title .= "\n<p><i>$t_affil</i></p>";
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1573 }
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1574 if ($t_date) {
15567
d38516ce6f14 For the title page, insert the package version number before the date.
Fred Drake <fdrake@acm.org>
parents: 15459
diff changeset
1575 $the_title .= "\n<p>";
15322
d17ba141480a Rename $PYTHON_VERSION to $PACKAGE_VERSION; this is the version number for
Fred Drake <fdrake@acm.org>
parents: 14987
diff changeset
1576 if ($PACKAGE_VERSION) {
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1577 $the_title .= ('<strong>Release '
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1578 . "$PACKAGE_VERSION$RELEASE_INFO</strong><br>\n");
14285
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1579 }
15567
d38516ce6f14 For the title page, insert the package version number before the date.
Fred Drake <fdrake@acm.org>
parents: 15459
diff changeset
1580 $the_title .= "<strong>$t_date</strong></p>"
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1581 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1582 if ($t_address) {
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
1583 $the_title .= "\n<p>$t_address</p>";
14285
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1584 }
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1585 else {
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1586 $the_title .= "\n<p>";
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1587 }
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1588 if ($t_email) {
7711
56dcfc27710a Coding cleanups.
Fred Drake <fdrake@acm.org>
parents: 7671
diff changeset
1589 $the_title .= "\n<p>$t_email</p>";
14285
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1590 }
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1591 return $the_title;
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1592 }
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1593
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1594 sub make_my_titlegraphic() {
14970
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
1595 my $filename = make_icon_filename($TITLE_PAGE_GRAPHIC);
14285
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1596 my $graphic = "<td class=\"titlegraphic\"";
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1597 $graphic .= " width=\"$TITLE_PAGE_GRAPHIC_COLWIDTH\""
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1598 if ($TITLE_PAGE_GRAPHIC_COLWIDTH);
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1599 $graphic .= "><img";
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1600 $graphic .= " width=\"$TITLE_PAGE_GRAPHIC_WIDTH\""
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1601 if ($TITLE_PAGE_GRAPHIC_WIDTH);
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1602 $graphic .= " height=\"$TITLE_PAGE_GRAPHIC_HEIGHT\""
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1603 if ($TITLE_PAGE_GRAPHIC_HEIGHT);
14987
bbe09cccb49b $OFF_SITE_LINK_ICON: Don't define here; simply defining it overrides a
Fred Drake <fdrake@acm.org>
parents: 14970
diff changeset
1604 $graphic .= "\n src=\"$filename\"></td>\n";
14285
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1605 return $graphic;
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1606 }
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1607
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1608 sub do_cmd_maketitle {
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1609 local($_) = @_;
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1610 my $the_title = "\n<div class=\"titlepage\">";
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1611 if ($TITLE_PAGE_GRAPHIC) {
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1612 if ($TITLE_PAGE_GRAPHIC_ON_RIGHT) {
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1613 $the_title .= ("\n<table border=\"0\" width=\"100%\">"
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1614 . "<tr align=\"right\">\n<td>"
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1615 . make_my_titlepage()
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1616 . "</td>\n"
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1617 . make_my_titlegraphic()
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1618 . "</tr>\n</table>");
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1619 }
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1620 else {
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1621 $the_title .= ("\n<table border=\"0\" width=\"100%\"><tr>\n"
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1622 . make_my_titlegraphic()
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1623 . "<td>"
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1624 . make_my_titlepage()
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1625 . "</td></tr>\n</table>");
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1626 }
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1627 }
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1628 else {
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1629 $the_title .= ("\n<center>"
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1630 . make_my_titlepage()
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1631 . "\n</center>");
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1632 }
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1633 $the_title .= "\n</div>";
d357ad367f26 Push some table header formatting to the style sheet; this also helps
Fred Drake <fdrake@acm.org>
parents: 13926
diff changeset
1634 return $the_title . $_;
10197
de7c0003578f Become more stylesheet-friendly.
Fred Drake <fdrake@acm.org>
parents: 10157
diff changeset
1635 $the_title .= "\n</center></div>";
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1636 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
1637 }
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1638
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1639
8397
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1640 #
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1641 # 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
1642 #
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1643
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1644 require SynopsisTable;
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1645
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
1646 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
1647 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
1648 $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
1649 $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
1650 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
1651 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1652
14491
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1653 # 'chapter' => 'SynopsisTable instance'
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1654 %ModuleSynopses = ();
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
1655
fba8455dcb54 Fix up the synopsis table stuff so it gets things right at each chapter,
Fred Drake <fdrake@acm.org>
parents: 8754
diff changeset
1656 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
1657 my($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
1658 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
1659 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
1660 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
1661 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
1662 }
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1663 }
14491
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1664 my $st = SynopsisTable->new();
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
1665 $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
1666 return $st;
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1667 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1668
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1669 sub do_cmd_moduleauthor{
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1670 local($_) = @_;
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1671 next_argument();
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1672 next_argument();
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1673 return $_;
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1674 }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1675
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1676 sub do_cmd_sectionauthor{
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1677 local($_) = @_;
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1678 next_argument();
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1679 next_argument();
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1680 return $_;
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1681 }
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1682
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1683 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
1684 local($_) = @_;
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1685 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
1686 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
1687 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
1688 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
1689 #
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1690 $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
1691 $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
1692 $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
1693 define_module($type, $name);
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1694 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
1695 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1696
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1697 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
1698 local($_) = @_;
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1699 my $st = get_synopsis_table(get_chapter_id());
10598
c8759ba83552 Fix problem of LaTeX leakage in the module synopsis tables at the
Fred Drake <fdrake@acm.org>
parents: 10464
diff changeset
1700 $st->set_synopsis($THIS_MODULE, translate_commands(next_argument()));
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1701 return $_;
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1702 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1703
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1704 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
1705 local($_) = @_;
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1706 my $chap = get_chapter_id();
14491
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1707 my $st = get_synopsis_table($chap);
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1708 $st->set_file("$CURRENT_FILE");
10327
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
1709 return "<tex2html-localmoduletable><$chap>\\tableofchildlinks[off]" . $_;
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1710 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1711
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1712 sub process_all_localmoduletables{
14491
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1713 my $key;
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1714 my $st, $file;
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1715 foreach $key (keys %ModuleSynopses) {
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1716 $st = $ModuleSynopses{$key};
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1717 $file = $st->get_file();
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1718 if ($file) {
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1719 process_localmoduletables_in_file($file);
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1720 }
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1721 else {
18231
f9261904cebb Added support for our new \infinity and \plusminus macros, and the
Fred Drake <fdrake@acm.org>
parents: 18185
diff changeset
1722 print "\nsynopsis table $key has no file association\n";
14491
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1723 }
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1724 }
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1725 }
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1726
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1727 sub process_localmoduletables_in_file{
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1728 my $file = @_[0];
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1729 open(MYFILE, "<$file");
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1730 local($_);
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1731 sysread(MYFILE, $_, 1024*1024);
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1732 close(MYFILE);
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1733 # need to get contents of file in $_
10327
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
1734 while (/<tex2html-localmoduletable><(\d+)>/) {
8756
fba8455dcb54 Fix up the synopsis table stuff so it gets things right at each chapter,
Fred Drake <fdrake@acm.org>
parents: 8754
diff changeset
1735 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
1736 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
1737 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
1738 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
1739 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
1740 }
14491
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1741 open(MYFILE,">$file");
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1742 print MYFILE $_;
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1743 close(MYFILE);
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1744 }
10327
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
1745 sub process_python_state{
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
1746 process_all_localmoduletables();
18426
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
1747 process_grammar_files();
10327
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
1748 }
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1749
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1750
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1751 #
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1752 # "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
1753 #
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1755 sub do_env_seealso{
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1756 return ("<div class=\"seealso\">\n "
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1757 . "<p class=\"heading\"><b>See Also:</b></p>\n"
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1758 . @_[0]
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1759 . '</div>');
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1760 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1761
21116
0a67463f8b7d Add a new environment in the Python docs markup: seealso*. This is similar
Fred Drake <fdrake@acm.org>
parents: 20678
diff changeset
1762 sub do_env_seealsostar{
0a67463f8b7d Add a new environment in the Python docs markup: seealso*. This is similar
Fred Drake <fdrake@acm.org>
parents: 20678
diff changeset
1763 return ("<div class=\"seealso-simple\">\n "
0a67463f8b7d Add a new environment in the Python docs markup: seealso*. This is similar
Fred Drake <fdrake@acm.org>
parents: 20678
diff changeset
1764 . @_[0]
0a67463f8b7d Add a new environment in the Python docs markup: seealso*. This is similar
Fred Drake <fdrake@acm.org>
parents: 20678
diff changeset
1765 . '</div>');
0a67463f8b7d Add a new environment in the Python docs markup: seealso*. This is similar
Fred Drake <fdrake@acm.org>
parents: 20678
diff changeset
1766 }
0a67463f8b7d Add a new environment in the Python docs markup: seealso*. This is similar
Fred Drake <fdrake@acm.org>
parents: 20678
diff changeset
1767
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1768 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
1769 # 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
1770 # 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
1771 local($_) = @_;
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1772 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
1773 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
1774 my $text = next_argument();
10846
b7378df3db56 Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents: 10777
diff changeset
1775 my $period = '.';
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1776 $key = $module
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1777 unless $key;
10846
b7378df3db56 Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents: 10777
diff changeset
1778 if ($text =~ /\.$/) {
b7378df3db56 Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents: 10777
diff changeset
1779 $period = '';
b7378df3db56 Change the look of \seemodule output to fit in better.
Fred Drake <fdrake@acm.org>
parents: 10777
diff changeset
1780 }
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1781 return ('<dl compact class="seemodule">'
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1782 . "\n <dt>Module <b><tt class=\"module\">"
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1783 . "<a href=\"module-$key.html\">$module</a></tt>:</b>"
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1784 . "\n <dd>$text$period\n </dl>"
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1785 . $_);
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1786 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1787
17429
c2fb2d476bd3 When forming the <A> tag for a \seepep or \seerfc, make sure we strip
Fred Drake <fdrake@acm.org>
parents: 17381
diff changeset
1788 sub strip_html_markup($){
c2fb2d476bd3 When forming the <A> tag for a \seepep or \seerfc, make sure we strip
Fred Drake <fdrake@acm.org>
parents: 17381
diff changeset
1789 my $str = @_[0];
c2fb2d476bd3 When forming the <A> tag for a \seepep or \seerfc, make sure we strip
Fred Drake <fdrake@acm.org>
parents: 17381
diff changeset
1790 my $s = "$str";
c2fb2d476bd3 When forming the <A> tag for a \seepep or \seerfc, make sure we strip
Fred Drake <fdrake@acm.org>
parents: 17381
diff changeset
1791 $s =~ s/<[a-zA-Z0-9]+(\s+[a-zA-Z0-9]+(\s*=\s*(\'[^\']*\'|\"[^\"]*\"|[a-zA-Z0-9]+))?)*\s*>//g;
c2fb2d476bd3 When forming the <A> tag for a \seepep or \seerfc, make sure we strip
Fred Drake <fdrake@acm.org>
parents: 17381
diff changeset
1792 $s =~ s/<\/[a-zA-Z0-9]+>//g;
c2fb2d476bd3 When forming the <A> tag for a \seepep or \seerfc, make sure we strip
Fred Drake <fdrake@acm.org>
parents: 17381
diff changeset
1793 return $s;
c2fb2d476bd3 When forming the <A> tag for a \seepep or \seerfc, make sure we strip
Fred Drake <fdrake@acm.org>
parents: 17381
diff changeset
1794 }
c2fb2d476bd3 When forming the <A> tag for a \seepep or \seerfc, make sure we strip
Fred Drake <fdrake@acm.org>
parents: 17381
diff changeset
1795
14491
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1796 sub handle_rfclike_reference{
16114
44fd1a7cb279 Fix \seepep handling -- correct URL to the online PEP repository on SF is
Fred Drake <fdrake@acm.org>
parents: 15567
diff changeset
1797 local($_, $what, $format) = @_;
12499
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
1798 my $rfcnum = next_argument();
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
1799 my $title = next_argument();
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
1800 my $text = next_argument();
16114
44fd1a7cb279 Fix \seepep handling -- correct URL to the online PEP repository on SF is
Fred Drake <fdrake@acm.org>
parents: 15567
diff changeset
1801 my $url = get_rfc_url($rfcnum, $format);
14970
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
1802 my $icon = get_link_icon($url);
17429
c2fb2d476bd3 When forming the <A> tag for a \seepep or \seerfc, make sure we strip
Fred Drake <fdrake@acm.org>
parents: 17381
diff changeset
1803 my $attrtitle = strip_html_markup($title);
12499
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
1804 return '<dl compact class="seerfc">'
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
1805 . "\n <dt><a href=\"$url\""
17429
c2fb2d476bd3 When forming the <A> tag for a \seepep or \seerfc, make sure we strip
Fred Drake <fdrake@acm.org>
parents: 17381
diff changeset
1806 . "\n title=\"$attrtitle\""
14987
bbe09cccb49b $OFF_SITE_LINK_ICON: Don't define here; simply defining it overrides a
Fred Drake <fdrake@acm.org>
parents: 14970
diff changeset
1807 . "\n >$what $rfcnum, <em>$title</em>$icon</a>"
12499
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
1808 . "\n <dd>$text\n </dl>"
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
1809 . $_;
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
1810 }
0780aba97898 ref_module_index_helper(): Use "my" instead of "local".
Fred Drake <fdrake@acm.org>
parents: 12376
diff changeset
1811
14491
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1812 sub do_cmd_seepep{
16114
44fd1a7cb279 Fix \seepep handling -- correct URL to the online PEP repository on SF is
Fred Drake <fdrake@acm.org>
parents: 15567
diff changeset
1813 return handle_rfclike_reference(@_[0], "PEP", $PEP_FORMAT);
14491
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1814 }
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1815
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1816 sub do_cmd_seerfc{
16114
44fd1a7cb279 Fix \seepep handling -- correct URL to the online PEP repository on SF is
Fred Drake <fdrake@acm.org>
parents: 15567
diff changeset
1817 return handle_rfclike_reference(@_[0], "RFC", $RFC_FORMAT);
14491
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1818 }
334d9aebaaf1 Add support for new \pep, \seepep, excclassdesc markup.
Fred Drake <fdrake@acm.org>
parents: 14285
diff changeset
1819
14521
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14491
diff changeset
1820 sub do_cmd_seetitle{
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14491
diff changeset
1821 local($_) = @_;
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14491
diff changeset
1822 my $url = next_optional_argument();
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14491
diff changeset
1823 my $title = next_argument();
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14491
diff changeset
1824 my $text = next_argument();
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14491
diff changeset
1825 if ($url) {
14987
bbe09cccb49b $OFF_SITE_LINK_ICON: Don't define here; simply defining it overrides a
Fred Drake <fdrake@acm.org>
parents: 14970
diff changeset
1826 my $icon = get_link_icon($url);
14521
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14491
diff changeset
1827 return '<dl compact class="seetitle">'
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14491
diff changeset
1828 . "\n <dt><em class=\"citetitle\"><a href=\"$url\""
14970
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
1829 . "\n >$title$icon</a></em>"
14521
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14491
diff changeset
1830 . "\n <dd>$text\n </dl>"
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14491
diff changeset
1831 . $_;
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14491
diff changeset
1832 }
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14491
diff changeset
1833 return '<dl compact class="seetitle">'
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14491
diff changeset
1834 . "\n <dt><em class=\"citetitle\""
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14491
diff changeset
1835 . "\n >$title</em>"
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14491
diff changeset
1836 . "\n <dd>$text\n </dl>"
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14491
diff changeset
1837 . $_;
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14491
diff changeset
1838 }
9fed4eebc586 \seetitle: New macro for building reference list content.
Fred Drake <fdrake@acm.org>
parents: 14491
diff changeset
1839
12637
69481cde511d do_cmd_seeurl(): New function.
Fred Drake <fdrake@acm.org>
parents: 12551
diff changeset
1840 sub do_cmd_seeurl{
69481cde511d do_cmd_seeurl(): New function.
Fred Drake <fdrake@acm.org>
parents: 12551
diff changeset
1841 local($_) = @_;
69481cde511d do_cmd_seeurl(): New function.
Fred Drake <fdrake@acm.org>
parents: 12551
diff changeset
1842 my $url = next_argument();
69481cde511d do_cmd_seeurl(): New function.
Fred Drake <fdrake@acm.org>
parents: 12551
diff changeset
1843 my $text = next_argument();
14970
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
1844 my $icon = get_link_icon($url);
12637
69481cde511d do_cmd_seeurl(): New function.
Fred Drake <fdrake@acm.org>
parents: 12551
diff changeset
1845 return '<dl compact class="seeurl">'
69481cde511d do_cmd_seeurl(): New function.
Fred Drake <fdrake@acm.org>
parents: 12551
diff changeset
1846 . "\n <dt><a href=\"$url\""
14970
6af9aa15647f make_icon_filename(): Convenience function to turn a partial filename
Fred Drake <fdrake@acm.org>
parents: 14766
diff changeset
1847 . "\n class=\"url\">$url$icon</a>"
12637
69481cde511d do_cmd_seeurl(): New function.
Fred Drake <fdrake@acm.org>
parents: 12551
diff changeset
1848 . "\n <dd>$text\n </dl>"
69481cde511d do_cmd_seeurl(): New function.
Fred Drake <fdrake@acm.org>
parents: 12551
diff changeset
1849 . $_;
69481cde511d do_cmd_seeurl(): New function.
Fred Drake <fdrake@acm.org>
parents: 12551
diff changeset
1850 }
69481cde511d do_cmd_seeurl(): New function.
Fred Drake <fdrake@acm.org>
parents: 12551
diff changeset
1851
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1852 sub do_cmd_seetext{
10767
e37074b6e78c do_cmd_seetext(): Clean up so we get proper nesting of <div>s. This
Fred Drake <fdrake@acm.org>
parents: 10641
diff changeset
1853 local($_) = @_;
e37074b6e78c do_cmd_seetext(): Clean up so we get proper nesting of <div>s. This
Fred Drake <fdrake@acm.org>
parents: 10641
diff changeset
1854 my $content = next_argument();
12217
5ea773413531 Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents: 11449
diff changeset
1855 return '<div class="seetext"><p>' . $content . '</div>' . $_;
8754
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1856 }
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1857
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1858
e88d4e6e4622 Added module synopsis support with one (big) caveat: All the modules are
Fred Drake <fdrake@acm.org>
parents: 8397
diff changeset
1859 #
8397
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1860 # Definition list support.
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1861 #
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1862
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1863 sub do_env_definitions{
18185
d3b1956e3de0 Added support for new \setreleaseinfo macro.
Fred Drake <fdrake@acm.org>
parents: 18127
diff changeset
1864 return "<dl class=\"definitions\">" . @_[0] . "</dl>\n";
8397
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1865 }
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1866
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1867 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
1868 local($_) = @_;
9775
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
1869 my $term = next_argument();
b116afb81732 write_idxfile(): New function. Isolate format of the external index
Fred Drake <fdrake@acm.org>
parents: 9769
diff changeset
1870 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
1871 # could easily add an index entry here...
8917
e55a79ff8228 do_cmd_moduleauthor(),
Fred Drake <fdrake@acm.org>
parents: 8820
diff changeset
1872 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
1873 }
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1874
c9b7e926fd86 Added support for AMK's {definitions} environment; thanks for the reminder!
Fred Drake <fdrake@acm.org>
parents: 8349
diff changeset
1875
14766
72860ef03171 use_sans_serif(),
Fred Drake <fdrake@acm.org>
parents: 14722
diff changeset
1876 # I don't recall exactly why this was needed, but it was very much needed.
72860ef03171 use_sans_serif(),
Fred Drake <fdrake@acm.org>
parents: 14722
diff changeset
1877 # We'll see if anything breaks when I move the "code" line out -- some
72860ef03171 use_sans_serif(),
Fred Drake <fdrake@acm.org>
parents: 14722
diff changeset
1878 # things broke with it in.
72860ef03171 use_sans_serif(),
Fred Drake <fdrake@acm.org>
parents: 14722
diff changeset
1879
72860ef03171 use_sans_serif(),
Fred Drake <fdrake@acm.org>
parents: 14722
diff changeset
1880 #code # {}
10100
9184862bd8d1 More magic to tighten up a little of the formatting.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
1881 process_commands_wrap_deferred(<<_RAW_ARG_DEFERRED_CMDS_);
10138
b21915e6589e Fix up some routines to coordinate the "indexsubitem" stuff so that
Fred Drake <fdrake@acm.org>
parents: 10128
diff changeset
1882 declaremodule # [] # {} # {}
b21915e6589e Fix up some routines to coordinate the "indexsubitem" stuff so that
Fred Drake <fdrake@acm.org>
parents: 10128
diff changeset
1883 memberline # [] # {}
b21915e6589e Fix up some routines to coordinate the "indexsubitem" stuff so that
Fred Drake <fdrake@acm.org>
parents: 10128
diff changeset
1884 methodline # [] # {} # {}
b21915e6589e Fix up some routines to coordinate the "indexsubitem" stuff so that
Fred Drake <fdrake@acm.org>
parents: 10128
diff changeset
1885 modulesynopsis # {}
10327
66a7d61cfd84 swallow_newline(): Removed function; not really needed. Modified all call
Fred Drake <fdrake@acm.org>
parents: 10197
diff changeset
1886 platform # {}
10100
9184862bd8d1 More magic to tighten up a little of the formatting.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
1887 samp # {}
10138
b21915e6589e Fix up some routines to coordinate the "indexsubitem" stuff so that
Fred Drake <fdrake@acm.org>
parents: 10128
diff changeset
1888 setindexsubitem # {}
10157
13239b48c469 Minor fix that helps out with the index.
Fred Drake <fdrake@acm.org>
parents: 10149
diff changeset
1889 withsubitem # {} # {}
10100
9184862bd8d1 More magic to tighten up a little of the formatting.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
1890 _RAW_ARG_DEFERRED_CMDS_
9184862bd8d1 More magic to tighten up a little of the formatting.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
1891
9184862bd8d1 More magic to tighten up a little of the formatting.
Fred Drake <fdrake@acm.org>
parents: 10077
diff changeset
1892
17381
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1893 $alltt_start = '<dl><dd><pre class="verbatim">';
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1894 $alltt_end = '</pre></dl>';
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1895
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1896 sub do_env_alltt {
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1897 local ($_) = @_;
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1898 local($closures,$reopens,@open_block_tags);
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1899
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1900 # get the tag-strings for all open tags
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1901 local(@keep_open_tags) = @$open_tags_R;
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1902 ($closures,$reopens) = &preserve_open_tags() if (@$open_tags_R);
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1903
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1904 # get the tags for text-level tags only
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1905 $open_tags_R = [ @keep_open_tags ];
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1906 local($local_closures, $local_reopens);
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1907 ($local_closures, $local_reopens,@open_block_tags)
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1908 = &preserve_open_block_tags
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1909 if (@$open_tags_R);
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1910
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1911 $open_tags_R = [ @open_block_tags ];
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1912
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1913 do {
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1914 local($open_tags_R) = [ @open_block_tags ];
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1915 local(@save_open_tags) = ();
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1916
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1917 local($cnt) = ++$global{'max_id'};
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1918 $_ = join('',"$O$cnt$C\\tt$O", ++$global{'max_id'}, $C
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1919 , $_ , $O, $global{'max_id'}, "$C$O$cnt$C");
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1920
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1921 $_ = &translate_environments($_);
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1922 $_ = &translate_commands($_) if (/\\/);
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1923
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1924 # preserve space-runs, using &nbsp;
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1925 while (s/(\S) ( +)/$1$2;SPMnbsp;/g){};
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1926 s/(<BR>) /$1;SPMnbsp;/g;
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1927
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1928 $_ = join('', $closures, $alltt_start, $local_reopens
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1929 , $_
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1930 , &balance_tags() #, $local_closures
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1931 , $alltt_end, $reopens);
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1932 undef $open_tags_R; undef @save_open_tags;
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1933 };
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1934 $open_tags_R = [ @keep_open_tags ];
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1935 $_;
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1936 }
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1937
18127
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1938 sub do_cmd_verbatiminput{
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1939 local($_) = @_;
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1940 my $fname = next_argument();
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1941 my $file;
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1942 my $found = 0;
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1943 my $texpath;
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1944 # Search TEXINPUTS for the input file, the way we're supposed to:
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1945 foreach $texpath (split /$envkey/, $TEXINPUTS) {
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1946 $file = "$texpath$dd$fname";
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1947 last if ($found = (-f $file));
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1948 }
18426
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
1949 my $srcname;
18127
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1950 my $text;
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1951 if ($found) {
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1952 open(MYFILE, "<$file") || die "\n$!\n";
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1953 read(MYFILE, $text, 1024*1024);
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1954 close(MYFILE);
18426
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
1955 use File::Basename;
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
1956 my $srcdir, $srcext;
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
1957 ($srcname, $srcdir, $srcext) = fileparse($file, '\..*');
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
1958 open(MYFILE, ">$srcname.txt");
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
1959 print MYFILE $text;
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
1960 close(MYFILE);
18127
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1961 #
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1962 # These rewrites convert the raw text to something that will
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1963 # be properly visible as HTML and also will pass through the
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1964 # vagaries of conversion through LaTeX2HTML. The order in
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1965 # which the specific rewrites are performed is significant.
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1966 #
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1967 $text =~ s/\&/\&amp;/g;
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1968 # These need to happen before the normal < and > re-writes,
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1969 # since we need to avoid LaTeX2HTML's attempt to perform
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1970 # ligature processing without regard to context (since it
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1971 # doesn't have font information).
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1972 $text =~ s/--/-&\#45;/g;
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1973 $text =~ s/<</\&lt;\&\#60;/g;
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1974 $text =~ s/>>/\&gt;\&\#62;/g;
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1975 # Just normal re-writes...
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1976 $text =~ s/</\&lt;/g;
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1977 $text =~ s/>/\&gt;/g;
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1978 # These last isn't needed for the HTML, but is needed to get
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1979 # past LaTeX2HTML processing TeX macros. We use &#92; instead
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1980 # of &sol; since many browsers don't support that.
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1981 $text =~ s/\\/\&\#92;/g;
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1982 }
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1983 else {
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1984 $text = '<b>Could not locate requested file <i>$fname</i>!</b>\n';
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1985 }
18426
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
1986 return ('<dl><dd><pre class="verbatim">'
18127
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1987 . $text
18426
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
1988 . "</pre>\n<div class=\"verbatiminput-footer\">\n"
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
1989 . "<a href=\"$srcname.txt\" type=\"text/plain\""
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
1990 . ">Download as text.</a>"
a83ff7739992 Add support for \ulink and hyperlink grammars.
Fred Drake <fdrake@acm.org>
parents: 18231
diff changeset
1991 . "\n</div>\n</dd></dl>"
18127
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1992 . $_);
e328218546b5 Implement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake <fdrake@acm.org>
parents: 17778
diff changeset
1993 }
17381
8a2dd97873f2 Add corresponding support for the alltt environment to the HTML generator.
Fred Drake <fdrake@acm.org>
parents: 17249
diff changeset
1994
7527
26a8771a4cfd Convert LaTeX support to create a new class of documents. HTML generation
Fred Drake <fdrake@acm.org>
parents:
diff changeset
1995 1; # This must be the last line