blob: cbf1e41d008f2b1789886b90b3fd3aa03ecb8db2 [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 Drake7497bd32000-10-25 16:18:10 +0000230 return "\n"
231 . make_nav_panel()
Fred Drake2fc88a62003-08-05 03:45:37 +0000232 . "<br /><hr />\n";
Fred Drakebc7101d1998-03-06 21:18:55 +0000233}
234
Fred Drakef5478632002-05-23 17:59:16 +0000235sub bot_navigation_panel() {
Fred Drake2fc88a62003-08-05 03:45:37 +0000236 return "\n<p></p><hr />\n"
Fred Drake7497bd32000-10-25 16:18:10 +0000237 . make_nav_panel()
Fred Drake2fc88a62003-08-05 03:45:37 +0000238 . "<hr />\n"
Fred Drake7497bd32000-10-25 16:18:10 +0000239 . get_version_text()
240 . "\n";
Fred Drake64bdc241998-04-17 02:14:12 +0000241}
242
243sub add_link {
244 # Returns a pair (iconic link, textual link)
245 my($icon, $current_file, @link) = @_;
246 my($dummy, $file, $title) = split($delim,
Fred Drake28e7b4c1998-10-20 18:14:20 +0000247 $section_info{join(' ',@link)});
Fred Draked18722b2001-01-02 22:08:48 +0000248 if ($icon =~ /\<tex2html_([_a-z]+)_visible_mark\>/) {
249 my $r = get_my_icon($1);
250 $icon =~ s/\<tex2html_[_a-z]+_visible_mark\>/$r/;
251 }
Fred Drake64bdc241998-04-17 02:14:12 +0000252 if ($title && ($file ne $current_file)) {
253 $title = purify($title);
254 $title = get_first_words($title, $WORDS_IN_NAVIGATION_PANEL_TITLES);
255 return (make_href($file, $icon), make_href($file, "$title"))
256 }
Fred Draked18722b2001-01-02 22:08:48 +0000257 elsif ($icon eq get_my_icon('up') && $EXTERNAL_UP_LINK) {
Fred Drake64bdc241998-04-17 02:14:12 +0000258 return (make_href($EXTERNAL_UP_LINK, $icon),
259 make_href($EXTERNAL_UP_LINK, "$EXTERNAL_UP_TITLE"))
260 }
Fred Draked18722b2001-01-02 22:08:48 +0000261 elsif ($icon eq get_my_icon('previous')
Fred Drake64bdc241998-04-17 02:14:12 +0000262 && $EXTERNAL_PREV_LINK && $EXTERNAL_PREV_TITLE) {
263 return (make_href($EXTERNAL_PREV_LINK, $icon),
264 make_href($EXTERNAL_PREV_LINK, "$EXTERNAL_PREV_TITLE"))
265 }
Fred Draked18722b2001-01-02 22:08:48 +0000266 elsif ($icon eq get_my_icon('next')
Fred Drake64bdc241998-04-17 02:14:12 +0000267 && $EXTERNAL_DOWN_LINK && $EXTERNAL_DOWN_TITLE) {
268 return (make_href($EXTERNAL_DOWN_LINK, $icon),
269 make_href($EXTERNAL_DOWN_LINK, "$EXTERNAL_DOWN_TITLE"))
270 }
Fred Drake85d14c92000-07-31 17:53:45 +0000271 return (&inactive_img($icon), "");
Fred Drake64bdc241998-04-17 02:14:12 +0000272}
273
Fred Drakef5478632002-05-23 17:59:16 +0000274sub add_special_link($$$) {
Fred Drake64bdc241998-04-17 02:14:12 +0000275 my($icon, $file, $current_file) = @_;
Fred Draked18722b2001-01-02 22:08:48 +0000276 if ($icon =~ /\<tex2html_([_a-z]+)_visible_mark\>/) {
277 my $r = get_my_icon($1);
278 $icon =~ s/\<tex2html_[_a-z]+_visible_mark\>/$r/;
279 }
Fred Drake85d14c92000-07-31 17:53:45 +0000280 return (($file && ($file ne $current_file))
281 ? make_href($file, $icon)
282 : undef)
Fred Drake64bdc241998-04-17 02:14:12 +0000283}
284
Fred Drake85d14c92000-07-31 17:53:45 +0000285# The img_tag() function seems only to be called with the parameter
286# 'anchor_invisible_mark', which we want to turn into ''. Since
287# replace_icon_marks() is the only interesting caller, and all it really
288# does is call img_tag(), we can just define the hook alternative to be
289# a no-op instead.
290#
291sub replace_icons_hook {}
Fred Drakebc7101d1998-03-06 21:18:55 +0000292
Fred Drake50cdd971999-02-19 23:04:59 +0000293sub do_cmd_arabic {
294 # get rid of that nasty <SPAN CLASS="arabic">...</SPAN>
Fred Drake73c5b6602002-10-24 16:36:05 +0000295 my($ctr, $val, $id, $text) = &read_counter_value($_[0]);
Fred Drake85d14c92000-07-31 17:53:45 +0000296 return ($val ? farabic($val) : "0") . $text;
Fred Drake50cdd971999-02-19 23:04:59 +0000297}
298
299
Fred Drakef5478632002-05-23 17:59:16 +0000300sub gen_index_id($$) {
Fred Drakebc7101d1998-03-06 21:18:55 +0000301 # this is used to ensure common index key generation and a stable sort
Fred Drakef5478632002-05-23 17:59:16 +0000302 my($str, $extra) = @_;
Fred Drake64bdc241998-04-17 02:14:12 +0000303 sprintf('%s###%s%010d', $str, $extra, ++$global{'max_id'});
Fred Drakebc7101d1998-03-06 21:18:55 +0000304}
305
Fred Drakef5478632002-05-23 17:59:16 +0000306sub insert_index($$$$$) {
307 my($mark, $datafile, $columns, $letters, $prefix) = @_;
Fred Drake4d10b431998-08-07 20:51:58 +0000308 my $prog = "$myrootdir/tools/buildindex.py";
309 my $index;
310 if ($letters) {
311 $index = `$prog --columns $columns --letters $datafile`;
312 }
313 else {
314 $index = `$prog --columns $columns $datafile`;
315 }
Fred Drakec5681732000-09-12 20:13:04 +0000316 if (!s/$mark/$prefix$index/) {
317 print "\nCould not locate index mark: $mark";
318 }
Fred Drake64bdc241998-04-17 02:14:12 +0000319}
320
Fred Drakef5478632002-05-23 17:59:16 +0000321sub add_idx() {
Fred Drake9bbdce51999-01-19 16:30:10 +0000322 print "\nBuilding HTML for the index ...";
Fred Drake235e6b11998-03-27 05:19:43 +0000323 close(IDXFILE);
Fred Drake2383f6d1999-03-02 16:00:37 +0000324 insert_index($idx_mark, 'index.dat', $INDEX_COLUMNS, 1, '');
Fred Drake13210ed1998-03-17 06:28:05 +0000325}
Fred Drakebc7101d1998-03-06 21:18:55 +0000326
327
328$idx_module_mark = '<tex2html_idx_module_mark>';
329$idx_module_title = 'Module Index';
330
Fred Drakef5478632002-05-23 17:59:16 +0000331sub add_module_idx() {
Fred Drake9bbdce51999-01-19 16:30:10 +0000332 print "\nBuilding HTML for the module index ...";
Fred Drake235e6b11998-03-27 05:19:43 +0000333 my $key;
Fred Drake2383f6d1999-03-02 16:00:37 +0000334 my $first = 1;
335 my $prevplat = '';
336 my $allthesame = 1;
337 my $prefix = '';
338 foreach $key (keys %Modules) {
Fred Drake73c5b6602002-10-24 16:36:05 +0000339 $key =~ s/<tt>([a-zA-Z0-9._]*)<\/tt>/$1/;
Fred Drake2383f6d1999-03-02 16:00:37 +0000340 my $plat = "$ModulePlatforms{$key}";
341 $plat = ''
Fred Drake62cc3601999-03-04 18:41:17 +0000342 if ($plat eq $IGNORE_PLATFORM_ANNOTATION);
Fred Drake2383f6d1999-03-02 16:00:37 +0000343 if (!$first) {
344 $allthesame = 0
345 if ($prevplat ne $plat);
346 }
347 else { $first = 0; }
348 $prevplat = $plat;
349 }
Fred Drake64bdc241998-04-17 02:14:12 +0000350 open(MODIDXFILE, '>modindex.dat') || die "\n$!\n";
Fred Drake235e6b11998-03-27 05:19:43 +0000351 foreach $key (keys %Modules) {
352 # dump the line in the data file; just use a dummy seqno field
Fred Drake2383f6d1999-03-02 16:00:37 +0000353 my $nkey = $1;
354 my $moditem = "$Modules{$key}";
355 my $plat = '';
Fred Drake73c5b6602002-10-24 16:36:05 +0000356 $key =~ s/<tt>([a-zA-Z0-9._]*)<\/tt>/$1/;
Fred Drake2383f6d1999-03-02 16:00:37 +0000357 if ($ModulePlatforms{$key} && !$allthesame) {
Fred Drakedce975c2001-06-20 21:31:36 +0000358 $plat = (" <em>(<span class=\"platform\">$ModulePlatforms{$key}"
Fred Drakebb584d31999-03-25 22:18:30 +0000359 . '</span>)</em>');
Fred Drake2383f6d1999-03-02 16:00:37 +0000360 }
Fred Drakee15956b2000-04-03 04:51:13 +0000361 print MODIDXFILE $moditem . $IDXFILE_FIELD_SEP
Fred Drakedce975c2001-06-20 21:31:36 +0000362 . "<tt class=\"module\">$key</tt>$plat###\n";
Fred Drakebc7101d1998-03-06 21:18:55 +0000363 }
Fred Drake235e6b11998-03-27 05:19:43 +0000364 close(MODIDXFILE);
Fred Drake42181db2001-01-09 22:02:10 +0000365
366 if ($GLOBAL_MODULE_INDEX) {
367 $prefix = <<MODULE_INDEX_PREFIX;
368
369<p> This index only lists modules documented in this manual.
370 The <em class="citetitle"><a href="$GLOBAL_MODULE_INDEX">Global Module
371 Index</a></em> lists all modules that are documented in this set
372 of manuals.</p>
373MODULE_INDEX_PREFIX
374 }
Fred Drake2383f6d1999-03-02 16:00:37 +0000375 if (!$allthesame) {
Fred Draked18722b2001-01-02 22:08:48 +0000376 $prefix .= <<PLAT_DISCUSS;
Fred Drake2383f6d1999-03-02 16:00:37 +0000377
378<p> Some module names are followed by an annotation indicating what
379platform they are available on.</p>
380
381PLAT_DISCUSS
382 }
383 insert_index($idx_module_mark, 'modindex.dat', $MODULE_INDEX_COLUMNS, 0,
384 $prefix);
Fred Drakebc7101d1998-03-06 21:18:55 +0000385}
386
Fred Drake235e6b11998-03-27 05:19:43 +0000387# replace both indexes as needed:
Fred Drake85d14c92000-07-31 17:53:45 +0000388sub add_idx_hook {
Fred Drakeb3a3ed81998-07-24 22:17:34 +0000389 add_idx() if (/$idx_mark/);
Fred Drake2383f6d1999-03-02 16:00:37 +0000390 process_python_state();
Fred Drakec5681732000-09-12 20:13:04 +0000391 if ($MODULE_INDEX_FILE) {
392 local ($_);
393 open(MYFILE, "<$MODULE_INDEX_FILE");
394 sysread(MYFILE, $_, 1024*1024);
395 close(MYFILE);
396 add_module_idx();
397 open(MYFILE,">$MODULE_INDEX_FILE");
398 print MYFILE $_;
399 close(MYFILE);
400 }
Fred Drake235e6b11998-03-27 05:19:43 +0000401}
Fred Drakebc7101d1998-03-06 21:18:55 +0000402
Fred Drakebc7101d1998-03-06 21:18:55 +0000403
Fred Drake191439a1999-09-22 19:50:51 +0000404# In addition to the standard stuff, add label to allow named node files and
405# support suppression of the page complete (for HTML Help use).
Fred Drake095f8172003-06-27 18:26:01 +0000406$MY_CONTENTS_PAGE = '';
Fred Drakebc7101d1998-03-06 21:18:55 +0000407sub do_cmd_tableofcontents {
408 local($_) = @_;
409 $TITLE = $toc_title;
410 $tocfile = $CURRENT_FILE;
Fred Drakef5478632002-05-23 17:59:16 +0000411 my($closures, $reopens) = preserve_open_tags();
Fred Drake64bdc241998-04-17 02:14:12 +0000412 anchor_label('contents', $CURRENT_FILE, $_); # this is added
Fred Drake095f8172003-06-27 18:26:01 +0000413 $MY_CONTENTS_PAGE = "$CURRENT_FILE";
Fred Drake2fc88a62003-08-05 03:45:37 +0000414 join('', "<br />\n\\tableofchildlinks[off]", $closures
415 , make_section_heading($toc_title, 'h2'), $toc_mark
Fred Drakebc7101d1998-03-06 21:18:55 +0000416 , $reopens, $_);
417}
418# In addition to the standard stuff, add label to allow named node files.
419sub do_cmd_listoffigures {
420 local($_) = @_;
421 $TITLE = $lof_title;
422 $loffile = $CURRENT_FILE;
Fred Drakef5478632002-05-23 17:59:16 +0000423 my($closures, $reopens) = preserve_open_tags();
Fred Drake64bdc241998-04-17 02:14:12 +0000424 anchor_label('lof', $CURRENT_FILE, $_); # this is added
Fred Drake2fc88a62003-08-05 03:45:37 +0000425 join('', "<br />\n", $closures
426 , make_section_heading($lof_title, 'h2'), $lof_mark
Fred Drakebc7101d1998-03-06 21:18:55 +0000427 , $reopens, $_);
428}
429# In addition to the standard stuff, add label to allow named node files.
430sub do_cmd_listoftables {
431 local($_) = @_;
432 $TITLE = $lot_title;
433 $lotfile = $CURRENT_FILE;
Fred Drakef5478632002-05-23 17:59:16 +0000434 my($closures, $reopens) = preserve_open_tags();
Fred Drake64bdc241998-04-17 02:14:12 +0000435 anchor_label('lot', $CURRENT_FILE, $_); # this is added
Fred Drake2fc88a62003-08-05 03:45:37 +0000436 join('', "<br />\n", $closures
437 , make_section_heading($lot_title, 'h2'), $lot_mark
Fred Drakebc7101d1998-03-06 21:18:55 +0000438 , $reopens, $_);
439}
440# In addition to the standard stuff, add label to allow named node files.
441sub do_cmd_textohtmlinfopage {
442 local($_) = @_;
443 if ($INFO) { #
Fred Drake64bdc241998-04-17 02:14:12 +0000444 anchor_label("about",$CURRENT_FILE,$_); # this is added
Fred Drakebc7101d1998-03-06 21:18:55 +0000445 } #
Fred Drake15796f71998-11-30 19:25:47 +0000446 my $the_version = ''; # and the rest is
447 if ($t_date) { # mostly ours
448 $the_version = ",\n$t_date";
Fred Drake7497bd32000-10-25 16:18:10 +0000449 if ($PACKAGE_VERSION) {
Fred Drakedce975c2001-06-20 21:31:36 +0000450 $the_version .= ", Release $PACKAGE_VERSION$RELEASE_INFO";
Fred Drake15796f71998-11-30 19:25:47 +0000451 }
452 }
Fred Drake9443dc32001-08-10 20:12:09 +0000453 my $about;
454 open(ABOUT, "<$ABOUT_FILE") || die "\n$!\n";
455 sysread(ABOUT, $about, 1024*1024);
456 close(ABOUT);
Fred Drake15796f71998-11-30 19:25:47 +0000457 $_ = (($INFO == 1)
Fred Drakeb35f2b71999-09-23 16:53:09 +0000458 ? join('',
459 $close_all,
460 "<strong>$t_title</strong>$the_version\n",
Fred Drake9443dc32001-08-10 20:12:09 +0000461 $about,
Fred Drakeb35f2b71999-09-23 16:53:09 +0000462 $open_all, $_)
463 : join('', $close_all, $INFO,"\n", $open_all, $_));
Fred Drake15796f71998-11-30 19:25:47 +0000464 $_;
Fred Drakebc7101d1998-03-06 21:18:55 +0000465}
466
467# $idx_mark will be replaced with the real index at the end
468sub do_cmd_textohtmlindex {
469 local($_) = @_;
470 $TITLE = $idx_title;
471 $idxfile = $CURRENT_FILE;
Fred Drake235e6b11998-03-27 05:19:43 +0000472 if (%index_labels) { make_index_labels(); }
473 if (($SHORT_INDEX) && (%index_segment)) { make_preindex(); }
Fred Drakebc7101d1998-03-06 21:18:55 +0000474 else { $preindex = ''; }
Fred Drake235e6b11998-03-27 05:19:43 +0000475 my $heading = make_section_heading($idx_title, 'h2') . $idx_mark;
Fred Drakef5478632002-05-23 17:59:16 +0000476 my($pre, $post) = minimize_open_tags($heading);
Fred Drake235e6b11998-03-27 05:19:43 +0000477 anchor_label('genindex',$CURRENT_FILE,$_); # this is added
Fred Drake2fc88a62003-08-05 03:45:37 +0000478 return "<br />\n" . $pre . $_;
Fred Drakebc7101d1998-03-06 21:18:55 +0000479}
480
Fred Drakec5681732000-09-12 20:13:04 +0000481$MODULE_INDEX_FILE = '';
482
Fred Drakebc7101d1998-03-06 21:18:55 +0000483# $idx_module_mark will be replaced with the real index at the end
484sub do_cmd_textohtmlmoduleindex {
485 local($_) = @_;
Fred Drakebc7101d1998-03-06 21:18:55 +0000486 $TITLE = $idx_module_title;
Fred Drakec5681732000-09-12 20:13:04 +0000487 anchor_label('modindex', $CURRENT_FILE, $_);
488 $MODULE_INDEX_FILE = "$CURRENT_FILE";
Fred Drake2fc88a62003-08-05 03:45:37 +0000489 $_ = ('<p></p>' . make_section_heading($idx_module_title, 'h2')
Fred Drakec5681732000-09-12 20:13:04 +0000490 . $idx_module_mark . $_);
491 return $_;
Fred Drakebc7101d1998-03-06 21:18:55 +0000492}
493
Fred Drakec5681732000-09-12 20:13:04 +0000494# The bibliography and the index should be treated as separate
495# sections in their own HTML files. The \bibliography{} command acts
496# as a sectioning command that has the desired effect. But when the
497# bibliography is constructed manually using the thebibliography
498# environment, or when using the theindex environment it is not
499# possible to use the normal sectioning mechanism. This subroutine
500# inserts a \bibliography{} or a dummy \textohtmlindex command just
501# before the appropriate environments to force sectioning.
Fred Drakebc7101d1998-03-06 21:18:55 +0000502
Fred Drakec5681732000-09-12 20:13:04 +0000503# XXX This *assumes* that if there are two {theindex} environments,
504# the first is the module index and the second is the standard
505# index. This is sufficient for the current Python documentation,
506# but that's about it.
Fred Drakebc7101d1998-03-06 21:18:55 +0000507
508sub add_bbl_and_idx_dummy_commands {
Fred Drake11916921998-04-02 22:30:57 +0000509 my $id = $global{'max_id'};
Fred Drakebc7101d1998-03-06 21:18:55 +0000510
Fred Drakea219b412001-10-22 16:57:49 +0000511 if (/[\\]tableofcontents/) {
512 $HAVE_TABLE_OF_CONTENTS = 1;
513 }
Fred Drakebc7101d1998-03-06 21:18:55 +0000514 s/([\\]begin\s*$O\d+$C\s*thebibliography)/$bbl_cnt++; $1/eg;
Fred Drake191439a1999-09-22 19:50:51 +0000515 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 +0000516 my(@parts) = split(/\\begin\s*$O\d+$C\s*theindex/);
517 if (scalar(@parts) == 3) {
518 # Be careful to re-write the string in place, since $_ is *not*
519 # returned explicity; *** nasty side-effect dependency! ***
Fred Drakebb7775a2001-12-04 17:03:54 +0000520 print "\nadd_bbl_and_idx_dummy_commands ==> adding general index";
Fred Drake85d14c92000-07-31 17:53:45 +0000521 print "\nadd_bbl_and_idx_dummy_commands ==> adding module index";
522 my $rx = "([\\\\]begin\\s*$O\\d+$C\\s*theindex[\\s\\S]*)"
523 . "([\\\\]begin\\s*$O\\d+$C\\s*theindex)";
Fred Drake73c5b6602002-10-24 16:36:05 +0000524 s/$rx/\\textohtmlmoduleindex $1 \\textohtmlindex $2/o;
Fred Drake85d14c92000-07-31 17:53:45 +0000525 # Add a button to the navigation areas:
Fred Drakeaaa23852000-09-14 22:20:41 +0000526 $CUSTOM_BUTTONS .= ('<a href="modindex.html" title="Module Index">'
Fred Draked18722b2001-01-02 22:08:48 +0000527 . get_my_icon('modules')
Fred Drakeaaa23852000-09-14 22:20:41 +0000528 . '</a>');
Fred Drakea219b412001-10-22 16:57:49 +0000529 $HAVE_MODULE_INDEX = 1;
530 $HAVE_GENERAL_INDEX = 1;
531 }
532 elsif (scalar(@parts) == 2) {
Fred Drakebb7775a2001-12-04 17:03:54 +0000533 print "\nadd_bbl_and_idx_dummy_commands ==> adding general index";
534 my $rx = "([\\\\]begin\\s*$O\\d+$C\\s*theindex)";
Fred Drake73c5b6602002-10-24 16:36:05 +0000535 s/$rx/\\textohtmlindex $1/o;
Fred Drakea219b412001-10-22 16:57:49 +0000536 $HAVE_GENERAL_INDEX = 1;
Fred Drake11916921998-04-02 22:30:57 +0000537 }
Fred Drakebb7775a2001-12-04 17:03:54 +0000538 elsif (scalar(@parts) == 1) {
539 print "\nadd_bbl_and_idx_dummy_commands ==> no index found";
Fred Draked18722b2001-01-02 22:08:48 +0000540 $CUSTOM_BUTTONS .= get_my_icon('blank');
Fred Drake85d14c92000-07-31 17:53:45 +0000541 $global{'max_id'} = $id; # not sure why....
542 s/([\\]begin\s*$O\d+$C\s*theindex)/\\textohtmlindex $1/o;
Fred Drake191439a1999-09-22 19:50:51 +0000543 s/[\\]printindex/\\textohtmlindex /o;
Fred Drakebb7775a2001-12-04 17:03:54 +0000544 }
545 else {
546 die "\n\nBad number of index environments!\n\n";
547 }
Fred Drake11916921998-04-02 22:30:57 +0000548 #----------------------------------------------------------------------
Fred Drake64bdc241998-04-17 02:14:12 +0000549 lib_add_bbl_and_idx_dummy_commands()
Fred Drake11916921998-04-02 22:30:57 +0000550 if defined(&lib_add_bbl_and_idx_dummy_commands);
Fred Drakebc7101d1998-03-06 21:18:55 +0000551}
552
Fred Drakec5681732000-09-12 20:13:04 +0000553# The bibliographic references, the appendices, the lists of figures
554# and tables etc. must appear in the contents table at the same level
555# as the outermost sectioning command. This subroutine finds what is
556# the outermost level and sets the above to the same level;
Fred Drakebc7101d1998-03-06 21:18:55 +0000557
Fred Drake13210ed1998-03-17 06:28:05 +0000558sub set_depth_levels {
559 # Sets $outermost_level
Fred Drake11916921998-04-02 22:30:57 +0000560 my $level;
Fred Drake13210ed1998-03-17 06:28:05 +0000561 #RRM: do not alter user-set value for $MAX_SPLIT_DEPTH
562 foreach $level ("part", "chapter", "section", "subsection",
563 "subsubsection", "paragraph") {
564 last if (($outermost_level) = /\\($level)$delimiter_rx/);
565 }
566 $level = ($outermost_level ? $section_commands{$outermost_level} :
567 do {$outermost_level = 'section'; 3;});
Fred Drakebc7101d1998-03-06 21:18:55 +0000568
Fred Drake13210ed1998-03-17 06:28:05 +0000569 #RRM: but calculate value for $MAX_SPLIT_DEPTH when a $REL_DEPTH was given
570 if ($REL_DEPTH && $MAX_SPLIT_DEPTH) {
571 $MAX_SPLIT_DEPTH = $level + $MAX_SPLIT_DEPTH;
572 } elsif (!($MAX_SPLIT_DEPTH)) { $MAX_SPLIT_DEPTH = 1 };
Fred Drakebc7101d1998-03-06 21:18:55 +0000573
Fred Drake64bdc241998-04-17 02:14:12 +0000574 %unnumbered_section_commands = ('tableofcontents' => $level,
575 'listoffigures' => $level,
576 'listoftables' => $level,
577 'bibliography' => $level,
578 'textohtmlindex' => $level,
579 'textohtmlmoduleindex' => $level);
580 $section_headings{'textohtmlmoduleindex'} = 'h1';
Fred Drakebc7101d1998-03-06 21:18:55 +0000581
Fred Drake64bdc241998-04-17 02:14:12 +0000582 %section_commands = (%unnumbered_section_commands,
583 %section_commands);
Fred Drake11916921998-04-02 22:30:57 +0000584
585 make_sections_rx();
Fred Drake13210ed1998-03-17 06:28:05 +0000586}
Fred Drakebc7101d1998-03-06 21:18:55 +0000587
588
Fred Drake1072e461998-04-12 02:16:34 +0000589# This changes the markup used for {verbatim} environments, and is the
Fred Drake95474f91999-02-09 18:45:50 +0000590# best way I've found that ensures the <dl> goes on the outside of the
Fred Drake1072e461998-04-12 02:16:34 +0000591# <pre>...</pre>.
592#
593# Note that this *must* be done in the init file, not the python.perl
Fred Drakec5681732000-09-12 20:13:04 +0000594# style support file. The %declarations must be set before
595# initialize() is called in the main LaTeX2HTML script (which happens
596# before style files are loaded).
Fred Drake1072e461998-04-12 02:16:34 +0000597#
Fred Drake8a5e6792002-04-15 18:41:31 +0000598%declarations = ('preform' => '<div class="verbatim"><pre></pre></div>',
Fred Drake1072e461998-04-12 02:16:34 +0000599 %declarations);
600
Fred Drakee15956b2000-04-03 04:51:13 +0000601
Fred Drakebf8ec3e2003-05-02 20:18:01 +0000602# This is used to map the link rel attributes LaTeX2HTML uses to those
603# currently recommended by the W3C.
604sub custom_REL_hook {
605 my($rel,$junk) = @_;
606 return 'parent' if $rel eq 'up';
607 return 'prev' if $rel eq 'previous';
608 return $rel;
609}
610
Fred Drakec5681732000-09-12 20:13:04 +0000611# This is added to get rid of the long comment that follows the
612# doctype declaration; MSIE5 on NT4 SP4 barfs on it and drops the
613# content of the page.
Fred Drakea219b412001-10-22 16:57:49 +0000614$MY_PARTIAL_HEADER = '';
Fred Drakef5478632002-05-23 17:59:16 +0000615sub make_head_and_body($$) {
Fred Drake85d14c92000-07-31 17:53:45 +0000616 my($title, $body) = @_;
Fred Drake16816272000-09-16 20:40:44 +0000617 $body = " $body" unless ($body eq '');
Fred Drake85d14c92000-07-31 17:53:45 +0000618 my $DTDcomment = '';
619 my($version, $isolanguage) = ($HTML_VERSION, 'EN');
620 my %isolanguages = ( 'english', 'EN' , 'USenglish', 'EN.US'
621 , 'original', 'EN' , 'german' , 'DE'
622 , 'austrian', 'DE.AT', 'french' , 'FR'
623 , 'spanish', 'ES');
Fred Drakee15956b2000-04-03 04:51:13 +0000624 $isolanguage = $isolanguages{$default_language};
625 $isolanguage = 'EN' unless $isolanguage;
626 $title = &purify($title,1);
627 eval("\$title = ". $default_title ) unless ($title);
628
Fred Drake2fc88a62003-08-05 03:45:37 +0000629 # allow user-modification of the <title> tag; thanks Dan Young
Fred Drakee15956b2000-04-03 04:51:13 +0000630 if (defined &custom_TITLE_hook) {
631 $title = &custom_TITLE_hook($title, $toc_sec_title);
632 }
633
634 if ($DOCTYPE =~ /\/\/[\w\.]+\s*$/) { # language spec included
635 $DTDcomment = "<!DOCTYPE html PUBLIC \"$DOCTYPE\">\n";
636 } else {
637 $DTDcomment = "<!DOCTYPE html PUBLIC \"$DOCTYPE//"
638 . ($ISO_LANGUAGE ? $ISO_LANGUAGE : $isolanguage) . "\">\n";
639 }
Fred Drakea219b412001-10-22 16:57:49 +0000640 if ($MY_PARTIAL_HEADER eq '') {
641 $STYLESHEET = $FILE.".css" unless $STYLESHEET;
642 $MY_PARTIAL_HEADER = join('',
Fred Drakedd3d6a02002-10-30 17:00:58 +0000643 ($DOCTYPE ? $DTDcomment : ''),
Fred Drake98b25762003-05-02 18:21:22 +0000644 "<html>\n<head>",
Fred Drake2fc88a62003-08-05 03:45:37 +0000645 ($BASE ? "\n<base href=\"$BASE\" />" : ''),
646 "\n<link rel=\"STYLESHEET\" href=\"$STYLESHEET\" type='text/css'",
647 " />",
Fred Drakedd3d6a02002-10-30 17:00:58 +0000648 ($FAVORITES_ICON
Fred Drake2fc88a62003-08-05 03:45:37 +0000649 ? ("\n<link rel=\"SHORTCUT ICON\" href=\"$FAVORITES_ICON\" />")
Fred Drakedd3d6a02002-10-30 17:00:58 +0000650 : ''),
Fred Drake23949002002-10-30 21:51:18 +0000651 ($EXTERNAL_UP_LINK
Fred Drake98b25762003-05-02 18:21:22 +0000652 ? ("\n<link rel='start' href='" . $EXTERNAL_UP_LINK
653 . ($EXTERNAL_UP_TITLE ?
Fred Drake2fc88a62003-08-05 03:45:37 +0000654 "' title='$EXTERNAL_UP_TITLE' />" : "' />"))
Fred Drake23949002002-10-30 21:51:18 +0000655 : ''),
Fred Drake98b25762003-05-02 18:21:22 +0000656 "\n<link rel=\"first\" href=\"$FILE.html\"",
Fred Drake23949002002-10-30 21:51:18 +0000657 ($t_title ? " title='$t_title'" : ''),
Fred Drake2fc88a62003-08-05 03:45:37 +0000658 ' />',
Fred Drakea219b412001-10-22 16:57:49 +0000659 ($HAVE_TABLE_OF_CONTENTS
Fred Drake095f8172003-06-27 18:26:01 +0000660 ? ("\n<link rel='contents' href='$MY_CONTENTS_PAGE'"
Fred Drake2fc88a62003-08-05 03:45:37 +0000661 . ' title="Contents" />')
Fred Drakea219b412001-10-22 16:57:49 +0000662 : ''),
663 ($HAVE_GENERAL_INDEX
Fred Drake2fc88a62003-08-05 03:45:37 +0000664 ? "\n<link rel='index' href='genindex.html' title='Index' />"
Fred Drakea219b412001-10-22 16:57:49 +0000665 : ''),
666 # disable for now -- Mozilla doesn't do well with multiple indexes
667 # ($HAVE_MODULE_INDEX
Fred Drake2fc88a62003-08-05 03:45:37 +0000668 # ? '<link rel="index" href="modindex.html" title="Module Index"'
669 # . " />\n"
Fred Drakea219b412001-10-22 16:57:49 +0000670 # : ''),
Fred Drake23949002002-10-30 21:51:18 +0000671 ($INFO
672 # XXX We can do this with the Python tools since the About...
673 # page always gets copied to about.html, even when we use the
674 # generated node###.html page names. Won't work with the
675 # rest of the Python doc tools.
Fred Drake98b25762003-05-02 18:21:22 +0000676 ? ("\n<link rel='last' href='about.html'"
Fred Drake2fc88a62003-08-05 03:45:37 +0000677 . " title='About this document...' />"
Fred Drake98b25762003-05-02 18:21:22 +0000678 . "\n<link rel='help' href='about.html'"
Fred Drake2fc88a62003-08-05 03:45:37 +0000679 . " title='About this document...' />")
Fred Drake23949002002-10-30 21:51:18 +0000680 : ''),
Fred Drakedd3d6a02002-10-30 17:00:58 +0000681 $more_links_mark,
Fred Drake0e2e6872002-10-30 19:55:23 +0000682 "\n",
Fred Drakedd3d6a02002-10-30 17:00:58 +0000683 ($CHARSET && $HTML_VERSION ge "2.1"
684 ? ('<meta http-equiv="Content-Type" content="text/html; '
Fred Drake2fc88a62003-08-05 03:45:37 +0000685 . "charset=$CHARSET\" />\n")
Fred Drakedd3d6a02002-10-30 17:00:58 +0000686 : ''),
687 ($AESOP_META_TYPE
Fred Drake2fc88a62003-08-05 03:45:37 +0000688 ? "<meta name='aesop' content='$AESOP_META_TYPE' />\n" : ''));
Fred Drakea219b412001-10-22 16:57:49 +0000689 }
Fred Drake0e2e6872002-10-30 19:55:23 +0000690 if (!$charset && $CHARSET) {
691 $charset = $CHARSET;
692 $charset =~ s/_/\-/go;
693 }
Fred Drakef06b9052003-05-02 18:08:16 +0000694 # Remove section number from the title for use in the
695 # <meta name='description' ...> element in the document head.
696 my $metatitle = "$title";
697 $metatitle =~ s/^\d+(\.\d+)*\s*//;
Fred Drake2fc88a62003-08-05 03:45:37 +0000698 $metatitle = meta_information($metatitle);
699 $metatitle =~ s/ NAME=/ name=/g;
700 $metatitle =~ s/ CONTENT=/ content=/g;
Fred Drakef06b9052003-05-02 18:08:16 +0000701
Fred Drakedd3d6a02002-10-30 17:00:58 +0000702 join('',
703 $MY_PARTIAL_HEADER,
Fred Drake2fc88a62003-08-05 03:45:37 +0000704 $metatitle,
Fred Drakedd3d6a02002-10-30 17:00:58 +0000705 "<title>", $title, "</title>\n</head>\n<body$body>");
Fred Drakee15956b2000-04-03 04:51:13 +0000706}
707
Fred Drake2fc88a62003-08-05 03:45:37 +0000708sub replace_morelinks {
709 $more_links =~ s/ REL=/ rel=/g;
710 $more_links =~ s/ HREF=/ href=/g;
711 $_ =~ s/$more_links_mark/$more_links/e;
712}
713
Fred Drakebc7101d1998-03-06 21:18:55 +00007141; # This must be the last line