|
6.4 Main program variables and usefull functions
In the functions
controlling the page layout some global variables set by the main
program are available, with value corresponding with the current
layout element.
6.4.1 Accessing elements informations
Four hashes are available, with key the elements labels (as described
in Element labels) and values:
-
%Texi2HTML::NAME
The formatted element name
-
%Texi2HTML::HREF
The element hypertext reference
-
%Texi2HTML::NODE
The element node name
-
%Texi2HTML::NO_TEXI
The element name after removal of texi commands
6.4.2 Accessing global informations
Three kinds of global informations are available, miscalleneous global
strings, flags set by @set and special flags and section lines.
Global strings
The
%Texi2HTML::THISDOC hash holds some global informations:
-
fulltitle
title set by @title. If there is no @title other
possibilities are tried (@settitle, @shorttitlepage…).
-
title
title set by @settitle, or fulltitle.
-
title_no_texi
title without texi formatting
-
title_texi
title with texi commands
-
author
Authors list set by @author.
-
authors
A reference on an array containing each author set by @author.
-
copying
Text appearing in @copying with all the texinfo commands removed,
put in comments.
-
program
The name and version of texi2html.
-
program_homepage
Homepage for texi2html.
-
program_authors
Authors of texi2html.
-
file_base_name
base name of the texinfo manual file.
-
filename
This is a reference on a hash that holds the filenames for special elements.
These files may not be used in certain cases, for example the toc
element file name may not be relevant if table of contents is not output
separately.
The keys are
-
doc
the document file if not split, if split should be the top element file.
-
top
Top element file name.
-
toc
Table of contents element file name.
-
stoc
Overview (also called short table of contents) element file name.
-
about
About element file name.
-
foot
Footnotes element file name.
-
destination_directory
Destination directory for the resulting files.
-
extension
Extension for the output files.
-
toc_file
The file name of the table of contents, should always be valid, even
when table of contents are output directly in the document.
-
inline_contents
A reference on a hash containing two key, one for each type of table
of contents:
-
contents
The associated value is a
reference on an array containg the line resulting from formatting
the table of contents, including a heading and a reference.
-
shortcontents
The associated value is a
reference on an array containg the line resulting from formatting
the short table of contents, including a heading and a reference.
-
today
The date. May be overriden by $DATE.
-
user
The user running texi2html. Maybe overriden by $USER.
-
css_import_lines
reference on an array containing the @import lines of
CSS files.
-
css_lines
reference on an array containing the normal lines of
CSS files.
It also holds the arg of the following commands, associated with the command
name: kbdinputstyle, paragraphindent, setchapternewpage, headings,
footnotestyle,
exampleindent, firstparagraphindent, everyheading, everyfooting,
evenheading, evenfooting, oddheading, oddfooting, setcontentsaftertitlepage,
setshortcontentsaftertitlepage, frenchspacing.
If the command doesn't have any arg, it will be true is it was set.
Flags
Flags defined by @set may be accessed through the
%main::value hash. The key is the flag name, the value is the
flag value at the end of the document.
Special flags are set by the main program. They correspond with a texinfo
command, like @setfilename, or @settitle,
@author… The corresponding flag is the command name with
‘_’ appended, for example, _titlefont corresponds with
@titlefont. Like other flags they are available in
%main::value.
Section lines
The following array references or arrays holds formatted lines:
-
$Texi2HTML::THIS_SECTION
Lines of the current element.
-
$Texi2HTML::THIS_HEADER
Lines of the current element appearing before the element label (anchors).
-
$Texi2HTML::OVERVIEW
Lines of short table of contents. See section Special pages formatting.
-
$Texi2HTML::TOC_LINES
Lines of table of contents. See section Special pages formatting.
-
$Texi2HTML::TITLEPAGE
The title page formatted with special title commands (@author,
@title) expanded. See section Formatting of title page.
6.4.3 Function usefull in page formatting
The usefull function is a function used to print an array of lines, which
also counts the number of words in the array, if needed.
- Function: $words_number main::print_lines $filehandle \@lines_array
$filehandle is the opened filehandle the function should write to.
\@lines_array is the array line the function should write to the file.
If this argument is omitted, the function uses
$Texi2HTML::THIS_SECTION.
$words_number is the number of words in the array, only defined if
split at nodes and
$WORDS_IN_PAGE is defined.
Doku-Base
This document was created by Netzdino using texi2html.
|