blob: 41b2f94f935d7f097c72fb3f13ed877f05ddc5bc [file] [log] [blame]
Fred Drake85d14c92000-07-31 17:53:45 +00001# LaTeX2HTML support base for use with Python documentation.
Fred Drake41814bc1998-05-11 18:23:35 +00002
3package main;
4
Fred Drake85d14c92000-07-31 17:53:45 +00005use L2hos;
6
Fred Drake28e7b4c1998-10-20 18:14:20 +00007$HTML_VERSION = 4.0;
8
Fred Drake6aa5d481998-08-11 03:14:50 +00009$MAX_LINK_DEPTH = 2;
Fred Draked7571651998-04-23 20:06:24 +000010$ADDRESS = '';
Fred Drakebc7101d1998-03-06 21:18:55 +000011
Fred Drakee194beb1998-05-19 19:38:49 +000012$NO_FOOTNODE = 1;
Fred Drakebc7101d1998-03-06 21:18:55 +000013$NUMBERED_FOOTNOTES = 1;
14
15# Python documentation uses section numbers to support references to match
16# in the printed and online versions.
17#
18$SHOW_SECTION_NUMBERS = 1;
19
Fred Drake15a159c2002-10-01 15:20:20 +000020$ICONSERVER = '.';
Fred Drakef730fc32000-08-31 07:19:07 +000021$IMAGE_TYPE = 'gif';
Fred Drakebc7101d1998-03-06 21:18:55 +000022
Fred Drake6aa5d481998-08-11 03:14:50 +000023# Control where the navigation bars should show up:
24$TOP_NAVIGATION = 1;
25$BOTTOM_NAVIGATION = 1;
26$AUTO_NAVIGATION = 0;
27
Fred Drake16816272000-09-16 20:40:44 +000028$BODYTEXT = '';
Fred Drake2fc88a62003-08-05 03:45:37 +000029$CHILDLINE = "\n<p></p><hr />\n";
Fred Drakebc7101d1998-03-06 21:18:55 +000030$VERBOSITY = 0;
Fred Drakebc7101d1998-03-06 21:18:55 +000031
Fred Drake4d10b431998-08-07 20:51:58 +000032# default # of columns for the indexes
Fred Drakeaa3f9fb1998-08-07 19:52:37 +000033$INDEX_COLUMNS = 2;
Fred Drake2383f6d1999-03-02 16:00:37 +000034$MODULE_INDEX_COLUMNS = 4;
Fred Drakeaa3f9fb1998-08-07 19:52:37 +000035
Fred Drakea219b412001-10-22 16:57:49 +000036$HAVE_MODULE_INDEX = 0;
37$HAVE_GENERAL_INDEX = 0;
38$HAVE_TABLE_OF_CONTENTS = 0;
39
Fred Drakee03e1fe2002-04-05 17:34:50 +000040$AESOP_META_TYPE = 'information';
41
Fred Drakec9f2c141998-03-11 12:08:21 +000042
Fred Drakedb34a1e1998-03-10 23:02:57 +000043# A little painful, but lets us clean up the top level directory a little,
Fred Drake85d14c92000-07-31 17:53:45 +000044# and not be tied to the current directory (as far as I can tell). Testing
45# an existing definition of $mydir is needed since it cannot be computed when
46# run under mkhowto with recent versions of LaTeX2HTML, since this file is
47# not read directly by LaTeX2HTML any more. mkhowto is required to prepend
48# the required definition at the top of the actual input file.
Fred Drakedb34a1e1998-03-10 23:02:57 +000049#
Fred Drake85d14c92000-07-31 17:53:45 +000050if (!defined $mydir) {
51 use Cwd;
52 use File::Basename;
53 ($myname, $mydir, $myext) = fileparse(__FILE__, '\..*');
54 chop $mydir; # remove trailing '/'
55 $mydir = getcwd() . "$dd$mydir"
56 unless $mydir =~ s|^/|/|;
57}
Fred Drakedb34a1e1998-03-10 23:02:57 +000058$LATEX2HTMLSTYLES = "$mydir$envkey$LATEX2HTMLSTYLES";
Fred Drakeb3a3ed81998-07-24 22:17:34 +000059push (@INC, $mydir);
Fred Drakebc7101d1998-03-06 21:18:55 +000060
Fred Drake235e6b11998-03-27 05:19:43 +000061($myrootname, $myrootdir, $myext) = fileparse($mydir, '\..*');
62chop $myrootdir;
63
Fred Drakebc7101d1998-03-06 21:18:55 +000064
Fred Drakea4565b01998-05-15 17:14:17 +000065# Hackish way to get the appropriate paper-*/ directory into $TEXINPUTS;
66# pass in the paper size (a4 or letter) as the environment variable PAPER
67# to add the right directory. If not given, the current directory is
68# added instead for use with HOWTO processing.
69#
70if (defined $ENV{'PAPER'}) {
71 $mytexinputs = "$myrootdir${dd}paper-$ENV{'PAPER'}$envkey";
72}
73else {
74 $mytexinputs = getcwd() . $envkey;
75}
76$mytexinputs .= "$myrootdir${dd}texinputs";
77
78
Fred Drakeb35f2b71999-09-23 16:53:09 +000079# Change this variable to change the text added in "About this document...";
80# this should be an absolute pathname to get it right.
81#
82$ABOUT_FILE = "$myrootdir${dd}html${dd}stdabout.dat";
83
84
Fred Drake85d14c92000-07-31 17:53:45 +000085sub custom_driver_hook {
Fred Drakea4565b01998-05-15 17:14:17 +000086 #
87 # This adds the directory of the main input file to $TEXINPUTS; it
88 # seems to be sufficiently general that it should be fine for HOWTO
89 # processing.
90 #
Fred Drake73c5b6602002-10-24 16:36:05 +000091 my $file = $_[0];
Fred Drake85d14c92000-07-31 17:53:45 +000092 my($jobname, $dir, $ext) = fileparse($file, '\..*');
93 $dir = L2hos->Make_directory_absolute($dir);
Fred Drakea4565b01998-05-15 17:14:17 +000094 $dir =~ s/$dd$//;
95 $TEXINPUTS = "$dir$envkey$mytexinputs";
Fred Drake85d14c92000-07-31 17:53:45 +000096 print "\nAdding $dir to \$TEXINPUTS\n";
Fred Drake191439a1999-09-22 19:50:51 +000097}
98
Fred Drakea4565b01998-05-15 17:14:17 +000099
Fred Drake85d14c92000-07-31 17:53:45 +0000100$CUSTOM_BUTTONS = '';
Fred Drake062bc6e1998-08-13 22:03:46 +0000101
Fred Drakebf8ec3e2003-05-02 20:18:01 +0000102sub make_nav_sectref($$$) {
103 my($label, $linktype, $title) = @_;
Fred Drakebeb27bf1999-02-16 17:22:32 +0000104 if ($title) {
Fred Drake02c70822000-09-19 15:36:19 +0000105 if ($title =~ /\<[aA] /) {
Fred Drakebf8ec3e2003-05-02 20:18:01 +0000106 $title =~ s/\<[aA] /<a class="sectref" rel="$linktype" /;
Fred Drake2fc88a62003-08-05 03:45:37 +0000107 $title =~ s/ HREF=/ href=/;
Fred Drake02c70822000-09-19 15:36:19 +0000108 }
109 else {
110 $title = "<span class=\"sectref\">$title</span>";
111 }
Fred Drakebf8ec3e2003-05-02 20:18:01 +0000112 return "<b class=\"navlabel\">$label:</b>\n$title\n";
Fred Drakebeb27bf1999-02-16 17:22:32 +0000113 }
114 return '';
115}
116
Fred Draked18722b2001-01-02 22:08:48 +0000117@my_icon_tags = ();
118$my_icon_tags{'next'} = 'Next Page';
119$my_icon_tags{'next_page'} = 'Next Page';
120$my_icon_tags{'previous'} = 'Previous Page';
121$my_icon_tags{'previous_page'} = 'Previous Page';
122$my_icon_tags{'up'} = 'Up One Level';
123$my_icon_tags{'contents'} = 'Contents';
124$my_icon_tags{'index'} = 'Index';
125$my_icon_tags{'modules'} = 'Module Index';
126
Fred Drakeb31d36c2001-01-04 15:16:01 +0000127@my_icon_names = ();
128$my_icon_names{'previous_page'} = 'previous';
129$my_icon_names{'next_page'} = 'next';
130
Fred Drakef5478632002-05-23 17:59:16 +0000131sub get_my_icon($) {
Fred Drake73c5b6602002-10-24 16:36:05 +0000132 my $name = $_[0];
Fred Draked18722b2001-01-02 22:08:48 +0000133 my $text = $my_icon_tags{$name};
Fred Drakeb31d36c2001-01-04 15:16:01 +0000134 if ($my_icon_names{$name}) {
135 $name = $my_icon_names{$name};
136 }
Fred Draked18722b2001-01-02 22:08:48 +0000137 if ($text eq '') {
138 $name = 'blank';
139 }
Fred Drake85d14c92000-07-31 17:53:45 +0000140 my $iconserver = ($ICONSERVER eq '.') ? '' : "$ICONSERVER/";
Fred Drakedd3d6a02002-10-30 17:00:58 +0000141 return "<img src='$iconserver$name.$IMAGE_TYPE'\n border='0'"
Fred Drake2fc88a62003-08-05 03:45:37 +0000142 . " height='32' alt='$text' width='32' />";
Fred Drake85d14c92000-07-31 17:53:45 +0000143}
144
Fred Drake8b34e7c2003-05-03 02:07:22 +0000145sub unlinkify($) {
146 my $text = "$_[0]";
147 $text =~ s|</[aA]>||;
148 $text =~ s|<a\s+[^>]*>||i;
149 return $text;
150}
151
152sub use_icon($$$) {
153 my($rel,$str,$title) = @_;
154 if ($title) {
155 my $s = "$str";
156 if ($s =~ /\<tex2html_([a-z_]+)_visible_mark\>/) {
157 my $r = get_my_icon($1);
158 $s =~ s/\<tex2html_[a-z_]+_visible_mark\>/$r/;
159 }
160 $s =~ s/<[aA] /<a rel="$rel" title="$title" \n /;
Fred Drake2fc88a62003-08-05 03:45:37 +0000161 $s =~ s/ HREF=/ href=/;
Fred Drake8b34e7c2003-05-03 02:07:22 +0000162 return $s;
Fred Draked18722b2001-01-02 22:08:48 +0000163 }
Fred Drake8b34e7c2003-05-03 02:07:22 +0000164 else {
165 return get_my_icon('blank');
166 }
Fred Drake13210ed1998-03-17 06:28:05 +0000167}
168
Fred Drakef5478632002-05-23 17:59:16 +0000169sub make_nav_panel() {
Fred Drake85d14c92000-07-31 17:53:45 +0000170 my $s;
Fred Drake8b34e7c2003-05-03 02:07:22 +0000171 # new iconic rel iconic page title
172 $NEXT = use_icon('next', $NEXT, unlinkify($NEXT_TITLE));
173 $UP = use_icon('parent', $UP, unlinkify($UP_TITLE));
174 $PREVIOUS = use_icon('prev', $PREVIOUS, unlinkify($PREVIOUS_TITLE));
175 $CONTENTS = use_icon('contents', $CONTENTS, 'Table of Contents');
176 $INDEX = use_icon('index', $INDEX, 'Index');
Fred Drake85d14c92000-07-31 17:53:45 +0000177 if (!$CUSTOM_BUTTONS) {
Fred Drake8b34e7c2003-05-03 02:07:22 +0000178 $CUSTOM_BUTTONS = get_my_icon('blank');
Fred Drake85d14c92000-07-31 17:53:45 +0000179 }
180 $s = ('<table align="center" width="100%" cellpadding="0" cellspacing="2">'
181 . "\n<tr>"
182 # left-hand side
Fred Drake85d14c92000-07-31 17:53:45 +0000183 . "\n<td>$PREVIOUS</td>"
Fred Drake4640e132000-07-31 20:13:23 +0000184 . "\n<td>$UP</td>"
185 . "\n<td>$NEXT</td>"
Fred Drake85d14c92000-07-31 17:53:45 +0000186 # title box
Fred Drakef730fc32000-08-31 07:19:07 +0000187 . "\n<td align=\"center\" width=\"100%\">$t_title</td>"
Fred Drake85d14c92000-07-31 17:53:45 +0000188 # right-hand side
189 . "\n<td>$CONTENTS</td>"
190 . "\n<td>$CUSTOM_BUTTONS</td>" # module index
191 . "\n<td>$INDEX</td>"
192 . "\n</tr></table>\n"
193 # textual navigation
Fred Drakebf8ec3e2003-05-02 20:18:01 +0000194 . make_nav_sectref("Previous", "prev", $PREVIOUS_TITLE)
195 . make_nav_sectref("Up", "parent", $UP_TITLE)
196 . make_nav_sectref("Next", "next", $NEXT_TITLE)
Fred Drake4640e132000-07-31 20:13:23 +0000197 );
Fred Drake85d14c92000-07-31 17:53:45 +0000198 # remove these; they are unnecessary and cause errors from validation
199 $s =~ s/ NAME="tex2html\d+"\n */ /g;
200 return $s;
201}
202
Fred Drakefb6499f2001-10-26 14:16:23 +0000203sub add_child_links {
204 my $toc = add_real_child_links(@_);
205 $toc =~ s|\s*</[aA]>|</a>|g;
206 $toc =~ s/ NAME=\"tex2html\d+\"\s*href=/ href=/gi;
Fred Drake2fc88a62003-08-05 03:45:37 +0000207 $toc =~ s|</UL>(\s*<BR( /)?>)?|</ul>|gi;
Fred Drakefb6499f2001-10-26 14:16:23 +0000208 return $toc;
209}
210
Fred Drakef5478632002-05-23 17:59:16 +0000211sub get_version_text() {
Fred Drake7497bd32000-10-25 16:18:10 +0000212 if ($PACKAGE_VERSION ne '' && $t_date) {
213 return ("<span class=\"release-info\">"
Fred Drakedce975c2001-06-20 21:31:36 +0000214 . "Release $PACKAGE_VERSION$RELEASE_INFO,"
Fred Drake7497bd32000-10-25 16:18:10 +0000215 . " documentation updated on $t_date.</span>");
216 }
217 if ($PACKAGE_VERSION ne '') {
218 return ("<span class=\"release-info\">"
Fred Drakedce975c2001-06-20 21:31:36 +0000219 . "Release $PACKAGE_VERSION$RELEASE_INFO.</span>");
Fred Drake7497bd32000-10-25 16:18:10 +0000220 }
221 if ($t_date) {
222 return ("<span class=\"release-info\">Documentation released on "
223 . "$t_date.</span>");
224 }
225 return '';
226}
227
Fred Drake85d14c92000-07-31 17:53:45 +0000228
Fred Drakef5478632002-05-23 17:59:16 +0000229sub top_navigation_panel() {
Fred Drake859c46a2003-09-04 19:30:15 +0000230 return "\n<div id='top-navigation-panel'>\n"
Fred Drake7497bd32000-10-25 16:18:10 +0000231 . make_nav_panel()
Fred Drake859c46a2003-09-04 19:30:15 +0000232 . "<br /><hr /></div>\n";
Fred Drakebc7101d1998-03-06 21:18:55 +0000233}
234
Fred Drakef5478632002-05-23 17:59:16 +0000235sub bot_navigation_panel() {
Fred Drake859c46a2003-09-04 19:30:15 +0000236 return "\n<div id='bottom-navigation-panel'>\n"
237 . "<p></p><hr />\n"
Fred Drake7497bd32000-10-25 16:18:10 +0000238 . make_nav_panel()
Fred Drake859c46a2003-09-04 19:30:15 +0000239 . "</div>\n"
Fred Drake2fc88a62003-08-05 03:45:37 +0000240 . "<hr />\n"
Fred Drake7497bd32000-10-25 16:18:10 +0000241 . get_version_text()
242 . "\n";
Fred Drake64bdc241998-04-17 02:14:12 +0000243}
244
245sub add_link {
246 # Returns a pair (iconic link, textual link)
247 my($icon, $current_file, @link) = @_;
248 my($dummy, $file, $title) = split($delim,
Fred Drake28e7b4c1998-10-20 18:14:20 +0000249 $section_info{join(' ',@link)});
Fred Draked18722b2001-01-02 22:08:48 +0000250 if ($icon =~ /\<tex2html_([_a-z]+)_visible_mark\>/) {
251 my $r = get_my_icon($1);
252 $icon =~ s/\<tex2html_[_a-z]+_visible_mark\>/$r/;
253 }
Fred Drake64bdc241998-04-17 02:14:12 +0000254 if ($title && ($file ne $current_file)) {
255 $title = purify($title);
256 $title = get_first_words($title, $WORDS_IN_NAVIGATION_PANEL_TITLES);
257 return (make_href($file, $icon), make_href($file, "$title"))
258 }
Fred Draked18722b2001-01-02 22:08:48 +0000259 elsif ($icon eq get_my_icon('up') && $EXTERNAL_UP_LINK) {
Fred Drake64bdc241998-04-17 02:14:12 +0000260 return (make_href($EXTERNAL_UP_LINK, $icon),
261 make_href($EXTERNAL_UP_LINK, "$EXTERNAL_UP_TITLE"))
262 }
Fred Draked18722b2001-01-02 22:08:48 +0000263 elsif ($icon eq get_my_icon('previous')
Fred Drake64bdc241998-04-17 02:14:12 +0000264 && $EXTERNAL_PREV_LINK && $EXTERNAL_PREV_TITLE) {
265 return (make_href($EXTERNAL_PREV_LINK, $icon),
266 make_href($EXTERNAL_PREV_LINK, "$EXTERNAL_PREV_TITLE"))
267 }
Fred Draked18722b2001-01-02 22:08:48 +0000268 elsif ($icon eq get_my_icon('next')
Fred Drake64bdc241998-04-17 02:14:12 +0000269 && $EXTERNAL_DOWN_LINK && $EXTERNAL_DOWN_TITLE) {
270 return (make_href($EXTERNAL_DOWN_LINK, $icon),
271 make_href($EXTERNAL_DOWN_LINK, "$EXTERNAL_DOWN_TITLE"))
272 }
Fred Drake85d14c92000-07-31 17:53:45 +0000273 return (&inactive_img($icon), "");
Fred Drake64bdc241998-04-17 02:14:12 +0000274}
275
Fred Drakef5478632002-05-23 17:59:16 +0000276sub add_special_link($$$) {
Fred Drake64bdc241998-04-17 02:14:12 +0000277 my($icon, $file, $current_file) = @_;
Fred Draked18722b2001-01-02 22:08:48 +0000278 if ($icon =~ /\<tex2html_([_a-z]+)_visible_mark\>/) {
279 my $r = get_my_icon($1);
280 $icon =~ s/\<tex2html_[_a-z]+_visible_mark\>/$r/;
281 }
Fred Drake85d14c92000-07-31 17:53:45 +0000282 return (($file && ($file ne $current_file))
283 ? make_href($file, $icon)
284 : undef)
Fred Drake64bdc241998-04-17 02:14:12 +0000285}
286
Fred Drake85d14c92000-07-31 17:53:45 +0000287# The img_tag() function seems only to be called with the parameter
288# 'anchor_invisible_mark', which we want to turn into ''. Since
289# replace_icon_marks() is the only interesting caller, and all it really
290# does is call img_tag(), we can just define the hook alternative to be
291# a no-op instead.
292#
293sub replace_icons_hook {}
Fred Drakebc7101d1998-03-06 21:18:55 +0000294
Fred Drake50cdd971999-02-19 23:04:59 +0000295sub do_cmd_arabic {
296 # get rid of that nasty <SPAN CLASS="arabic">...</SPAN>
Fred Drake73c5b6602002-10-24 16:36:05 +0000297 my($ctr, $val, $id, $text) = &read_counter_value($_[0]);
Fred Drake85d14c92000-07-31 17:53:45 +0000298 return ($val ? farabic($val) : "0") . $text;
Fred Drake50cdd971999-02-19 23:04:59 +0000299}
300
301
Fred Drakef5478632002-05-23 17:59:16 +0000302sub gen_index_id($$) {
Fred Drakebc7101d1998-03-06 21:18:55 +0000303 # this is used to ensure common index key generation and a stable sort
Fred Drakef5478632002-05-23 17:59:16 +0000304 my($str, $extra) = @_;
Fred Drake64bdc241998-04-17 02:14:12 +0000305 sprintf('%s###%s%010d', $str, $extra, ++$global{'max_id'});
Fred Drakebc7101d1998-03-06 21:18:55 +0000306}
307
Fred Drakef5478632002-05-23 17:59:16 +0000308sub insert_index($$$$$) {
309 my($mark, $datafile, $columns, $letters, $prefix) = @_;
Fred Drake4d10b431998-08-07 20:51:58 +0000310 my $prog = "$myrootdir/tools/buildindex.py";
311 my $index;
312 if ($letters) {
313 $index = `$prog --columns $columns --letters $datafile`;
314 }
315 else {
316 $index = `$prog --columns $columns $datafile`;
317 }
Fred Drakec5681732000-09-12 20:13:04 +0000318 if (!s/$mark/$prefix$index/) {
319 print "\nCould not locate index mark: $mark";
320 }
Fred Drake64bdc241998-04-17 02:14:12 +0000321}
322
Fred Drakef5478632002-05-23 17:59:16 +0000323sub add_idx() {
Fred Drake9bbdce51999-01-19 16:30:10 +0000324 print "\nBuilding HTML for the index ...";
Fred Drake235e6b11998-03-27 05:19:43 +0000325 close(IDXFILE);
Fred Drake2383f6d1999-03-02 16:00:37 +0000326 insert_index($idx_mark, 'index.dat', $INDEX_COLUMNS, 1, '');
Fred Drake13210ed1998-03-17 06:28:05 +0000327}
Fred Drakebc7101d1998-03-06 21:18:55 +0000328
329
330$idx_module_mark = '<tex2html_idx_module_mark>';
331$idx_module_title = 'Module Index';
332
Fred Drakef5478632002-05-23 17:59:16 +0000333sub add_module_idx() {
Fred Drake9bbdce51999-01-19 16:30:10 +0000334 print "\nBuilding HTML for the module index ...";
Fred Drake235e6b11998-03-27 05:19:43 +0000335 my $key;
Fred Drake2383f6d1999-03-02 16:00:37 +0000336 my $first = 1;
337 my $prevplat = '';
338 my $allthesame = 1;
339 my $prefix = '';
340 foreach $key (keys %Modules) {
Fred Drake73c5b6602002-10-24 16:36:05 +0000341 $key =~ s/<tt>([a-zA-Z0-9._]*)<\/tt>/$1/;
Fred Drake2383f6d1999-03-02 16:00:37 +0000342 my $plat = "$ModulePlatforms{$key}";
343 $plat = ''
Fred Drake62cc3601999-03-04 18:41:17 +0000344 if ($plat eq $IGNORE_PLATFORM_ANNOTATION);
Fred Drake2383f6d1999-03-02 16:00:37 +0000345 if (!$first) {
346 $allthesame = 0
347 if ($prevplat ne $plat);
348 }
349 else { $first = 0; }
350 $prevplat = $plat;
351 }
Fred Drake64bdc241998-04-17 02:14:12 +0000352 open(MODIDXFILE, '>modindex.dat') || die "\n$!\n";
Fred Drake235e6b11998-03-27 05:19:43 +0000353 foreach $key (keys %Modules) {
354 # dump the line in the data file; just use a dummy seqno field
Fred Drake2383f6d1999-03-02 16:00:37 +0000355 my $nkey = $1;
356 my $moditem = "$Modules{$key}";
357 my $plat = '';
Fred Drake73c5b6602002-10-24 16:36:05 +0000358 $key =~ s/<tt>([a-zA-Z0-9._]*)<\/tt>/$1/;
Fred Drake2383f6d1999-03-02 16:00:37 +0000359 if ($ModulePlatforms{$key} && !$allthesame) {
Fred Drakedce975c2001-06-20 21:31:36 +0000360 $plat = (" <em>(<span class=\"platform\">$ModulePlatforms{$key}"
Fred Drakebb584d31999-03-25 22:18:30 +0000361 . '</span>)</em>');
Fred Drake2383f6d1999-03-02 16:00:37 +0000362 }
Fred Drakee15956b2000-04-03 04:51:13 +0000363 print MODIDXFILE $moditem . $IDXFILE_FIELD_SEP
Fred Drakedce975c2001-06-20 21:31:36 +0000364 . "<tt class=\"module\">$key</tt>$plat###\n";
Fred Drakebc7101d1998-03-06 21:18:55 +0000365 }
Fred Drake235e6b11998-03-27 05:19:43 +0000366 close(MODIDXFILE);
Fred Drake42181db2001-01-09 22:02:10 +0000367
368 if ($GLOBAL_MODULE_INDEX) {
369 $prefix = <<MODULE_INDEX_PREFIX;
370
371<p> This index only lists modules documented in this manual.
372 The <em class="citetitle"><a href="$GLOBAL_MODULE_INDEX">Global Module
373 Index</a></em> lists all modules that are documented in this set
374 of manuals.</p>
375MODULE_INDEX_PREFIX
376 }
Fred Drake2383f6d1999-03-02 16:00:37 +0000377 if (!$allthesame) {
Fred Draked18722b2001-01-02 22:08:48 +0000378 $prefix .= <<PLAT_DISCUSS;
Fred Drake2383f6d1999-03-02 16:00:37 +0000379
380<p> Some module names are followed by an annotation indicating what
381platform they are available on.</p>
382
383PLAT_DISCUSS
384 }
385 insert_index($idx_module_mark, 'modindex.dat', $MODULE_INDEX_COLUMNS, 0,
386 $prefix);
Fred Drakebc7101d1998-03-06 21:18:55 +0000387}
388
Fred Drake235e6b11998-03-27 05:19:43 +0000389# replace both indexes as needed:
Fred Drake85d14c92000-07-31 17:53:45 +0000390sub add_idx_hook {
Fred Drakeb3a3ed81998-07-24 22:17:34 +0000391 add_idx() if (/$idx_mark/);
Fred Drake2383f6d1999-03-02 16:00:37 +0000392 process_python_state();
Fred Drakec5681732000-09-12 20:13:04 +0000393 if ($MODULE_INDEX_FILE) {
394 local ($_);
395 open(MYFILE, "<$MODULE_INDEX_FILE");
396 sysread(MYFILE, $_, 1024*1024);
397 close(MYFILE);
398 add_module_idx();
399 open(MYFILE,">$MODULE_INDEX_FILE");
400 print MYFILE $_;
401 close(MYFILE);
402 }
Fred Drake235e6b11998-03-27 05:19:43 +0000403}
Fred Drakebc7101d1998-03-06 21:18:55 +0000404
Fred Drakebc7101d1998-03-06 21:18:55 +0000405
Fred Drake191439a1999-09-22 19:50:51 +0000406# In addition to the standard stuff, add label to allow named node files and
407# support suppression of the page complete (for HTML Help use).
Fred Drake095f8172003-06-27 18:26:01 +0000408$MY_CONTENTS_PAGE = '';
Fred Drakebc7101d1998-03-06 21:18:55 +0000409sub do_cmd_tableofcontents {
410 local($_) = @_;
411 $TITLE = $toc_title;
412 $tocfile = $CURRENT_FILE;
Fred Drakef5478632002-05-23 17:59:16 +0000413 my($closures, $reopens) = preserve_open_tags();
Fred Drake64bdc241998-04-17 02:14:12 +0000414 anchor_label('contents', $CURRENT_FILE, $_); # this is added
Fred Drake095f8172003-06-27 18:26:01 +0000415 $MY_CONTENTS_PAGE = "$CURRENT_FILE";
Fred Drake2fc88a62003-08-05 03:45:37 +0000416 join('', "<br />\n\\tableofchildlinks[off]", $closures
417 , make_section_heading($toc_title, 'h2'), $toc_mark
Fred Drakebc7101d1998-03-06 21:18:55 +0000418 , $reopens, $_);
419}
420# In addition to the standard stuff, add label to allow named node files.
421sub do_cmd_listoffigures {
422 local($_) = @_;
423 $TITLE = $lof_title;
424 $loffile = $CURRENT_FILE;
Fred Drakef5478632002-05-23 17:59:16 +0000425 my($closures, $reopens) = preserve_open_tags();
Fred Drake64bdc241998-04-17 02:14:12 +0000426 anchor_label('lof', $CURRENT_FILE, $_); # this is added
Fred Drake2fc88a62003-08-05 03:45:37 +0000427 join('', "<br />\n", $closures
428 , make_section_heading($lof_title, 'h2'), $lof_mark
Fred Drakebc7101d1998-03-06 21:18:55 +0000429 , $reopens, $_);
430}
431# In addition to the standard stuff, add label to allow named node files.
432sub do_cmd_listoftables {
433 local($_) = @_;
434 $TITLE = $lot_title;
435 $lotfile = $CURRENT_FILE;
Fred Drakef5478632002-05-23 17:59:16 +0000436 my($closures, $reopens) = preserve_open_tags();
Fred Drake64bdc241998-04-17 02:14:12 +0000437 anchor_label('lot', $CURRENT_FILE, $_); # this is added
Fred Drake2fc88a62003-08-05 03:45:37 +0000438 join('', "<br />\n", $closures
439 , make_section_heading($lot_title, 'h2'), $lot_mark
Fred Drakebc7101d1998-03-06 21:18:55 +0000440 , $reopens, $_);
441}
442# In addition to the standard stuff, add label to allow named node files.
443sub do_cmd_textohtmlinfopage {
444 local($_) = @_;
445 if ($INFO) { #
Fred Drake64bdc241998-04-17 02:14:12 +0000446 anchor_label("about",$CURRENT_FILE,$_); # this is added
Fred Drakebc7101d1998-03-06 21:18:55 +0000447 } #
Fred Drake15796f71998-11-30 19:25:47 +0000448 my $the_version = ''; # and the rest is
449 if ($t_date) { # mostly ours
450 $the_version = ",\n$t_date";
Fred Drake7497bd32000-10-25 16:18:10 +0000451 if ($PACKAGE_VERSION) {
Fred Drakedce975c2001-06-20 21:31:36 +0000452 $the_version .= ", Release $PACKAGE_VERSION$RELEASE_INFO";
Fred Drake15796f71998-11-30 19:25:47 +0000453 }
454 }
Fred Drake9443dc32001-08-10 20:12:09 +0000455 my $about;
456 open(ABOUT, "<$ABOUT_FILE") || die "\n$!\n";
457 sysread(ABOUT, $about, 1024*1024);
458 close(ABOUT);
Fred Drake15796f71998-11-30 19:25:47 +0000459 $_ = (($INFO == 1)
Fred Drakeb35f2b71999-09-23 16:53:09 +0000460 ? join('',
461 $close_all,
462 "<strong>$t_title</strong>$the_version\n",
Fred Drake9443dc32001-08-10 20:12:09 +0000463 $about,
Fred Drakeb35f2b71999-09-23 16:53:09 +0000464 $open_all, $_)
465 : join('', $close_all, $INFO,"\n", $open_all, $_));
Fred Drake15796f71998-11-30 19:25:47 +0000466 $_;
Fred Drakebc7101d1998-03-06 21:18:55 +0000467}
468
469# $idx_mark will be replaced with the real index at the end
470sub do_cmd_textohtmlindex {
471 local($_) = @_;
472 $TITLE = $idx_title;
473 $idxfile = $CURRENT_FILE;
Fred Drake235e6b11998-03-27 05:19:43 +0000474 if (%index_labels) { make_index_labels(); }
475 if (($SHORT_INDEX) && (%index_segment)) { make_preindex(); }
Fred Drakebc7101d1998-03-06 21:18:55 +0000476 else { $preindex = ''; }
Fred Drake235e6b11998-03-27 05:19:43 +0000477 my $heading = make_section_heading($idx_title, 'h2') . $idx_mark;
Fred Drakef5478632002-05-23 17:59:16 +0000478 my($pre, $post) = minimize_open_tags($heading);
Fred Drake235e6b11998-03-27 05:19:43 +0000479 anchor_label('genindex',$CURRENT_FILE,$_); # this is added
Fred Drake2fc88a62003-08-05 03:45:37 +0000480 return "<br />\n" . $pre . $_;
Fred Drakebc7101d1998-03-06 21:18:55 +0000481}
482
Fred Drakec5681732000-09-12 20:13:04 +0000483$MODULE_INDEX_FILE = '';
484
Fred Drakebc7101d1998-03-06 21:18:55 +0000485# $idx_module_mark will be replaced with the real index at the end
486sub do_cmd_textohtmlmoduleindex {
487 local($_) = @_;
Fred Drakebc7101d1998-03-06 21:18:55 +0000488 $TITLE = $idx_module_title;
Fred Drakec5681732000-09-12 20:13:04 +0000489 anchor_label('modindex', $CURRENT_FILE, $_);
490 $MODULE_INDEX_FILE = "$CURRENT_FILE";
Fred Drake2fc88a62003-08-05 03:45:37 +0000491 $_ = ('<p></p>' . make_section_heading($idx_module_title, 'h2')
Fred Drakec5681732000-09-12 20:13:04 +0000492 . $idx_module_mark . $_);
493 return $_;
Fred Drakebc7101d1998-03-06 21:18:55 +0000494}
495
Fred Drakec5681732000-09-12 20:13:04 +0000496# The bibliography and the index should be treated as separate
497# sections in their own HTML files. The \bibliography{} command acts
498# as a sectioning command that has the desired effect. But when the
499# bibliography is constructed manually using the thebibliography
500# environment, or when using the theindex environment it is not
501# possible to use the normal sectioning mechanism. This subroutine
502# inserts a \bibliography{} or a dummy \textohtmlindex command just
503# before the appropriate environments to force sectioning.
Fred Drakebc7101d1998-03-06 21:18:55 +0000504
Fred Drakec5681732000-09-12 20:13:04 +0000505# XXX This *assumes* that if there are two {theindex} environments,
506# the first is the module index and the second is the standard
507# index. This is sufficient for the current Python documentation,
508# but that's about it.
Fred Drakebc7101d1998-03-06 21:18:55 +0000509
510sub add_bbl_and_idx_dummy_commands {
Fred Drake11916921998-04-02 22:30:57 +0000511 my $id = $global{'max_id'};
Fred Drakebc7101d1998-03-06 21:18:55 +0000512
Fred Drakea219b412001-10-22 16:57:49 +0000513 if (/[\\]tableofcontents/) {
514 $HAVE_TABLE_OF_CONTENTS = 1;
515 }
Fred Drakebc7101d1998-03-06 21:18:55 +0000516 s/([\\]begin\s*$O\d+$C\s*thebibliography)/$bbl_cnt++; $1/eg;
Fred Drake191439a1999-09-22 19:50:51 +0000517 s/([\\]begin\s*$O\d+$C\s*thebibliography)/$id++; "\\bibliography$O$id$C$O$id$C $1"/geo;
Fred Drake85d14c92000-07-31 17:53:45 +0000518 my(@parts) = split(/\\begin\s*$O\d+$C\s*theindex/);
519 if (scalar(@parts) == 3) {
520 # Be careful to re-write the string in place, since $_ is *not*
521 # returned explicity; *** nasty side-effect dependency! ***
Fred Drakebb7775a2001-12-04 17:03:54 +0000522 print "\nadd_bbl_and_idx_dummy_commands ==> adding general index";
Fred Drake85d14c92000-07-31 17:53:45 +0000523 print "\nadd_bbl_and_idx_dummy_commands ==> adding module index";
524 my $rx = "([\\\\]begin\\s*$O\\d+$C\\s*theindex[\\s\\S]*)"
525 . "([\\\\]begin\\s*$O\\d+$C\\s*theindex)";
Fred Drake73c5b6602002-10-24 16:36:05 +0000526 s/$rx/\\textohtmlmoduleindex $1 \\textohtmlindex $2/o;
Fred Drake85d14c92000-07-31 17:53:45 +0000527 # Add a button to the navigation areas:
Fred Drakeaaa23852000-09-14 22:20:41 +0000528 $CUSTOM_BUTTONS .= ('<a href="modindex.html" title="Module Index">'
Fred Draked18722b2001-01-02 22:08:48 +0000529 . get_my_icon('modules')
Fred Drakeaaa23852000-09-14 22:20:41 +0000530 . '</a>');
Fred Drakea219b412001-10-22 16:57:49 +0000531 $HAVE_MODULE_INDEX = 1;
532 $HAVE_GENERAL_INDEX = 1;
533 }
534 elsif (scalar(@parts) == 2) {
Fred Drakebb7775a2001-12-04 17:03:54 +0000535 print "\nadd_bbl_and_idx_dummy_commands ==> adding general index";
536 my $rx = "([\\\\]begin\\s*$O\\d+$C\\s*theindex)";
Fred Drake73c5b6602002-10-24 16:36:05 +0000537 s/$rx/\\textohtmlindex $1/o;
Fred Drakea219b412001-10-22 16:57:49 +0000538 $HAVE_GENERAL_INDEX = 1;
Fred Drake11916921998-04-02 22:30:57 +0000539 }
Fred Drakebb7775a2001-12-04 17:03:54 +0000540 elsif (scalar(@parts) == 1) {
541 print "\nadd_bbl_and_idx_dummy_commands ==> no index found";
Fred Draked18722b2001-01-02 22:08:48 +0000542 $CUSTOM_BUTTONS .= get_my_icon('blank');
Fred Drake85d14c92000-07-31 17:53:45 +0000543 $global{'max_id'} = $id; # not sure why....
544 s/([\\]begin\s*$O\d+$C\s*theindex)/\\textohtmlindex $1/o;
Fred Drake191439a1999-09-22 19:50:51 +0000545 s/[\\]printindex/\\textohtmlindex /o;
Fred Drakebb7775a2001-12-04 17:03:54 +0000546 }
547 else {
548 die "\n\nBad number of index environments!\n\n";
549 }
Fred Drake11916921998-04-02 22:30:57 +0000550 #----------------------------------------------------------------------
Fred Drake64bdc241998-04-17 02:14:12 +0000551 lib_add_bbl_and_idx_dummy_commands()
Fred Drake11916921998-04-02 22:30:57 +0000552 if defined(&lib_add_bbl_and_idx_dummy_commands);
Fred Drakebc7101d1998-03-06 21:18:55 +0000553}
554
Fred Drakec5681732000-09-12 20:13:04 +0000555# The bibliographic references, the appendices, the lists of figures
556# and tables etc. must appear in the contents table at the same level
557# as the outermost sectioning command. This subroutine finds what is
558# the outermost level and sets the above to the same level;
Fred Drakebc7101d1998-03-06 21:18:55 +0000559
Fred Drake13210ed1998-03-17 06:28:05 +0000560sub set_depth_levels {
561 # Sets $outermost_level
Fred Drake11916921998-04-02 22:30:57 +0000562 my $level;
Fred Drake13210ed1998-03-17 06:28:05 +0000563 #RRM: do not alter user-set value for $MAX_SPLIT_DEPTH
564 foreach $level ("part", "chapter", "section", "subsection",
565 "subsubsection", "paragraph") {
566 last if (($outermost_level) = /\\($level)$delimiter_rx/);
567 }
568 $level = ($outermost_level ? $section_commands{$outermost_level} :
569 do {$outermost_level = 'section'; 3;});
Fred Drakebc7101d1998-03-06 21:18:55 +0000570
Fred Drake13210ed1998-03-17 06:28:05 +0000571 #RRM: but calculate value for $MAX_SPLIT_DEPTH when a $REL_DEPTH was given
572 if ($REL_DEPTH && $MAX_SPLIT_DEPTH) {
573 $MAX_SPLIT_DEPTH = $level + $MAX_SPLIT_DEPTH;
574 } elsif (!($MAX_SPLIT_DEPTH)) { $MAX_SPLIT_DEPTH = 1 };
Fred Drakebc7101d1998-03-06 21:18:55 +0000575
Fred Drake64bdc241998-04-17 02:14:12 +0000576 %unnumbered_section_commands = ('tableofcontents' => $level,
577 'listoffigures' => $level,
578 'listoftables' => $level,
579 'bibliography' => $level,
580 'textohtmlindex' => $level,
581 'textohtmlmoduleindex' => $level);
582 $section_headings{'textohtmlmoduleindex'} = 'h1';
Fred Drakebc7101d1998-03-06 21:18:55 +0000583
Fred Drake64bdc241998-04-17 02:14:12 +0000584 %section_commands = (%unnumbered_section_commands,
585 %section_commands);
Fred Drake11916921998-04-02 22:30:57 +0000586
587 make_sections_rx();
Fred Drake13210ed1998-03-17 06:28:05 +0000588}
Fred Drakebc7101d1998-03-06 21:18:55 +0000589
590
Fred Drake1072e461998-04-12 02:16:34 +0000591# This changes the markup used for {verbatim} environments, and is the
Fred Drake95474f91999-02-09 18:45:50 +0000592# best way I've found that ensures the <dl> goes on the outside of the
Fred Drake1072e461998-04-12 02:16:34 +0000593# <pre>...</pre>.
594#
595# Note that this *must* be done in the init file, not the python.perl
Fred Drakec5681732000-09-12 20:13:04 +0000596# style support file. The %declarations must be set before
597# initialize() is called in the main LaTeX2HTML script (which happens
598# before style files are loaded).
Fred Drake1072e461998-04-12 02:16:34 +0000599#
Fred Drake8a5e6792002-04-15 18:41:31 +0000600%declarations = ('preform' => '<div class="verbatim"><pre></pre></div>',
Fred Drake1072e461998-04-12 02:16:34 +0000601 %declarations);
602
Fred Drakee15956b2000-04-03 04:51:13 +0000603
Fred Drakebf8ec3e2003-05-02 20:18:01 +0000604# This is used to map the link rel attributes LaTeX2HTML uses to those
605# currently recommended by the W3C.
606sub custom_REL_hook {
607 my($rel,$junk) = @_;
608 return 'parent' if $rel eq 'up';
609 return 'prev' if $rel eq 'previous';
610 return $rel;
611}
612
Fred Drakec5681732000-09-12 20:13:04 +0000613# This is added to get rid of the long comment that follows the
614# doctype declaration; MSIE5 on NT4 SP4 barfs on it and drops the
615# content of the page.
Fred Drakea219b412001-10-22 16:57:49 +0000616$MY_PARTIAL_HEADER = '';
Fred Drakef5478632002-05-23 17:59:16 +0000617sub make_head_and_body($$) {
Fred Drake85d14c92000-07-31 17:53:45 +0000618 my($title, $body) = @_;
Fred Drake16816272000-09-16 20:40:44 +0000619 $body = " $body" unless ($body eq '');
Fred Drake85d14c92000-07-31 17:53:45 +0000620 my $DTDcomment = '';
621 my($version, $isolanguage) = ($HTML_VERSION, 'EN');
622 my %isolanguages = ( 'english', 'EN' , 'USenglish', 'EN.US'
623 , 'original', 'EN' , 'german' , 'DE'
624 , 'austrian', 'DE.AT', 'french' , 'FR'
625 , 'spanish', 'ES');
Fred Drakee15956b2000-04-03 04:51:13 +0000626 $isolanguage = $isolanguages{$default_language};
627 $isolanguage = 'EN' unless $isolanguage;
628 $title = &purify($title,1);
629 eval("\$title = ". $default_title ) unless ($title);
630
Fred Drake2fc88a62003-08-05 03:45:37 +0000631 # allow user-modification of the <title> tag; thanks Dan Young
Fred Drakee15956b2000-04-03 04:51:13 +0000632 if (defined &custom_TITLE_hook) {
633 $title = &custom_TITLE_hook($title, $toc_sec_title);
634 }
635
636 if ($DOCTYPE =~ /\/\/[\w\.]+\s*$/) { # language spec included
637 $DTDcomment = "<!DOCTYPE html PUBLIC \"$DOCTYPE\">\n";
638 } else {
639 $DTDcomment = "<!DOCTYPE html PUBLIC \"$DOCTYPE//"
640 . ($ISO_LANGUAGE ? $ISO_LANGUAGE : $isolanguage) . "\">\n";
641 }
Fred Drakea219b412001-10-22 16:57:49 +0000642 if ($MY_PARTIAL_HEADER eq '') {
643 $STYLESHEET = $FILE.".css" unless $STYLESHEET;
644 $MY_PARTIAL_HEADER = join('',
Fred Drakedd3d6a02002-10-30 17:00:58 +0000645 ($DOCTYPE ? $DTDcomment : ''),
Fred Drake98b25762003-05-02 18:21:22 +0000646 "<html>\n<head>",
Fred Drake2fc88a62003-08-05 03:45:37 +0000647 ($BASE ? "\n<base href=\"$BASE\" />" : ''),
648 "\n<link rel=\"STYLESHEET\" href=\"$STYLESHEET\" type='text/css'",
649 " />",
Fred Drakedd3d6a02002-10-30 17:00:58 +0000650 ($FAVORITES_ICON
Fred Drake2fc88a62003-08-05 03:45:37 +0000651 ? ("\n<link rel=\"SHORTCUT ICON\" href=\"$FAVORITES_ICON\" />")
Fred Drakedd3d6a02002-10-30 17:00:58 +0000652 : ''),
Fred Drake23949002002-10-30 21:51:18 +0000653 ($EXTERNAL_UP_LINK
Fred Drake98b25762003-05-02 18:21:22 +0000654 ? ("\n<link rel='start' href='" . $EXTERNAL_UP_LINK
655 . ($EXTERNAL_UP_TITLE ?
Fred Drake2fc88a62003-08-05 03:45:37 +0000656 "' title='$EXTERNAL_UP_TITLE' />" : "' />"))
Fred Drake23949002002-10-30 21:51:18 +0000657 : ''),
Fred Drake98b25762003-05-02 18:21:22 +0000658 "\n<link rel=\"first\" href=\"$FILE.html\"",
Fred Drake23949002002-10-30 21:51:18 +0000659 ($t_title ? " title='$t_title'" : ''),
Fred Drake2fc88a62003-08-05 03:45:37 +0000660 ' />',
Fred Drakea219b412001-10-22 16:57:49 +0000661 ($HAVE_TABLE_OF_CONTENTS
Fred Drake095f8172003-06-27 18:26:01 +0000662 ? ("\n<link rel='contents' href='$MY_CONTENTS_PAGE'"
Fred Drake2fc88a62003-08-05 03:45:37 +0000663 . ' title="Contents" />')
Fred Drakea219b412001-10-22 16:57:49 +0000664 : ''),
665 ($HAVE_GENERAL_INDEX
Fred Drake2fc88a62003-08-05 03:45:37 +0000666 ? "\n<link rel='index' href='genindex.html' title='Index' />"
Fred Drakea219b412001-10-22 16:57:49 +0000667 : ''),
668 # disable for now -- Mozilla doesn't do well with multiple indexes
669 # ($HAVE_MODULE_INDEX
Fred Drake2fc88a62003-08-05 03:45:37 +0000670 # ? '<link rel="index" href="modindex.html" title="Module Index"'
671 # . " />\n"
Fred Drakea219b412001-10-22 16:57:49 +0000672 # : ''),
Fred Drake23949002002-10-30 21:51:18 +0000673 ($INFO
674 # XXX We can do this with the Python tools since the About...
675 # page always gets copied to about.html, even when we use the
676 # generated node###.html page names. Won't work with the
677 # rest of the Python doc tools.
Fred Drake98b25762003-05-02 18:21:22 +0000678 ? ("\n<link rel='last' href='about.html'"
Fred Drake2fc88a62003-08-05 03:45:37 +0000679 . " title='About this document...' />"
Fred Drake98b25762003-05-02 18:21:22 +0000680 . "\n<link rel='help' href='about.html'"
Fred Drake2fc88a62003-08-05 03:45:37 +0000681 . " title='About this document...' />")
Fred Drake23949002002-10-30 21:51:18 +0000682 : ''),
Fred Drakedd3d6a02002-10-30 17:00:58 +0000683 $more_links_mark,
Fred Drake0e2e6872002-10-30 19:55:23 +0000684 "\n",
Fred Drakedd3d6a02002-10-30 17:00:58 +0000685 ($CHARSET && $HTML_VERSION ge "2.1"
686 ? ('<meta http-equiv="Content-Type" content="text/html; '
Fred Drake2fc88a62003-08-05 03:45:37 +0000687 . "charset=$CHARSET\" />\n")
Fred Drakedd3d6a02002-10-30 17:00:58 +0000688 : ''),
689 ($AESOP_META_TYPE
Fred Drake2fc88a62003-08-05 03:45:37 +0000690 ? "<meta name='aesop' content='$AESOP_META_TYPE' />\n" : ''));
Fred Drakea219b412001-10-22 16:57:49 +0000691 }
Fred Drake0e2e6872002-10-30 19:55:23 +0000692 if (!$charset && $CHARSET) {
693 $charset = $CHARSET;
694 $charset =~ s/_/\-/go;
695 }
Fred Drakef06b9052003-05-02 18:08:16 +0000696 # Remove section number from the title for use in the
697 # <meta name='description' ...> element in the document head.
698 my $metatitle = "$title";
699 $metatitle =~ s/^\d+(\.\d+)*\s*//;
Fred Drake2fc88a62003-08-05 03:45:37 +0000700 $metatitle = meta_information($metatitle);
701 $metatitle =~ s/ NAME=/ name=/g;
702 $metatitle =~ s/ CONTENT=/ content=/g;
Fred Drakef06b9052003-05-02 18:08:16 +0000703
Fred Drakedd3d6a02002-10-30 17:00:58 +0000704 join('',
705 $MY_PARTIAL_HEADER,
Fred Drake2fc88a62003-08-05 03:45:37 +0000706 $metatitle,
Fred Drakedd3d6a02002-10-30 17:00:58 +0000707 "<title>", $title, "</title>\n</head>\n<body$body>");
Fred Drakee15956b2000-04-03 04:51:13 +0000708}
709
Fred Drake2fc88a62003-08-05 03:45:37 +0000710sub replace_morelinks {
711 $more_links =~ s/ REL=/ rel=/g;
712 $more_links =~ s/ HREF=/ href=/g;
713 $_ =~ s/$more_links_mark/$more_links/e;
714}
715
Fred Drakebc7101d1998-03-06 21:18:55 +00007161; # This must be the last line