Initial import to Tizen
[profile/ivi/python-pyOpenSSL.git] / doc / tools / perl / l2hinit.perl
1 # LaTeX2HTML support base for use with Python documentation.
2
3 package main;
4
5 use L2hos;
6
7 $HTML_VERSION = 4.0;
8
9 $MAX_LINK_DEPTH = 2;
10 $ADDRESS = '';
11
12 $NO_FOOTNODE = 1;
13 $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
20 $ICONSERVER = '../icons';
21 $IMAGE_TYPE = 'gif';
22
23 # Control where the navigation bars should show up:
24 $TOP_NAVIGATION = 1;
25 $BOTTOM_NAVIGATION = 1;
26 $AUTO_NAVIGATION = 0;
27
28 $BODYTEXT = '';
29 $CHILDLINE = "\n<p><hr>\n";
30 $VERBOSITY = 0;
31
32 # default # of columns for the indexes
33 $INDEX_COLUMNS = 2;
34 $MODULE_INDEX_COLUMNS = 4;
35
36
37 # A little painful, but lets us clean up the top level directory a little,
38 # and not be tied to the current directory (as far as I can tell).  Testing
39 # an existing definition of $mydir is needed since it cannot be computed when
40 # run under mkhowto with recent versions of LaTeX2HTML, since this file is
41 # not read directly by LaTeX2HTML any more.  mkhowto is required to prepend
42 # the required definition at the top of the actual input file.
43 #
44 if (!defined $mydir) {
45     use Cwd;
46     use File::Basename;
47     ($myname, $mydir, $myext) = fileparse(__FILE__, '\..*');
48     chop $mydir;                        # remove trailing '/'
49     $mydir = getcwd() . "$dd$mydir"
50         unless $mydir =~ s|^/|/|;
51 }
52 $LATEX2HTMLSTYLES = "$mydir$envkey$LATEX2HTMLSTYLES";
53 push (@INC, $mydir);
54
55 ($myrootname, $myrootdir, $myext) = fileparse($mydir, '\..*');
56 chop $myrootdir;
57
58
59 # Hackish way to get the appropriate paper-*/ directory into $TEXINPUTS;
60 # pass in the paper size (a4 or letter) as the environment variable PAPER
61 # to add the right directory.  If not given, the current directory is
62 # added instead for use with HOWTO processing.
63 #
64 if (defined $ENV{'PAPER'}) {
65     $mytexinputs = "$myrootdir${dd}paper-$ENV{'PAPER'}$envkey";
66 }
67 else {
68     $mytexinputs = getcwd() . $envkey;
69 }
70 $mytexinputs .= "$myrootdir${dd}texinputs";
71
72
73 # Change this variable to change the text added in "About this document...";
74 # this should be an absolute pathname to get it right.
75 #
76 $ABOUT_FILE = "$myrootdir${dd}html${dd}stdabout.dat";
77
78
79 sub custom_driver_hook {
80     #
81     # This adds the directory of the main input file to $TEXINPUTS; it
82     # seems to be sufficiently general that it should be fine for HOWTO
83     # processing.
84     #
85     my $file = @_[0];
86     my($jobname, $dir, $ext) = fileparse($file, '\..*');
87     $dir = L2hos->Make_directory_absolute($dir);
88     $dir =~ s/$dd$//;
89     $TEXINPUTS = "$dir$envkey$mytexinputs";
90     print "\nAdding $dir to \$TEXINPUTS\n";
91 }
92
93
94 $CUSTOM_BUTTONS = '';
95
96 sub make_nav_sectref {
97     my($label,$title) = @_;
98     if ($title) {
99         if ($title =~ /\<[aA] /) {
100             $title =~ s/\<[aA] /<a class="sectref" /;
101         }
102         else {
103             $title = "<span class=\"sectref\">$title</span>";
104         }
105         return "<b class=\"navlabel\">$label:</b> $title\n";
106     }
107     return '';
108 }
109
110 @my_icon_tags = ();
111 $my_icon_tags{'next'} = 'Next Page';
112 $my_icon_tags{'next_page'} = 'Next Page';
113 $my_icon_tags{'previous'} = 'Previous Page';
114 $my_icon_tags{'previous_page'} = 'Previous Page';
115 $my_icon_tags{'up'} = 'Up One Level';
116 $my_icon_tags{'contents'} = 'Contents';
117 $my_icon_tags{'index'} = 'Index';
118 $my_icon_tags{'modules'} = 'Module Index';
119
120 @my_icon_names = ();
121 $my_icon_names{'previous_page'} = 'previous';
122 $my_icon_names{'next_page'} = 'next';
123
124 sub get_my_icon {
125     my $name = @_[0];
126     my $text = $my_icon_tags{$name};
127     if ($my_icon_names{$name}) {
128         $name = $my_icon_names{$name};
129     }
130     if ($text eq '') {
131         $name = 'blank';
132     }
133     my $iconserver = ($ICONSERVER eq '.') ? '' : "$ICONSERVER/";
134     return "<img src=\"$iconserver$name.$IMAGE_TYPE\"\n  border=\"0\""
135            . " height=\"32\"\n  alt=\"$text\" width=\"32\">";
136 }
137
138 sub use_my_icon {
139     my $s = @_[0];
140     if ($s =~ /\<tex2html_([a-z_]+)_visible_mark\>/) {
141         my $r = get_my_icon($1);
142         $s =~ s/\<tex2html_[a-z_]+_visible_mark\>/$r/;
143     }
144     return $s;
145 }
146
147 sub make_nav_panel {
148     my $s;
149     my $BLANK_ICON = get_my_icon('blank');
150     $NEXT = $NEXT_TITLE ? use_my_icon("$NEXT") : $BLANK_ICON;
151     $UP = $UP_TITLE ? use_my_icon("$UP") : $BLANK_ICON;
152     $PREVIOUS = $PREVIOUS_TITLE ? use_my_icon("$PREVIOUS") : $BLANK_ICON;
153     $CONTENTS = use_my_icon("$CONTENTS");
154     $INDEX = $INDEX ? use_my_icon("$INDEX") : $BLANK_ICON;
155     if (!$CUSTOM_BUTTONS) {
156         $CUSTOM_BUTTONS = $BLANK_ICON;
157     }
158     $s = ('<table align="center" width="100%" cellpadding="0" cellspacing="2">'
159           . "\n<tr>"
160           # left-hand side
161           . "\n<td>$PREVIOUS</td>"
162           . "\n<td>$UP</td>"
163           . "\n<td>$NEXT</td>"
164           # title box
165           . "\n<td align=\"center\" width=\"100%\">$t_title</td>"
166           # right-hand side
167           . "\n<td>$CONTENTS</td>"
168           . "\n<td>$CUSTOM_BUTTONS</td>" # module index
169           . "\n<td>$INDEX</td>"
170           . "\n</tr></table>\n"
171           # textual navigation
172           . make_nav_sectref("Previous", $PREVIOUS_TITLE)
173           . make_nav_sectref("Up", $UP_TITLE)
174           . make_nav_sectref("Next", $NEXT_TITLE)
175           );
176     # remove these; they are unnecessary and cause errors from validation
177     $s =~ s/ NAME="tex2html\d+"\n */ /g;
178     return $s;
179 }
180
181 sub get_version_text {
182     if ($PACKAGE_VERSION ne '' && $t_date) {
183         return ("<span class=\"release-info\">"
184                 . "Release $PACKAGE_VERSION,"
185                 . " documentation updated on $t_date.</span>");
186     }
187     if ($PACKAGE_VERSION ne '') {
188         return ("<span class=\"release-info\">"
189                 . "Release $PACKAGE_VERSION.</span>");
190     }
191     if ($t_date) {
192         return ("<span class=\"release-info\">Documentation released on "
193                 . "$t_date.</span>");
194     }
195     return '';
196 }
197
198
199 sub top_navigation_panel {
200     return "\n"
201            . make_nav_panel()
202            . "<br><hr>\n";
203 }
204
205 sub bot_navigation_panel {
206     return "\n<p><hr>\n"
207            . make_nav_panel()
208            . "<hr>\n"
209            . get_version_text()
210            . "\n";
211 }
212
213 sub add_link {
214     # Returns a pair (iconic link, textual link)
215     my($icon, $current_file, @link) = @_;
216     my($dummy, $file, $title) = split($delim,
217                                       $section_info{join(' ',@link)});
218     if ($icon =~ /\<tex2html_([_a-z]+)_visible_mark\>/) {
219         my $r = get_my_icon($1);
220         $icon =~ s/\<tex2html_[_a-z]+_visible_mark\>/$r/;
221     }
222     if ($title && ($file ne $current_file)) {
223         $title = purify($title);
224         $title = get_first_words($title, $WORDS_IN_NAVIGATION_PANEL_TITLES);
225         return (make_href($file, $icon), make_href($file, "$title"))
226         }
227     elsif ($icon eq get_my_icon('up') && $EXTERNAL_UP_LINK) {
228         return (make_href($EXTERNAL_UP_LINK, $icon),
229                 make_href($EXTERNAL_UP_LINK, "$EXTERNAL_UP_TITLE"))
230         }
231     elsif ($icon eq get_my_icon('previous')
232            && $EXTERNAL_PREV_LINK && $EXTERNAL_PREV_TITLE) {
233         return (make_href($EXTERNAL_PREV_LINK, $icon),
234                 make_href($EXTERNAL_PREV_LINK, "$EXTERNAL_PREV_TITLE"))
235         }
236     elsif ($icon eq get_my_icon('next')
237            && $EXTERNAL_DOWN_LINK && $EXTERNAL_DOWN_TITLE) {
238         return (make_href($EXTERNAL_DOWN_LINK, $icon),
239                 make_href($EXTERNAL_DOWN_LINK, "$EXTERNAL_DOWN_TITLE"))
240         }
241     return (&inactive_img($icon), "");
242 }
243
244 sub add_special_link {
245     my($icon, $file, $current_file) = @_;
246     if ($icon =~ /\<tex2html_([_a-z]+)_visible_mark\>/) {
247         my $r = get_my_icon($1);
248         $icon =~ s/\<tex2html_[_a-z]+_visible_mark\>/$r/;
249     }
250     return (($file && ($file ne $current_file))
251             ? make_href($file, $icon)
252             : undef)
253 }
254
255 # The img_tag() function seems only to be called with the parameter
256 # 'anchor_invisible_mark', which we want to turn into ''.  Since
257 # replace_icon_marks() is the only interesting caller, and all it really
258 # does is call img_tag(), we can just define the hook alternative to be
259 # a no-op instead.
260 #
261 sub replace_icons_hook {}
262
263 sub do_cmd_arabic {
264     # get rid of that nasty <SPAN CLASS="arabic">...</SPAN>
265     my($ctr, $val, $id, $text) = &read_counter_value(@_[0]);
266     return ($val ? farabic($val) : "0") . $text;
267 }
268
269
270 sub gen_index_id {
271     # this is used to ensure common index key generation and a stable sort
272     my($str,$extra) = @_;
273     sprintf('%s###%s%010d', $str, $extra, ++$global{'max_id'});
274 }
275
276 sub insert_index {
277     my($mark,$datafile,$columns,$letters,$prefix) = @_;
278     my $prog = "$myrootdir/tools/buildindex.py";
279     my $index;
280     if ($letters) {
281         $index = `$prog --columns $columns --letters $datafile`;
282     }
283     else {
284         $index = `$prog --columns $columns $datafile`;
285     }
286     if (!s/$mark/$prefix$index/) {
287         print "\nCould not locate index mark: $mark";
288     }
289 }
290
291 sub add_idx {
292     print "\nBuilding HTML for the index ...";
293     close(IDXFILE);
294     insert_index($idx_mark, 'index.dat', $INDEX_COLUMNS, 1, '');
295 }
296
297
298 $idx_module_mark = '<tex2html_idx_module_mark>';
299 $idx_module_title = 'Module Index';
300
301 sub add_module_idx {
302     print "\nBuilding HTML for the module index ...";
303     my $key;
304     my $first = 1;
305     my $prevplat = '';
306     my $allthesame = 1;
307     my $prefix = '';
308     foreach $key (keys %Modules) {
309         $key =~ s/<tt>([a-zA-Z0-9._]*)<\/tt>/\1/;
310         my $plat = "$ModulePlatforms{$key}";
311         $plat = ''
312           if ($plat eq $IGNORE_PLATFORM_ANNOTATION);
313         if (!$first) {
314             $allthesame = 0
315               if ($prevplat ne $plat);
316         }
317         else { $first = 0; }
318         $prevplat = $plat;
319     }
320     open(MODIDXFILE, '>modindex.dat') || die "\n$!\n";
321     foreach $key (keys %Modules) {
322         # dump the line in the data file; just use a dummy seqno field
323         my $nkey = $1;
324         my $moditem = "$Modules{$key}";
325         my $plat = '';
326         $key =~ s/<tt>([a-zA-Z0-9._]*)<\/tt>/\1/;
327         if ($ModulePlatforms{$key} && !$allthesame) {
328             $plat = (" <em>(<span class='platform'>$ModulePlatforms{$key}"
329                      . '</span>)</em>');
330         }
331         print MODIDXFILE $moditem . $IDXFILE_FIELD_SEP
332               . "<tt class='module'>$key</tt>$plat###\n";
333     }
334     close(MODIDXFILE);
335
336     if ($GLOBAL_MODULE_INDEX) {
337         $prefix = <<MODULE_INDEX_PREFIX;
338
339 <p> This index only lists modules documented in this manual.
340   The <em class="citetitle"><a href="$GLOBAL_MODULE_INDEX">Global Module
341      Index</a></em> lists all modules that are documented in this set
342   of manuals.</p>
343 MODULE_INDEX_PREFIX
344     }
345     if (!$allthesame) {
346         $prefix .= <<PLAT_DISCUSS;
347
348 <p> Some module names are followed by an annotation indicating what
349 platform they are available on.</p>
350
351 PLAT_DISCUSS
352     }
353     insert_index($idx_module_mark, 'modindex.dat', $MODULE_INDEX_COLUMNS, 0,
354                  $prefix);
355 }
356
357 # replace both indexes as needed:
358 sub add_idx_hook {
359     add_idx() if (/$idx_mark/);
360     process_python_state();
361     if ($MODULE_INDEX_FILE) {
362         local ($_);
363         open(MYFILE, "<$MODULE_INDEX_FILE");
364         sysread(MYFILE, $_, 1024*1024);
365         close(MYFILE);
366         add_module_idx();
367         open(MYFILE,">$MODULE_INDEX_FILE");
368         print MYFILE $_;
369         close(MYFILE);
370     }
371 }
372
373
374 # In addition to the standard stuff, add label to allow named node files and
375 # support suppression of the page complete (for HTML Help use).
376 sub do_cmd_tableofcontents {
377     local($_) = @_;
378     $TITLE = $toc_title;
379     $tocfile = $CURRENT_FILE;
380     my($closures,$reopens) = preserve_open_tags();
381     anchor_label('contents', $CURRENT_FILE, $_);        # this is added
382     join('', "<BR>\n\\tableofchildlinks[off]", $closures
383          , make_section_heading($toc_title, 'H2'), $toc_mark
384          , $reopens, $_);
385 }
386 # In addition to the standard stuff, add label to allow named node files.
387 sub do_cmd_listoffigures {
388     local($_) = @_;
389     $TITLE = $lof_title;
390     $loffile = $CURRENT_FILE;
391     my($closures,$reopens) = preserve_open_tags();
392     anchor_label('lof', $CURRENT_FILE, $_);             # this is added
393     join('', "<BR>\n", $closures
394          , make_section_heading($lof_title, 'H2'), $lof_mark
395          , $reopens, $_);
396 }
397 # In addition to the standard stuff, add label to allow named node files.
398 sub do_cmd_listoftables {
399     local($_) = @_;
400     $TITLE = $lot_title;
401     $lotfile = $CURRENT_FILE;
402     my($closures,$reopens) = preserve_open_tags();
403     anchor_label('lot', $CURRENT_FILE, $_);             # this is added
404     join('', "<BR>\n", $closures
405          , make_section_heading($lot_title, 'H2'), $lot_mark
406          , $reopens, $_);
407 }
408 # In addition to the standard stuff, add label to allow named node files.
409 sub do_cmd_textohtmlinfopage {
410     local($_) = @_;
411     if ($INFO) {                                        # 
412         anchor_label("about",$CURRENT_FILE,$_);         # this is added
413     }                                                   #
414     my $the_version = '';                               # and the rest is
415     if ($t_date) {                                      # mostly ours
416         $the_version = ",\n$t_date";
417         if ($PACKAGE_VERSION) {
418             $the_version .= ", Release $PACKAGE_VERSION";
419         }
420     }
421     $_ = (($INFO == 1)
422           ? join('',
423                  $close_all,
424                  "<strong>$t_title</strong>$the_version\n",
425                  `cat $ABOUT_FILE`,
426                  $open_all, $_)
427           : join('', $close_all, $INFO,"\n", $open_all, $_));
428     $_;
429 }
430
431 # $idx_mark will be replaced with the real index at the end
432 sub do_cmd_textohtmlindex {
433     local($_) = @_;
434     $TITLE = $idx_title;
435     $idxfile = $CURRENT_FILE;
436     if (%index_labels) { make_index_labels(); }
437     if (($SHORT_INDEX) && (%index_segment)) { make_preindex(); }
438     else { $preindex = ''; }
439     my $heading = make_section_heading($idx_title, 'h2') . $idx_mark;
440     my($pre,$post) = minimize_open_tags($heading);
441     anchor_label('genindex',$CURRENT_FILE,$_);          # this is added
442     return "<br>\n" . $pre . $_;
443 }
444
445 $MODULE_INDEX_FILE = '';
446
447 # $idx_module_mark will be replaced with the real index at the end
448 sub do_cmd_textohtmlmoduleindex {
449     local($_) = @_;
450     $TITLE = $idx_module_title;
451     anchor_label('modindex', $CURRENT_FILE, $_);
452     $MODULE_INDEX_FILE = "$CURRENT_FILE";
453     $_ = ('<p>' . make_section_heading($idx_module_title, 'h2')
454           . $idx_module_mark . $_);
455     return $_;
456 }
457
458 # The bibliography and the index should be treated as separate
459 # sections in their own HTML files. The \bibliography{} command acts
460 # as a sectioning command that has the desired effect. But when the
461 # bibliography is constructed manually using the thebibliography
462 # environment, or when using the theindex environment it is not
463 # possible to use the normal sectioning mechanism. This subroutine
464 # inserts a \bibliography{} or a dummy \textohtmlindex command just
465 # before the appropriate environments to force sectioning.
466
467 # XXX   This *assumes* that if there are two {theindex} environments,
468 #       the first is the module index and the second is the standard
469 #       index.  This is sufficient for the current Python documentation,
470 #       but that's about it.
471
472 sub add_bbl_and_idx_dummy_commands {
473     my $id = $global{'max_id'};
474
475     s/([\\]begin\s*$O\d+$C\s*thebibliography)/$bbl_cnt++; $1/eg;
476     s/([\\]begin\s*$O\d+$C\s*thebibliography)/$id++; "\\bibliography$O$id$C$O$id$C $1"/geo;
477     my(@parts) = split(/\\begin\s*$O\d+$C\s*theindex/);
478     if (scalar(@parts) == 3) {
479         # Be careful to re-write the string in place, since $_ is *not*
480         # returned explicity;  *** nasty side-effect dependency! ***
481         print "\nadd_bbl_and_idx_dummy_commands ==> adding module index";
482         my $rx = "([\\\\]begin\\s*$O\\d+$C\\s*theindex[\\s\\S]*)"
483           . "([\\\\]begin\\s*$O\\d+$C\\s*theindex)";
484         s/$rx/\\textohtmlmoduleindex \1 \\textohtmlindex \2/o;
485         # Add a button to the navigation areas:
486         $CUSTOM_BUTTONS .= ('<a href="modindex.html" title="Module Index">'
487                             . get_my_icon('modules')
488                             . '</a>');
489     }
490     else {
491         $CUSTOM_BUTTONS .= get_my_icon('blank');
492         $global{'max_id'} = $id; # not sure why....
493         s/([\\]begin\s*$O\d+$C\s*theindex)/\\textohtmlindex $1/o;
494             s/[\\]printindex/\\textohtmlindex /o;
495         }
496     #----------------------------------------------------------------------
497     lib_add_bbl_and_idx_dummy_commands()
498         if defined(&lib_add_bbl_and_idx_dummy_commands);
499 }
500
501 # The bibliographic references, the appendices, the lists of figures
502 # and tables etc. must appear in the contents table at the same level
503 # as the outermost sectioning command. This subroutine finds what is
504 # the outermost level and sets the above to the same level;
505
506 sub set_depth_levels {
507     # Sets $outermost_level
508     my $level;
509     #RRM:  do not alter user-set value for  $MAX_SPLIT_DEPTH
510     foreach $level ("part", "chapter", "section", "subsection",
511                     "subsubsection", "paragraph") {
512         last if (($outermost_level) = /\\($level)$delimiter_rx/);
513     }
514     $level = ($outermost_level ? $section_commands{$outermost_level} :
515               do {$outermost_level = 'section'; 3;});
516
517     #RRM:  but calculate value for $MAX_SPLIT_DEPTH when a $REL_DEPTH was given
518     if ($REL_DEPTH && $MAX_SPLIT_DEPTH) { 
519         $MAX_SPLIT_DEPTH = $level + $MAX_SPLIT_DEPTH;
520     } elsif (!($MAX_SPLIT_DEPTH)) { $MAX_SPLIT_DEPTH = 1 };
521
522     %unnumbered_section_commands = ('tableofcontents' => $level,
523                                     'listoffigures' => $level,
524                                     'listoftables' => $level,
525                                     'bibliography' => $level,
526                                     'textohtmlindex' => $level,
527                                     'textohtmlmoduleindex' => $level);
528     $section_headings{'textohtmlmoduleindex'} = 'h1';
529
530     %section_commands = (%unnumbered_section_commands,
531                          %section_commands);
532
533     make_sections_rx();
534 }
535
536
537 # This changes the markup used for {verbatim} environments, and is the
538 # best way I've found that ensures the <dl> goes on the outside of the
539 # <pre>...</pre>.
540 #
541 # Note that this *must* be done in the init file, not the python.perl
542 # style support file.  The %declarations must be set before
543 # initialize() is called in the main LaTeX2HTML script (which happens
544 # before style files are loaded).
545 #
546 %declarations = ('preform' => '<dl><dd><pre class="verbatim"></pre></dl>',
547                  %declarations);
548
549
550 # This is added to get rid of the long comment that follows the
551 # doctype declaration; MSIE5 on NT4 SP4 barfs on it and drops the
552 # content of the page.
553 sub make_head_and_body {
554     my($title, $body) = @_;
555     $body = " $body" unless ($body eq '');
556     my $DTDcomment = '';
557     my($version, $isolanguage) = ($HTML_VERSION, 'EN');
558     my %isolanguages = (  'english',  'EN'   , 'USenglish', 'EN.US'
559                         , 'original', 'EN'   , 'german'   , 'DE'
560                         , 'austrian', 'DE.AT', 'french'   , 'FR'
561                         , 'spanish',  'ES');
562     $isolanguage = $isolanguages{$default_language};
563     $isolanguage = 'EN' unless $isolanguage;
564     $title = &purify($title,1);
565     eval("\$title = ". $default_title ) unless ($title);
566
567     # allow user-modification of the <TITLE> tag; thanks Dan Young
568     if (defined &custom_TITLE_hook) {
569         $title = &custom_TITLE_hook($title, $toc_sec_title);
570     }
571
572     if ($DOCTYPE =~ /\/\/[\w\.]+\s*$/) { # language spec included
573         $DTDcomment = "<!DOCTYPE html PUBLIC \"$DOCTYPE\">\n";
574     } else {
575         $DTDcomment = "<!DOCTYPE html PUBLIC \"$DOCTYPE//"
576             . ($ISO_LANGUAGE ? $ISO_LANGUAGE : $isolanguage) . "\">\n";
577     }
578
579     $STYLESHEET = $FILE.".css" unless $STYLESHEET;
580     if (!$charset && $CHARSET) { $charset = $CHARSET; $charset =~ s/_/\-/go; }
581
582     join('', ($DOCTYPE ? $DTDcomment : '' )
583         ,"<html>\n<head>\n<title>", $title, "</title>\n"
584         , &meta_information($title)
585         , ($CHARSET && $HTML_VERSION ge "2.1" ?
586            "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=$charset\">\n"
587            : "" )
588         , ($BASE ? "<base href=\"$BASE\">\n" : "" )
589         , "<link rel=\"STYLESHEET\" href=\"$STYLESHEET\">"
590         , $more_links_mark
591         , "\n</head>\n<body$body>");
592 }
593
594 1;      # This must be the last line