Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 23888 lines (22271 sloc) 857.702 kb
#!/usr/bin/perl --
# perl
'di ';
'ig 00 ';
#+##############################################################################
#
# *** THIS PROGRAM WAS MODIFIED FOR PROCESSING THE GAMBIT MANUAL ***
#
# The original file can be found here
#
# http://nongnu.askapache.com/texi2html/texi2html-1.82.tar.gz
#
# The lines that were modified contain the comment "###GAMBIT###".
#
#-##############################################################################
#+##############################################################################
#
# texi2html: Program to transform Texinfo documents to HTML
#
# Copyright (C) 1999-2005 Patrice Dumas <dumas@centre-cired.fr>,
# Derek Price <derek@ximbiot.com>,
# Adrian Aichner <adrian@xemacs.org>,
# & others.
#
# 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
#
#-##############################################################################
# The man page for this program is included at the end of this file and can be
# viewed using the command 'nroff -man texi2html'.
# for POSIX::setlocale and File::Spec
require 5.00405;
# Perl pragma to restrict unsafe constructs
use strict;
# used in case of tests, to revert to "C" locale.
use POSIX qw(setlocale LC_ALL LC_CTYPE);
# used to obtain the name of the current working directory
use Cwd;
# Used to find the parent directory of this script.
use File::Basename;
# used to find a relative path back to the current working directory
use File::Spec;
#
# According to
# larry.jones@sdrc.com (Larry Jones)
# this pragma is not present in perl5.004_02:
#
# Perl pragma to control optional warnings
# use warnings;
#++##########################################################################
#
# NOTE FOR DEBUGGING THIS SCRIPT:
# You can run 'perl texi2html.pl' directly, provided you have the script
# in the same directory with, or the environment variable T2H_HOME set to
# the directory containing, the texi2html.init, T2h_i18n.pm, translations.pl,
# l2h.init, & T2h_l2h.pm files
#
#--##########################################################################
my $T2H_HOME = defined $ENV{T2H_HOME} ? $ENV{T2H_HOME} : dirname $0;
if ($0 =~ /\.pl$/)
{
# Issue a warning in debugging mode if $T2H_HOME is set but isn't
# accessible.
if (!-e $T2H_HOME)
{ warn "T2H_HOME ($T2H_HOME) does not exist."; }
elsif (!-d $T2H_HOME)
{ warn "T2H_HOME ($T2H_HOME) is not a directory."; }
elsif (!-x $T2H_HOME)
{ warn "T2H_HOME ($T2H_HOME) is not accessible."; }
}
# CVS version:
# $Id: texi2html.pl,v 1.255 2009/01/05 11:44:48 pertusus Exp $
# Homepage:
my $T2H_HOMEPAGE = "http://www.nongnu.org/texi2html/";
# Authors (appears in comments):
my $T2H_AUTHORS = <<EOT;
texi2html was 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: Many creative people.
Send bugs and suggestions to <texi2html-bug\@nongnu.org>
EOT
# Version: set in configure.in
my $THISVERSION = '1.82';
my $THISPROG = "texi2html $THISVERSION"; # program name and version
#+++########################################################################
# #
# Paths and file names #
# #
#---########################################################################
# set by configure, prefix for the sysconfdir and so on
my $prefix = '/usr/local';
my $datarootdir = '${prefix}/share';
my $sysconfdir;
my $pkgdatadir;
my $datadir;
# We need to eval as $prefix has to be expanded. However when we haven't
# run configure @sysconfdir will be expanded as an array, thus we verify
# whether configure was run or not
if ('${prefix}/etc' ne '@' . 'sysconfdir@')
{
$sysconfdir = eval '"${prefix}/etc"';
}
else
{
$sysconfdir = "/usr/local/etc";
}
if ('${datarootdir}' ne '@' . 'datadir@')
{
$pkgdatadir = eval '"${datarootdir}/texi2html"';
$datadir = eval '"${datarootdir}"';
}
else
{
$pkgdatadir = "/usr/local/share/texi2html";
$datadir = "/usr/local/share";
}
my $i18n_dir = 'i18n'; # name of the directory containing the per language files
my $conf_file_name = 'Config' ;
my $texinfo_htmlxref = 'htmlxref.cnf';
my $target_prefix = "t_h";
# directories for texi2html init files
my @texi2html_config_dirs = ('./');
push @texi2html_config_dirs, "$ENV{'HOME'}/.texi2html/" if (defined($ENV{'HOME'}));
push @texi2html_config_dirs, "$sysconfdir/texi2html/" if (defined($sysconfdir));
push @texi2html_config_dirs, "$pkgdatadir" if (defined($pkgdatadir));
# directories for texinfo configuration files
my @texinfo_config_dirs = ('./.texinfo/');
push @texinfo_config_dirs, "$ENV{'HOME'}/.texinfo/" if (defined($ENV{'HOME'}));
push @texinfo_config_dirs, "$sysconfdir/texinfo/" if (defined($sysconfdir));
push @texinfo_config_dirs, "$datadir/texinfo/" if (defined($datadir));
#+++########################################################################
# #
# Constants #
# #
#---########################################################################
my $DEBUG_MENU = 1;
my $DEBUG_INDEX = 2;
my $DEBUG_TEXI = 4;
my $DEBUG_MACROS = 8;
my $DEBUG_FORMATS = 16;
my $DEBUG_ELEMENTS = 32;
my $DEBUG_USER = 64;
my $DEBUG_L2H = 128;
my $ERROR = "***"; # prefix for errors
my $WARN = "**"; # prefix for warnings
my $VARRE = '[\w\-]+'; # RE for a variable name
my $NODERE = '[^:]+'; # RE for node names
my $MAX_LEVEL = 4;
my $MIN_LEVEL = 1;
#+++###########################################################################
# #
# Initialization #
# Some declarations, some functions that are GPL and therefore cannot be in #
# texi2html.init, some functions that are not to be customized. #
# Pasted content of File $(srcdir)/texi2html.init: Default initializations #
# #
#---###########################################################################
{
package Texi2HTML::Config;
sub load($)
{
my $file = shift;
eval { require($file) ;};
if ($@ ne '')
{
print STDERR "error loading $file: $@\n";
return 0;
}
return 1;
}
# customization options variables
use vars qw(
$DEBUG
$PREFIX
$VERBOSE
$SUBDIR
$IDX_SUMMARY
$SPLIT
$SHORT_REF
@EXPAND
$EXPAND
$TOP
$DOCTYPE
$FRAMESET_DOCTYPE
$ERROR_LIMIT
$CHECK
$TEST
$DUMP_TEXI
$MACRO_EXPAND
$USE_GLOSSARY
$INVISIBLE_MARK
$USE_ISO
$TOP_FILE
$TOC_FILE
$FRAMES
$SHOW_MENU
$NUMBER_SECTIONS
$USE_NODES
$USE_SECTIONS
$USE_NODE_TARGET
$USE_UNICODE
$USE_UNIDECODE
$TRANSLITERATE_NODE
$NODE_FILES
$NODE_NAME_IN_MENU
$AVOID_MENU_REDUNDANCY
$SECTION_NAVIGATION
$MONOLITHIC
$SHORTEXTN
$EXTENSION
$OUT
$NOVALIDATE
$DEF_TABLE
$LANG
$DO_CONTENTS
$DO_SCONTENTS
$SEPARATED_FOOTNOTES
$TOC_LINKS
$L2H
$L2H_L2H
$L2H_SKIP
$L2H_TMP
$L2H_CLEAN
$L2H_FILE
$L2H_HTML_VERSION
$EXTERNAL_DIR
@INCLUDE_DIRS
@PREPEND_DIRS
@CONF_DIRS
$IGNORE_PREAMBLE_TEXT
@CSS_FILES
@CSS_REFS
$INLINE_CONTENTS
$INLINE_INSERTCOPYING
);
# customization variables
# ENCODING is deprecated
use vars qw(
$ENCODING
$ENCODING_NAME
$DOCUMENT_ENCODING
$OUT_ENCODING
$IN_ENCODING
$DEFAULT_ENCODING
$MENU_PRE_STYLE
$MENU_PRE_COMPLEX_FORMAT
$CENTER_IMAGE
$EXAMPLE_INDENT_CELL
$SMALL_EXAMPLE_INDENT_CELL
$SMALL_FONT_SIZE
$SMALL_RULE
$DEFAULT_RULE
$MIDDLE_RULE
$BIG_RULE
$TOP_HEADING
$INDEX_CHAPTER
$SPLIT_INDEX
$HREF_DIR_INSTEAD_FILE
$USE_MENU_DIRECTIONS
$USE_UP_FOR_ADJACENT_NODES
$AFTER_BODY_OPEN
$PRE_BODY_CLOSE
$EXTRA_HEAD
$VERTICAL_HEAD_NAVIGATION
$WORDS_IN_PAGE
$ICONS
$UNNUMBERED_SYMBOL_IN_MENU
$SIMPLE_MENU
$MENU_SYMBOL
$USE_ACCESSKEY
$USE_REL_REV
$USE_LINKS
$OPEN_QUOTE_SYMBOL
$CLOSE_QUOTE_SYMBOL
$NO_BULLET_LIST_STYLE
$NO_BULLET_LIST_ATTRIBUTE
$TOP_NODE_FILE
$TOP_NODE_UP
$NODE_FILE_EXTENSION
$BEFORE_OVERVIEW
$AFTER_OVERVIEW
$BEFORE_TOC_LINES
$AFTER_TOC_LINES
$NEW_CROSSREF_STYLE
$TOP_HEADING_AT_BEGINNING
$USER
$USE_NUMERIC_ENTITY
$USE_SETFILENAME
$SEPARATE_DESCRIPTION
$IGNORE_BEFORE_SETFILENAME
$OVERVIEW_LINK_TO_TOC
$COMPLETE_IMAGE_PATHS
$DATE
%ACTIVE_ICONS
%NAVIGATION_TEXT
%PASSIVE_ICONS
%BUTTONS_NAME
%BUTTONS_GOTO
%BUTTONS_EXAMPLE
%BUTTONS_ACCESSKEY
%BUTTONS_REL
@CHAPTER_BUTTONS
@MISC_BUTTONS
@SECTION_BUTTONS
@SECTION_FOOTER_BUTTONS
@NODE_FOOTER_BUTTONS
@LINKS_BUTTONS
@IMAGE_EXTENSIONS
);
# customization variables which may be guessed in the script
#our $ADDRESS;
use vars qw(
$BODYTEXT
$CSS_LINES
$DOCUMENT_DESCRIPTION
$EXTERNAL_CROSSREF_SPLIT
);
# I18n
use vars qw(
$I
$LANGUAGES
);
# customizable subroutines references
use vars qw(
$print_section
$one_section
$end_section
$print_Top_header
$print_Top_footer
$print_Top
$print_Toc
$print_Overview
$print_Footnotes
$print_About
$print_misc_header
$print_misc_footer
$print_misc
$print_section_header
$print_section_footer
$print_chapter_header
$print_chapter_footer
$print_element_header
$print_page_head
$print_page_foot
$print_head_navigation
$print_foot_navigation
$button_icon_img
$print_navigation
$about_body
$print_frame
$print_toc_frame
$toc_body
$titlepage
$insertcopying
$css_lines
$print_redirection_page
$translate_names
$init_out
$finish_out
$node_file_name
$element_file_name
$node_target_name
$element_target_name
$placed_target_file_name
$inline_contents
$program_string
$preserve_misc_command
$protect_text
$anchor
$anchor_label
$element_label
$misc_element_label
$def_item
$def
$menu
$menu_command
$menu_link
$menu_description
$menu_comment
$simple_menu_link
$ref_beginning
$info_ref
$book_ref
$external_href
$external_ref
$internal_ref
$table_item
$table_line
$row
$cell
$list_item
$comment
$def_line
$def_line_no_texi
$heading_no_texi
$raw
$raw_no_texi
$heading
$element_heading
$paragraph
$preformatted
$foot_line_and_ref
$foot_section
$address
$image
$image_files
$index_entry_label
$index_entry
$index_entry_command
$index_letter
$print_index
$printindex
$index_summary
$summary_letter
$complex_format
$cartouche
$sp
$definition_category
$definition_index_entry
$table_list
$copying_comment
$documentdescription
$index_summary_file_entry
$index_summary_file_end
$index_summary_file_begin
$style
$format
$normal_text
$empty_line
$unknown
$unknown_style
$float
$caption_shortcaption
$caption_shortcaption_command
$listoffloats
$listoffloats_entry
$listoffloats_caption
$listoffloats_float_style
$listoffloats_style
$acronym_like
$quotation
$quotation_prepend_text
$paragraph_style_command
$heading_texi
$index_element_heading_texi
$format_list_item_texi
$begin_format_texi
$begin_style_texi
$begin_paragraph_texi
$tab_item_texi
$colon_command
$simple_command
$thing_command
$begin_special_region
$end_special_region
$PRE_ABOUT
$AFTER_ABOUT
);
# hash which entries might be redefined by the user
use vars qw(
$complex_format_map
%accent_map
%def_map
%format_map
%simple_map
%simple_map_pre
%simple_map_texi
%simple_map_math
%simple_map_pre_math
%simple_map_texi_math
%style_map
%style_map_pre
%style_map_texi
%simple_format_simple_map_texi
%simple_format_style_map_texi
%simple_format_texi_map
%command_type
%paragraph_style
%stop_paragraph_command
%format_code_style
%region_formats_kept
%texi_formats_map
%things_map
%pre_map
%texi_map
%unicode_map
%unicode_diacritical
%transliterate_map
%transliterate_accent_map
%no_transliterate_map
%ascii_character_map
%ascii_simple_map
%ascii_things_map
%numeric_entity_map
%perl_charset_to_html
%misc_pages_targets
%iso_symbols
%misc_command
%no_paragraph_commands
%css_map
%format_in_paragraph
%special_list_commands
%accent_letters
%unicode_accents
%special_accents
%inter_item_commands
$def_always_delimiters
$def_in_type_delimiters
$def_argument_separator_delimiters
%colon_command_punctuation_characters
@command_handler_init
@command_handler_process
@command_handler_finish
%command_handler
%special_style
);
# subject to change
use vars qw(
%makeinfo_encoding_to_map
%makeinfo_unicode_to_eight_bit
%eight_bit_to_unicode
%t2h_encoding_aliases
);
# needed in this namespace for translations
$I = \&Texi2HTML::I18n::get_string;
#
# Function refs covered by the GPL as part of the texi2html.pl original
# code. As such they cannot appear in texi2html.init which is public
# domain (at least the things coded by me, and, if I'm not wrong also the
# things coded by Olaf -- Pat).
#
$toc_body = \&T2H_GPL_toc_body;
$style = \&T2H_GPL_style;
$format = \&T2H_GPL_format;
$printindex = \&t2h_GPL_default_printindex;
$summary_letter = \&t2h_default_summary_letter;
sub T2H_GPL_toc_body($)
{
my $elements_list = shift;
return unless ($Texi2HTML::THISDOC{'DO_CONTENTS'} or
$Texi2HTML::THISDOC{'DO_SCONTENTS'} or $FRAMES);
my $current_level = 0;
my $ul_style = $NUMBER_SECTIONS ? $NO_BULLET_LIST_ATTRIBUTE : '';
foreach my $element (@$elements_list)
{
next if ($element->{'top'});
my $ind = ' ' x $current_level;
my $level = $element->{'toc_level'};
print STDERR "Bug no toc_level for ($element) $element->{'texi'}\n" if (!defined ($level));
if ($level > $current_level)
{
while ($level > $current_level)
{
$current_level++;
my $ln = "\n$ind<ul${ul_style}>\n";
$ind = ' ' x $current_level;
push(@{$Texi2HTML::TOC_LINES}, $ln);
}
}
elsif ($level < $current_level)
{
while ($level < $current_level)
{
$current_level--;
$ind = ' ' x $current_level;
my $line = "</li>\n$ind</ul>";
$line .= "</li>" if ($level == $current_level);
push(@{$Texi2HTML::TOC_LINES}, "$line\n");
}
}
else
{
push(@{$Texi2HTML::TOC_LINES}, "</li>\n");
}
# if there is more than one toc, in different files, the toc in
# the file different from $Texi2HTML::THISDOC{'toc_file'} may have
# wrong links, that is links that point to the same file and are
# therefore empty, although the section isn't in the current file,
# since it is in $Texi2HTML::THISDOC{'toc_file'}.
my $dest_for_toc = $element->{'file'};
my $dest_for_stoc = $element->{'file'};
my $dest_target_for_stoc = $element->{'target'};
if ($Texi2HTML::Config::OVERVIEW_LINK_TO_TOC)
{
$dest_for_stoc = $Texi2HTML::THISDOC{'toc_file'};
$dest_target_for_stoc = $element->{'tocid'};
}
$dest_for_toc = '' if ($dest_for_toc eq $Texi2HTML::THISDOC{'toc_file'});
$dest_for_stoc = '' if ($dest_for_stoc eq $Texi2HTML::THISDOC{'stoc_file'});
my $text = $element->{'text'};
#$text = $element->{'name'} unless ($NUMBER_SECTIONS);
my $toc_entry = "<li>" . &$anchor ($element->{'tocid'}, "$dest_for_toc#$element->{'target'}",$text);
my $stoc_entry = "<li>" . &$anchor ($element->{'stocid'}, "$dest_for_stoc#$dest_target_for_stoc",$text);
push (@{$Texi2HTML::TOC_LINES}, $ind . $toc_entry);
push(@{$Texi2HTML::OVERVIEW}, $stoc_entry. "</li>\n") if ($level == 1);
}
while (0 < $current_level)
{
$current_level--;
my $ind = ' ' x $current_level;
push(@{$Texi2HTML::TOC_LINES}, "</li>\n$ind</ul>\n");
}
@{$Texi2HTML::TOC_LINES} = () unless ($Texi2HTML::THISDOC{'DO_CONTENTS'});
if (@{$Texi2HTML::TOC_LINES})
{
unshift @{$Texi2HTML::TOC_LINES}, $BEFORE_TOC_LINES;
push @{$Texi2HTML::TOC_LINES}, $AFTER_TOC_LINES;
}
@{$Texi2HTML::OVERVIEW} = () unless ($Texi2HTML::THISDOC{'DO_SCONTENTS'} or $FRAMES);
if (@{$Texi2HTML::OVERVIEW})
{
unshift @{$Texi2HTML::OVERVIEW}, "<ul${ul_style}>\n";
push @{$Texi2HTML::OVERVIEW}, "</ul>\n";
unshift @{$Texi2HTML::OVERVIEW}, $BEFORE_OVERVIEW;
push @{$Texi2HTML::OVERVIEW}, $AFTER_OVERVIEW;
}
}
sub T2H_GPL_style($$$$$$$$$)
{ # known style
my $style = shift;
my $command = shift;
my $text = shift;
my $args = shift;
my $no_close = shift;
my $no_open = shift;
my $line_nr = shift;
my $state = shift;
my $style_stack = shift;
my $do_quotes = 0;
my $use_attribute = 0;
my $use_begin_end = 0;
if (ref($style) eq 'HASH')
{
#print STDERR "GPL_STYLE $command ($style)\n";
#print STDERR " @$args\n";
if (ref($style->{'args'}) ne 'ARRAY')
{
print STDERR "BUG: args not an array for command `$command'\n";
}
$do_quotes = $style->{'quote'};
if ((@{$style->{'args'}} == 1) and defined($style->{'attribute'}))
{
$style = $style->{'attribute'};
$use_attribute = 1;
$text = $args->[0];
}
elsif (defined($style->{'function'}))
{
$text = &{$style->{'function'}}($command, $args, $style_stack, $state, $line_nr);
}
}
else
{
if ($style =~ s/^\"//)
{ # add quotes
$do_quotes = 1;
}
if ($style =~ s/^\&//)
{ # custom
$style = 'Texi2HTML::Config::' . $style;
eval "\$text = &$style(\$text, \$command, \$style_stack)";
}
elsif ($style ne '')
{
$use_attribute = 1;
}
else
{ # no style
}
}
if ($use_attribute)
{ # good style
my $attribute_text = '';
if ($style =~ /^(\w+)(\s+.*)/)
{
$style = $1;
$attribute_text = $2;
}
# $text = "<${style}$attribute_text>$text</$style>" ;
$text = "<${style}$attribute_text>" . "$text" if (!$no_open);
$text .= "</$style>" if (!$no_close);
if ($do_quotes)
{
$text = $OPEN_QUOTE_SYMBOL . "$text" if (!$no_open);
$text .= $CLOSE_QUOTE_SYMBOL if (!$no_close);
}
}
if (ref($style) eq 'HASH')
{
if (defined($style->{'begin'}) and !$no_open)
{
$text = $style->{'begin'} . $text;
}
if (defined($style->{'end'}) and !$no_close)
{
$text = $text . $style->{'end'};
}
}
if ($do_quotes and !$use_attribute)
{
$text = $OPEN_QUOTE_SYMBOL . "$text" if (!$no_open);
$text .= $CLOSE_QUOTE_SYMBOL if (!$no_close);
}
return $text;
}
sub T2H_GPL_format($$$)
{
my $tag = shift;
my $element = shift;
my $text = shift;
return '' if (!defined($element) or ($text !~ /\S/));
return $text if ($element eq '');
my $attribute_text = '';
if ($element =~ /^(\w+)(\s+.*)/)
{
$element = $1;
$attribute_text = $2;
}
return "<${element}$attribute_text>\n" . $text. "</$element>\n";
}
my $t2h_default_file_number;
my $t2h_default_index_page_nr;
#my %t2h_default_element_indices;
my %t2h_default_index_letters_hash;
my %t2h_default_index_letters_array;
my %t2h_default_seen_files;
my $t2h_default_element_split_printindices;
my %t2h_default_split_files;
# FIXME call it where indices are split in main program
sub t2h_default_init_split_indices ()
{
#print STDERR "Do splitting of index letters, once.\n";
push @command_handler_process, \&t2h_default_index_rearrange_directions;
%t2h_default_index_letters_hash = ();
%t2h_default_index_letters_array = ();
%t2h_default_seen_files = ();
%t2h_default_split_files = ();
$t2h_default_element_split_printindices = undef;
$t2h_default_index_page_nr = 0;
$t2h_default_file_number = 0;
foreach my $index_name (keys %{$Texi2HTML::THISDOC{'indices'}})
{
#print STDERR "Gathering and sorting $index_name letters\n";
foreach my $key (keys %{$Texi2HTML::THISDOC{'indices'}->{$index_name}->[0]->{'entries'}})
{
my $letter = uc(substr($key, 0, 1));
$t2h_default_index_letters_hash{$index_name}->{$letter}->{$key} = $Texi2HTML::THISDOC{'indices'}->{$index_name}->[0]->{'entries'}->{$key};
}
my $entries_count = 0;
my @letters = ();
# use cmp if only letters or only symbols, otherwise symbols before
# letters
foreach my $letter (sort {
((($a =~ /^[[:alpha:]]/ and $b =~ /^[[:alpha:]]/) or
($a !~ /^[[:alpha:]]/ and $b !~ /^[[:alpha:]]/)) && $a cmp $b)
|| ($a =~ /^[[:alpha:]]/ && 1) || -1 } (keys(%{$t2h_default_index_letters_hash{$index_name}})))
{
my $letter_entry = {'letter' => $letter };
foreach my $key (sort {uc($a) cmp uc($b)} (keys(%{$t2h_default_index_letters_hash{$index_name}->{$letter}})))
{
push @{$letter_entry->{'entries'}}, $t2h_default_index_letters_hash{$index_name}->{$letter}->{$key};
}
push @letters, $letter_entry;
$entries_count += scalar(@{$letter_entry->{'entries'}});
#if ($SPLIT and $SPLIT_INDEX and $entries_count >= $SPLIT_INDEX)
# FIXME this is not right, above is right
# Don't split if document is not split
if ($SPLIT and $SPLIT_INDEX and $entries_count > $SPLIT_INDEX)
{
push @{$t2h_default_index_letters_array{$index_name}}, [ @letters ];
@letters = ();
$entries_count = 0;
}
}
push @{$t2h_default_index_letters_array{$index_name}}, [ @letters ] if (scalar(@letters));
}
}
sub t2h_default_associate_index_element($$$$)
{
my $element = shift;
my $is_top = shift;
my $docu_name = shift;
my $use_node_file = shift;
my ($file, $default_element_file);
if ($SPLIT)
{
# respect the default splitting
$default_element_file = $element->{'file'};
if ($t2h_default_seen_files{$default_element_file})
{
$file = $t2h_default_seen_files{$default_element_file};
}
else
{
if ($is_top eq 'top')
{
$file = $default_element_file;
}
else
{
$file = "${docu_name}_$t2h_default_file_number";
$file .= '.' . $Texi2HTML::THISDOC{'extension'} if
(defined($Texi2HTML::THISDOC{'extension'}));
}
$t2h_default_file_number++;
$t2h_default_seen_files{$default_element_file} = $file;
}
}
my $modify_file = ($SPLIT and (!$use_node_file or $t2h_default_split_files{$default_element_file}));
$element->{'file'} = $file if ($modify_file);
my $current_element = $element;
#print STDERR "Doing printindices for $element $element->{'texi'}, file $file (@{$element->{'place'}})\n";
my @places = @{$element->{'place'}};
@{$element->{'place'}} = ();
foreach my $place (@places)
{
unless ($place->{'command'} and $place->{'command'} eq 'printindex')
{
#print STDERR "HHHHHHHHH ($element->{'texi'}) place: $place->{'texi'}, current: $current_element->{'texi'}, $current_element->{'file'}\n";
push @{$current_element->{'place'}}, $place;
$place->{'file'} = $current_element->{'file'};
$place->{'element_ref'} = $current_element if ($place->{'element_ref'} and $current_element ne $element);
next;
}
my $printindex = $place;
my $index_name = $printindex->{'name'};
#print STDERR "Associate letters in $element->{'texi'} for $index_name\n";
my @letter_groups = ();
# empty index
next if (!exists($t2h_default_index_letters_array{$index_name}));
my @letters_split = @{$t2h_default_index_letters_array{$index_name}};
# index is not split
if (scalar(@letters_split) eq 1)
{
push @{$letter_groups[0]->{'letters'}}, @{$letters_split[0]};
}
# the element is at the level of splitting, then we split according to
# INDEX_SPLIT
elsif (!$element->{'top'} and $SPLIT and (($SPLIT eq 'node') or (defined($element->{'level'}) and $element->{'level'} <= $Texi2HTML::THISDOC{'split_level'})))
{
$t2h_default_split_files{$default_element_file} = 1;
foreach my $letters_split (@letters_split)
{
push @letter_groups, {'letters' => [@$letters_split]};
}
}
else
{ # we 'unsplit' index split if not located where document is indeed split
#print STDERR "UNSPLIT $element->{'texi'}, $index_name\n";
foreach my $letters_split (@letters_split)
{
push @{$letter_groups[0]->{'letters'}}, @$letters_split;
}
}
$letter_groups[0]->{'element'} = $current_element;
# may only happen if SPLIT
if (scalar(@letter_groups) > 1)
{ # this weird construct is there because the element use as a key is
# converted to a string by perl, losing its meaning as a reference,
# the reference must be recorded explicitly
$t2h_default_element_split_printindices->{$element}->{'element'} = $element;
push @{$t2h_default_element_split_printindices->{$element}->{'printindices'}}, $printindex;
#print STDERR "Pushing $element, $element->{'texi'}, $printindex\n";
foreach my $split_group (@letter_groups)
{
my $first_letter = $split_group->{'letters'}->[0]->{'letter'};
my $last_letter = $split_group->{'letters'}->[-1]->{'letter'};
if (!$split_group->{'element'})
{
#construct new element name
my $letters_heading;
if ($last_letter ne $first_letter)
{
$letters_heading = &$normal_text("$first_letter -- $last_letter");
}
else
{
$letters_heading = &$normal_text("$first_letter");
}
my ($name, $simple);
my $texi = "ADDED ELEMENT $element->{'texi'}: $letters_heading";
if (!defined($element->{'text'}))
{
my $element_heading_texi = &$heading_texi($element->{'tag'}, $element->{'texi'}, $element->{'number'});
my $heading_texi = &$index_element_heading_texi(
$element_heading_texi,
$element->{'tag'},
$element->{'texi'},
$element->{'number'},
$first_letter, $last_letter);
$name = main::substitute_line($heading_texi);
$simple = main::simple_format(undef,undef,$heading_texi);
}
else
{ # should never happen
$name = "$element->{'text'}: $letters_heading";
$simple = "$element->{'simple_format'}: $letters_heading";
}
#file and id
my $relative_file = $Texi2HTML::THISDOC{'file_base_name'} . '_' . $t2h_default_file_number;
$t2h_default_file_number++;
$relative_file .= '.' . $Texi2HTML::THISDOC{'extension'} if
(defined($Texi2HTML::THISDOC{'extension'}));
my $id = "index_split-$t2h_default_index_page_nr";
$t2h_default_index_page_nr++;
my $new_element = { 'file' => $relative_file, 'id' => $id, 'target' => $id, 'text' => $name, 'texi' => $texi, 'seen' => 1, 'simple_format' => $simple };
$split_group->{'element'} = $new_element;
$current_element = $new_element;
#print STDERR "Added $new_element->{'file'} for $new_element->{'texi'} ($first_letter:$last_letter)\n";
}
else
{ # this is the first index split, it is still associated with the element
#print STDERR "No file added for ($first_letter:$last_letter)\n";
}
}
$t2h_default_seen_files{$default_element_file} = $current_element->{'file'};
}
else
{
push @{$current_element->{'place'}}, $place;
}
$printindex->{'split_groups'} = \@letter_groups;
#print STDERR "$index_name processed for $element, $element->{'texi'} (@{$printindex->{'split_groups'}})\n";
}
return $file if ($modify_file);
return undef;
}
sub t2h_default_index_rearrange_directions()
{
return if (!defined($t2h_default_element_split_printindices));
foreach my $element_string (keys(%$t2h_default_element_split_printindices))
{
my $element = $t2h_default_element_split_printindices->{$element_string}->{'element'};
my $current_element = $element;
#print STDERR " E Processing $element_string,$current_element $current_element->{'texi'}\n";
foreach my $printindex (@{$t2h_default_element_split_printindices->{$element_string}->{'printindices'}})
{
#print STDERR " I Processing $printindex $printindex->{'name'} (@{$printindex->{'split_groups'}})\n";
foreach my $split_group (@{$printindex->{'split_groups'}})
{
my $first_letter = $split_group->{'letters'}->[0]->{'letter'};
my $last_letter = $split_group->{'letters'}->[-1]->{'letter'};
my $new_element = $split_group->{'element'};
next if ($current_element eq $new_element);
#print STDERR " G Processing ($first_letter:$last_letter) in $element->{'texi'}, index $printindex->{'name'}: $new_element->{'texi'}\n";
$new_element->{'This'} = $new_element;
if ($current_element->{'Forward'})
{
$current_element->{'Forward'}->{'Back'} = $new_element;
$new_element->{'Forward'} = $current_element->{'Forward'};
}
$current_element->{'Forward'} = $new_element;
$new_element->{'Back'} = $current_element;
if ($current_element->{'Following'})
{
#print STDERR "F: C($current_element): $current_element->{'texi'}, N($new_element): $new_element->{'texi'} -- C->F: $current_element->{'Following'}->{'texi'}\n";
$new_element->{'Following'} = $current_element->{'Following'};
$current_element->{'Following'} = $new_element;
}
foreach my $key ('FastForward', 'FastBack', 'Up', 'tag_level', 'tag',
'level', 'node')
{
$new_element->{$key} = $element->{$key} if (defined($element->{$key}));
}
$current_element = $new_element;
}
}
}
}
# not needed to initialize it for a document, since it is reset
# in index_summary
my $t2h_symbol_indices = 0;
# format a letter appearing in a summary for an index. The letter links to
# the place where the index elements beginning with this letter are (called
# a letter entry).
#
# arguments:
# letter
# file where the target letter entry is
# identifier for the target letter entry
# This should better be in texi2html.init, but $t2h_symbol_indices
# has to be in the same file scope than printindeex.
sub t2h_default_summary_letter($$$$$$$)
{
my $letter = shift;
my $file = shift;
my $default_identifier = shift;
my $index_element_id = shift;
my $number = shift;
my $index_element = shift;
my $index_name = shift;
my $is_symbol = $letter !~ /^[A-Za-z]/;
my $identifier = $default_identifier;
if ($NEW_CROSSREF_STYLE)
{
if ($is_symbol)
{
$t2h_symbol_indices++;
$identifier = $index_element_id . "_${index_name}_symbol-$t2h_symbol_indices";
}
else
{
$identifier = $index_element_id . "_${index_name}_letter-${letter}";
}
}
my $result = &$anchor('', $file . '#' . $identifier, '<b>' . &$protect_text($letter) . '</b>', 'class="summary-letter"');
return $result unless ($NEW_CROSSREF_STYLE);
return ($result, $identifier, $is_symbol);
}
# this replaces do_index_page
# args should be:
# index_name
sub t2h_GPL_default_printindex($)
{
my $index_name = shift;
my %letter_entries;
my $identifier_index_nr = 0;
# could be cross verified with argument
my $printindex = shift @{$Texi2HTML::THISDOC{'printindices'}};
if ($printindex->{'name'} ne $index_name)
{
print STDERR "BUG: THISDOC{'printindices'} $printindex->{'name'} ne $index_name\n";
}
#print STDERR "Doing printindex $index_name\n";
return '' if (! defined($printindex->{'split_groups'}));
my @split_letters = @{$printindex->{'split_groups'}};
return '' if (!scalar(@split_letters));
foreach my $split_group (@split_letters)
{
#do summmary
my @non_alpha = ();
my @alpha = ();
my $file = $split_group->{'element'}->{'file'};
# letter_id could be done once for all instead of for each split_group
# and outside of t2h_default_summary_letter (or t2h_default_summary_letter
# could be simplified and inlined
my %letter_id;
foreach my $summary_split_group (@split_letters)
{
foreach my $letter_entry (@{$summary_split_group->{'letters'}})
{
my $letter = $letter_entry->{'letter'};
#my $letter = $letter_entry;
my $dest_file = '';
$dest_file = $summary_split_group->{'element'}->{'file'}
if ($summary_split_group ne $split_group);
my $index_element_id = $summary_split_group->{'element'}->{'id'};
my $default_identifier = $index_element_id . "_$identifier_index_nr";
$identifier_index_nr++;
my ($result, $identifier, $is_symbol) =
&$summary_letter($letter, $dest_file, $default_identifier, $index_element_id, '', '', $index_name);
$identifier = $default_identifier if (!defined($identifier));
$letter_id{$letter} = $identifier;
$is_symbol = $letter !~ /^[A-Za-z]/ if (!defined($is_symbol));
if ($is_symbol)
{
push @non_alpha, $result;
}
else
{
push @alpha, $result;
}
}
}
my $summary = &$index_summary(\@alpha, \@non_alpha);
# reset symbols numbering
$t2h_symbol_indices = 0;
my $letters_text = '';
foreach my $letter_entry (@{$split_group->{'letters'}})
{
my $letter = $letter_entry->{'letter'};
my $entries_text = '';
#foreach my $entry (@{$letter_entries{$letter}->{'entries'}})
foreach my $index_entry_ref (@{$letter_entry->{'entries'}})
{
#my $entry_infos = main::get_index_entry_infos($index_entry, $split_group->{'element'});
#my ($text_href, $entry, $element_href, $element_text, $entry_file, $element_file, $entry_target, $entry_element_target) = @$entry_infos;
my ($text_href, $entry_file, $element_file, $entry_target,
$entry_element_target, $formatted_entry, $element_href, $entry_element_text)
= main::get_index_entry_infos($index_entry_ref, $split_group->{'element'});
$entries_text .= &$index_entry ($text_href, $formatted_entry, $element_href, $entry_element_text, $entry_file, $element_file, $entry_target, $entry_element_target);
}
$letters_text .= &$index_letter ($letter, $letter_id{$letter}, $entries_text)
}
my $index_text = &$print_index($letters_text, $index_name);
$split_group->{'text'} = $summary . $index_text . $summary;
# print STDERR " ---> $index_name @{$split_group->{'letters'}}
# * elt: $split_group->{'element'}->{'id'}, $split_group->{'element'}->{'file'}, $split_group->{'element'}->{'name'}
# * directions: B: $split_group->{'element'}->{'Back'}->{'name'}, F: $split_group->{'element'}->{'Forward'}->{'name'}, FB: $split_group->{'element'}->{'FastBack'}->{'name'}, FF: $split_group->{'element'}->{'FastForward'}->{'name'}
# * text
#
#$split_group->{'text'}
#
#";
}
my $current_page = shift @split_letters;
if (!scalar(@split_letters))
{
return $current_page->{'text'};
}
while (1)
{
# print the index letters
push @{$Texi2HTML::THIS_SECTION}, $current_page->{'text'};
$current_page = shift @split_letters;
last if (!defined($current_page));
# end the previous element
main::finish_element ($Texi2HTML::THISDOC{'FH'}, $Texi2HTML::THIS_ELEMENT, $Texi2HTML::THIS_ELEMENT->{'Forward'}, 0);
# do the new element beginning
$Texi2HTML::THIS_ELEMENT = $current_page->{'element'};
main::do_element_directions($Texi2HTML::THIS_ELEMENT);
main::open_out_file($current_page->{'element'}->{'file'});
&$print_page_head($Texi2HTML::THISDOC{'FH'});
&$print_chapter_header($Texi2HTML::THISDOC{'FH'}, $Texi2HTML::THIS_ELEMENT) if $Texi2HTML::Config::SPLIT eq 'chapter';
&$print_section_header($Texi2HTML::THISDOC{'FH'}, $Texi2HTML::THIS_ELEMENT) if $Texi2HTML::Config::SPLIT eq 'section';
@{$Texi2HTML::THIS_SECTION} = &$element_label($Texi2HTML::THIS_ELEMENT->{'id'}, $Texi2HTML::THIS_ELEMENT, undef, undef);
push @{$Texi2HTML::THIS_SECTION}, &$print_element_header(1, 0);
push @{$Texi2HTML::THIS_SECTION}, &$heading($Texi2HTML::THIS_ELEMENT);
}
return '';
}
# leave this within comments, and keep the require statement
# This way, you can directly run texi2html.pl, if
# $T2H_HOME/texi2html.init exists.
# @INIT@
# -*-perl-*-
######################################################################
# File: texi2html.init
#
# Default values for command-line arguments and for various customizable
# procedures are set in this file.
#
# A copy of this file is pasted into the beginning of texi2html by
# running './configure'.
#
# Copy this file, rename it and make changes to it, if you like.
# Afterwards, load the file with command-line
# option -init-file <your_init_file>
#
# $Id: texi2html.init,v 1.173 2009/01/01 22:35:10 pertusus Exp $
######################################################################
# The following variables can also be set by command-line options
#
#
# The default values are set in this file, texi2html.init and the content
# of this file is included at the beginning of the texi2html script file.
# Those values may be overrided by values set in $sysconfdir/texi2htmlrc
# and then by values set in $HOME/texi2htmlrc.
#
# command line switches may override these values, and values set in files
# specified by -init-file are also taken into account.
# values set in these files overwrite values set by the command-line
# options appearing before -init-file and might still be overwritten by
# command-line arguments following the -init-file option.
# -debug
# The integer value specifies what kind of debugging output is generated.
$DEBUG = 0;
# -doctype
# The value is the 'SystemLiteral' which identifies the canonical DTD
# for the document.
# Definition: The SystemLiteral is called the entity's system
# identifier. It is a URI, which may be used to retrieve the entity.
# See http://www.xml.com/axml/target.html#NT-ExternalID
$DOCTYPE = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">';
# -frameset-doctype
# When frames are used, this SystemLiteral identifies the DTD used for
# the file containing the frame description.
$FRAMESET_DOCTYPE = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html401/frameset.dtd">';
# -test
# If this value is true, some variables which should be dynamically generated
# (the date, the user running texi2html, the version of texi2html) are set to
# fix and given values. This is usefull in case the resulting manual is
# compared with a reference. For example this is used in the tests of test.sh.
$TEST = 0;
# -dump-texi
# This value is usefull for debugging purposes. The result of the first pass is
# put in <document name>.passtexi, the result of the second pass is put in
# <document name>.passfirst.
$DUMP_TEXI = 0;
# -expand
# the @EXPAND array contains the expanded section names.
@EXPAND = ('html');
# -invisible
# This seems obsolete and is not used anywhere.
# This was a workaround for a known bug of many WWW browsers, including
# netscape. This was used to create invisible destination in anchors.
$INVISIBLE_MARK = '';
# $INVISIBLE_MARK = '&#160;';
# -iso
# if this value is true, ISO8859 characters are used for special symbols
# (like copyright, etc).
$USE_ISO = 1;
# -I
# add a directory to the list of directories where @include files are
# searched for (besides the directory of the file). additional '-I'
# args are appended to this list.
# (APA: Don't implicitely search ., to conform with the docs!)
# my @INCLUDE_DIRS = (".");
@INCLUDE_DIRS = ();
# -P
# prepend a directory to the list of directories where @include files are
# searched for before the directory of the file. additional '-P'
# args are prepended to this list.
@PREPEND_DIRS = ();
# --conf-dir
# append to the files searched for init files.
@CONF_DIRS = ();
# -top-file
# This file name is used for the top-level file.
# The extension is set appropriately, if necessary.
# If empty, <basename of document>.html is used.
# Typically, you would set this to "index.html".
$TOP_FILE = '';
# -toc-file
# This file name is used for the table of contents. The
# extension is set appropriately, if necessary.
# If empty, <basename of document>_toc.html is used.
$TOC_FILE = '';
# -frames
# if the value is true, HTML 4.0 "frames" are used.
# A file describing the frame layout is generated, together with a file
# with the short table of contents.
$FRAMES = 0;
# -menu | -nomenu
# if the value is true the Texinfo menus are shown.
$SHOW_MENU = 1;
# -number | -nonumber
# if this is set the sections are numbered, and section names and numbers
# are used in references and menus (instead of node names).
$NUMBER_SECTIONS = 1;
# -use-nodes
# if this is set the nodes are used as sectionning elements.
# Otherwise the nodes are incorporated in sections.
#$USE_NODES = 0;
$USE_NODES = undef;
$USE_SECTIONS = 1;
# -node-files
# if this is set one file per node is generated, which can be a target for
# cross manual references.
$NODE_FILES = 0;
# -split section|chapter|node|none
# if $SPLIT is set to 'section' (resp. 'chapter') one html file per section
# (resp. chapter) is generated. If $SPLIT is set to 'node' one html file per
# node or sectionning element is generated. In all these cases separate pages
# for Top, Table of content (Toc), Overview and About are generated.
# Otherwise a monolithic html file that contains the whole document is
# created.
#$SPLIT = 'section';
$SPLIT = '';
# -sec-nav|-nosec-nav
# if this is set then navigation panels are printed at the beginning of each
# section.
# If the document is split at nodes then navigation panels are
# printed at the end if there were more than $WORDS_IN_PAGE words on page.
#
# Navigation panels are always printed at the beginning of output files.
#
# This is most useful if you do not want to have section navigation
# with -split chapter. There will be chapter navigation panel at the
# beginning and at the end of chapters anyway.
$SECTION_NAVIGATION = 1;
# -separated-footnotes
# if this is set footnotes are on a separated page. Otherwise they are at
# the end of each file (if the document is split).
$SEPARATED_FOOTNOTES = 1;
# -toc-links
# if this is set, links from headings to toc entries are created.
$TOC_LINKS = 0;
# -subdir
# If this is set, then put result files into the specified directory.
# If not set, then result files are put into the current directory.
#$SUBDIR = 'html';
$SUBDIR = '';
# -short-extn
# If this is set, then all HTML files will have extension ".htm" instead of
# ".html". This is helpful when shipping the document to DOS-based systems.
$SHORTEXTN = 0;
# -prefix
# This set the output file prefix, prepended to all .html, .gif and .pl files.
# By default, this is the basename of the document.
$PREFIX = '';
# -o filename
# If this is set a monolithic document is outputted into $filename.
$OUT = '';
# -no-validate
# suppress node cross-reference validation
$NOVALIDATE = 0;
# -short-ref
# if this is set cross-references are given without section numbers.
$SHORT_REF = '';
# -idx-sum
# if value is set, then for each @printindex <index name>
# <document name>_<index name>.idx is created which contains lines of the form
# key ref sorted alphabetically (case matters).
$IDX_SUMMARY = 0;
# -def-table
# If this is set a table construction for @def.... instead of definition
# lists.
# (New Option: 27.07.2000 Karl Heinz Marbaise)
$DEF_TABLE = 0;
# -verbose
# if this is set chatter about what we are doing.
$VERBOSE = '';
# -lang
# use &$I('my string') if you want to have translations of 'my string'
# and provide the translations in $LANGUAGES->{$LANG} with 'my string'
# as key.
# To add a new language use ISO 639 language codes (see e.g. perl module
# Locale-Codes-1.02 for definitions). Supply translations in the
# $LANGUAGES hash and put it in a file with $LANG as name in an i18n
# directory.
# This is used for the initial language, it is overriden during
# document processing if there is a @documentlanguage.
# It is ignored if the language is passed on the command line.
$LANG = 'en';
# -ignore-preamble-text
# If this is set the text before @node and sectionning commands is ignored.
$IGNORE_PREAMBLE_TEXT = 0;
# -html-xref-prefix
# base directory for external manuals.
#$EXTERNAL_DIR = '../';
$EXTERNAL_DIR = undef;
# -l2h
# if this is set, latex2html is used for generation of math content.
$L2H = '';
# -transliterate-file-names
# transliterate node names for external refs (and internal if NODE_FILES)
$TRANSLITERATE_NODE = 1;
# --error-limit
# quit after NUM errors (default 1000).
$ERROR_LIMIT = 1000;
# -monolithic
# output only one file including ToC. It only makes sense when not split
$MONOLITHIC = 1;
# -css-include
# All the specified css files are used. More precisely the @import sections
# are added to the beginning of the CSS_LINES the remaining is added at
# the end of the CSS_LINES (after the css rules generated by texi2html).
# cf texinfo manual for more info.
# - means STDIN
@CSS_FILES = ();
# -css-ref
# the specified url are used as stylesheet links
@CSS_REFS = ();
######################
# The following options are only relevant if $L2H is set
#
# -l2h-l2h
# name/location of latex2html program
$L2H_L2H = "latex2html";
# -l2h-skip
# If this is set the actual call to latex2html is skipped. The previously
# generated content is reused, instead.
$L2H_SKIP = '';
# -l2h-tmp
# If this is set l2h uses the specified directory for temporary files. The path
# leading to this directory may not contain a dot (i.e., a ".");
# otherwise, l2h will fail.
$L2H_TMP = '';
# -l2h-file
# If set, l2h uses the file as latex2html init file
$L2H_FILE = 'l2h.init';
# -l2h-clean
# if this is set the intermediate files generated by texi2html in relation with
# latex2html are cleaned (they all have the prefix <document name>_l2h_).
$L2H_CLEAN = 1;
##############################################################################
#
# The following can only be set in the init file
#
##############################################################################
# If true do table of contents even if there is no @content
$DO_CONTENTS = undef;
# If true do short table of contents even if there is no @shortcontent
$DO_SCONTENTS = undef;
# if set, output the contents where the command is located
$INLINE_CONTENTS = 0;
# if this variable is true, numeric entities are used when there is no
# corresponding textual entity.
$USE_NUMERIC_ENTITY = 1;
# if set, the image files are completed to be relative from the
# document directory, to the source manual directory and then to
# the image
$COMPLETE_IMAGE_PATHS = 0;
# if this variable is true, @setfilename is used if found to determine the
# out file name
$USE_SETFILENAME = 0;
# if true, begin outputting at @setfilename, if this command is present.
$IGNORE_BEFORE_SETFILENAME = 1;
# if true the link in Overview link to the corresponding Toc entry.
$OVERVIEW_LINK_TO_TOC = 0;
# if set always separate description and menu link, even in
# preformatted environment
$SEPARATE_DESCRIPTION = 0;
# if set, then use node names in menu entries, instead of section names
$NODE_NAME_IN_MENU = 0;
# if set, use node anchors for sections targets
$USE_NODE_TARGET = 1;
# new style for crossrefs
$NEW_CROSSREF_STYLE = 1;
# top heading is always at the beginning of the element.
$TOP_HEADING_AT_BEGINNING = 1;
# if set and menu entry equals menu description, then do not print
# menu description.
# Likewise, if node name equals entry name, do not print entry name.
$AVOID_MENU_REDUNDANCY = 1;
# if set, center @image by default
# otherwise, do not center by default
# Deprecated and not used anymore
$CENTER_IMAGE = 1;
# used as identation for block enclosing command @example, etc
# If not empty, must be enclosed in <td></td>
$EXAMPLE_INDENT_CELL = '<td>&nbsp;</td>';
# same as above, only for @small
$SMALL_EXAMPLE_INDENT_CELL = '<td>&nbsp;</td>';
# font size for @small
$SMALL_FONT_SIZE = '-1';
# horizontal rules
$SMALL_RULE = '<hr size="1">';
$DEFAULT_RULE = '<hr>';
$MIDDLE_RULE = '<hr size="2">';
$BIG_RULE = '<hr size="6">';
# 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)
$TOP_HEADING = '';
# if set, use this chapter for 'Index' button, else
# use first chapter with @printindex
$INDEX_CHAPTER = '';
# if set and $SPLIT is set, then split index pages at the next letter
# after they have more than that many entries
$SPLIT_INDEX = 100;
# symbol put at the beginning of nodes entry in menu (and optionnaly of
# unnumbered in menus, see next variable)
$MENU_SYMBOL = '&bull;';
#$MENU_SYMBOL = '*';
$SIMPLE_MENU = 0;
$OPEN_QUOTE_SYMBOL = "\`";
$CLOSE_QUOTE_SYMBOL = "'";
# if true put a $MENU_SYMBOL before unnumbered in menus
$UNNUMBERED_SYMBOL_IN_MENU = 0;
# extension for nodes files when NODE_FILES is true
$NODE_FILE_EXTENSION = 'html';
# extension
$EXTENSION = 'html';
# file name used for Top node when NODE_FILES is true
$TOP_NODE_FILE = 'index';
# node name used for Top node when automatic node directions are used
$TOP_NODE_UP = '(dir)';
# this controls the pre style for menus
$MENU_PRE_STYLE = 'font-family: serif';
# on bug-texinfo is has been said the the style is not code_style
# for menus (except for the node name).
# this controls the menu preformatted format
# FIXME this is not dynamic, so change in MENU_PRE_STYLE is not taken
# into account.
$MENU_PRE_COMPLEX_FORMAT = {
'pre_style' => $MENU_PRE_STYLE,
'class' => 'menu-preformatted',
# 'style' => 'code'
};
# This controls the ul style for toc
$NO_BULLET_LIST_STYLE = 'list-style: none';
$NO_BULLET_LIST_ATTRIBUTE = ' class="toc"';
# These lines are inserted before and after the shortcontents
$BEFORE_OVERVIEW = "<div class=\"shortcontents\">\n";
$AFTER_OVERVIEW = "</div>\n";
# These lines are inserted before and after the contents
$BEFORE_TOC_LINES = "<div class=\"contents\">\n";
$AFTER_TOC_LINES = "</div>\n";
# if set (e.g., to index.html) replace hrefs to this file
# (i.e., to index.html) by ./
# Obsolete. Worked around a bug that is fixed now.
$HREF_DIR_INSTEAD_FILE = '';
# text inserted after <body ...>
$AFTER_BODY_OPEN = '';
# text inserted before </body>, this will be automatically inside <p></p>
$PRE_BODY_CLOSE = '';
# this is added inside <head></head> after <title> and some <meta name>
# stuff, it can be used for eg. <style>, <script>, <meta> etc. tags.
$EXTRA_HEAD = '';
# Specifies the minimum page length required before a navigation panel
# is placed at the bottom of a page
# FIXME this is not true:
# THIS_WORDS_IN_PAGE holds number of words of current page
$WORDS_IN_PAGE = 300;
# if this is set a vertical navigation panel is used.
$VERTICAL_HEAD_NAVIGATION = 0;
# html version for latex2html
$L2H_HTML_VERSION = "4.0";
# use the information given by menus to complete the node directions
$USE_MENU_DIRECTIONS = 1;
# try up sections to complete the node directions
$USE_UP_FOR_ADJACENT_NODES = 1;
# use accesskey in hrefs
$USE_ACCESSKEY = 0;
# use rel= and rev= in hrefs. Currently only rel is used
$USE_REL_REV = 0;
# generate <link> elements in head
$USE_LINKS = 0;
# specify in this array which "buttons" should appear in which order
# in the navigation panel for sections; use ' ' for empty buttons (space)
@SECTION_BUTTONS =
(
'Back', 'Forward', ' ', 'FastBack', 'Up', 'FastForward',
' ', ' ', ' ', ' ',
'Top', 'Contents', 'Index', 'About',
);
# buttons for misc stuff
@MISC_BUTTONS = ('Top', 'Contents', 'Index', 'About');
# buttons for chapter file footers
# (and headers but only if SECTION_NAVIGATION is false)
@CHAPTER_BUTTONS =
(
'FastBack', 'FastForward', ' ',
' ', ' ', ' ', ' ',
'Top', 'Contents', 'Index', 'About',
);
# buttons for section file footers
@SECTION_FOOTER_BUTTONS =
(
'Back', 'Forward', ' ', 'FastBack', 'Up', 'FastForward'
);
@NODE_FOOTER_BUTTONS =
(
'Back', 'Forward', ' ', 'FastBack', 'Up', 'FastForward',
' ', ' ', ' ', ' ',
'Top', 'Contents', 'Index', 'About',
# 'Back', 'Forward', ' ', 'FastBack', 'Up', 'FastForward'
);
@LINKS_BUTTONS =
(
'Top', 'Index', 'Contents', 'About', 'Up', 'NextFile', 'PrevFile'
);
$ICONS = 0;
# insert here name of icon images for buttons
# Icons are used, if $ICONS and resp. value are set
%ACTIVE_ICONS =
(
'Top', '',
'Contents', '',
'Overview', '',
'Index', '',
'This', '',
'Back', '',
'FastBack', '',
'Prev', '',
'Up', '',
'Next', '',
'NodeUp', '',
'NodeNext', '',
'NodePrev', '',
'Following', '',
'Forward', '',
'FastForward', '',
'About' , '',
'First', '',
'Last', '',
'NextFile', '',
'PrevFile', '',
' ', '',
);
# insert here name of icon images for these, if button is inactive
%PASSIVE_ICONS =
(
'Top', '',
'Contents', '',
'Overview', '',
'Index', '',
'This', '',
'Back', '',
'FastBack', '',
'Prev', '',
'Up', '',
'Next', '',
'NodeUp', '',
'NodeNext', '',
'NodePrev', '',
'Following', '',
'Forward', '',
'FastForward', '',
'About', '',
'First', '',
'Last', '',
'NextFile', '',
'PrevFile', '',
);
@IMAGE_EXTENSIONS = ('png','jpg','jpeg','gif');
#, 'txt');
%misc_pages_targets = (
'Overview' => 'SEC_Overview',
'Contents' => 'SEC_Contents',
'Footnotes' => 'SEC_Foot',
'About' => 'SEC_About'
);
$init_out = \&t2h_default_init_out;
$finish_out = \&t2h_default_finish_out;
$translate_names = \&t2h_default_translate_names;
sub t2h_default_translate_names()
{
# Names of text as alternative for icons
# FIXME maybe get those in simple_format?
%NAVIGATION_TEXT =
(
'Top', &$I('Top'),
'Contents', &$I('Contents'),
'Overview', &$I('Overview'),
'Index', &$I('Index'),
' ', ' &nbsp; ',
'This', &$I('current'),
'Back', ' &lt; ',
'FastBack', ' &lt;&lt; ',
'Prev', &$I('Prev'),
'Up', &$I(' Up '),
'Next', &$I('Next'),
'NodeUp', &$I('Node up'),
'NodeNext', &$I('Next node'),
'NodePrev', &$I('Previous node'),
'Following', &$I('Following node'),
'Forward', ' &gt; ',
'FastForward', ' &gt;&gt; ',
'About', ' ? ',
'First', ' |&lt; ',
'Last', ' &gt;| ',
'NextFile', &$I('Next file'),
'PrevFile', &$I('Previous file'),
);
%BUTTONS_GOTO =
(
'Top', &$I('Cover (top) of document'),
'Contents', &$I('Table of contents'),
'Overview', &$I('Short table of contents'),
'Index', &$I('Index'),
'This', &$I('Current section'),
'Back', &$I('Previous section in reading order'),
'FastBack', &$I('Beginning of this chapter or previous chapter'),
'Prev', &$I('Previous section on same level'),
'Up', &$I('Up section'),
'Next', &$I('Next section on same level'),
'NodeUp', &$I('Up node'),
'NodeNext', &$I('Next node'),
'NodePrev', &$I('Previous node'),
'Following', &$I('Node following in node reading order'),
'Forward', &$I('Next section in reading order'),
'FastForward', &$I('Next chapter'),
'About' , &$I('About (help)'),
'First', &$I('First section in reading order'),
'Last', &$I('Last section in reading order'),
'NextFile', &$I('Forward section in next file'),
'PrevFile', &$I('Back section in previous file'),
);
%BUTTONS_NAME =
(
'Top', &$I('Top'),
'Contents', &$I('Contents'),
'Overview', &$I('Overview'),
'Index', &$I('Index'),
' ', ' ',
'This', &$I('This'),
'Back', &$I('Back'),
'FastBack', &$I('FastBack'),
'Prev', &$I('Prev'),
'Up', &$I('Up'),
'Next', &$I('Next'),
'NodeUp', &$I('NodeUp'),
'NodeNext', &$I('NodeNext'),
'NodePrev', &$I('NodePrev'),
'Following', &$I('Following'),
'Forward', &$I('Forward'),
'FastForward', &$I('FastForward'),
'About', &$I('About'),
'First', &$I('First'),
'Last', &$I('Last'),
'NextFile', &$I('NextFile'),
'PrevFile', &$I('PrevFile'),
);
%BUTTONS_ACCESSKEY =
(
'Top', '',
'Contents', '',
'Overview', '',
'Index', '',
'This', '',
'Back', 'p',
'FastBack', '',
'Prev', 'p',
'Up', 'u',
'Next', 'n',
'NodeUp', 'u',
'NodeNext', 'n',
'NodePrev', 'p',
'Following', '',
'Forward', 'n',
'FastForward', '',
'About' , '',
'First', '',
'Last', '',
'NextFile', '',
'PrevFile', '',
);
# see http://www.w3.org/TR/REC-html40/types.html#type-links
%BUTTONS_REL =
(
'Top', 'start',
'Contents', 'contents',
'Overview', '',
'Index', 'index',
'This', '',
'Back', 'previous',
'FastBack', '',
'Prev', 'previous',
'Up', 'up',
'Next', 'next',
'NodeUp', 'up',
'NodeNext', 'next',
'NodePrev', 'previous',
'Following', '',
'Forward', 'next',
'FastForward', '',
'About' , 'help',
'First', '',
'Last', '',
'NextFile', 'next',
'PrevFile', 'previous',
);
}
# is used in main program for dumping texi too.
sub t2h_default_set_out_encoding()
{
# these variables are used for the corresponding
# $Texi2HTML::THISDOC{'*_ENCODING'} to keep code shorter
my ($out_encoding, $encoding_name, $document_encoding);
if (defined($DOCUMENT_ENCODING))
{
$document_encoding = $DOCUMENT_ENCODING;
}
elsif (defined($Texi2HTML::THISDOC{'documentencoding'}))
{
$document_encoding = $Texi2HTML::THISDOC{'documentencoding'};
}
if (defined($OUT_ENCODING))
{
$out_encoding = $OUT_ENCODING;
}
if (defined($ENCODING_NAME))
{
$encoding_name = $ENCODING_NAME;
}
if (!defined($out_encoding) and (defined($encoding_name)))
{
$out_encoding = main::encoding_alias ($encoding_name);
$out_encoding = $encoding_name if (!defined($out_encoding));
}
if (!defined($out_encoding) and (defined($Texi2HTML::THISDOC{'IN_ENCODING'})))
{
$out_encoding = $Texi2HTML::THISDOC{'IN_ENCODING'};
}
if (!defined($out_encoding) and (defined($document_encoding)))
{
$out_encoding = main::encoding_alias ($document_encoding);
$out_encoding = $document_encoding if (!defined($out_encoding));
}
if (!defined($encoding_name))
{
if (defined($out_encoding) and defined($perl_charset_to_html{$out_encoding}))
{
$encoding_name = $perl_charset_to_html{$out_encoding};
}
elsif (defined($Texi2HTML::THISDOC{'IN_ENCODING'}) and defined($perl_charset_to_html{$Texi2HTML::THISDOC{'IN_ENCODING'}}))
{
$encoding_name = $perl_charset_to_html{$Texi2HTML::THISDOC{'IN_ENCODING'}};
}
elsif (defined($document_encoding) and defined($perl_charset_to_html{$document_encoding}))
{
$encoding_name = $perl_charset_to_html{$document_encoding};
}
elsif (defined($out_encoding))
{
$encoding_name = $out_encoding;
}
elsif (defined($Texi2HTML::THISDOC{'IN_ENCODING'}))
{
$encoding_name = $Texi2HTML::THISDOC{'IN_ENCODING'};
}
elsif (defined($document_encoding))
{
$encoding_name = $document_encoding;
}
elsif (defined($perl_charset_to_html{$DEFAULT_ENCODING}))
{
$encoding_name = $perl_charset_to_html{$DEFAULT_ENCODING};
}
else
{
$encoding_name = 'us-ascii';
}
}
$Texi2HTML::THISDOC{'OUT_ENCODING'} = $out_encoding;
$Texi2HTML::THISDOC{'ENCODING_NAME'} = $encoding_name;
$Texi2HTML::THISDOC{'DOCUMENT_ENCODING'} = $document_encoding;
$out_encoding = 'UNDEF' if (!defined($out_encoding));
my $in_encoding = $Texi2HTML::THISDOC{'IN_ENCODING'};
$in_encoding = 'UNDEF' if (!defined($in_encoding));
$document_encoding = 'UNDEF' if (!defined($document_encoding));
print STDERR "# Encodings: doc $document_encoding, in $in_encoding out $out_encoding, name $encoding_name\n" if ($VERBOSE);
}
my @t2h_default_multitable_stack;
# We have to do this dynamically because of internationalization and because
# in body $LANG could be used.
sub t2h_default_init_out()
{
@t2h_default_multitable_stack = ();
&$translate_names;
# Set the default body text, inserted between <body ... >
if (defined($BODYTEXT))
{
$Texi2HTML::THISDOC{'BODYTEXT'} = $BODYTEXT;
}
else
{
$Texi2HTML::THISDOC{'BODYTEXT'} = 'lang="' . $Texi2HTML::THISDOC{'current_lang'} . '" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000"';
}
if (!defined($EXTERNAL_CROSSREF_SPLIT))
{
if ($SPLIT)
{
$Texi2HTML::THISDOC{'EXTERNAL_CROSSREF_SPLIT'} = 1;
}
else
{
$Texi2HTML::THISDOC{'EXTERNAL_CROSSREF_SPLIT'} = 0;
}
}
else
{
$Texi2HTML::THISDOC{'EXTERNAL_CROSSREF_SPLIT'} = $EXTERNAL_CROSSREF_SPLIT;
}
t2h_default_set_out_encoding();
# not in code_style, according to post on bug-texinfo
if ($SIMPLE_MENU)
{
foreach my $format ('menu', 'detailmenu')
{
if (!defined($complex_format_map->{$format}))
{
$complex_format_map->{$format} = { 'begin' => q{''} , 'end' => q{''},
'pre_style' => "$MENU_PRE_STYLE", 'class' => 'menu-preformatted',
# 'style' => 'code'
};
}
}
#$SEPARATE_DESCRIPTION = 1;
#$format_map{'menu_comment'} = '' if (!defined($format_map{'menu_comment'}));
}
elsif (!defined($format_map{'menu_comment'}) and !defined($complex_format_map->{'menu_comment'}))
{
$complex_format_map->{'menu_comment'} =
{
'begin' => q{"<tr><th colspan=\"3\" align=\"left\" valign=\"top\">"},
'end' => q{"</th></tr>"}, 'pre_style' => "$MENU_PRE_STYLE", 'class' => 'menu-comment',
# 'style' => 'code'
}
}
# obsolete
#return $OUT_ENCODING;
};
sub t2h_default_finish_out()
{
}
#######################################################################
#
# Values guessed if not set here. The value used is in
# $Texi2HTML::THISDOC{'VARNAME'}
#
#######################################################################
$BODYTEXT = undef;
# default used in init_out for the setting of the ENCODING_NAME variable
$DEFAULT_ENCODING = 'utf8';
# In file encoding. The @documentencoding allows autodetection of
# that variable.
$DOCUMENT_ENCODING = undef;
# In file encoding, understandable by perl. Set according to DOCUMENT_ENCODING
$IN_ENCODING = undef;
# Formatted document encoding name. If undef, set in init_out based on
# $OUT_ENCODING or $DOCUMENT_ENCODING if they are defined
$ENCODING_NAME = undef;
# Out files encoding, understandable by perl. If undef, set in init_out
# using $ENCODING_NAME or $IN_ENCODING if they are defined
$OUT_ENCODING = undef;
# Used to set $Texi2HTML::THISDOC{'DOCUMENT_DESCRIPTION'}.
# if undef set to @documentdescription. If there is no @documentdescription,
# set in page_head.
$DOCUMENT_DESCRIPTION = undef;
# if undef $Texi2HTML::THISDOC{'EXTERNAL_CROSSREF_SPLIT'} set 1 if SPLIT,
# to 0 otherwise
$EXTERNAL_CROSSREF_SPLIT = undef;
$USER = undef;
$DATE = undef;
########################################################################
# 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
# $<fnc> variable.
# As a general interface, the hashes Texi2HTML::HREF, Texi2HTML::NAME, Texi2HTML::NODE, Texi2HTML::NO_TEXI, Texi2HTML::SIMPLE_TEXT hold
# href, html-name, node-name, name after removal of texi commands of
# This -- current section (resp. html page)
# Top -- top element
# Contents -- Table of contents element
# Overview -- Short table of contents element
# Index -- Index page element
# About -- page which explain "navigation buttons" element
# First -- first node element
# Last -- last node element
#
# Whether or not the following hash values are set, depends on the context
# (all values are w.r.t. 'This' section)
# Next -- next element of texinfo
# Prev -- previous element of texinfo
# NodeUp -- up node of texinfo
# Following -- following node in node reading order, taking menu into account
# Forward -- next node in reading order
# Back -- previous node in reading order
# Up -- parent given by sectionning commands
# 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:
# $Texi2HTML::THISDOC{title} -- title as set by @title...
# $Texi2HTML::THISDOC{title_no_texi} -- title without texi (without html elements)
# $Texi2HTML::THISDOC{title_texi} -- title with texinfo @-commands
# $Texi2HTML::THISDOC{fulltitle} -- full title as set by @title...
# $Texi2HTML::THISDOC{subtitle} -- subtitle as set by @subtitle
# $Texi2HTML::THISDOC{author} -- author as set by @author
# $Texi2HTML::THISDOC{copying_comment} -- text of @copying and @end copying in comment
#
# $Texi2HTML::THISDOC{program} -- name and version of texi2html
# $Texi2HTML::THISDOC{program_homepage} -- homepage for texi2html
# $Texi2HTML::THISDOC{program_authors} -- authors of texi2html
# $Texi2HTML::THISDOC{today} -- date formatted with pretty_date
# $Texi2HTML::THISDOC{toc_file} -- table of contents file
# $Texi2HTML::THISDOC{file_base_name} -- base name of the texinfo manual file
# $Texi2HTML::THISDOC{input_file_name} -- name of the texinfo manual file
# $Texi2HTML::THISDOC{destination_directory}
# -- directory for the resulting files
# $Texi2HTML::THISDOC{user} -- user running the script
# $Texi2HTML::THISDOC{css_import_lines} -- ref on @import lines in css files
# $Texi2HTML::THISDOC{css_lines} -- ref on css rules lines
# other $Texi2HTML::THISDOC keys corresponds with texinfo commands, the value
# being the command arg, for the following commands:
# kbdinputstyle, paragraphindent, setchapternewpage, headings, footnotestyle,
# exampleindent, firstparagraphindent, everyheading, everyfooting,
# evenheading, evenfooting, oddheading, oddfooting
#
# and pointer to arrays of lines which need to be printed by main::print_lines
# $Texi2HTML::THIS_SECTION -- lines of 'This' section
# $Texi2HTML::OVERVIEW -- lines of short table of contents
# $Texi2HTML::TOC_LINES -- lines of table of contents
# $Texi2HTML::TITLEPAGE -- lines of title page
#
# $Texi2HTML::THIS_ELEMENT holds the element reference.
#
# There are the following subs which control the layout:
#
$print_section = \&T2H_DEFAULT_print_section;
$end_section = \&T2H_DEFAULT_end_section;
$one_section = \&T2H_DEFAULT_one_section;
$print_Top_header = \&T2H_DEFAULT_print_Top_header;
$print_Top_footer = \&T2H_DEFAULT_print_Top_footer;
$print_Top = \&T2H_DEFAULT_print_Top;
$print_Toc = \&T2H_DEFAULT_print_Toc;
$print_Overview = \&T2H_DEFAULT_print_Overview;
$print_Footnotes = \&T2H_DEFAULT_print_Footnotes;
$print_About = \&T2H_DEFAULT_print_About;
$print_misc_header = \&T2H_DEFAULT_print_misc_header;
$print_misc_footer = \&T2H_DEFAULT_print_misc_footer;
$print_misc = \&T2H_DEFAULT_print_misc;
$print_section_footer = \&T2H_DEFAULT_print_section_footer;
$print_chapter_header = \&T2H_DEFAULT_print_chapter_header;
$print_section_header = \&T2H_DEFAULT_print_section_header;
$print_element_header = \&T2H_DEFAULT_print_element_header;
$print_chapter_footer = \&T2H_DEFAULT_print_chapter_footer;
$print_page_head = \&T2H_DEFAULT_print_page_head;
$print_page_foot = \&T2H_DEFAULT_print_page_foot;
$print_head_navigation = \&T2H_DEFAULT_print_head_navigation;
$print_foot_navigation = \&T2H_DEFAULT_print_foot_navigation;
$button_icon_img = \&T2H_DEFAULT_button_icon_img;
$print_navigation = \&T2H_DEFAULT_print_navigation;
$about_body = \&T2H_DEFAULT_about_body;
$print_frame = \&T2H_DEFAULT_print_frame;
$print_toc_frame = \&T2H_DEFAULT_print_toc_frame;
#$toc_body = \&T2H_DEFAULT_toc_body;
$titlepage = \&T2H_DEFAULT_titlepage;
$css_lines = \&T2H_DEFAULT_css_lines;
$print_redirection_page = \&T2H_DEFAULT_print_redirection_page;
$node_file_name = \&T2H_DEFAULT_node_file_name;
$inline_contents = \&T2H_DEFAULT_inline_contents;
$program_string = \&T2H_DEFAULT_program_string;
########################################################################
# Layout for html for every sections
#
sub T2H_DEFAULT_print_element_header
{
my $first_in_page = shift;
my $previous_is_top = shift;
my $buttons = \@SECTION_BUTTONS;
if (($first_in_page or $previous_is_top) and $SECTION_NAVIGATION)
{
return &$print_head_navigation(undef, $buttons);
}
else
{ # got to do this here, as it isn't done in print_head_navigation
return &$print_navigation($buttons) if ($SECTION_NAVIGATION or $SPLIT eq 'node');
}
}
sub T2H_DEFAULT_print_section
{
my $fh = shift;
my $first_in_page = shift;
my $previous_is_top = shift;
my $element = shift;
my $buttons = \@SECTION_BUTTONS;
my $nw = main::print_lines($fh);
if (defined $SPLIT
and (($SPLIT eq 'node') && $SECTION_NAVIGATION))
{
my $buttons = \@NODE_FOOTER_BUTTONS;
&$print_foot_navigation($fh, $buttons, $SMALL_RULE,
(!defined($WORDS_IN_PAGE) or (defined ($nw) and $nw >= $WORDS_IN_PAGE)),
$element);
# print $fh "$SMALL_RULE\n";
# &$print_navigation($buttons) if (!defined($WORDS_IN_PAGE) or (defined ($nw)
# and $nw >= $WORDS_IN_PAGE));
}
}
sub T2H_DEFAULT_one_section($$)
{
my $fh = shift;
my $element = shift;
main::print_lines($fh);
print $fh "$SMALL_RULE\n";
&$print_page_foot($fh);
}
###################################################################
# 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
# Texi2HTML::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($$)
{
my $fh = shift;
my $do_page_head = shift;
&$print_page_head($fh) if ($do_page_head);
}
sub T2H_DEFAULT_print_Top_footer($$$)
{
my $fh = shift;
my $end_page = shift;
my $element = shift;
my $buttons = \@MISC_BUTTONS;
&$print_foot_navigation($fh, $buttons, $SMALL_RULE,
($end_page and ($SECTION_NAVIGATION or ($SPLIT and $SPLIT ne 'node'))), $element);
# &$print_foot_navigation($fh);
# print $fh "$SMALL_RULE\n";
if ($end_page)
{
# &$print_navigation($fh, $buttons);
&$print_page_foot($fh);
}
}
sub T2H_DEFAULT_print_Top($$$)
{
my $fh = shift;
my $has_top_heading = shift;
my $element = shift;
# for redefining navigation buttons use:
# my $buttons = [...];
# as it is, 'Top', 'Contents', 'Index', 'About' are printed
my $buttons = \@MISC_BUTTONS;
my $nw;
# a dirty hack. A section is considered to be empty if there are 2
# lines or less in it. Indeed, this catches the sectionning command like
# @top and the @node.
if (scalar(@$Texi2HTML::THIS_SECTION) > 2)
{
# if top-level node has content
$nw = main::print_lines($fh, $Texi2HTML::THIS_SECTION);
}
else
{
# top-level node is fully enclosed in @ifnothtml
# print fulltitle, subtitle, author, Overview or table of contents
# redo the titlepage with the actual state
my ($titlepage_text, $titlepage_no_texi, $titlepage_simple_format) = main::do_special_region_lines('titlepage',$Texi2HTML::THISDOC{'state'});
&$titlepage([],$titlepage_text, $titlepage_no_texi, $titlepage_simple_format);
# only print the header and node label
print $fh $Texi2HTML::THIS_SECTION->[0];
print $fh $Texi2HTML::TITLEPAGE;
if (@{$Texi2HTML::OVERVIEW} and !$Texi2HTML::THISDOC{'setshortcontentsaftertitlepage'})
{
print $fh '<h2> ' . $Texi2HTML::NAME{'Overview'} . "</h2>\n" . "<blockquote\n";
my $nw = main::print_lines($fh, $Texi2HTML::OVERVIEW);
print $fh "</blockquote>\n";
}
elsif (@{$Texi2HTML::TOC_LINES} and !$Texi2HTML::THISDOC{'setcontentsaftertitlepage'})
{
print $fh '<h1> ' . $Texi2HTML::NAME{'Contents'} . "</h1>\n";
my $nw = main::print_lines($fh, $Texi2HTML::TOC_LINES);
}
}
}
###################################################################
# Layout of Toc, Overview, and Footnotes pages
# By default, we use "normal" layout
# Texi2HTML::HREF of Next, Prev, Up, Forward, Back, etc are not defined
# use: my $buttons = [...] to redefine navigation buttons
sub T2H_DEFAULT_print_Toc
{
return &$print_misc(@_);
}
sub T2H_DEFAULT_print_Overview
{
return &$print_misc(@_);
}
sub T2H_DEFAULT_print_Footnotes
{
return &$print_misc(@_);
}
sub T2H_DEFAULT_print_About
{
# if there is no section navigation and it is not split, the
# navigation information is useless
return &$print_misc(@_) if ($SPLIT or $SECTION_NAVIGATION);
}
sub T2H_DEFAULT_print_misc_header
{
my $fh = shift;
my $buttons = shift;
my $new_file = shift;
my $misc_page = shift;
&$print_page_head($fh) if ($new_file);
print $fh "".&$misc_element_label($misc_pages_targets{$misc_page}, $misc_page);
&$print_head_navigation($fh, $buttons) if ($new_file or $SECTION_NAVIGATION);
}
sub T2H_DEFAULT_print_misc_footer
{
my $fh = shift;
my $buttons = shift;
my $new_file = shift;
&$print_foot_navigation($fh, $buttons, $SMALL_RULE,
($new_file and ($SECTION_NAVIGATION or ($SPLIT and $SPLIT ne 'node'))), undef);
# print $fh "$SMALL_RULE\n";
if ($new_file)
{
# &$print_navigation($fh, $buttons);# if ($SPLIT ne 'node');
&$print_page_foot($fh);
}
}
sub T2H_DEFAULT_print_misc
{
my $fh = shift;
my $new_file = shift;
my $misc_page = shift;
my $buttons = \@MISC_BUTTONS;
&$print_misc_header($fh, $buttons, $new_file, $misc_page);
print $fh "<h1>$Texi2HTML::NAME{This}</h1>\n";
main::print_lines($fh);
&$print_misc_footer($fh, $buttons, $new_file);
}
##################################################################
# section_footer is only called if SPLIT eq 'section'
# section_footer: after print_section of last section, before print_page_foot
#
sub T2H_DEFAULT_print_section_footer
{
my $fh = shift;
my $element = shift;
my $buttons = \@SECTION_FOOTER_BUTTONS;
&$print_foot_navigation($fh, $buttons, $BIG_RULE, 1, $element);
# &$end_section ($fh, 1, $element);
# &$print_navigation($fh, $buttons);
}
###################################################################
# chapter_header and chapter_footer are only called if
# SPLIT eq 'chapter'
# chapter_header: after print_page_head, before print_section
# chapter_footer: after print_section of last section, before print_page_foot
#
# 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
sub T2H_DEFAULT_print_chapter_header
{
my $fh = shift;
my $element = shift;
# nothing to do there, by default, the navigation panel
# is the section navigation panel
if (! $SECTION_NAVIGATION)
{ # in this case print_navigation is called here.
my $buttons = \@CHAPTER_BUTTONS;
&$print_head_navigation($fh, $buttons);
print $fh "\n$MIDDLE_RULE\n" unless ($VERTICAL_HEAD_NAVIGATION);
}
}
sub T2H_DEFAULT_print_chapter_footer
{
my $fh = shift;
my $element = shift;
my $buttons = \@CHAPTER_BUTTONS;
&$print_foot_navigation($fh, $buttons, $BIG_RULE, 1, $element);
# print $fh "$BIG_RULE\n";
# &$print_navigation($fh, $buttons);
}
sub T2H_DEFAULT_print_section_header
{
# nothing to do there, by default
if (! $SECTION_NAVIGATION)
{ # in this case print_navigation is called here.
my $fh = shift;
my $buttons = \@SECTION_BUTTONS;
&$print_head_navigation($fh, $buttons);
}
}
###################################################################
# Layout of standard header and footer
#
sub T2H_DEFAULT_print_page_head($)
{
my $fh = shift;
my $longtitle = "$Texi2HTML::THISDOC{'fulltitle_simple_format'}";
$longtitle .= ": $Texi2HTML::SIMPLE_TEXT{'This'}" if (defined ($Texi2HTML::SIMPLE_TEXT{'This'}) and ($Texi2HTML::SIMPLE_TEXT{'This'} !~ /^\s*$/) and $SPLIT);
my $description = $Texi2HTML::THISDOC{'DOCUMENT_DESCRIPTION'};
$description = $longtitle if (!defined($description));
$description = "<meta name=\"description\" content=\"$description\">" if
($description ne '');
my $encoding = '';
$encoding = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=$Texi2HTML::THISDOC{'ENCODING_NAME'}\">" if (defined($Texi2HTML::THISDOC{'ENCODING_NAME'}) and ($Texi2HTML::THISDOC{'ENCODING_NAME'} ne ''));
my $links = '';
if ($USE_LINKS)
{
foreach my $link (@LINKS_BUTTONS)
{
#print STDERR "$link!!$Texi2HTML::HREF{$link}\n";
if (defined($Texi2HTML::HREF{$link}) and $Texi2HTML::HREF{$link} ne '')
{
my $title = '';
$title = " title=\"$Texi2HTML::SIMPLE_TEXT{$link}\"" if (defined($Texi2HTML::SIMPLE_TEXT{$link}));
my $rel = '';
$rel = " rel=\"$BUTTONS_REL{$link}\"" if (defined($BUTTONS_REL{$link}));
$links .= "<link href=\"$Texi2HTML::HREF{$link}\"${rel}${title}>\n";
}
}
}
print $fh <<EOT;
$DOCTYPE
<html>
$Texi2HTML::THISDOC{'copying_comment'}<!-- Created on $Texi2HTML::THISDOC{today} by $Texi2HTML::THISDOC{program}
$Texi2HTML::THISDOC{program_authors}-->
<head>
<title>$longtitle</title>
$description
<meta name="keywords" content="$longtitle">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="$Texi2HTML::THISDOC{program}">
$encoding
${links}$Texi2HTML::THISDOC{'CSS_LINES'}
$EXTRA_HEAD
</head>
<body $Texi2HTML::THISDOC{'BODYTEXT'}>
$AFTER_BODY_OPEN
EOT
}
sub T2H_DEFAULT_program_string()
{
my $user = $Texi2HTML::THISDOC{'user'};
my $date = $Texi2HTML::THISDOC{'today'};
$user = '' if (!defined($user));
$date = '' if (!defined($date));
if (($user ne '') and ($date ne ''))
{
return &$I('This document was generated by @emph{%{user}} on @emph{%{date}} using @uref{%{program_homepage}, @emph{%{program}}}.', {
'user' => $user, 'date' => $date, 'program_homepage' => $Texi2HTML::THISDOC{'program_homepage'}, 'program' => $Texi2HTML::THISDOC{'program'} }, {'duplicate'=>1});
}
elsif ($user ne '')
{
return &$I('This document was generated by @emph{%{user}} using @uref{%{program_homepage}, @emph{%{program}}}.', {
'user' => $user, 'program_homepage' => $Texi2HTML::THISDOC{'program_homepage'}, 'program' => $Texi2HTML::THISDOC{'program'} }, {'duplicate'=>1});
}
elsif ($date ne '')
{
return &$I('This document was generated on @i{%{date}} using @uref{%{program_homepage}, @i{%{program}}}.', {
'date' => $date, 'program_homepage' => $Texi2HTML::THISDOC{'program_homepage'}, 'program' => $Texi2HTML::THISDOC{'program'} },{'duplicate'=>1});
}
return &$I('This document was generated using @uref{%{program_homepage}, @emph{%{program}}}.', {
'program_homepage' => $Texi2HTML::THISDOC{'program_homepage'}, 'program'
=> $Texi2HTML::THISDOC{'program'} },{'duplicate'=>1});
}
sub T2H_DEFAULT_end_section($$$)
{
my $fh = shift;
my $misc_and_section_separation = shift;
my $element = shift;
#&$print_foot_navigation($fh) if ($end_foot_navigation);
#print $fh "$BIG_RULE\n";
if ($misc_and_section_separation)
{
&$print_foot_navigation($fh, undef, $BIG_RULE, 0, $element);
}
else
{
print $fh "$BIG_RULE\n";
}
}
sub T2H_DEFAULT_print_page_foot($)
{
my $fh = shift;
my $program_string = &$program_string();
print $fh <<EOT;
<p>
<font size="-1">
$program_string
</font>
<br>
$PRE_BODY_CLOSE
</p>
</body>
</html>
EOT
}
###################################################################
# Layout of navigation panel
sub T2H_DEFAULT_print_head_navigation($$)
{
my $fh = shift;
my $buttons = shift;
my $result = '';
if ($VERTICAL_HEAD_NAVIGATION)
{
$result .= <<EOT;
<table border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
<td align="left">
EOT
}
$result .= &$print_navigation($buttons, $VERTICAL_HEAD_NAVIGATION);
if ($VERTICAL_HEAD_NAVIGATION)
{
$result .= <<EOT;
</td>
<td align="left">
EOT
}
elsif (defined $SPLIT
and ($SPLIT eq 'node'))
{
$result .= "$SMALL_RULE\n";
}
print $fh $result if (defined($fh));
return $result;
}
sub T2H_DEFAULT_print_foot_navigation
{
my $fh = shift;
my $buttons = shift;
my $rule = shift;
my $print_navigation_panel = shift;
my $element = shift;
$rule = '' if (!defined($rule));
$print_navigation_panel = 1 if (!defined($print_navigation_panel)
and defined($buttons));
if ($VERTICAL_HEAD_NAVIGATION)
{
print $fh <<EOT;
</td>
</tr>
</table>
EOT
}
print $fh "$rule\n" if ($rule ne '');
print $fh "".&$print_navigation($buttons) if ($print_navigation_panel);
}
######################################################################
# navigation panel
#
# how to create IMG tag
sub T2H_DEFAULT_button_icon_img
{
my $button = shift;
my $icon = shift;
my $name = shift;
return '' if (!defined($icon));
$button = "" if (!defined ($button));
$name = '' if (!defined($name));
my $alt = '';
if ($name ne '')
{
if ($button ne '')
{
$alt = "$button: $name";
}
else
{
$alt = $name;
}
}
else
{
$alt = $button;
}
return qq{<img src="$icon" border="0" alt="$alt" align="middle">};
}
sub T2H_DEFAULT_print_navigation
{
my $buttons = shift;
my $vertical = shift;
my $result = '';
$result .= '<table cellpadding="1" cellspacing="1" border="0">'."\n";
$result .= "<tr>" unless $vertical;
for my $button (@$buttons)
{
$result .= qq{<tr valign="top" align="left">\n} if $vertical;
$result .= qq{<td valign="middle" align="left">};
if (ref($button) eq 'CODE')
{
$result .= &$button($vertical);
}
elsif (ref($button) eq 'SCALAR')
{
$result .= "$$button" if defined($$button);
}
elsif (ref($button) eq 'ARRAY')
{
my $text = $button->[1];
my $button_href = $button->[0];
# verify that $button_href is simple text and text is a reference
if (defined($button_href) and !ref($button_href)
and defined($text) and (ref($text) eq 'SCALAR') and defined($$text))
{ # use given text
if ($Texi2HTML::HREF{$button_href})
{
my $anchor_attributes = '';
if ($USE_ACCESSKEY and (defined($BUTTONS_ACCESSKEY{$button_href})) and ($BUTTONS_ACCESSKEY{$button_href} ne ''))
{
$anchor_attributes = "accesskey=\"$BUTTONS_ACCESSKEY{$button_href}\"";
}
if ($USE_REL_REV and (defined($BUTTONS_REL{$button_href})) and ($BUTTONS_REL{$button_href} ne ''))
{
$anchor_attributes .= " rel=\"$BUTTONS_REL{$button_href}\"";
}
$result .= "" .
&$anchor('',
$Texi2HTML::HREF{$button_href},
$$text,
$anchor_attributes
)
;
}
else
{
$result .= $$text;
}
}
}
elsif ($button eq ' ')
{ # handle space button
$result .=
($ICONS && $ACTIVE_ICONS{' '}) ?
&$button_icon_img($BUTTONS_NAME{$button}, $ACTIVE_ICONS{' '}) :
$NAVIGATION_TEXT{' '};
#next;
}
elsif ($Texi2HTML::HREF{$button})
{ # button is active
my $btitle = $BUTTONS_GOTO{$button} ?
'title="' . $BUTTONS_GOTO{$button} . '"' : '';
if ($USE_ACCESSKEY and (defined($BUTTONS_ACCESSKEY{$button})) and ($BUTTONS_ACCESSKEY{$button} ne ''))
{
$btitle .= " accesskey=\"$BUTTONS_ACCESSKEY{$button}\"";
}
if ($USE_REL_REV and (defined($BUTTONS_REL{$button})) and ($BUTTONS_REL{$button} ne ''))
{
$btitle .= " rel=\"$BUTTONS_REL{$button}\"";
}
if ($ICONS && $ACTIVE_ICONS{$button})
{ # use icon
$result .= '' .
&$anchor('',
$Texi2HTML::HREF{$button},
&$button_icon_img($BUTTONS_NAME{$button},
$ACTIVE_ICONS{$button},
$Texi2HTML::SIMPLE_TEXT{$button}),
$btitle
);
}
else
{ # use text
$result .=
'[' .
&$anchor('',
$Texi2HTML::HREF{$button},
$NAVIGATION_TEXT{$button},
$btitle
) .
']';
}
}
else
{ # button is passive
$result .=
$ICONS && $PASSIVE_ICONS{$button} ?
&$button_icon_img($BUTTONS_NAME{$button},
$PASSIVE_ICONS{$button},
$Texi2HTML::SIMPLE_TEXT{$button}) :
"[" . $NAVIGATION_TEXT{$button} . "]";
}
$result .= "</td>\n";
$result .= "</tr>\n" if $vertical;
}
$result .= "</tr>" unless $vertical;
$result .= "</table>\n";
return $result;
}
######################################################################
# Frames: this is from "Richard Y. Kim" <ryk@coho.net>
# Should be improved to be more conforming to other _print* functions
# toc_file and main_file passed as args are relative to the texinfo manual
# location, and therefore are not used.
sub T2H_DEFAULT_print_frame
{
my $fh = shift;
my $toc_file = shift;
my $main_file = shift;
$main_file = $Texi2HTML::THISDOC{'filename'}->{'top'};
$toc_file = $Texi2HTML::THISDOC{'filename'}->{'toc_frame'};
print $fh <<EOT;
$FRAMESET_DOCTYPE
<html>
<head><title>$Texi2HTML::THISDOC{'fulltitle'}</title></head>
<frameset cols="140,*">
<frame name="toc" src="$toc_file">
<frame name="main" src="$main_file">
</frameset>
</html>
EOT
}
sub T2H_DEFAULT_print_toc_frame
{
my $fh = shift;
my $stoc_lines = shift;
&$print_page_head($fh);
print $fh <<EOT;
<h2>Content</h2>
EOT
print $fh map {s/\bhref=/target="main" href=/; $_;} @$stoc_lines;
print $fh "</body></html>\n";
}
# This subroutine is intended to fill @Texi2HTML::TOC_LINES and
# @Texi2HTML::OVERVIEW with the table of contents and short table of
# contents.
#
# arguments:
# ref on an array containing all the elements
# each element is a reference on a hash. The following keys might be of
# use:
# 'top': true if this is the top element
# 'toc_level': level of the element in the table of content. Highest level
# is 1 for the @top element and for chapters, appendix and so on,
# 2 for section, unnumberedsec and so on...
# 'tocid': label used for reference linking to the element in table of
# contents
# 'file': the file containing the element, usefull to do href to that file
# in case the document is split.
# 'text': text of the element, with section number
# 'text_nonumber': text of the element, without section number
# Relevant configuration variables are:
# $NUMBER_SECTIONS
# $NO_BULLET_LIST_ATTRIBUTE: usefull in case a list is used
# $FRAMES: @Texi2HTML::OVERVIEW is used in one of the frames.
# $BEFORE_OVERVIEW
# $AFTER_OVERVIEW
# $BEFORE_TOC_LINES
# $AFTER_TOC_LINES
# $DO_CONTENTS
# $DO_SCONTENTS
sub T2H_DEFAULT_toc_body($)
{
}
sub T2H_DEFAULT_inline_contents($$$)
{
my $fh = shift;
my $command = shift;
my $element = shift;
my $name;
my $lines;
my $result = undef;
if ($command eq 'contents')
{
$name = $Texi2HTML::NAME{'Contents'};
$lines = $Texi2HTML::TOC_LINES;
}
else
{
$name = $Texi2HTML::NAME{'Overview'};
$lines = $Texi2HTML::OVERVIEW;
}
if (@{$lines})
{
$result = [ "".&$anchor($element->{'id'})."\n",
"<h1>$name</h1>\n" ];
push @$result, @$lines;
}
return $result;
}
sub T2H_DEFAULT_css_lines ($$)
{
my $import_lines = shift;
my $rule_lines = shift;
# return if (defined($CSS_LINES) or (!@$rule_lines and !@$import_lines and (! keys(%css_map))));
if (defined($CSS_LINES))
{ # if predefined, use CSS_LINES.
$Texi2HTML::THISDOC{'CSS_LINES'} = $CSS_LINES;
return;
}
return if (!@$rule_lines and !@$import_lines and (! keys(%css_map)));
my $css_lines = "<style type=\"text/css\">\n<!--\n";
$css_lines .= join('',@$import_lines) . "\n" if (@$import_lines);
foreach my $css_rule (sort(keys(%css_map)))
{
next unless ($css_map{$css_rule});
$css_lines .= "$css_rule {$css_map{$css_rule}}\n";
}
$css_lines .= join('',@$rule_lines) . "\n" if (@$rule_lines);
$css_lines .= "-->\n</style>\n";
foreach my $ref (@CSS_REFS)
{
$css_lines .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"$ref\">\n";
}
$Texi2HTML::THISDOC{'CSS_LINES'} = $css_lines;
}
######################################################################
# About page
#
# PRE_ABOUT can be a function reference or a scalar.
# Note that if it is a scalar, T2H_InitGlobals has not been called,
# and all global variables like $ADDRESS are not available.
$PRE_ABOUT = sub
{
return ' ' . &$program_string() . "\n";
};
# If customizing $AFTER_ABOUT, be sure to put the content inside <p></p>.
$AFTER_ABOUT = '';
%BUTTONS_EXAMPLE =
(
'Top', ' &nbsp; ',
'Contents', ' &nbsp; ',
'Overview', ' &nbsp; ',
'Index', ' &nbsp; ',
'This', '1.2.3',
'Back', '1.2.2',
'FastBack', '1',
'Prev', '1.2.2',
'Up', '1.2',
'Next', '1.2.4',
'NodeUp', '1.2',
'NodeNext', '1.2.4',
'NodePrev', '1.2.2',
'Following', '1.2.4',
'Forward', '1.2.4',
'FastForward', '2',
'About', ' &nbsp; ',
'First', '1.',
'Last', '1.2.4',
'NextFile', ' &nbsp; ',
'PrevFile', ' &nbsp; ',
);
sub T2H_DEFAULT_about_body
{
my $about = "<p>\n";
if (ref($PRE_ABOUT) eq 'CODE')
{
$about .= &$PRE_ABOUT();
}
else
{
$about .= $PRE_ABOUT;
}
$about .= <<EOT;
</p>
<p>
EOT
$about .= &$I(' The buttons in the navigation panels have the following meaning:') . "\n";
$about .= <<EOT;
</p>
<table border="1">
<tr>
EOT
$about .= ' <th> ' . &$I('Button') . " </th>\n" .
' <th> ' . &$I('Name') . " </th>\n" .
' <th> ' . &$I('Go to') . " </th>\n" .
' <th> ' . &$I('From 1.2.3 go to') . "</th>\n" . " </tr>\n";
for my $button (@SECTION_BUTTONS)
{
next if $button eq ' ' || ref($button) eq 'CODE' || ref($button) eq 'SCALAR' || ref($button) eq 'ARRAY';
$about .= " <tr>\n <td align=\"center\">";
$about .=
($ICONS && $ACTIVE_ICONS{$button} ?
&$button_icon_img($BUTTONS_NAME{$button}, $ACTIVE_ICONS{$button}) :
' [' . $NAVIGATION_TEXT{$button} . '] ');
$about .= "</td>\n";
$about .= <<EOT;
<td align="center">$BUTTONS_NAME{$button}</td>
<td>$BUTTONS_GOTO{$button}</td>
<td>$BUTTONS_EXAMPLE{$button}</td>
</tr>
EOT
}
$about .= <<EOT;
</table>
<p>
EOT
$about .= &$I(' where the @strong{ Example } assumes that the current position is at @strong{ Subsubsection One-Two-Three } of a document of the following structure:') . "\n";
# where the <strong> Example </strong> assumes that the current position
# is at <strong> Subsubsection One-Two-Three </strong> of a document of
# the following structure:
$about .= <<EOT;
</p>
<ul>
EOT
$about .= ' <li> 1. ' . &$I('Section One') . "\n" .
" <ul>\n" .
' <li>1.1 ' . &$I('Subsection One-One') . "\n";
$about .= <<EOT;
<ul>
<li>...</li>
</ul>
</li>
EOT
$about .= ' <li>1.2 ' . &$I('Subsection One-Two') . "\n" .
" <ul>\n" .
' <li>1.2.1 ' . &$I('Subsubsection One-Two-One') . "</li>\n" .
' <li>1.2.2 ' . &$I('Subsubsection One-Two-Two') . "</li>\n" .
' <li>1.2.3 ' . &$I('Subsubsection One-Two-Three') . " &nbsp; &nbsp;\n"
.
' <strong>&lt;== ' . &$I('Current Position') . " </strong></li>\n" .
' <li>1.2.4 ' . &$I('Subsubsection One-Two-Four') . "</li>\n" .
" </ul>\n" .
" </li>\n" .
' <li>1.3 ' . &$I('Subsection One-Three') . "\n";
$about .= <<EOT;
<ul>
<li>...</li>
</ul>
</li>
EOT
$about .= ' <li>1.4 ' . &$I('Subsection One-Four') . "</li>\n";
$about .= <<EOT;
</ul>
</li>
</ul>
$AFTER_ABOUT
EOT
return $about;
}
# return value is currently ignored
sub T2H_DEFAULT_titlepage($$$$)
{
my $titlepage_lines = shift;
my $titlepage_text = shift;
my $titlepage_no_texi = shift;
my $titlepage_simple_format = shift;
my $result = '';
my $title = '';
$title = $Texi2HTML::THISDOC{'title'} if (defined($Texi2HTML::THISDOC{'title'}) and $Texi2HTML::THISDOC{'title'} !~ /^\s*$/);
if ($title ne ''
or @{$Texi2HTML::THISDOC{'subtitles'}}
or @{$Texi2HTML::THISDOC{'authors'}})
{
$result = "<div align=\"center\">\n";
if ($title ne '')
{
$result .= '<h1>' . $title . "</h1>\n";
}
foreach my $subtitle (@{$Texi2HTML::THISDOC{'subtitles'}})
{
$result .= '<h2>' . $subtitle . "</h2>\n";
}
foreach my $author (@{$Texi2HTML::THISDOC{'authors'}})
{
$result .= '<strong> ' . $author . " </strong><br>\n";
}
$result .= "</div>\n$DEFAULT_RULE\n";
}
$Texi2HTML::TITLEPAGE = $titlepage_text;
$Texi2HTML::TITLEPAGE = $result . $Texi2HTML::TITLEPAGE;
if ($Texi2HTML::THISDOC{'setcontentsaftertitlepage'} and (defined($Texi2HTML::THISDOC{'inline_contents'}->{'contents'})) and @{$Texi2HTML::THISDOC{'inline_contents'}->{'contents'}})
{
foreach my $line(@{$Texi2HTML::THISDOC{'inline_contents'}->{'contents'}})
{
$Texi2HTML::TITLEPAGE .= $line;
}
$Texi2HTML::TITLEPAGE .= "$DEFAULT_RULE\n";
}
if ($Texi2HTML::THISDOC{'setshortcontentsaftertitlepage'} and (defined($Texi2HTML::THISDOC{'inline_contents'}->{'shortcontents'})) and @{$Texi2HTML::THISDOC{'inline_contents'}->{'shortcontents'}})
{
foreach my $line(@{$Texi2HTML::THISDOC{'inline_contents'}->{'shortcontents'}})
{
$Texi2HTML::TITLEPAGE .= $line;
}
$Texi2HTML::TITLEPAGE .= "$DEFAULT_RULE\n";
}
return $Texi2HTML::TITLEPAGE;
}
# FIXME Honor DOCUMENT_DESCRIPTION?
sub T2H_DEFAULT_print_redirection_page($)
{
my $fh = shift;
my $longtitle = "$Texi2HTML::THISDOC{'fulltitle_simple_format'}";
$longtitle .= ": $Texi2HTML::SIMPLE_TEXT{'This'}" if exists $Texi2HTML::SIMPLE_TEXT{'This'};
my $description = $longtitle;
my $encoding = '';
$encoding = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=$Texi2HTML::THISDOC{'ENCODING_NAME'}\">" if (defined($Texi2HTML::THISDOC{'ENCODING_NAME'}) and ($Texi2HTML::THISDOC{'ENCODING_NAME'} ne ''));
my $href = &$anchor('', $Texi2HTML::HREF{'This'}, $Texi2HTML::NAME{'This'});
my $string = &$I('The node you are looking for is at %{href}.',
{ 'href' => $href });
print $fh <<EOT;
$DOCTYPE
<html>
<!-- Created on $Texi2HTML::THISDOC{'today'} by $Texi2HTML::THISDOC{'program'} -->
<!--
$Texi2HTML::THISDOC{'program_authors'}
-->
<head>
<title>$longtitle</title>
<meta name="description" content="$description">
<meta name="keywords" content="$longtitle">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="$Texi2HTML::THISDOC{program}">
$encoding
$Texi2HTML::THISDOC{'CSS_LINES'}
<meta http-equiv="Refresh" content="2; url=$Texi2HTML::HREF{'This'}">
$EXTRA_HEAD
</head>
<body $Texi2HTML::THISDOC{'BODYTEXT'}>
$AFTER_BODY_OPEN
<p>$string</p>
</body>
EOT
}
sub T2H_DEFAULT_node_file_name($$)
{
my $node = shift;
my $type = shift;
return undef if ($node->{'external_node'}
or ($type eq 'top' and !$NEW_CROSSREF_STYLE));
my $node_file_base;
if ($type eq 'top' and defined($TOP_NODE_FILE))
{
$node_file_base = $TOP_NODE_FILE;
}
elsif ($NEW_CROSSREF_STYLE)
{
if ($TRANSLITERATE_NODE)
{
$node_file_base = $node->{'cross_manual_file'};
}
else
{
$node_file_base = $node->{'cross_manual_target'};
}
}
else
{
$node_file_base = main::remove_texi($node->{'texi'});
$node_file_base =~ s/[^\w\.\-]/-/g;
}
if (defined($NODE_FILE_EXTENSION) and $NODE_FILE_EXTENSION ne '')
{
return ($node_file_base . ".$NODE_FILE_EXTENSION");
}
return $node_file_base;
}
########################################################################
# Control of formatting:
# 1.) For some changes, it is often enough to change the value of
# some global map. It might necessitate building a little
# function along with the change in hash, if the change is the use
# of another function (in style_map).
# 2.) For other changes, reimplement one of the t2h_default_<fnc>* routines,
# give them another name, and assign them to the respective
# $<fnc> variable (below).
#
# This hash should have keys corresponding with the nonletter command accent
# whose following character is considered to be the argument
# This hash associates an accent macro to the ISO name for the accent if any.
# The customary use of this map is to find the ISO name appearing in html
# entity (like &eacute;) associated with a texinfo accent macro.
#
# The keys of the hash are
# ": umlaut
# ~: tilda accent
# ^: circumflex accent
# `: grave accent
# ': acute accent
# =: macron accent
%accent_map = (
'"', 'uml',
'~', 'tilde',
'^', 'circ',
'`', 'grave',
"'", 'acute',
",", 'cedil',
'=', '',
'ringaccent', 'ring',
'H', '',
'dotaccent', '',
'u', '',
'ubaraccent', '',
'udotaccent', '',
'v', '',
'ogonek', 'ogon',
);
#
# texinfo "simple things" (@foo) to HTML ones
#
%simple_map = (
'*', "<br>", # HTML+
' ', '&nbsp;',
"\t", '&nbsp;',
"\n", '&nbsp;',
# "&#173;" or "&shy;" could also be possible for @-, but it seems
# that some browser will consider this as an always visible hyphen mark
# which is not what we want (see http://www.cs.tut.fi/~jkorpela/shy.html)
'-', '', # hyphenation hint
'|', '', # used in formatting commands @evenfooting and friends
'/', '',
# spacing commands
':', '',
'!', '!',
'?', '?',
'.', '.',
'@', '@',
'}', '}',
'{', '{',
);
# this map is used in preformatted text
%simple_map_pre = %simple_map;
$simple_map_pre{'*'} = "\n";
# maps for the math specific commands
%simple_map_math = (
'\\', '\\'
);
%simple_map_pre_math = %simple_map_math;
%simple_map_texi_math = %simple_map_math;
%colon_command_punctuation_characters = (
'.' => '.',
':' => ':',
'?' => '?',
'!' => '!'
);
#
# texinfo "things" (@foo{}) to HTML ones
#
%things_map = (
'TeX' => 'TeX',
'LaTeX' => 'LaTeX',
# pertusus: unknown by makeinfo, not in texinfo manual (@* is the right thing)
# 'br', '<br>', # paragraph break
'bullet' => '*',
# #'copyright' => '(C)',
'copyright' => '&copy;',
'registeredsymbol' => '&reg;',
'dots' => '<small class="dots">...</small>',
'enddots' => '<small class="enddots">...</small>',
'equiv' => '==',
# FIXME i18n
'error' => 'error--&gt;',
'expansion' => '==&gt;',
'arrow' => '->',
'minus' => '-',
'point' => '-!-',
'print' => '-|',
'result' => '=&gt;',
# set in code using the language
# 'today', &pretty_date,
'today' => '',
'aa' => '&aring;',
'AA' => '&Aring;',
'ae' => '&aelig;',
'oe' => '&oelig;', #pertusus: also &#156;. &oelig; not in html 3.2
'AE' => '&AElig;',
'OE' => '&OElig;', #pertusus: also &#140;. &OElig; not in html 3.2
'o' => '&oslash;',
'O' => '&Oslash;',
'ss' => '&szlig;',
'l' => '&#322;',
'L' => '&#321;',
'exclamdown' => '&iexcl;',
'questiondown' => '&iquest;',
'pounds' => '&pound;',
'ordf' => '&ordf;',
'ordm' => '&ordm;',
'comma' => ',',
'euro' => '&euro;',
'geq' => '&ge;',
'leq' => '&le;',
'tie' => '&nbsp;',
'textdegree' => '&deg;',
'quotedblleft' => '&ldquo;',
'quotedblright' => '&rdquo;',
'quoteleft' => '&lsquo;',
'quoteright' => '&rsquo;',
'quotedblbase' => '&bdquo;',
'quotesinglbase' => '&sbquo;',
'guillemetleft' => '&laquo;',
'guillemetright' => '&raquo;',
'guillemotleft' => '&laquo;',
'guillemotright' => '&raquo;',
'guilsinglleft' => '&lsaquo;',
'guilsinglright' => '&rsaquo;',
);
# This map is used in preformatted environments
%pre_map = %things_map;
$pre_map{'dots'} = '...';
$pre_map{'enddots'} = '...';
#$pre_map{'br'} = "\n";
%ascii_things_map = (
'TeX' => 'TeX',
'LaTeX' => 'LaTeX',
'bullet' => '*',
'copyright' => '(C)',
'registeredsymbol' => '(R)',
'dots' => '...',
'enddots' => '...',
'equiv' => '==',
# FIXME i18n
'error' => 'error-->',
'expansion' => '==>',
'arrow' => '->',
'minus' => '-',
'point' => '-!-',
'print' => '-|',
'result' => '=>',
'today' => '',
'aa' => 'aa',
'AA' => 'AA',
'ae' => 'ae',
'oe' => 'oe',
'AE' => 'AE',
'OE' => 'OE',
'o' => '/o',
'O' => '/O',
'ss' => 'ss',
'l' => '/l',
'L' => '/L',
'exclamdown' => '?',
'questiondown' => '!',
'pounds' => '#',
'ordf' => 'a',
'ordm' => 'o',
'comma' => ',',
'euro' => 'Euro',
'geq' => '>=',
'leq' => '<=',
'tie' => ' ',
'textdegree' => 'o',
'quotedblleft' => '``',
'quotedblright' => "''",
'quoteleft' => '`',
'quoteright' => "'",
'quotedblbase' => ',,',
'quotesinglbase' => ',',
'guillemetleft' => '<<',
'guillemetright' => '>>',
'guillemotleft' => '<<',
'guillemotright' => '>>',
'guilsinglleft' => '<',
'guilsinglright' => '>',
);
# ascii representation of @-commands
%ascii_simple_map = (
'*', "\n",
' ', ' ',
"\t", ' ',
"\n", ' ',
'-', '', # hyphenation hint
'|', '', # used in formatting commands @evenfooting and friends
'/', '',
':', '',
'!', '!',
'?', '?',
'.', '.',
'@', '@',
'}', '}',
'{', '{',
);
#
# This map is used when texi elements are removed and replaced
# by simple text
#
%simple_map_texi = %ascii_simple_map;
# text replacing macros when texi commands are removed and plain text is
# produced
%texi_map = (
'TeX', 'TeX',
'LaTeX', 'LaTeX',
'bullet', '*',
'copyright', 'C',
'registeredsymbol', 'R',
'dots', '...',
'enddots', '...',
'equiv', '==',
'error', 'error-->',
'expansion', '==>',
'arrow', '->',
'minus', '-',
'point', '-!-',
'print', '-|',
'result', '=>',
'today' => '',
'aa', 'aa',
'AA', 'AA',
'ae', 'ae',
'oe', 'oe',
'AE', 'AE',
'OE', 'OE',
'o', 'o',
'O', 'O',
'ss', 'ss',
'l', 'l',
'L', 'L',
'exclamdown', '! upside-down',
#'exclamdown', '&iexcl;',
'questiondown', '? upside-down',
#'questiondown', '&iquest;',
'pounds', 'pound sterling',
#'pounds', '&pound;'
'ordf' => 'a',
'ordm' => 'o',
'comma' => ',',
'euro' => 'Euro',
'geq' => '>=',
'leq' => '<=',
'tie' => ' ',
'textdegree' => 'o',
'quotedblleft' => '``',
'quotedblright' => "''",
'quoteleft' => '`',
'quoteright' => "'",
'quotedblbase' => ',,',
'quotesinglbase' => ',',
'guillemetleft' => '<<',
'guillemetright' => '>>',
'guillemotleft' => '<<',
'guillemotright' => '>>',
'guilsinglleft' => '<',
'guilsinglright' => '>',
);
# taken from
#Latin extended additionnal
#http://www.alanwood.net/unicode/latin_extended_additional.html
#C1 Controls and Latin-1 Supplement
#http://www.alanwood.net/unicode/latin_1_supplement.html
#Latin Extended-A
#http://www.alanwood.net/unicode/latin_extended_a.html
#Latin Extended-B
#http://www.alanwood.net/unicode/latin_extended_b.html
#dotless i: 0131
#http://www.alanwood.net/unicode/arrows.html 21**
#http://www.alanwood.net/unicode/general_punctuation.html 20**
#http://www.alanwood.net/unicode/mathematical_operators.html 22**
%unicode_map = (
'bullet' => '2022',
'copyright' => '00A9',
'registeredsymbol' => '00AE',
'dots' => '2026',
'enddots' => '',
'equiv' => '2261',
'error' => '',
'expansion' => '2192',
'arrow' => '2192',
'minus' => '2212', # in mathematical operators
# 'minus' => '002D', # in latin1
'point' => '2605',
'print' => '22A3',
'result' => '21D2',
'today' => '',
'aa' => '00E5',
'AA' => '00C5',
'ae' => '00E6',
'oe' => '0153',
'AE' => '00C6',
'OE' => '0152',
'o' => '00F8',
'O' => '00D8',
'ss' => '00DF',
'l' => '0142',
'L' => '0141',
'exclamdown' => '00A1',
'questiondown' => '00BF',
'pounds' => '00A3',
'ordf' => '00AA',
'ordm' => '00BA',
'comma' => '002C',
'euro' => '20AC',
'geq' => '2265',
'leq' => '2264',
'tie' => '',
# 'tie' => '0020',
'textdegree' => '00B0',
'quotedblleft' => '201C',
'quotedblright' => '201D',
'quoteleft' => '2018',
'quoteright' => '2019',
'quotedblbase' => '201E',
'quotesinglbase' => '201A',
'guillemetleft' => '00AB',
'guillemetright' => '00BB',
'guillemotleft' => '00AB',
'guillemotright' => '00BB',
'guilsinglleft' => '2039',
'guilsinglright' => '203A',
);
%makeinfo_encoding_to_map = (
"iso-8859-1", 'iso8859_1',
"iso-8859-2", 'iso8859_2',
"iso-8859-15", 'iso8859_15',
"koi8-r", 'koi8',
"koi8-u", 'koi8',
);
foreach my $encoding (keys(%makeinfo_encoding_to_map))
{
$t2h_encoding_aliases{$encoding} = $encoding;
$t2h_encoding_aliases{$makeinfo_encoding_to_map{$encoding}} = $encoding;
}
# cut and pasted from eigth_bit_makeinfo_maps.pl, in turn generated with
# ./parse_8bit_makeinfo_maps.pl
%makeinfo_unicode_to_eight_bit = (
'iso8859_1' => {
'00A0' => 'A0',
'00A1' => 'A1',
'00A2' => 'A2',
'00A3' => 'A3',
'00A4' => 'A4',
'00A5' => 'A5',
'00A6' => 'A6',
'00A7' => 'A7',
'00A8' => 'A8',
'00A9' => 'A9',
'00AA' => 'AA',
'00AB' => 'AB',
'00AC' => 'AC',
'00AD' => 'AD',
'00AE' => 'AE',
'00AF' => 'AF',
'00B0' => 'B0',
'00B1' => 'B1',
'00B2' => 'B2',
'00B3' => 'B3',
'00B4' => 'B4',
'00B5' => 'B5',
'00B6' => 'B6',
'00B7' => 'B7',
'00B8' => 'B8',
'00B9' => 'B9',
'00BA' => 'BA',
'00BB' => 'BB',
'00BC' => 'BC',
'00BD' => 'BD',
'00BE' => 'BE',
'00BF' => 'BF',
'00C0' => 'C0',
'00C1' => 'C1',
'00C2' => 'C2',
'00C3' => 'C3',
'00C4' => 'C4',
'00C5' => 'C5',
'00C6' => 'C6',
'00C7' => 'C7',
'00C7' => 'C7',
'00C8' => 'C8',
'00C9' => 'C9',
'00CA' => 'CA',
'00CB' => 'CB',
'00CC' => 'CC',
'00CD' => 'CD',
'00CE' => 'CE',
'00CF' => 'CF',
'00D0' => 'D0',
'00D1' => 'D1',
'00D2' => 'D2',
'00D3' => 'D3',
'00D4' => 'D4',
'00D5' => 'D5',
'00D6' => 'D6',
'00D7' => 'D7',
'00D8' => 'D8',
'00D9' => 'D9',
'00DA' => 'DA',
'00DB' => 'DB',
'00DC' => 'DC',
'00DD' => 'DD',
'00DE' => 'DE',
'00DF' => 'DF',
'00E0' => 'E0',
'00E1' => 'E1',
'00E2' => 'E2',
'00E3' => 'E3',
'00E4' => 'E4',
'00E5' => 'E5',
'00E6' => 'E6',
'00E7' => 'E7',
'00E8' => 'E8',
'00E9' => 'E9',
'00EA' => 'EA',
'00EB' => 'EB',
'00EC' => 'EC',
'00ED' => 'ED',
'00EE' => 'EE',
'00EF' => 'EF',
'00F0' => 'F0',
'00F1' => 'F1',
'00F2' => 'F2',
'00F3' => 'F3',
'00F4' => 'F4',
'00F5' => 'F5',
'00F6' => 'F6',
'00F7' => 'F7',
'00F8' => 'F8',
'00F9' => 'F9',
'00FA' => 'FA',
'00FB' => 'FB',
'00FC' => 'FC',
'00FD' => 'FD',
'00FE' => 'FE',
'00FF' => 'FF',
},
'iso8859_15' => {
'00A0' => 'A0',
'00A1' => 'A1',
'00A2' => 'A2',
'00A3' => 'A3',
'20AC' => 'A4',
'00A5' => 'A5',
'0160' => 'A6',
'00A7' => 'A7',
'0161' => 'A8',
'00A9' => 'A9',
'00AA' => 'AA',
'00AB' => 'AB',
'00AC' => 'AC',
'00AD' => 'AD',
'00AE' => 'AE',
'00AF' => 'AF',
'00B0' => 'B0',
'00B1' => 'B1',
'00B2' => 'B2',
'00B3' => 'B3',
'017D' => 'B4',
'00B5' => 'B5',
'00B6' => 'B6',
'00B7' => 'B7',
'017E' => 'B8',
'00B9' => 'B9',
'00BA' => 'BA',
'00BB' => 'BB',
'0152' => 'BC',
'0153' => 'BD',
'0178' => 'BE',
'00BF' => 'BF',
'00C0' => 'C0',
'00C1' => 'C1',
'00C2' => 'C2',
'00C3' => 'C3',
'00C4' => 'C4',
'00C5' => 'C5',
'00C6' => 'C6',
'00C7' => 'C7',
'00C8' => 'C8',
'00C9' => 'C9',
'00CA' => 'CA',
'00CB' => 'CB',
'00CC' => 'CC',
'00CD' => 'CD',
'00CE' => 'CE',
'00CF' => 'CF',
'00D0' => 'D0',
'00D1' => 'D1',
'00D2' => 'D2',
'00D3' => 'D3',
'00D4' => 'D4',
'00D5' => 'D5',
'00D6' => 'D6',
'00D7' => 'D7',
'00D8' => 'D8',
'00D9' => 'D9',
'00DA' => 'DA',
'00DB' => 'DB',
'00DC' => 'DC',
'00DD' => 'DD',
'00DE' => 'DE',
'00DF' => 'DF',
'00E0' => 'E0',
'00E1' => 'E1',
'00E2' => 'E2',
'00E3' => 'E3',
'00E4' => 'E4',
'00E5' => 'E5',
'00E6' => 'E6',
'00E7' => 'E7',
'00E8' => 'E8',
'00E9' => 'E9',
'00EA' => 'EA',
'00EB' => 'EB',
'00EC' => 'EC',
'00ED' => 'ED',
'00EE' => 'EE',
'00EF' => 'EF',
'00F0' => 'F0',
'00F1' => 'F1',
'00F2' => 'F2',
'00F3' => 'F3',
'00F4' => 'F4',
'00F5' => 'F5',
'00F6' => 'F6',
'00F7' => 'F7',
'00F8' => 'F8',
'00F9' => 'F9',
'00FA' => 'FA',
'00FB' => 'FB',
'00FC' => 'FC',
'00FD' => 'FD',
'00FE' => 'FE',
'00FF' => 'FF',
},
'iso8859_2' => {
'00A0' => 'A0',
'0104' => 'A1',
'02D8' => 'A2',
'0141' => 'A3',
'00A4' => 'A4',
'013D' => 'A5',
'015A' => 'A6',
'00A7' => 'A7',
'00A8' => 'A8',
'015E' => 'AA',
'0164' => 'AB',
'0179' => 'AC',
'00AD' => 'AD',
'017D' => 'AE',
'017B' => 'AF',
'00B0' => 'B0',
'0105' => 'B1',
'02DB' => 'B2',
'0142' => 'B3',
'00B4' => 'B4',
'013E' => 'B5',
'015B' => 'B6',
'02C7' => 'B7',
'00B8' => 'B8',
'0161' => 'B9',
'015F' => 'BA',
'0165' => 'BB',
'017A' => 'BC',
'02DD' => 'BD',
'017E' => 'BE',
'017C' => 'BF',
'0154' => 'C0',
'00C1' => 'C1',
'00C2' => 'C2',
'0102' => 'C3',
'00C4' => 'C4',
'0139' => 'C5',
'0106' => 'C6',
'00C7' => 'C7',
'010C' => 'C8',
'00C9' => 'C9',
'0118' => 'CA',
'00CB' => 'CB',
'011A' => 'CC',
'00CD' => 'CD',
'00CE' => 'CE',
'010E' => 'CF',
'0110' => 'D0',
'0143' => 'D1',
'0147' => 'D2',
'00D3' => 'D3',
'00D4' => 'D4',
'0150' => 'D5',
'00D6' => 'D6',
'00D7' => 'D7',
'0158' => 'D8',
'016E' => 'D9',
'00DA' => 'DA',
'0170' => 'DB',
'00DC' => 'DC',
'00DD' => 'DD',
'0162' => 'DE',
'00DF' => 'DF',
'0155' => 'E0',
'00E1' => 'E1',
'00E2' => 'E2',
'0103' => 'E3',
'00E4' => 'E4',
'013A' => 'E5',
'0107' => 'E6',
'00E7' => 'E7',
'010D' => 'E8',
'00E9' => 'E9',
'0119' => 'EA',
'00EB' => 'EB',
'011B' => 'EC',
'00ED' => 'ED',
'00EE' => 'EE',
'010F' => 'EF',
'0111' => 'F0',
'0144' => 'F1',
'0148' => 'F2',
'00F3' => 'F3',
'00F4' => 'F4',
'0151' => 'F5',
'00F6' => 'F6',
'00F7' => 'F7',
'0159' => 'F8',
'016F' => 'F9',
'00FA' => 'FA',
'0171' => 'FB',
'00FC' => 'FC',
'00FD' => 'FD',
'0163' => 'FE',
'02D9' => 'FF',
},
'koi8' => {
'0415' => 'A3',
'0454' => 'A4',
'0456' => 'A6',
'0457' => 'A7',
'04D7' => 'B3',
'0404' => 'B4',
'0406' => 'B6',
'0407' => 'B7',
'042E' => 'C0',
'0430' => 'C1',