📄 texi2html
字号:
# @settitle or @shorttitle (in that order)$T2H_TOP_HEADING = '';# if set, use this chapter for 'Index' button, else# use first chapter whose name matches 'index' (case insensitive)$T2H_INDEX_CHAPTER = '';# if set and $T2H_SPLIT is set, then split index pages at the next letter# after they have more than that many entries$T2H_SPLIT_INDEX = 100;# if set (e.g., to index.html) replace hrefs to this file # (i.e., to index.html) by ./$T2H_HREF_DIR_INSTEAD_FILE = '';######################################################################### Language dependencies: # To add a new language extend T2H_WORDS hash and create $T2H_<...>_WORDS hash# To redefine one word, simply do:# $T2H_WORDS->{<language>}->{<word>} = 'whatever' in your personal init file.#$T2H_WORDS_EN ={ # titles of pages 'ToC_Title' => 'Table of Contents', 'Overview_Title' => 'Short Table of Contents', 'Index_Title' => 'Index', 'About_Title' => 'About this document', 'Footnotes_Title' => 'Footnotes', 'See' => 'See', 'see' => 'see', 'section' => 'section',# If necessary, we could extend this as follows: # # text for buttons# 'Top_Button' => 'Top',# 'ToC_Button' => 'Contents',# 'Overview_Button' => 'Overview',# 'Index_button' => 'Index',# 'Back_Button' => 'Back',# 'FastBack_Button' => 'FastBack',# 'Prev_Button' => 'Prev',# 'Up_Button' => 'Up',# 'Next_Button' => 'Next',# 'Forward_Button' =>'Forward',# 'FastWorward_Button' => 'FastForward',# 'First_Button' => 'First',# 'Last_Button' => 'Last',# 'About_Button' => 'About'};$T2H_WORD_DE ={ 'ToC_Title' => 'Inhaltsverzeichniss', 'Overview_Title' => 'Kurzes Inhaltsverzeichniss', 'Index_Title' => 'Index', 'About_Title' => 'Über dieses Dokument', 'Footnotes_Title' => 'Fußnoten', 'See' => 'Siehe', 'see' => 'siehe', 'section' => 'Abschnitt',};$T2H_WORD_NL ={ 'ToC_Title' => 'Inhoudsopgave', 'Overview_Title' => 'Korte inhoudsopgave', 'Index_Title' => 'Index', #Not sure ;-) 'About_Title' => 'No translation available!', #No translation available! 'Footnotes_Title' => 'No translation available!', #No translation available! 'See' => 'Zie', 'see' => 'zie', 'section' => 'sectie',};$T2H_WORD_ES ={ 'ToC_Title' => 'índice General', 'Overview_Title' => 'Resumen del Contenido', 'Index_Title' => 'Index', #Not sure ;-) 'About_Title' => 'No translation available!', #No translation available! 'Footnotes_Title' => 'Fußnoten', 'See' => 'Véase', 'see' => 'véase', 'section' => 'sección',};$T2H_WORD_NO ={ 'ToC_Title' => 'Innholdsfortegnelse', 'Overview_Title' => 'Kort innholdsfortegnelse', 'Index_Title' => 'Indeks', #Not sure ;-) 'About_Title' => 'No translation available!', #No translation available! 'Footnotes_Title' => 'No translation available!', 'See' => 'Se', 'see' => 'se', 'section' => 'avsnitt',};$T2H_WORD_PT ={ 'ToC_Title' => 'Sumário', 'Overview_Title' => 'Breve Sumário', 'Index_Title' => 'Índice', #Not sure ;-) 'About_Title' => 'No translation available!', #No translation available! 'Footnotes_Title' => 'No translation available!', 'See' => 'Veja', 'see' => 'veja', 'section' => 'Seção',};$T2H_WORDS ={ 'en' => $T2H_WORDS_EN, 'de' => $T2H_WORDS_DE, 'nl' => $T2H_WORDS_NL, 'es' => $T2H_WORDS_ES, 'no' => $T2H_WORDS_NO, 'pt' => $T2H_WORDS_PT};@MONTH_NAMES_EN =( 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');@MONTH_NAMES_DE =( 'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember');@MONTH_NAMES_NL =( 'Januari', 'Februari', 'Maart', 'April', 'Mei', 'Juni', 'Juli', 'Augustus', 'September', 'Oktober', 'November', 'December');@MONTH_NAMES_ES =( 'enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre');@MONTH_NAMES_NO =( 'januar', 'februar', 'mars', 'april', 'mai', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'desember');@MONTH_NAMES_PT =( 'Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro');$MONTH_NAMES ={ 'en' => \@MONTH_NAMES_EN, 'de' => \@MONTH_NAMES_DE, 'es' => \@MONTH_NAMES_ES, 'nl' => \@MONTH_NAMES_NL, 'no' => \@MONTH_NAMES_NO, 'pt' => \@MONTH_NAMES_PT};######################################################################### Control of Page layout:# You can make changes of the Page layout at two levels:# 1.) For small changes, it is often enough to change the value of# some global string/hash/array variables# 2.) For larger changes, reimplement one of the T2H_DEFAULT_<fnc>* routines,# give them another name, and assign them to the respective# $T2H_<fnc> variable.# As a general interface, the hashes T2H_HREF, T2H_NAME, T2H_NODE hold # href, html-name, node-name of# This -- current section (resp. html page)# Top -- top page ($T2H_TOP_FILE)# Contents -- Table of contents# Overview -- Short table of contents# Index -- Index page# About -- page which explain "navigation buttons"# First -- first node # Last -- last node## Whether or not the following hash values are set, depends on the context # (all values are w.r.t. 'This' section)# Next -- next node of texinfo# Prev -- previous node of texinfo# Up -- up node of texinfo# Forward -- next node in reading order# Back -- previous node in reading order# FastForward -- if leave node, up and next, else next node# FastBackward-- if leave node, up and prev, else prev node## Furthermore, the following global variabels are set:# $T2H_THISDOC{title} -- title as set by @setttile# $T2H_THISDOC{fulltitle} -- full title as set by @title...# $T2H_THISDOC{subtitle} -- subtitle as set by @subtitle# $T2H_THISDOC{author} -- author as set by @author# # and pointer to arrays of lines which need to be printed by t2h_print_lines # $T2H_OVERVIEW -- lines of short table of contents# $T2H_TOC -- lines of table of contents# $T2H_TOP -- lines of Top texinfo node # $T2H_THIS_SECTION -- lines of 'This' section## There are the following subs which control the layout:#$T2H_print_section = \&T2H_DEFAULT_print_section;$T2H_print_Top_header = \&T2H_DEFAULT_print_Top_header; $T2H_print_Top_footer = \&T2H_DEFAULT_print_Top_footer; $T2H_print_Top = \&T2H_DEFAULT_print_Top; $T2H_print_Toc = \&T2H_DEFAULT_print_Toc; $T2H_print_Overview = \&T2H_DEFAULT_print_Overview; $T2H_print_Footnotes = \&T2H_DEFAULT_print_Footnotes; $T2H_print_About = \&T2H_DEFAULT_print_About; $T2H_print_misc_header = \&T2H_DEFAULT_print_misc_header; $T2H_print_misc_footer = \&T2H_DEFAULT_print_misc_footer; $T2H_print_misc = \&T2H_DEFAULT_print_misc;$T2H_print_chapter_header = \&T2H_DEFAULT_print_chapter_header; $T2H_print_chapter_footer = \&T2H_DEFAULT_print_chapter_footer; $T2H_print_page_head = \&T2H_DEFAULT_print_page_head; $T2H_print_page_foot = \&T2H_DEFAULT_print_page_foot; $T2H_print_head_navigation = \&T2H_DEFAULT_print_head_navigation; $T2H_print_foot_navigation = \&T2H_DEFAULT_print_foot_navigation; $T2H_button_icon_img = \&T2H_DEFAULT_button_icon_img; $T2H_print_navigation = \&T2H_DEFAULT_print_navigation; $T2H_about_body = \&T2H_DEFAULT_about_body; $T2H_print_frame = \&T2H_DEFAULT_print_frame;$T2H_print_toc_frame = \&T2H_DEFAULT_print_toc_frame;######################################################################### Layout for html for every sections#sub T2H_DEFAULT_print_section{ my $fh = shift; local $T2H_BUTTONS = \@T2H_SECTION_BUTTONS; &$T2H_print_head_navigation($fh) if $T2H_SECTION_NAVIGATION; my $nw = t2h_print_lines($fh); if ($T2H_SPLIT eq 'section' && $T2H_SECTION_NAVIGATION) { &$T2H_print_foot_navigation($fh, $nw); } else { print $fh '<HR SIZE="6">' . "\n"; }}#################################################################### Layout of top-page I recommend that you use @ifnothtml, @ifhtml,# @html within the Top texinfo node to specify content of top-level# page. ## If you enclose everything in @ifnothtml, then title, subtitle,# author and overview is printed# T2H_HREF of Next, Prev, Up, Forward, Back are not defined# if $T2H_SPLIT then Top page is in its own html filesub T2H_DEFAULT_print_Top_header{ &$T2H_print_page_head(@_) if $T2H_SPLIT; t2h_print_label(@_); # this needs to be called, otherwise no label set &$T2H_print_head_navigation(@_);}sub T2H_DEFAULT_print_Top_footer{ &$T2H_print_foot_navigation(@_); &$T2H_print_page_foot(@_) if $T2H_SPLIT; }sub T2H_DEFAULT_print_Top{ my $fh = shift; # for redefining navigation buttons use: # local $T2H_BUTTONS = [...]; # as it is, 'Top', 'Contents', 'Index', 'About' are printed local $T2H_BUTTONS = \@T2H_MISC_BUTTONS; &$T2H_print_Top_header($fh); if ($T2H_THIS_SECTION) { # if top-level node has content, then print it with extra header print $fh "<H1>$T2H_NAME{Top}</H1>" unless ($T2H_HAS_TOP_HEADING); t2h_print_lines($fh, $T2H_THIS_SECTION) } else { # top-level node is fully enclosed in @ifnothtml # print fulltitle, subtitle, author, Overview print $fh "<CENTER>\n<H1>" . join("</H1>\n<H1>", split(/\n/, $T2H_THISDOC{fulltitle})) . "</H1>\n"; print $fh "<H2>$T2H_THISDOC{subtitle}</H2>\n" if $T2H_THISDOC{subtitle}; print $fh "$T2H_THISDOC{author}\n" if $T2H_THISDOC{author}; print $fh <<EOT;</CENTER><HR><P></P> <H2> Overview: </H2><BLOCKQUOTE> EOT t2h_print_lines($fh, $T2H_OVERVIEW); print $fh "</BLOCKQUOTE>\n"; } &$T2H_print_Top_footer($fh);}#################################################################### Layout of Toc, Overview, and Footnotes pages# By default, we use "normal" layout # T2H_HREF of Next, Prev, Up, Forward, Back, etc are not defined# use: local $T2H_BUTTONS = [...] to redefine navigation buttonssub T2H_DEFAULT_print_Toc{ return &$T2H_print_misc(@_);}sub T2H_DEFAULT_print_Overview{ return &$T2H_print_misc(@_);}sub T2H_DEFAULT_print_Footnotes{ return &$T2H_print_misc(@_);}sub T2H_DEFAULT_print_About{ return &$T2H_print_misc(@_);}sub T2H_DEFAULT_print_misc_header{ &$T2H_print_page_head(@_) if $T2H_SPLIT; # this needs to be called, otherwise, no labels are set t2h_print_label(@_); &$T2H_print_head_navigation(@_);}sub T2H_DEFAULT_print_misc_footer{ &$T2H_print_foot_navigation(@_); &$T2H_print_page_foot(@_) if $T2H_SPLIT; }sub T2H_DEFAULT_print_misc{ my $fh = shift; local $T2H_BUTTONS = \@T2H_MISC_BUTTONS; &$T2H_print_misc_header($fh); print $fh "<H1>$T2H_NAME{This}</H1>\n"; t2h_print_lines($fh); &$T2H_print_misc_footer($fh);}#################################################################### chapter_header and chapter_footer are only called if# T2H_SPLIT eq 'chapter'# chapter_header: after print_page_header, before print_section# chapter_footer: after print_section of last section, before print_page_footer# # If you want to get rid of navigation stuff after each section,# redefine print_section such that it does not call print_navigation,# and put print_navigation into print_chapter_header@T2H_CHAPTER_BUTTONS = ( 'FastBack', 'FastForward', ' ', ' ', ' ', ' ', ' ', 'Top', 'Contents', 'Index', 'About', );sub T2H_DEFAULT_print_chapter_header{ # nothing to do there, by default if (! $T2H_SECTION_NAVIGATION) { my $fh = shift; local $T2H_BUTTONS = \@T2H_CHAPTER_BUTTONS; &$T2H_print_navigation($fh); print $fh "\n<HR SIZE=2>\n"; }}sub T2H_DEFAULT_print_chapter_footer{ local $T2H_BUTTONS = \@T2H_CHAPTER_BUTTONS; &$T2H_print_navigation(@_);}###################################################################$T2H_TODAY = &pretty_date; # like "20 September 1993"sub pretty_date { local($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst); ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time); $year += ($year < 70) ? 2000 : 1900; # obachman: Let's do it as the Americans do return($MONTH_NAMES->{$T2H_LANG}[$mon] . ", " . $mday . " " . $year);}#################################################################### Layout of standard header and footer## Set the default body text, inserted between <BODY ... > ###$T2H_BODYTEXT = 'LANG="EN" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000"';$T2H_BODYTEXT = 'LANG="' . $T2H_LANG . '" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000"';# text inserted after <BODY ...>$T2H_AFTER_BODY_OPEN = '';#text inserted before </BODY>$T2H_PRE_BODY_CLOSE = '';# this is used in footer$T2H_ADDRESS = "by <I>$T2H_USER</I> " if $T2H_USER;$T2H_ADDRESS .= "on <I>$T2H_TODAY</I>";# this is added inside <HEAD></HEAD> after <TITLE> and some META NAME stuff# can be used for <style> <script>, <meta> tags$T2H_EXTRA_HEAD = '';sub T2H_DEFAULT_print_page_head{ my $fh = shift; my $longtitle = "$T2H_THISDOC{title}: $T2H_NAME{This}"; print $fh <<EOT;<HTML>$T2H_DOCTYPE<!-- Created on $T2H_TODAY by $THISPROG --><!-- $T2H_AUTHORS --><HEAD><TITLE>$longtitle</TITLE><META NAME="description" CONTENT="$longtitle"><META NAME="keywords" CONTENT="$longtitle"><META NAME="resource-type" CONTENT="document"><META NAME="distribution" CONTENT="global"><META NAME="Generator" CONTENT="$THISPROG">$T2H_EXTRA_HEAD</HEAD><BODY $T2H_BODYTEXT>$T2H_AFTER_BODY_OPENEOT}sub T2H_DEFAULT_print_page_foot{ my $fh = shift; print $fh <<EOT;<BR> <FONT SIZE="-1">This document was generated$T2H_ADDRESSusing <A HREF="$T2H_HOMEPAGE"><I>texi2html</I></A>$T2H_PRE_BODY_CLOSE</BODY></HTML>EOT}#################################################################### Layout of navigation panel# if this is set, then a vertical navigation panel is used$T2H_VERTICAL_HEAD_NAVIGATION = 0;sub T2H_DEFAULT_print_head_navigation{ my $fh = shift; if ($T2H_VERTICAL_HEAD_NAVIGATION) { print $fh <<EOT;<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"><TR VALIGN="TOP"><TD ALIGN="LEFT">EOT
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -