# -*-perl-*- #+############################################################################## # # xhtml.pm: convert to well-formed xhtml transitional # !!!!!!! This is very out of date!!!! # # Copyright (C) 2003 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 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, see . # # Originally written by Patrice Dumas. # #-############################################################################## # FIXME this is out of date. There are still the T2H_ prefixes! # APA: Add SystemLiteral to identify the canonical DTD. # [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 set_default('DOCTYPE', ''); set_default('FRAMESET_DOCTYPE', ''); # -iso # if set, ISO8859 characters are used for special symbols (like copyright, etc) # FIXME certainly obsoleted by t2h_default_set_iso_symbols which should # certainly ba called indirectly through html_default_load set_default('USE_ISO', 1); # horizontal rules $SMALL_RULE = '
'; $DEFAULT_RULE = '
'; $MIDDLE_RULE = '
'; $BIG_RULE = '
'; # this is added inside after and some <meta name> # stuff, it can be used for eg. <style>, <script>, <meta> etc. tags. $EXTRA_HEAD = ''; $print_page_head = \&T2H_XHTML_print_page_head; $print_page_foot = \&T2H_XHTML_print_page_foot; $print_frame = \&T2H_XHTML_print_frame; $button_icon_img = \&T2H_XHTML_button_icon_img; #FIXME update once it is more stabilized in texi2html.pm sub T2H_XHTML_print_page_head { my $fh = shift; my $longtitle = "$Texi2HTML::THISDOC{'title_no_texi'}"; $longtitle .= ": $Texi2HTML::NO_TEXI{'This'}" if exists $T2H_NO_TEXI{'This'}; my $doctype = get_conf('doctype'); my $bodytext = get_conf('BODYTEXT'); print $fh <<EOT; <?xml version="1.0" encoding="iso-8859-1"?> $doctype <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="$T2H_LANG" lang="$T2H_LANG"> $T2H_THISDOC{'copying'}<!-- Created on $Texi2HTML::THISDOC{today} by $Texi2HTML::THISDOC{program} --> <!-- $Texi2HTML::THISDOC{program_authors} --> <head> <title>$longtitle $EXTRA_HEAD $AFTER_BODY_OPEN EOT } # instead of sub T2H_XHTML_print_page_foot { my $fh = shift; print $fh < This document was generated $ADDRESS using $Texi2HTML::THISDOC{program}.
$PRE_BODY_CLOSE

EOT } sub T2H_XHTML_print_frame { my $fh = shift; my $toc_file = shift; my $main_file = shift; my $doctype = get_conf('FRAMESET_DOCTYPE'); print $fh < $Texi2HTML::THISDOC{title} EOT } # / in sub T2H_XHTML_button_icon_img { my $button = shift; my $icon = shift; my $name = shift; return '' if (!defined($icon)); if (defined($name) && $name) { $name = ": $name"; } else { $name = ''; } $button = "" if (!defined ($button)); return qq{$button$name}; } $simple_map{'*'} = '
'; # formatting functions $def_line = \&t2h_xhtml_def_line; $index_summary = \&t2h_xhtml_index_summary; $image = \&t2h_xhtml_image; # need / in sub t2h_xhtml_image($$$) { my $file = shift; my $base = shift; my $preformatted = shift; return "[ $base ]" if ($preformatted); return "\"$base\"/"; } # process definition commands line @deffn for example # replaced by sub t2h_xhtml_def_line($$$$$) { my $category = shift; my $name = shift; my $type = shift; my $arguments = shift; my $index_label = shift; $index_label = '' if (!defined($index_label)); $name = '' if (!defined($name) or ($name =~ /^\s*$/)); $type = '' if (!defined($type) or $type =~ /^\s*$/); if (!defined($arguments) or $arguments =~ /^\s*$/) { $arguments = ''; } else { $arguments = '' . $arguments . ''; } my $type_name = ''; $type_name = " $type" if ($type ne ''); $type_name .= ' ' . $name . '' if ($name ne ''); $type_name .= $arguments . "\n"; if (! get_conf('DEF_TABLE')) { return '
'. '' . $category . ':' . $type_name . $index_label . "
\n"; } else { return "\n" . $type_name . "\n" . $category . $index_label . "\n" . "\n"; } } # There is a br which needs / sub t2h_xhtml_index_summary($$) { my $alpha = shift; my $nonalpha = shift; my $join = ''; my $nonalpha_text = ''; my $alpha_text = ''; $join = "   \n
\n" if (@$nonalpha and @$alpha); if (@$nonalpha) { $nonalpha_text = join("\n   \n", @$nonalpha) . "\n"; } if (@$alpha) { $alpha_text = join("\n   \n", @$alpha) . "\n   \n"; } #I18n return "
Jump to:   " . $nonalpha_text . $join . $alpha_text . '
'; }