forked from bonzini/smalltalk
/
texi2html
executable file
·4872 lines (4401 loc) · 125 KB
/
texi2html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#! /usr/bin/env perl
'di ';
'ig 00 ';
#+##############################################################################
#
# texi2html: Program to transform Texinfo documents to HTML
#
# Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
#-##############################################################################
# Summary of changes by Paolo Bonzini:
# - Extensive modifications to texi2html.init to produce a nicer navigation
# bar
# - Removed support for an external texi2html.init
# - Removed support for latex2html
# - Don't use latex2html to produce smallcaps (@sc)
# - Produce a navigation bar for each chapter
# - Split at sections only, not at every node, if `-split section' is given
# on the command line
# - Produce amp/lt/gt entities instead of #38/#60/#62
# - Produce lowercase html
# This requires perl version 5 or higher
require 5.0;
# Homepage:
$T2H_HOMEPAGE = <<EOT;
http://www.mathematik.uni-kl.de/~obachman/Texi2html
EOT
# Authors:
$T2H_AUTHORS = <<EOT;
Written by: Lionel Cons <Lionel.Cons\@cern.ch> (original author)
Karl Berry <karl\@freefriends.org>
Olaf Bachmann <obachman\@mathematik.uni-kl.de>
and many others.
Maintained by: Olaf Bachmann <obachman\@mathematik.uni-kl.de>
Adapted by: Paolo Bonzini <bonzini\@gnu.org>
EOT
# Version: set in configure.in
$THISVERSION = '1.64a';
$THISPROG = "texi2html $THISVERSION"; # program name and version
# The man page for this program is included at the end of this file and can be
# viewed using the command 'nroff -man texi2html'.
# Identity:
$T2H_TODAY = &pretty_date; # like "20 September 1993"
#+++############################################################################
# #
# Initialization #
# Pasted content of File $(srcdir)/texi2html.init: Default initializations #
# #
#---############################################################################
######################################################################
# File: texi2html.init
#
# Sets default values for command-line arguments and for various customizable
# procedures
#
# A copy of this file is pasted into the beginning of texi2html by
# 'make texi2html'
#
# Copy this file and make changes to it, if you like.
# Afterwards, either, load it with command-line option -init_file <your_init_file>
#
# $Id: texi2html.init,v 1.34 2000/07/27 14:09:02 obachman Exp $
######################################################################
# stuff which can also be set by command-line options
#
#
# Note: values set here, overwrite values set by the command-line
# options before -init_file and might still be overwritten by
# command-line arguments following the -init_file option
#
# T2H_OPTIONS is a hash whose keys are the (long) names of valid
# command-line options and whose values are a hash with the following keys:
# type ==> one of !|=i|:i|=s|:s (see GetOpt::Long for more info)
# linkage ==> ref to scalar, array, or subroutine (see GetOpt::Long for more info)
# verbose ==> short description of option (displayed by -h)
# noHelp ==> if 1 -> for "not so important options": only print description on -h 1
# 2 -> for obsolete options: only print description on -h 2
$T2H_DEBUG = 0;
$T2H_OPTIONS -> {debug} =
{
type => '=i',
linkage => \$main::T2H_DEBUG,
verbose => 'output HTML with debuging information',
};
$T2H_DOCTYPE = '<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">';
$T2H_OPTIONS -> {doctype} =
{
type => '=s',
linkage => \$main::T2H_DOCTYPE,
verbose => 'document type which is output in header of HTML files',
noHelp => 1
};
$T2H_CHECK = 0;
$T2H_OPTIONS -> {check} =
{
type => '!',
linkage => \$main::T2H_CHECK,
verbose => 'if set, only check files and output all things that may be Texinfo commands',
noHelp => 1
};
# -expand
# if set to "tex" (or, "info") expand @iftex and @tex (or, @ifinfo) sections
# else, neither expand @iftex, @tex, nor @ifinfo sections
$T2H_EXPAND = "none";
$T2H_OPTIONS -> {expand} =
{
type => '=s',
linkage => \$T2H_EXPAND,
verbose => 'Expand info|tex|none section of texinfo source',
};
# - glossary
#if set, uses section named `Footnotes' for glossary
$T2H_USE_GLOSSARY = 0;
T2H_OPTIONS -> {glossary} =
{
type => '!',
linkage => \$T2H_USE_GLOSSARY,
verbose => "if set, uses section named `Footnotes' for glossary",
noHelp => 1,
};
# -invisible
# $T2H_INVISIBLE_MARK is the text used to create invisible destination
# anchors for index links (you can for instance use the invisible.xbm
# file shipped with this program). This is a workaround for a known
# bug of many WWW browsers, including netscape.
# For me, it works fine without it -- on the contrary: if there, it
# inserts space between headers and start of text (obachman 3/99)
$T2H_INVISIBLE_MARK = '';
# $T2H_INVISIBLE_MARK = ' ';
$T2H_OPTIONS -> {invisible} =
{
type => '=s',
linkage => \$T2H_INVISIBLE_MARK,
verbose => 'use text in invisble anchot',
noHelp => 1,
};
# -iso
# if set, ISO8879 characters are used for special symbols (like copyright, etc)
$T2H_USE_ISO = 0;
$T2H_OPTIONS -> {iso} =
{
type => 'iso',
linkage => \$T2H_USE_ISO,
verbose => 'if set, ISO8879 characters are used for special symbols (like copyright, etc)',
noHelp => 1,
};
# -I
# list directories where @include files are searched for (besides the
# directory of the doc file) additional '-I' args add to this list
@T2H_INCLUDE_DIRS = (".");
$T2H_OPTIONS -> {I} =
{
type => '=s',
linkage => \@T2H_INCLUDE_DIRS,
verbose => 'append $s to the @include search path',
};
# -top_file
# uses file of this name for top-level file
# extension is manipulated appropriately, if necessary.
# If empty, <basename of document>.html is used
# Typically, you would set this to "index.html".
$T2H_TOP_FILE = '';
$T2H_OPTIONS -> {top_file} =
{
type => '=s',
linkage => \$T2H_TOP_FILE,
verbose => 'use $s as top file, instead of <docname>.html',
};
# -toc_file
# uses file of this name for table of contents file
# extension is manipulated appropriately, if necessary.
# If empty, <basename of document>_toc.html is used
$T2H_TOC_FILE = '';
$T2H_OPTIONS -> {toc_file} =
{
type => '=s',
linkage => \$T2H_TOC_FILE,
verbose => 'use $s as ToC file, instead of <docname>_toc.html',
};
# -frames
# if set, output two additional files which use HTML 4.0 "frames".
$T2H_FRAMES = 0;
$T2H_OPTIONS -> {frames} =
{
type => '!',
linkage => \$T2H_FRAMES,
verbose => 'output files which use HTML 4.0 frames (experimental)',
noHelp => 1,
};
# -menu | -nomenu
# if set, show the Texinfo menus
$T2H_SHOW_MENU = 1;
$T2H_OPTIONS -> {menu} =
{
type => '!',
linkage => \$T2H_SHOW_MENU,
verbose => 'ouput Texinfo menus',
};
# -number | -nonumber
# if set, number sections and show section names and numbers in references
# and menus
$T2H_NUMBER_SECTIONS = 1;
$T2H_OPTIONS -> {number} =
{
type => '!',
linkage => \$T2H_NUMBER_SECTIONS,
verbose => 'use numbered sections'
};
# if set, and T2H_NUMBER_SECTIONS is set, then use node names in menu
# entries, instead of section names
$T2H_NODE_NAME_IN_MENU = 0;
# if set and menu entry equals menu descr, then do not print menu descr.
# Likewise, if node name equals entry name, do not print entry name.
$T2H_AVOID_MENU_REDUNDANCY = 1;
# -split section|chapter|none
# if set to 'section' (resp. 'chapter') create one html file per (sub)section
# (resp. chapter) and separate pages for Top, ToC, Overview, Index,
# Glossary, About.
# otherwise, create monolithic html file which contains whole document
#$T2H_SPLIT = 'section';
$T2H_SPLIT = '';
$T2H_OPTIONS -> {split} =
{
type => '=s',
linkage => \$T2H_SPLIT,
verbose => 'split document on section|chapter else no splitting',
};
# -section_navigation|-no-section_navigation
# if set, then navigation panels are printed at the beginning of each section
# and, possibly at the end (depending on whether or not there were more than
# $T2H_WORDS_IN_PAGE words on page
# This is most useful if you do not want to have section navigation
# on -split chapter
$T2H_SECTION_NAVIGATION = 0;
# -subdir
# if set put result files in this directory
# if not set result files are put into current directory
#$T2H_SUBDIR = 'html';
$T2H_SUBDIR = '';
$T2H_OPTIONS -> {subdir} =
{
type => '=s',
linkage => \$T2H_SUBDIR,
verbose => 'put HTML files in directory $s, instead of $cwd',
};
# -short_extn
# If this is set all HTML file will have extension ".htm" instead of
# ".html". This is helpful when shipping the document to PC systems.
$T2H_SHORTEXTN = 0;
$T2H_OPTIONS -> {short_ext} =
{
type => '!',
linkage => \$T2H_SHORTEXTN,
verbose => 'use "htm" extension for output HTML files',
};
# -prefix
# Set the output file prefix, prepended to all .html, .gif and .pl files.
# By default, this is the basename of the document
$T2H_PREFIX = '';
$T2H_OPTIONS -> {prefix} =
{
type => '=s',
linkage => \$T2H_PREFIX,
verbose => 'use as prefix for output files, instead of <docname>',
};
# -o filename
# If set, generate monolithic document output html into $filename
$T2H_OUT = '';
$T2H_OPTIONS -> {out_file} =
{
type => '=s',
linkage => sub {$main::T2H_OUT = @_[1]; $T2H_SPLIT = '';},
verbose => 'if set, all HTML output goes into file $s',
};
# -short_ref
#if set cross-references are given without section numbers
$T2H_SHORT_REF = '';
$T2H_OPTIONS -> {short_ref} =
{
type => '!',
linkage => \$T2H_SHORT_REF,
verbose => 'if set, references are without section numbers',
};
# -idx_sum
# if value is set, then for each @prinindex $what
# $docu_name_$what.idx is created which contains lines of the form
# $key\t$ref sorted alphabetically (case matters)
$T2H_IDX_SUMMARY = 0;
$T2H_OPTIONS -> {idx_sum} =
{
type => '!',
linkage => \$T2H_IDX_SUMMARY,
verbose => 'if set, also output index summary',
noHelp => 1,
};
# -verbose
# if set, chatter about what we are doing
$T2H_VERBOSE = '';
$T2H_OPTIONS -> {Verbose} =
{
type => '!',
linkage => \$T2H_VERBOSE,
verbose => 'print progress info to stdout',
};
# -lang
# For page titles use $T2H_WORDS->{$T2H_LANG}->{...} as title.
# To add a new language, supply list of titles (see $T2H_WORDS below).
# and use ISO 639 language codes (see e.g. perl module Locale-Codes-1.02
# for definitions)
# Default's to 'en' if not set or no @documentlanguage is specified
$T2H_LANG = '';
$T2H_OPTIONS -> {lang} =
{
type => '=s',
linkage => sub {SetDocumentLanguage($_[1])},
verbose => 'use $s as document language (ISO 639 encoding)',
};
$T2H_OPTIONS -> {D} =
{
type => '=s',
linkage => sub {$main::value{@_[1]} = 1;},
verbose => 'equivalent to Texinfo "@set $s 1"',
noHelp => 1,
};
$T2H_OPTIONS -> {init_file} =
{
type => '=s',
linkage => \&LoadInitFile,
verbose => 'load init file $s'
};
##############################################################################
#
# The following can only be set in the init file
#
##############################################################################
# if set, center @image by default
# otherwise, do not center by default
$T2H_CENTER_IMAGE = 1;
# used as identation for block enclosing command @example, etc
# If not empty, must be enclosed in <td></td>
$T2H_EXAMPLE_INDENT_CELL = '<td> </td>';
# same as above, only for @small
$T2H_SMALL_EXAMPLE_INDENT_CELL = '<td> </td>';
# font size for @small
$T2H_SMALL_FONT_SIZE = '-1';
# if non-empty, and no @..heading appeared in Top node, then
# use this as header for top node/section, otherwise use value of
# @settitle or @shorttitle (in that order)
$T2H_TOP_HEADING = '';
# if set, use this chapter for 'Index' button, else
# use first chapter whose name matches 'index' (case insensitive)
$T2H_INDEX_CHAPTER = '';
# if set and $T2H_SPLIT is set, then split index pages at the next letter
# after they have more than that many entries
$T2H_SPLIT_INDEX = 100;
# if set (e.g., to index.html) replace hrefs to this file
# (i.e., to index.html) by ./
$T2H_HREF_DIR_INSTEAD_FILE = '';
########################################################################
# Language dependencies:
# To add a new language extend T2H_WORDS hash and create $T2H_<...>_WORDS hash
# To redefine one word, simply do:
# $T2H_WORDS->{<language>}->{<word>} = 'whatever' in your personal init file.
#
$T2H_WORDS_EN =
{
# titles of pages
'ToC_Title' => 'Table of Contents',
'Overview_Title' => 'Short Table of Contents',
'Index_Title' => 'Index',
'About_Title' => 'About this document',
'Footnotes_Title' => 'Footnotes',
'See' => 'See',
'see' => 'see',
'section' => 'section',
# If necessary, we could extend this as follows:
# # text for buttons
# 'Top_Button' => 'Top',
# 'ToC_Button' => 'Contents',
# 'Overview_Button' => 'Overview',
# 'Index_button' => 'Index',
# 'Back_Button' => 'Back',
# 'FastBack_Button' => 'FastBack',
# 'Prev_Button' => 'Prev',
# 'Up_Button' => 'Up',
# 'Next_Button' => 'Next',
# 'Forward_Button' =>'Forward',
# 'FastWorward_Button' => 'FastForward',
# 'First_Button' => 'First',
# 'Last_Button' => 'Last',
# 'About_Button' => 'About'
};
$T2H_WORD_DE =
{
'ToC_Title' => 'Inhaltsverzeichniss',
'Overview_Title' => 'Kurzes Inhaltsverzeichniss',
'Index_Title' => 'Index',
'About_Title' => 'Über dieses Dokument',
'Footnotes_Title' => 'Fußnoten',
'See' => 'Siehe',
'see' => 'siehe',
'section' => 'Abschnitt',
};
$T2H_WORD_NL =
{
'ToC_Title' => 'Inhoudsopgave',
'Overview_Title' => 'Korte inhoudsopgave',
'Index_Title' => 'Index', #Not sure ;-)
'About_Title' => 'No translation available!', #No translation available!
'Footnotes_Title' => 'No translation available!', #No translation available!
'See' => 'Zie',
'see' => 'zie',
'section' => 'sectie',
};
$T2H_WORD_ES =
{
'ToC_Title' => 'índice General',
'Overview_Title' => 'Resumen del Contenido',
'Index_Title' => 'Index', #Not sure ;-)
'About_Title' => 'No translation available!', #No translation available!
'Footnotes_Title' => 'Fußnoten',
'See' => 'Véase',
'see' => 'véase',
'section' => 'sección',
};
$T2H_WORD_NO =
{
'ToC_Title' => 'Innholdsfortegnelse',
'Overview_Title' => 'Kort innholdsfortegnelse',
'Index_Title' => 'Indeks', #Not sure ;-)
'About_Title' => 'No translation available!', #No translation available!
'Footnotes_Title' => 'No translation available!',
'See' => 'Se',
'see' => 'se',
'section' => 'avsnitt',
};
$T2H_WORD_PT =
{
'ToC_Title' => 'Sumário',
'Overview_Title' => 'Breve Sumário',
'Index_Title' => 'Índice', #Not sure ;-)
'About_Title' => 'No translation available!', #No translation available!
'Footnotes_Title' => 'No translation available!',
'See' => 'Veja',
'see' => 'veja',
'section' => 'Seção',
};
$T2H_WORDS =
{
'en' => $T2H_WORDS_EN,
'de' => $T2H_WORDS_DE,
'nl' => $T2H_WORDS_NL,
'es' => $T2H_WORDS_ES,
'no' => $T2H_WORDS_NO,
'pt' => $T2H_WORDS_PT
};
@MONTH_NAMES_EN =
(
'January', 'February', 'March', 'April', 'May',
'June', 'July', 'August', 'September', 'October',
'November', 'December'
);
@MONTH_NAMES_DE =
(
'Januar', 'Februar', 'März', 'April', 'Mai',
'Juni', 'Juli', 'August', 'September', 'Oktober',
'November', 'Dezember'
);
@MONTH_NAMES_NL =
(
'Januari', 'Februari', 'Maart', 'April', 'Mei',
'Juni', 'Juli', 'Augustus', 'September', 'Oktober',
'November', 'December'
);
@MONTH_NAMES_ES =
(
'enero', 'febrero', 'marzo', 'abril', 'mayo',
'junio', 'julio', 'agosto', 'septiembre', 'octubre',
'noviembre', 'diciembre'
);
@MONTH_NAMES_NO =
(
'januar', 'februar', 'mars', 'april', 'mai',
'juni', 'juli', 'august', 'september', 'oktober',
'november', 'desember'
);
@MONTH_NAMES_PT =
(
'Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio',
'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro',
'Novembro', 'Dezembro'
);
$MONTH_NAMES =
{
'en' => \@MONTH_NAMES_EN,
'de' => \@MONTH_NAMES_DE,
'es' => \@MONTH_NAMES_ES,
'nl' => \@MONTH_NAMES_NL,
'no' => \@MONTH_NAMES_NO,
'pt' => \@MONTH_NAMES_PT
};
########################################################################
# Control of Page layout:
# You can make changes of the Page layout at two levels:
# 1.) For small changes, it is often enough to change the value of
# some global string/hash/array variables
# 2.) For larger changes, reimplement one of the T2H_DEFAULT_<fnc>* routines,
# give them another name, and assign them to the respective
# $T2H_<fnc> variable.
# As a general interface, the hashes T2H_HREF, T2H_NAME, T2H_NODE hold
# href, html-name, node-name of
# This -- current section (resp. html page)
# Top -- top page ($T2H_TOP_FILE)
# Contents -- Table of contents
# Overview -- Short table of contents
# Index -- Index page
# About -- page which explain "navigation buttons"
# First -- first node
# Last -- last node
#
# Whether or not the following hash values are set, depends on the context
# (all values are w.r.t. 'This' section)
# Next -- next node of texinfo
# Prev -- previous node of texinfo
# Up -- up node of texinfo
# Forward -- next node in reading order
# Back -- previous node in reading order
# FastForward -- if leave node, up and next, else next node
# FastBackward-- if leave node, up and prev, else prev node
#
# Furthermore, the following global variabels are set:
# $T2H_THISDOC{title} -- title as set by @setttile
# $T2H_THISDOC{fulltitle} -- full title as set by @title...
# $T2H_THISDOC{subtitle} -- subtitle as set by @subtitle
# $T2H_THISDOC{author} -- author as set by @author
#
# and pointer to arrays of lines which need to be printed by t2h_print_lines
# $T2H_OVERVIEW -- lines of short table of contents
# $T2H_TOC -- lines of table of contents
# $T2H_TOP -- lines of Top texinfo node
# $T2H_THIS_SECTION -- lines of 'This' section
#
# There are the following subs which control the layout:
#
$T2H_print_section = \&T2H_DEFAULT_print_section;
$T2H_print_Top_header = \&T2H_DEFAULT_print_Top_header;
$T2H_print_Top_footer = \&T2H_DEFAULT_print_Top_footer;
$T2H_print_Top = \&T2H_DEFAULT_print_Top;
$T2H_print_Toc = \&T2H_DEFAULT_print_Toc;
$T2H_print_Overview = \&T2H_DEFAULT_print_Overview;
$T2H_print_Footnotes = \&T2H_DEFAULT_print_Footnotes;
$T2H_print_About = \&T2H_DEFAULT_print_About;
$T2H_print_misc_header = \&T2H_DEFAULT_print_misc_header;
$T2H_print_misc_footer = \&T2H_DEFAULT_print_misc_footer;
$T2H_print_misc = \&T2H_DEFAULT_print_misc;
$T2H_print_chapter_header = \&T2H_DEFAULT_print_chapter_header;
$T2H_print_chapter_footer = \&T2H_DEFAULT_print_chapter_footer;
$T2H_print_page_head = \&T2H_DEFAULT_print_page_head;
$T2H_print_page_foot = \&T2H_DEFAULT_print_page_foot;
$T2H_print_head_navigation = \&T2H_DEFAULT_print_head_navigation;
$T2H_print_foot_navigation = \&T2H_DEFAULT_print_foot_navigation;
$T2H_button_icon_img = \&T2H_DEFAULT_button_icon_img;
$T2H_print_navigation = \&T2H_DEFAULT_print_navigation;
$T2H_about_body = \&T2H_DEFAULT_about_body;
$T2H_print_frame = \&T2H_DEFAULT_print_frame;
$T2H_print_toc_frame = \&T2H_DEFAULT_print_toc_frame;
########################################################################
# Layout for html for every sections
#
sub T2H_DEFAULT_print_section
{
my $fh = shift;
my $nw = t2h_print_lines($fh);
print $fh '<hr size="6">' . "\n";
}
###################################################################
# Layout of top-page I recommend that you use @ifnothtml, @ifhtml,
# @html within the Top texinfo node to specify content of top-level
# page.
#
# If you enclose everything in @ifnothtml, then title, subtitle,
# author and overview is printed
# T2H_HREF of Next, Prev, Up, Forward, Back are not defined
# if $T2H_SPLIT then Top page is in its own html file
sub T2H_DEFAULT_print_Top_header
{
&$T2H_print_page_head(@_) if $T2H_SPLIT;
t2h_print_label(@_); # this needs to be called, otherwise no label set
&$T2H_print_head_navigation(@_);
}
sub T2H_DEFAULT_print_Top_footer
{
&$T2H_print_foot_navigation(@_);
&$T2H_print_page_foot(@_) if $T2H_SPLIT;
}
sub T2H_DEFAULT_print_Top
{
my $fh = shift;
# for redefining navigation buttons use:
# local $T2H_BUTTONS = [...];
# as it is, 'Top', 'Contents', 'Index', 'About' are printed
local $T2H_BUTTONS = \@T2H_MISC_BUTTONS;
&$T2H_print_Top_header($fh);
if ($T2H_THIS_SECTION)
{
# if top-level node has content, then print it with extra header
print $fh "<h1>$T2H_NAME{Top}</h1>"
unless ($T2H_HAS_TOP_HEADING);
t2h_print_lines($fh, $T2H_THIS_SECTION)
}
else
{
# top-level node is fully enclosed in @ifnothtml
# print fulltitle, subtitle, author, Overview
print $fh
"<center>\n<h1>" .
join("</h1>\n<h1>", split(/\n/, $T2H_THISDOC{fulltitle})) .
"</h1>\n";
print $fh "<h2>$T2H_THISDOC{subtitle}</h2>\n" if $T2H_THISDOC{subtitle};
print $fh "$T2H_THISDOC{author}\n" if $T2H_THISDOC{author};
print $fh <<EOT;
</center>
<hr>
<p></p>
<h2> overview: </h2>
<blockquote>
EOT
t2h_print_lines($fh, $T2H_OVERVIEW);
print $fh "</blockquote>\n";
}
&$T2H_print_Top_footer($fh);
}
###################################################################
# Layout of Toc, Overview, and Footnotes pages
# By default, we use "normal" layout
# T2H_HREF of Next, Prev, Up, Forward, Back, etc are not defined
# use: local $T2H_BUTTONS = [...] to redefine navigation buttons
sub T2H_DEFAULT_print_Toc
{
return &$T2H_print_misc(@_);
}
sub T2H_DEFAULT_print_Overview
{
return &$T2H_print_misc(@_);
}
sub T2H_DEFAULT_print_Footnotes
{
return &$T2H_print_misc(@_);
}
sub T2H_DEFAULT_print_About
{
return &$T2H_print_misc(@_);
}
sub T2H_DEFAULT_print_misc_header
{
&$T2H_print_page_head(@_) if $T2H_SPLIT;
# this needs to be called, otherwise, no labels are set
t2h_print_label(@_);
&$T2H_print_head_navigation(@_);
}
sub T2H_DEFAULT_print_misc_footer
{
&$T2H_print_foot_navigation(@_);
&$T2H_print_page_foot(@_) if $T2H_SPLIT;
}
sub T2H_DEFAULT_print_misc
{
my $fh = shift;
local $T2H_BUTTONS = \@T2H_MISC_BUTTONS;
&$T2H_print_misc_header($fh);
print $fh "<h1>$T2H_NAME{This}</h1>\n";
t2h_print_lines($fh);
&$T2H_print_misc_footer($fh);
}
###################################################################
# chapter_header and chapter_footer are only called if
# T2H_SPLIT eq 'chapter'
# chapter_header: after print_page_header, before print_section
# chapter_footer: after print_section of last section, before print_page_footer
#
# If you want to get rid of navigation stuff after each section,
# redefine print_section such that it does not call print_navigation,
# and put print_navigation into print_chapter_header
@T2H_CHAPTER_BUTTONS =
(
'FastBack', 'FastForward', ' ',
'Top', 'Contents', 'Index', 'About',
);
@T2H_SECTION_BUTTONS =
(
'Back', 'Up', 'Forward', ' ',
'Top', 'Contents', 'Index', 'About',
);
sub T2H_DEFAULT_print_chapter_header
{
#if ($T2H_SPLIT)
#{
my $fh = shift;
local $T2H_BUTTONS = \@T2H_CHAPTER_BUTTONS if $T2H_SPLIT ne 'section';
local $T2H_BUTTONS = \@T2H_SECTION_BUTTONS if $T2H_SPLIT eq 'section';
&$T2H_print_head_navigation($fh);
#}
}
sub T2H_DEFAULT_print_chapter_footer
{
#if ($T2H_SPLIT)
#{
my $fh = shift;
local $T2H_BUTTONS = \@T2H_CHAPTER_BUTTONS if $T2H_SPLIT ne 'chapter';
local $T2H_BUTTONS = \@T2H_SECTION_BUTTONS if $T2H_SPLIT eq 'section';
&$T2H_print_foot_navigation($fh);
#}
}
###################################################################
$T2H_TODAY = &pretty_date; # like "20 September 1993"
sub pretty_date {
local($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst);
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time);
$year += ($year < 70) ? 2000 : 1900;
# obachman: Let's do it as the Americans do
return($MONTH_NAMES->{$T2H_LANG}[$mon] . ", " . $mday . " " . $year);
}
###################################################################
# Layout of standard header and footer
#
# Set the default body text, inserted between <BODY ... >
###$T2H_BODYTEXT = 'lang="en" bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000"';
$T2H_BODYTEXT = 'lang="' . $t2h_lang . '" bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000"';
# text inserted after <BODY ...>
$T2H_AFTER_BODY_OPEN = '';
#text inserted before </BODY>
$T2H_PRE_BODY_CLOSE = '';
# this is used in footer
$T2H_ADDRESS = "on <i>$T2H_TODAY</i>";
# this is added inside <HEAD></HEAD> after <TITLE> and some META NAME stuff
# can be used for <style> <script>, <meta> tags
$T2H_EXTRA_HEAD = '
<script language="Javascript">
<!--
// Check the browser version.
function checkVersion() {
if (navigator.appVersion.charAt(0)>=3) return true;
if (navigator.appVersion.charAt(0)>=4) return true;
else return false;
}
if (checkVersion()) {
homeon = new Image();
homeon.src = "images/homeon.png";
homeoff = new Image();
homeoff.src = "images/home.png";
tocon = new Image();
tocon.src = "images/tocon.png";
tocoff = new Image();
tocoff.src = "images/toc.png";
indexon = new Image();
indexon.src = "images/indexon.png";
indexoff = new Image();
indexoff.src = "images/index.png";
helpon = new Image();
helpon.src = "images/helpon.png";
helpoff = new Image();
helpoff.src = "images/help.png";
backon = new Image();
backon.src = "images/backon.png";
backoff = new Image();
backoff.src = "images/back.png";
forwardon = new Image();
forwardon.src = "images/forwardon.png";
forwardoff = new Image();
forwardoff.src = "images/forward.png";
prevon = new Image();
prevon.src = "images/prevon.png";
prevoff = new Image();
prevoff.src = "images/prev.png";
nexton = new Image();
nexton.src = "images/nexton.png";
nextoff = new Image();
nextoff.src = "images/next.png";
upon = new Image();
upon.src = "images/upon.png";
upoff = new Image();
upoff.src = "images/up.png";
}
function img_act(imgName) {
if (checkVersion()) {
imgOn = eval(imgName + "on.src");
document [imgName].src = imgOn;
}
}
function img_inact(imgName) {
if (checkVersion()) {
imgOff = eval(imgName + "off.src");
document [imgName].src = imgOff;
}
}
// -->
</script>
';
sub T2H_DEFAULT_print_page_head
{
my $fh = shift;
my $longtitle = "$T2H_THISDOC{title}: $T2H_NAME{This}";
print $fh <<EOT;
<html>
$T2H_DOCTYPE
<!-- Created on $T2H_TODAY by $THISPROG -->
<!--
$T2H_AUTHORS
-->
<head>
<title>$longtitle</title>
<meta name="description" content="$longtitle">
<meta name="keywords" content="$longtitle">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="generator" content="$THISPROG">
$T2H_EXTRA_HEAD
</head>
<body $T2H_BODYTEXT>
$T2H_AFTER_BODY_OPEN
EOT
}
sub T2H_DEFAULT_print_page_foot
{
my $fh = shift;
print $fh <<EOT;
</td>
</tr>
</table>
</tr></table>
<br>
<font size="-1">
This document was generated
$T2H_ADDRESS
using <a href="$t2h_homepage"><i>texi2html</i></a>
$T2H_PRE_BODY_CLOSE
</body>
</html>
EOT
}
###################################################################
# Layout of navigation panel
sub T2H_DEFAULT_print_head_navigation
{
my $fh = shift;
&$T2H_print_navigation($fh);
print $fh "<hr size=1>\n";
}
sub T2H_DEFAULT_print_foot_navigation
{
my $fh = shift;
my $nwords = shift;
print $fh "<hr size=1>\n";
&$T2H_print_navigation($fh);
print $fh "<hr size=1>\n";
}
######################################################################
# navigation panel
#
# specify in this array which "buttons" should appear in which order
# in the navigation panel for sections; use ' ' for empty buttons (space)
# buttons for misc stuff
@T2H_MISC_BUTTONS = ('Top', 'Contents', 'Index', 'About');
# insert here name of icon images for buttons
# Icons are used, if $T2H_ICONS and resp. value are set
%T2H_ACTIVE_ICONS =
(
'Top', 'home',
'Contents', 'toc',