[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Texi2html-cvs] texi2html texi2html.pl NEWS TODO Makefile.in Ma...
From: |
Patrice Dumas |
Subject: |
[Texi2html-cvs] texi2html texi2html.pl NEWS TODO Makefile.in Ma... |
Date: |
Thu, 10 Sep 2009 20:32:30 +0000 |
CVSROOT: /cvsroot/texi2html
Module name: texi2html
Changes by: Patrice Dumas <pertusus> 09/09/10 20:32:29
Modified files:
. : texi2html.pl NEWS TODO Makefile.in Makefile.am
ChangeLog
formats : html.init info.init xml.init
test : run_test.sh run_test_all.sh
doc : Makefile.am Makefile.in stamp-vti
texi2html.texi version.texi
Added files:
examples : style_example.css
maintained_extra: book.init chm.init html32.init tex4ht.init
doc : info_format_informations.txt
Removed files:
examples : tex4ht.init chm.init html32.init book.init
Log message:
Handle right @. followed by any of )"'] at end of line.
* formats/html.init: modify element classes. Change class "toc"
for ul to class "no-bullet" ($NO_BULLET_LIST_ATTRIBUTE). @top
and @centerchap have now their command name as class.
@node heading class is now "node-heading", instead of "node".
The whole header is in an element with class "header" (was
"node" when
!$HEADER_IN_TABLE).
* examples/,maintained_extra/: separate examples, that are kept
in examples/, and init files that are maintained, and installed
in the default case and put in maintained_extra/.
* examples/style_example.css: Add an example css stylesheet from
http://planet.gnu.org/~ams/style.css.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texi2html/examples/style_example.css?cvsroot=texi2html&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texi2html/examples/tex4ht.init?cvsroot=texi2html&r1=1.11&r2=0
http://cvs.savannah.gnu.org/viewcvs/texi2html/examples/chm.init?cvsroot=texi2html&r1=1.21&r2=0
http://cvs.savannah.gnu.org/viewcvs/texi2html/examples/html32.init?cvsroot=texi2html&r1=1.30&r2=0
http://cvs.savannah.gnu.org/viewcvs/texi2html/examples/book.init?cvsroot=texi2html&r1=1.29&r2=0
http://cvs.savannah.gnu.org/viewcvs/texi2html/texi2html.pl?cvsroot=texi2html&r1=1.330&r2=1.331
http://cvs.savannah.gnu.org/viewcvs/texi2html/NEWS?cvsroot=texi2html&r1=1.106&r2=1.107
http://cvs.savannah.gnu.org/viewcvs/texi2html/TODO?cvsroot=texi2html&r1=1.143&r2=1.144
http://cvs.savannah.gnu.org/viewcvs/texi2html/Makefile.in?cvsroot=texi2html&r1=1.76&r2=1.77
http://cvs.savannah.gnu.org/viewcvs/texi2html/Makefile.am?cvsroot=texi2html&r1=1.53&r2=1.54
http://cvs.savannah.gnu.org/viewcvs/texi2html/ChangeLog?cvsroot=texi2html&r1=1.431&r2=1.432
http://cvs.savannah.gnu.org/viewcvs/texi2html/formats/html.init?cvsroot=texi2html&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/texi2html/formats/info.init?cvsroot=texi2html&r1=1.29&r2=1.30
http://cvs.savannah.gnu.org/viewcvs/texi2html/formats/xml.init?cvsroot=texi2html&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/texi2html/maintained_extra/book.init?cvsroot=texi2html&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texi2html/maintained_extra/chm.init?cvsroot=texi2html&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texi2html/maintained_extra/html32.init?cvsroot=texi2html&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texi2html/maintained_extra/tex4ht.init?cvsroot=texi2html&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texi2html/test/run_test.sh?cvsroot=texi2html&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/texi2html/test/run_test_all.sh?cvsroot=texi2html&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/texi2html/doc/Makefile.am?cvsroot=texi2html&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/texi2html/doc/Makefile.in?cvsroot=texi2html&r1=1.52&r2=1.53
http://cvs.savannah.gnu.org/viewcvs/texi2html/doc/stamp-vti?cvsroot=texi2html&r1=1.62&r2=1.63
http://cvs.savannah.gnu.org/viewcvs/texi2html/doc/texi2html.texi?cvsroot=texi2html&r1=1.93&r2=1.94
http://cvs.savannah.gnu.org/viewcvs/texi2html/doc/version.texi?cvsroot=texi2html&r1=1.62&r2=1.63
http://cvs.savannah.gnu.org/viewcvs/texi2html/doc/info_format_informations.txt?cvsroot=texi2html&rev=1.1
Patches:
Index: texi2html.pl
===================================================================
RCS file: /cvsroot/texi2html/texi2html/texi2html.pl,v
retrieving revision 1.330
retrieving revision 1.331
diff -u -b -r1.330 -r1.331
--- texi2html.pl 9 Sep 2009 18:56:04 -0000 1.330
+++ texi2html.pl 10 Sep 2009 20:32:27 -0000 1.331
@@ -86,7 +86,7 @@
}
# CVS version:
-# $Id: texi2html.pl,v 1.330 2009/09/09 18:56:04 pertusus Exp $
+# $Id: texi2html.pl,v 1.331 2009/09/10 20:32:27 pertusus Exp $
# Homepage:
my $T2H_HOMEPAGE = "http://www.nongnu.org/texi2html/";
@@ -355,6 +355,7 @@
$NO_NUMBER_FOOTNOTE_SYMBOL
$NO_BULLET_LIST_STYLE
$NO_BULLET_LIST_ATTRIBUTE
+$NO_BULLET_LIST_CLASS
$TOP_NODE_FILE
$TOP_NODE_FILE_TARGET
$TOP_NODE_UP
@@ -4584,10 +4585,11 @@
return $section_ref;
}
-sub scan_line_separators($$)
+sub scan_line_separators($$$)
{
my $node_line = shift;
my $separators = shift;
+ my $context = shift;
my @command_stack;
my @results;
@@ -4601,6 +4603,15 @@
{
$node_arg .= $1;
my $macro = $2;
+ if (defined($Texi2HTML::Config::misc_command{$macro}))
+ {
+ if ($macro ne 'c' and $macro ne 'comment')
+ {
+ msg_error ("address@hidden should not appear in $context");
+ return ($node_arg, $node_line, undef);
+ }
+
+ }
$node_arg .= "address@hidden";
$macro = $alias{$macro} if (exists($alias{$macro}));
if ($node_line =~ s/^{//)
@@ -4638,7 +4649,7 @@
pop @command_stack;
}
}
- elsif ($node_line =~ s/^([^${separators}]*)([$separators])//)
+ elsif ($separators ne '' and $node_line =~
s/^([^${separators}]*)([$separators])//)
{
$node_arg .= $1;
my $separator = $2;
@@ -4755,7 +4766,7 @@
while ($node_line =~ /\S/)
{
my ($next_node, $separator);
- ($next_node, $node_line, $separator) =
scan_line_separators($node_line, ',');
+ ($next_node, $node_line, $separator) =
scan_line_separators($node_line, ',', '@node');
if (defined($next_node))
{
$next_node = normalise_node($next_node);
@@ -12144,7 +12155,7 @@
return ($node, $name, $ending, $remaining) unless $menu_line =~ s/^\*//;
my ($before_colon, $separator);
- ($before_colon, $remaining, $separator) = scan_line_separators($menu_line,
':');
+ ($before_colon, $remaining, $separator) = scan_line_separators($menu_line,
':', 'menu entry');
if (defined($before_colon) and defined($separator))
{
if ($remaining =~ s/^://)
@@ -12157,13 +12168,13 @@
my $after_colon;
$node = '';
$ending = "\n";
- ($after_colon, $remaining, $separator) =
scan_line_separators($remaining, '\t,\.');
+ ($after_colon, $remaining, $separator) =
scan_line_separators($remaining, '\t,\.', 'menu entry node');
return (undef, $name, $ending, $remaining) if
(!defined($after_colon));
$node .= $after_colon;
while ($separator eq '.' and (defined($remaining) and $remaining !~
/^\s/))
{
- ($after_colon, $remaining, $separator) =
scan_line_separators($remaining, '\t,\.');
+ ($after_colon, $remaining, $separator) =
scan_line_separators($remaining, '\t,\.', 'menu entry node');
return (undef, $name, $ending, $remaining) if
(!defined($after_colon));
$node .= $separator.$after_colon;
}
Index: NEWS
===================================================================
RCS file: /cvsroot/texi2html/texi2html/NEWS,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -b -r1.106 -r1.107
--- NEWS 9 Sep 2009 18:56:04 -0000 1.106
+++ NEWS 10 Sep 2009 20:32:28 -0000 1.107
@@ -81,6 +81,14 @@
* Don't treat _setfilename as a value set. It should be available through
get_conf.
+* Changes in class attribute in html elements:
+ Change class "toc" for ul to class "no-bullet" ($NO_BULLET_LIST_ATTRIBUTE).
+ @top and @centerchap have now their command name as class.
+ @node heading class is now "node-heading", instead of "node".
+ The whole header is in an element with class "header" (was "node" when
+ !$HEADER_IN_TABLE).
+
+
1.82 (2009-01-05)
* NEW FEATURES
Index: TODO
===================================================================
RCS file: /cvsroot/texi2html/texi2html/TODO,v
retrieving revision 1.143
retrieving revision 1.144
diff -u -b -r1.143 -r1.144
--- TODO 9 Sep 2009 21:20:11 -0000 1.143
+++ TODO 10 Sep 2009 20:32:28 -0000 1.144
@@ -3,23 +3,14 @@
Before next release
-------------------
-* document css classes, and have similar classes with makeinfo, sent
- on the bug-texinfo list.
-
-* ship the css file from http://planet.gnu.org/~ams/.
-
-* in sectionning, test nodes_after_top_before_section_use_nodes_chapter
- not split at chapter. It is split at nodes although top node is not
- always considered as an element. out_html is much better, since at least
- one of the nodes is associated with the section, but the @node Top is
- still considered as a separate element -- which could even be considered
- to be right.
-
-* add --command command line that gives inserted lines.
Later
-----
+* add --command command line that gives inserted lines. This should wait
+ for @setfilename status to be resolved, on TeX, since otherwise there
+ is the issue of inserting before or after @setfilename to be resolved.
+
* many FIXME in the code
* Create detailed texinfo documentation (see in doc)
@@ -89,6 +80,54 @@
* document the new $image arguments/API
+* document the css classes:
+
+Sectionning command headings @top, @chapter, @appendix...
+h? @var{command_name}
+
+for @display, @example, @smallexample...
+pre @var{environment_name}
+
+for @node, in case it is output as a header (which is quite rare).
+h3 node-heading
+
+For summary letters in indices
+a summary-letter
+
+For lists that should not have a bullet in front
+ul no-bullet
+
+When whole menu is in a preformatted environment
+pre menu-preformatted
+
+For the menu text between menu entries
+pre menu-comment
+
+For a whole header, depending on $HEADER_IN_TABLE:
+table header
+div header
+
+Others
+
+pre verbatim
+pre verbatiminclude
+div footnote
+table cartouche
+blockquote smallquotation
+table address@hidden
+div shortcontents
+div contents
+div float
+dl listoffloats
+h1 settitle
+table menu
+
address@hidden small dots
address@hidden small enddots
address@hidden span sansserif
address@hidden span roman
address@hidden h1 titlefont
+
* in chm.init (Jose Fonseca)
[WINDOWS]
@@ -385,3 +424,4 @@
So things are right as is, but in formats that always set the quotes to
a special font should honor txicodequote* like tex. There is an example
of such code commented out in texi2html.init in normal_text.
+
Index: Makefile.in
===================================================================
RCS file: /cvsroot/texi2html/texi2html/Makefile.in,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -b -r1.76 -r1.77
--- Makefile.in 6 Sep 2009 21:45:55 -0000 1.76
+++ Makefile.in 10 Sep 2009 20:32:28 -0000 1.77
@@ -244,10 +244,17 @@
formats/xml.init \
formats/plaintext.init
+dist_pkgdata_DATA = maintained_extra/book.init \
+ maintained_extra/chm.init \
+ maintained_extra/tex4ht.init \
+ maintained_extra/html32.init
+
texi2html_sources = texi2html_configured.pl $(texi2html_additional_scripts)
noinst_SCRIPTS = manage_i18n.pl buildt2h.sh addformats.sh \
parse_8bit_makeinfo_maps.pl
+
+#Â style_example.css comes from http://planet.gnu.org/~ams/style.css
EXTRA_DIST = \
MySimple.pod \
autogen.sh \
@@ -259,24 +266,20 @@
texi2html.pl \
regenerate_documentlanguages.pl \
$(texi2html_additional_scripts) \
- $(texi2html_formats)
-
-dist_pkgdata_DATA = examples/l2h.init \
+ $(texi2html_formats) \
+ examples/l2h.init \
examples/makeinfo.init \
examples/xhtml.init \
- examples/html32.init \
- examples/book.init \
examples/noheaders.init \
examples/inlinestyle.init \
examples/utf8.init \
examples/enable_encoding.init \
- examples/chm.init \
examples/roff.init \
examples/mediawiki.init \
- examples/tex4ht.init \
examples/my-bib-macros.texi \
examples/bib-example.texi \
- examples/glossary.texi
+ examples/glossary.texi \
+ examples/style_example.css
i18n_files = i18n/de \
i18n/es \
Index: Makefile.am
===================================================================
RCS file: /cvsroot/texi2html/texi2html/Makefile.am,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -b -r1.53 -r1.54
--- Makefile.am 4 Aug 2009 14:30:44 -0000 1.53
+++ Makefile.am 10 Sep 2009 20:32:28 -0000 1.54
@@ -26,11 +26,17 @@
formats/xml.init \
formats/plaintext.init
+dist_pkgdata_DATA = maintained_extra/book.init \
+ maintained_extra/chm.init \
+ maintained_extra/tex4ht.init \
+ maintained_extra/html32.init
+
texi2html_sources = texi2html_configured.pl $(texi2html_additional_scripts)
noinst_SCRIPTS = manage_i18n.pl buildt2h.sh addformats.sh \
parse_8bit_makeinfo_maps.pl
+#Â style_example.css comes from http://planet.gnu.org/~ams/style.css
EXTRA_DIST = \
MySimple.pod \
autogen.sh \
@@ -42,24 +48,20 @@
texi2html.pl \
regenerate_documentlanguages.pl \
$(texi2html_additional_scripts) \
- $(texi2html_formats)
-
-dist_pkgdata_DATA = examples/l2h.init \
+ $(texi2html_formats) \
+ examples/l2h.init \
examples/makeinfo.init \
examples/xhtml.init \
- examples/html32.init \
- examples/book.init \
examples/noheaders.init \
examples/inlinestyle.init \
examples/utf8.init \
examples/enable_encoding.init \
- examples/chm.init \
examples/roff.init \
examples/mediawiki.init \
- examples/tex4ht.init \
examples/my-bib-macros.texi \
examples/bib-example.texi \
- examples/glossary.texi
+ examples/glossary.texi \
+ examples/style_example.css
i18n_files = i18n/de \
i18n/es \
Index: ChangeLog
===================================================================
RCS file: /cvsroot/texi2html/texi2html/ChangeLog,v
retrieving revision 1.431
retrieving revision 1.432
diff -u -b -r1.431 -r1.432
--- ChangeLog 9 Sep 2009 21:20:10 -0000 1.431
+++ ChangeLog 10 Sep 2009 20:32:28 -0000 1.432
@@ -6,6 +6,18 @@
through get_conf.
Handle better bogus uses of @setfilename.
* formats/info.init: take @frenchspacing into account.
+ Handle right @. followed by any of )"'] at end of line.
+ * formats/html.init: modify element classes. Change class "toc"
+ for ul to class "no-bullet" ($NO_BULLET_LIST_ATTRIBUTE). @top
+ and @centerchap have now their command name as class.
+ @node heading class is now "node-heading", instead of "node".
+ The whole header is in an element with class "header" (was "node" when
+ !$HEADER_IN_TABLE).
+ * examples/,maintained_extra/: separate examples, that are kept
+ in examples/, and init files that are maintained, and installed
+ in the default case and put in maintained_extra/.
+ * examples/style_example.css: Add an example css stylesheet from
+ http://planet.gnu.org/~ams/style.css.
2009-09-09 Patrice Dumas <address@hidden>
Index: formats/html.init
===================================================================
RCS file: /cvsroot/texi2html/texi2html/formats/html.init,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- formats/html.init 8 Sep 2009 22:16:46 -0000 1.24
+++ formats/html.init 10 Sep 2009 20:32:28 -0000 1.25
@@ -6,7 +6,7 @@
# A copy of this file is pasted into the beginning of texi2html by
# running './configure'.
#
-# $Id: html.init,v 1.24 2009/09/08 22:16:46 pertusus Exp $
+# $Id: html.init,v 1.25 2009/09/10 20:32:28 pertusus Exp $
use strict;
@@ -167,7 +167,8 @@
# This controls the ul style for toc
$NO_BULLET_LIST_STYLE = 'list-style: none';
-$NO_BULLET_LIST_ATTRIBUTE = ' class="toc"';
+$NO_BULLET_LIST_CLASS = 'no-bullet';
+$NO_BULLET_LIST_ATTRIBUTE = ' class="'.$NO_BULLET_LIST_CLASS.'"';
# These lines are inserted before and after the shortcontents
$BEFORE_OVERVIEW = "<div class=\"shortcontents\">\n";
@@ -613,7 +614,7 @@
%css_map =
(
- 'ul.toc' => "$NO_BULLET_LIST_STYLE",
+ "ul.$NO_BULLET_LIST_CLASS" => "$NO_BULLET_LIST_STYLE",
'pre.menu-comment' => "$MENU_PRE_STYLE",
'pre.menu-preformatted' => "$MENU_PRE_STYLE",
'a.summary-letter' => 'text-decoration: none',
@@ -1302,12 +1303,12 @@
my $result = '';
if ($HEADER_IN_TABLE)
{
- $result .= '<table cellpadding="1" cellspacing="1" border="0">'."\n";
+ $result .= '<table class="header" cellpadding="1" cellspacing="1"
border="0">'."\n";
$result .= "<tr>" unless $vertical;
}
else
{
- $result .= '<div class="node">'."\n<p>\n";
+ $result .= '<div class="header">'."\n<p>\n";
}
for my $button (@$buttons)
{
@@ -2600,7 +2601,7 @@
}
my $text = $element->{'text'};
my $class = $element->{'tag_level'};
- $class = 'unnumbered' if ($class eq 'top' or $class eq 'centerchap');
+ $class = 'node-heading' if ($element->{'node'});
my $align = '';
$align = ' align="center"' if ($element->{'tag'} eq 'centerchap');
Index: formats/info.init
===================================================================
RCS file: /cvsroot/texi2html/texi2html/formats/info.init,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- formats/info.init 9 Sep 2009 21:20:12 -0000 1.29
+++ formats/info.init 10 Sep 2009 20:32:28 -0000 1.30
@@ -1519,19 +1519,27 @@
if ((!defined($content->{'command'}) or
($content->{'command'} ne ':' and $content->{'command'} ne 'accents_commands'))
and get_conf('frenchspacing') ne 'on' and $new_text =~
/([$info_default_end_sentence_character])([$info_default_after_punctuation_characters]*)(\s*)$/)
{
#Â the info_default_after_punctuation_characters should
- #Â always be in the same text element.
+ #Â always be in the same text element except if the
+ #Â punctuation character is in a command.
if (chomp($new_text))
{
$new_text =~ s/(\s*)$/ /;
}
else
{
-#if (defined($content->{'command'}))
-#{
-# main::msg_debug ("$content->{'command'} ($content->{'text'})",
$content->{'line_nr'});
-#}
- # spaces may be in following commands
+ # spaces may be in following commands, and also
+ #Â info_default_after_punctuation_characters
my ($current_next, $index_next, $close_next,
$text_next, $command_next) = info_default_next ($current, $index, $close);
+ #Â the info_default_after_punctuation_characters
+ #Â may be in the next elemnt, if it is the only
+ #Â text in the element and the element is only text
+ if (defined($content->{'command'}) and
defined($current_next) and !defined($command_next) and $text_next =~
/^([$info_default_after_punctuation_characters]*)(\s*)$/ and chomp ($text_next))
+ {
+ my $content =
$current_next->{'content'}->[$index_next];
+ $content->{'text'} =~ s/(\s*)$/ /;
+ }
+ else
+ {
while (1)
{
#Â !defined($text_next) catches many special
@@ -1546,7 +1554,6 @@
{
if (chomp($text_next))
{
-#print STDERR "DOIT\n";
info_default_skip_spaces($current,
$index, $close);
$new_text =~ s/(\s*)$/ /;
last;
@@ -1556,6 +1563,7 @@
}
}
}
+ }
elsif (chomp($new_text))
{
$new_text =~ s/(\s*)$/ /;
Index: formats/xml.init
===================================================================
RCS file: /cvsroot/texi2html/texi2html/formats/xml.init,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- formats/xml.init 6 Sep 2009 12:52:39 -0000 1.13
+++ formats/xml.init 10 Sep 2009 20:32:28 -0000 1.14
@@ -432,8 +432,6 @@
{
my $element = shift;
my $class = $element->{'tag_level'};
- # FIXME wrong?
- $class = 'unnumbered' if ($class eq 'top' or $class eq 'centerchap');
return $class;
}
Index: test/run_test.sh
===================================================================
RCS file: /cvsroot/texi2html/texi2html/test/run_test.sh,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- test/run_test.sh 4 Aug 2009 07:58:28 -0000 1.22
+++ test/run_test.sh 10 Sep 2009 20:32:28 -0000 1.23
@@ -143,8 +143,8 @@
# -I $testdir/$srcdir_test/ is useful when file name is found using
# @setfilename
echo "$dir" >> $logfile
- echo "perl -w -x $testdir/$srcdir_test/../../$command --force --conf-dir
$testdir/$srcdir_test/../../examples --conf-dir
$testdir/$srcdir_test/../../formats --conf-dir $testdir/$srcdir_test/ --test
--output $out_dir/$dir/ -I $testdir/$srcdir_test/ -I $testdir/$srcdir_test/../
--dump-texi --macro-expand=$out_dir/$dir/$basename.texi $remaining_out_dir
$src_file 2>$out_dir/$dir/$basename.2" >> $logfile
- eval "perl -w -x $testdir/$srcdir_test/../../$command --force --conf-dir
$testdir/$srcdir_test/../../examples --conf-dir
$testdir/$srcdir_test/../../formats --conf-dir $testdir/$srcdir_test/ --test
--output $out_dir/$dir/ -I $testdir/$srcdir_test/ -I $testdir/$srcdir_test/../
--dump-texi --macro-expand=$out_dir/$dir/$basename.texi $remaining_out_dir
$src_file 2>$out_dir/$dir/$basename.2"
+ echo "perl -w -x $testdir/$srcdir_test/../../$command --force --conf-dir
$testdir/$srcdir_test/../../maintained_extra --conf-dir
$testdir/$srcdir_test/../../examples --conf-dir
$testdir/$srcdir_test/../../formats --conf-dir $testdir/$srcdir_test/ --test
--output $out_dir/$dir/ -I $testdir/$srcdir_test/ -I $testdir/$srcdir_test/../
--dump-texi --macro-expand=$out_dir/$dir/$basename.texi $remaining_out_dir
$src_file 2>$out_dir/$dir/$basename.2" >> $logfile
+ eval "perl -w -x $testdir/$srcdir_test/../../$command --force --conf-dir
$testdir/$srcdir_test/../../maintained_extra --conf-dir
$testdir/$srcdir_test/../../examples --conf-dir
$testdir/$srcdir_test/../../formats --conf-dir $testdir/$srcdir_test/ --test
--output $out_dir/$dir/ -I $testdir/$srcdir_test/ -I $testdir/$srcdir_test/../
--dump-texi --macro-expand=$out_dir/$dir/$basename.texi $remaining_out_dir
$src_file 2>$out_dir/$dir/$basename.2"
ret=$?
else
use_latex2html=no
@@ -172,8 +172,8 @@
mkdir "$out_dir/$dir"
remaining_out_dir=`echo $remaining | sed
's,@OUT_DIR@,'"${outdir}/$dir/"',g'`
echo "$dir" >> $logfile
- echo "perl -w -x $testdir/$srcdir_test/../../$command --force --conf-dir
$testdir/$srcdir_test/../../examples --conf-dir
$testdir/$srcdir_test/../../formats --conf-dir $testdir/$srcdir_test/ -I
$testdir/$srcdir_test/ -I $testdir/$srcdir_test/../ --test --output
$out_dir/$dir/ $remaining_out_dir $src_file > $out_dir/$dir/$basename.1
2>$out_dir/$dir/$basename.2" >> $logfile
- eval "perl -w -x $testdir/$srcdir_test/../../$command --force --conf-dir
$testdir/$srcdir_test/../../examples --conf-dir
$testdir/$srcdir_test/../../formats --conf-dir $testdir/$srcdir_test/ -I
$testdir/$srcdir_test/ -I $testdir/$srcdir_test/../ --test --output
$out_dir/$dir/ $remaining_out_dir $src_file > $out_dir/$dir/$basename.1
2>$out_dir/$dir/$basename.2"
+ echo "perl -w -x $testdir/$srcdir_test/../../$command --force --conf-dir
$testdir/$srcdir_test/../../maintained_extra --conf-dir
$testdir/$srcdir_test/../../examples --conf-dir
$testdir/$srcdir_test/../../formats --conf-dir $testdir/$srcdir_test/ -I
$testdir/$srcdir_test/ -I $testdir/$srcdir_test/../ --test --output
$out_dir/$dir/ $remaining_out_dir $src_file > $out_dir/$dir/$basename.1
2>$out_dir/$dir/$basename.2" >> $logfile
+ eval "perl -w -x $testdir/$srcdir_test/../../$command --force --conf-dir
$testdir/$srcdir_test/../../maintained_extra --conf-dir
$testdir/$srcdir_test/../../examples --conf-dir
$testdir/$srcdir_test/../../formats --conf-dir $testdir/$srcdir_test/ -I
$testdir/$srcdir_test/ -I $testdir/$srcdir_test/../ --test --output
$out_dir/$dir/ $remaining_out_dir $src_file > $out_dir/$dir/$basename.1
2>$out_dir/$dir/$basename.2"
ret=$?
rm -f $out_dir/$dir/*_l2h_images.log $out_dir/$dir/*_tex4ht_*.log \
$out_dir/$dir/*_tex4ht_*.idv $out_dir/$dir/*_tex4ht_*.dvi \
Index: test/run_test_all.sh
===================================================================
RCS file: /cvsroot/texi2html/texi2html/test/run_test_all.sh,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- test/run_test_all.sh 10 Aug 2009 10:00:29 -0000 1.10
+++ test/run_test_all.sh 10 Sep 2009 20:32:29 -0000 1.11
@@ -185,8 +185,8 @@
# -I $testdir/$srcdir_test/ is useful when file name is found using
# @setfilename
echo "$command $dir" >> $logfile
- echo "perl -w -x $command_run $format_option --force --conf-dir
$testdir/$srcdir_test/../../examples --conf-dir
$testdir/$srcdir_test/../../formats --conf-dir $testdir/$srcdir_test/ --test
--output ${outdir}$dir/ -I $testdir/$srcdir_test/ -I $testdir/$srcdir_test/../
--dump-texi --macro-expand=${outdir}$dir/$basename.texi $remaining_out_dir
$src_file 2>${outdir}$dir/$basename.2" >> $logfile
- eval "perl -w -x $command_run $format_option --force --conf-dir
$testdir/$srcdir_test/../../examples --conf-dir
$testdir/$srcdir_test/../../formats --conf-dir $testdir/$srcdir_test/ --test
--output ${outdir}$dir/ -I $testdir/$srcdir_test/ -I $testdir/$srcdir_test/../
--dump-texi --macro-expand=${outdir}$dir/$basename.texi $remaining_out_dir
$src_file 2>${outdir}$dir/$basename.2"
+ echo "perl -w -x $command_run $format_option --force --conf-dir
$testdir/$srcdir_test/../../maintained_extra --conf-dir
$testdir/$srcdir_test/../../examples --conf-dir
$testdir/$srcdir_test/../../formats --conf-dir $testdir/$srcdir_test/ --test
--output ${outdir}$dir/ -I $testdir/$srcdir_test/ -I $testdir/$srcdir_test/../
--dump-texi --macro-expand=${outdir}$dir/$basename.texi $remaining_out_dir
$src_file 2>${outdir}$dir/$basename.2" >> $logfile
+ eval "perl -w -x $command_run $format_option --force --conf-dir
$testdir/$srcdir_test/../../maintained_extra --conf-dir
$testdir/$srcdir_test/../../examples --conf-dir
$testdir/$srcdir_test/../../formats --conf-dir $testdir/$srcdir_test/ --test
--output ${outdir}$dir/ -I $testdir/$srcdir_test/ -I $testdir/$srcdir_test/../
--dump-texi --macro-expand=${outdir}$dir/$basename.texi $remaining_out_dir
$src_file 2>${outdir}$dir/$basename.2"
ret=$?
else
use_latex2html=no
@@ -210,8 +210,8 @@
mkdir "${outdir}$dir"
remaining_out_dir=`echo $remaining | sed
's,@OUT_DIR@,'"${outdir}$dir/"',g'`
echo "$command $dir" >> $logfile
- echo "perl -w -x $command_run $format_option --force --conf-dir
$testdir/$srcdir_test/../../examples --conf-dir
$testdir/$srcdir_test/../../formats --conf-dir $testdir/$srcdir_test/ -I
$testdir/$srcdir_test/ -I $testdir/$srcdir_test/../ --test --output
${outdir}$dir/ $remaining_out_dir $src_file > ${outdir}$dir/$basename.1
2>${outdir}$dir/$basename.2" >> $logfile
- eval "perl -w -x $command_run $format_option --force --conf-dir
$testdir/$srcdir_test/../../examples --conf-dir
$testdir/$srcdir_test/../../formats --conf-dir $testdir/$srcdir_test/ -I
$testdir/$srcdir_test/ -I $testdir/$srcdir_test/../ --test --output
${outdir}$dir/ $remaining_out_dir $src_file > ${outdir}$dir/$basename.1
2>${outdir}$dir/$basename.2"
+ echo "perl -w -x $command_run $format_option --force --conf-dir
$testdir/$srcdir_test/../../maintained_extra --conf-dir
$testdir/$srcdir_test/../../examples --conf-dir
$testdir/$srcdir_test/../../formats --conf-dir $testdir/$srcdir_test/ -I
$testdir/$srcdir_test/ -I $testdir/$srcdir_test/../ --test --output
${outdir}$dir/ $remaining_out_dir $src_file > ${outdir}$dir/$basename.1
2>${outdir}$dir/$basename.2" >> $logfile
+ eval "perl -w -x $command_run $format_option --force --conf-dir
$testdir/$srcdir_test/../../maintained_extra --conf-dir
$testdir/$srcdir_test/../../examples --conf-dir
$testdir/$srcdir_test/../../formats --conf-dir $testdir/$srcdir_test/ -I
$testdir/$srcdir_test/ -I $testdir/$srcdir_test/../ --test --output
${outdir}$dir/ $remaining_out_dir $src_file > ${outdir}$dir/$basename.1
2>${outdir}$dir/$basename.2"
ret=$?
rm -f ${outdir}$dir/*_l2h_images.log ${outdir}$dir/*_tex4ht_*.log \
${outdir}$dir/*_tex4ht_*.idv ${outdir}$dir/*_tex4ht_*.dvi \
Index: doc/Makefile.am
===================================================================
RCS file: /cvsroot/texi2html/texi2html/doc/Makefile.am,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- doc/Makefile.am 5 Feb 2007 16:01:44 -0000 1.15
+++ doc/Makefile.am 10 Sep 2009 20:32:29 -0000 1.16
@@ -16,7 +16,8 @@
EXTRA_DIST = \
texi2html.1.in \
- texi2html.html
+ texi2html.html \
+ info_format_informations.txt
CLEANFILES = texi2html.1
Index: doc/Makefile.in
===================================================================
RCS file: /cvsroot/texi2html/texi2html/doc/Makefile.in,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -b -r1.52 -r1.53
--- doc/Makefile.in 6 Sep 2009 21:45:57 -0000 1.52
+++ doc/Makefile.in 10 Sep 2009 20:32:29 -0000 1.53
@@ -192,7 +192,8 @@
man_MANS = texi2html.1
EXTRA_DIST = \
texi2html.1.in \
- texi2html.html
+ texi2html.html \
+ info_format_informations.txt
CLEANFILES = texi2html.1
SUFFIXES = .txt
Index: doc/stamp-vti
===================================================================
RCS file: /cvsroot/texi2html/texi2html/doc/stamp-vti,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -b -r1.62 -r1.63
--- doc/stamp-vti 6 Sep 2009 21:45:57 -0000 1.62
+++ doc/stamp-vti 10 Sep 2009 20:32:29 -0000 1.63
@@ -1,4 +1,4 @@
address@hidden UPDATED 24 August 2009
address@hidden UPDATED-MONTH August 2009
address@hidden UPDATED 9 September 2009
address@hidden UPDATED-MONTH September 2009
@set EDITION 1.83
@set VERSION 1.83
Index: doc/texi2html.texi
===================================================================
RCS file: /cvsroot/texi2html/texi2html/doc/texi2html.texi,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -b -r1.93 -r1.94
--- doc/texi2html.texi 9 Sep 2009 18:56:05 -0000 1.93
+++ doc/texi2html.texi 10 Sep 2009 20:32:29 -0000 1.94
@@ -2020,6 +2020,9 @@
@item $NO_BULLET_LIST_STYLE
This should contain a css style used for the list style when there
is no bullet.
address@hidden $NO_BULLET_LIST_CLASS
+This should contain the class assocciated with the $NO_BULLET_LIST_STYLE
+css style.
@item $NO_BULLET_LIST_ATTRIBUTE
This should contain an attribute text used for the list element when there
is no bullet. For example it is used in the tables of if they are
@@ -4589,6 +4592,13 @@
$Texi2HTML::address@hidden@}.
@item Don't treat _setfilename as a value set. It should be available through
get_conf.
address@hidden change in class attribute for html elements:
+for ul to class "no-bullet" ($NO_BULLET_LIST_ATTRIBUTE). @@top
+and @@centerchap have now their command name as class.
+@@node heading class is now "node-heading", instead of "node".
+The whole header is in an element with class "header"
+(was "node" when !$HEADER_IN_TABLE).
+
@end itemize
@item API changes between 1.78 and 1.80:
@itemize @bullet
Index: doc/version.texi
===================================================================
RCS file: /cvsroot/texi2html/texi2html/doc/version.texi,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -b -r1.62 -r1.63
--- doc/version.texi 6 Sep 2009 21:45:57 -0000 1.62
+++ doc/version.texi 10 Sep 2009 20:32:29 -0000 1.63
@@ -1,4 +1,4 @@
address@hidden UPDATED 24 August 2009
address@hidden UPDATED-MONTH August 2009
address@hidden UPDATED 9 September 2009
address@hidden UPDATED-MONTH September 2009
@set EDITION 1.83
@set VERSION 1.83
Index: examples/style_example.css
===================================================================
RCS file: examples/style_example.css
diff -N examples/style_example.css
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/style_example.css 10 Sep 2009 20:32:27 -0000 1.1
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2009, Free Software Foundation, Inc.
+ *
+ * Copying and distribution of this file, with or without
+ * modification, are permitted in any medium without royalty provided
+ * the copyright notice and this notice are preserved.
+ */
+
+body {
+ font: 1em/1.5em georgia,serif;
+ max-width: 50em;
+ margin: auto;
+ padding: 0;
+ padding: 30px 0 60px 0;
+}
+
+h1, h2, h3, h4, h5 {
+ font-family: "Trebuchet MS", "Tahoma","Helvetica","Arial",sans-serif;
+ letter-spacing: 0px;
+ word-spacing: 0px;
+ font-weight: normal;
+}
+
+h2.unnumbered {
+ font-size: 34px;
+ margin: 30px 0 60px 0;
+ text-align: right;
+}
+
+/*
+h2.unnumbered + p, h2.unnumbered + p + p {
+ font-size: 14px;
+}
+*/
+
+h2.chapter {
+ font-size: 26px;
+ margin: 30px 0;
+ text-align: left;
+}
+
+h3 {
+ font-size: 22px;
+}
+
+h4 {
+ font-size: 18px;
+}
+
+a {
+ color: midnightblue;
+}
+
+a:visited {
+ color: indigo;
+}
+
+a:active, a:hover, a:visited:hover {
+ color: crimson;
+}
+
+p, dd {
+ text-align: justify;
+}
+
+dt {
+ font-style: italic;
+}
+
+pre, tt, code, kbd, samp {
+ font-size: 12px;
+ line-height: 20px;
+}
Index: maintained_extra/book.init
===================================================================
RCS file: maintained_extra/book.init
diff -N maintained_extra/book.init
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ maintained_extra/book.init 10 Sep 2009 20:32:28 -0000 1.1
@@ -0,0 +1,196 @@
+# This is based on the scriptbasic style
+
+html_default_load();
+
+set_conf('contents', 1);
+
+$INLINE_CONTENTS = 1;
+$USE_TITLEPAGE_FOR_TITLE = 1;
+
address@hidden =
+ (
+ 'Back', 'Forward', ' ', 'Contents', 'Index', 'About'
+ );
+
address@hidden = @SECTION_BUTTONS;
address@hidden = @SECTION_BUTTONS;
+
address@hidden = ('Contents', 'Index', 'About');
address@hidden = @SECTION_FOOTER_BUTTONS;
+
address@hidden = ('Back', 'Forward');
+
+$WORDS_IN_PAGE = undef;
+$SHOW_MENU = 0;
+
+$BIG_RULE = '<hr>';
+
+#FIXME lift that constraint once it is better supported
+$USE_SECTIONS = 1;
+$USE_NODES = undef;
+
+push @command_handler_init, \&book_initialize_variables;
+
+sub book_print_sub_toc($$);
+
+sub book_print_sub_toc($$)
+{
+ my $parent_element = shift;
+ my $element = shift;
+ my $result = "<li> ".&$anchor('', main::href($element,
$parent_element->{'file'}), $element->{'text'}) . " </li>\n";
+#print STDERR "SUB_TOC $element->{'text'}\n"; #sleep 1;
+ if (exists($element->{'child'}))
+ {
+#print STDERR "SUB_TOC child $element->{'child'}->{'text'}\n";
+ $result .= "<li><ul${NO_BULLET_LIST_ATTRIBUTE}>\n".
book_print_sub_toc($parent_element, $element->{'child'}) ."</ul></li>\n";
+ }
+ if (exists($element->{'sectionnext'}))
+ {
+#print STDERR "SUB_TOC next($element->{'text'})
$element->{'next'}->{'text'}\n";
+ $result .= book_print_sub_toc($parent_element,
$element->{'sectionnext'});
+ }
+ return $result;
+}
+
+sub book_print_up_toc($)
+{
+ my $element = shift;
+
+ my $result = '';
+ my $current_element = $element;
+ my @elements;
+ while (defined($current_element->{'sectionup'}) and
($current_element->{'sectionup'} ne $current_element))
+ {
+ unshift (@elements, $current_element->{'sectionup'});
+ $current_element = $current_element->{'sectionup'};
+ }
+ #print $fh "<ul>" . &$anchor('', $Texi2HTML::HREF{Contents}, '[' .
$Texi2HTML::NAME{Contents} . ']') . " <br>\n";
+ my $elem = shift @elements;
+ $result .= "<ul${NO_BULLET_LIST_ATTRIBUTE}><li>" . &$anchor('',
main::href($elem, $element->{'file'}), $elem->{'text'}) . " </li>\n";
+ foreach my $elem (@elements)
+ {
+ $result .= "<li><ul${NO_BULLET_LIST_ATTRIBUTE}><li>" . &$anchor('',
main::href($elem, $element->{'file'}), $elem->{'text'}) . " </li>\n";
+ }
+ foreach my $elem (@elements)
+ {
+ $result .= "</ul></li>\n";
+ }
+ $result .= "</ul>\n";
+}
+
+#$print_section = \&book_print_section;
+$print_element_header = \&book_print_element_header;
+$element_file_name = \&book_element_file_name;
+
+sub book_print_element_header($$)
+{
+ my $first_in_page = shift;
+ my $previous_is_top = shift;
+ my $buttons = address@hidden;
+ my $result;
+
+ if ($first_in_page and get_conf('headers'))
+ {
+ $result = book_print_up_toc($Texi2HTML::THIS_ELEMENT);
+ $result .= &$print_head_navigation(undef, $buttons);
+ }
+ else
+ { # got to do this here, as it isn't done in print_head_navigation
+ $result = &$print_navigation($buttons) if (get_conf('headers'));
+ }
+ return $result;
+}
+
+my $unumbered_nr;
+my $previous_nr;
+my $previous_file_name;
+
+sub book_initialize_variables()
+{
+ $unumbered_nr = -1;
+ $previous_nr = undef;
+ $previous_file_name = undef;
+}
+
+sub book_element_file_name($$$)
+{
+ my $element = shift;
+ my $type = shift;
+ my $prefix = shift;
+
+ return undef if ($NODE_FILENAMES or !get_conf('SPLIT'));
+ return undef if (!defined($element));
+
+ if (defined($previous_nr) and ($element->{'doc_nr'} == $previous_nr))
+ {
+ return $previous_file_name;
+ }
+ if ($type eq 'top')
+ {
+ $previous_file_name = "${prefix}_top.html";
+ }
+ elsif (defined($element->{'plain_number'}) and ($element->{'plain_number'}
ne ''))
+ {
+ my $number = $element->{'plain_number'};
+ $number .= '.' unless ($number =~ /\.$/);
+ $previous_file_name = "${prefix}_$number" . 'html';
+ }
+ else
+ {
+ $unumbered_nr++;
+ $previous_file_name = "${prefix}_U." . $unumbered_nr . '.html';
+ }
+ $previous_nr = $element->{'doc_nr'};
+ return $previous_file_name;
+}
+
+$heading = \&book_heading;
+
+sub book_heading($$$$$$;$$)
+{
+ my $element = shift;
+ my $command = shift;
+ my $texi_line = shift;
+ my $line = shift;
+ my $in_preformatted = shift;
+ my $one_section = shift;
+ my $element_heading = shift;
+
+ my $level = 3;
+
+ if (!$element->{'node'})
+ {
+ $level = $element->{'level'};
+ }
+ else
+ {
+ return '' unless ($element->{'this'} and !$element->{'with_section'});
+ }
+ $level = 1 if ($level == 0);
+ my $text = $element->{'text'};
+ return '' if ($text !~ /\S/);
+ my $class = $element->{'tag_level'};
+ $class = 'node-heading' if ($element->{'node'});
+ my $align = '';
+ $align = ' align="center"' if ($element->{'tag'} eq 'centerchap');
+
+ if (defined($element->{'tocid'}) and $TOC_LINKS)
+ {
+ $text = &$anchor ('',
"$Texi2HTML::THISDOC{'toc_file'}#$element->{'tocid'}", $text);
+ }
+ $text = "<h$level class=\"$class\"${align}> $text </h$level>\n";
+ address@hidden should already have a table of contents, either because
there
+ #Â is a @contents, or setcontentsaftertitlepage is set.
+ # In any case it would just be a duplication
+ #Â of the table of contents, better let the user decide where it should be.
+ if (exists($element->{'child'})
+ and ($element->{'tag_level'} !~ /heading/) and $element->{'tag'} ne
'top')
+ {
+ $text .= "<ul${NO_BULLET_LIST_ATTRIBUTE}>\n";
+ $text .= "" . book_print_sub_toc($element, $element->{'child'});
+ $text .= "</ul>\n";
+ }
+ return $text;
+}
+
+1;
Index: maintained_extra/chm.init
===================================================================
RCS file: maintained_extra/chm.init
diff -N maintained_extra/chm.init
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ maintained_extra/chm.init 10 Sep 2009 20:32:28 -0000 1.1
@@ -0,0 +1,438 @@
+# -*-perl-*-
+
+#+##############################################################################
+#
+# chm.init: convert to chm intermediate formats hhp, hhc, hhk and html files
+#
+# Copyright (C) 2004-2008 Patrice Dumas <address@hidden>
+#
+# 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
+#
+#-##############################################################################
+
+use strict;
+
+html_default_load();
+
+$TOP_NODE_FILE = undef;
+$TOP_FILE = undef;
+
+#$SECTION_NAVIGATION = 0; # to avoid headers in normal elements
+$SHOW_MENU = 0;
+$SPLIT = 'node';
+set_conf('contents', 1);
+$SPLIT_INDEX = undef;
+$IDX_SUMMARY = 1;
+
+$SMALL_RULE = '';
+$DEFAULT_RULE = '';
+$MIDDLE_RULE = '';
+$BIG_RULE = '';
+
+$DOCUMENT_DESCRIPTION = '';
+$FOOTNOTESTYLE = 'end';
+
+#FIXME remove that later
+$USE_SECTIONS = 1;
+
+push @command_handler_process, \&chm_initialize_variables;
+
+$index_summary_file_entry = \&chm_index_summary_file_entry;
+$index_summary_file_begin = \&chm_index_summary_file_begin;
+$index_summary_file_end = \&chm_index_summary_file_end;
+
+$print_page_foot = \&chm_print_page_foot;
+# no-ops to avoid headers and footers
+$print_head_navigation = \&chm_noop;
+#$print_Top_footer = \&chm_noop;
+$print_foot_navigation = \&chm_noop;
+$print_element_header = \&chm_noop;
+
+my $default_toc_body = $toc_body;
+$toc_body = \&chm_toc_body;
+
+$finish_out = \&chm_finish_out;
+my $default_init_out = $init_out;
+
+$init_out = \&chm_init_out;
+
+my %chm_languages = (
+ 'en' => '0x409 English (United States)',
+ 'sq' => '0x041c Albanian',
+# 'ar' => '0x1401 Arabic (ALGERIA)',
+# 'es' => '0x2c0a Spanish (ARGENTINA)',
+# 'en' => '0x0c09 English (AUSTRALIA)',
+# 'de' => '0x0c07 German (AUSTRIA)',
+# 'ar' => '0x3c01 Arabic (BAHRAIN)',
+ 'be' => '0x0423 Byelorussian',
+# 'fr' => '0x080c French (BELGIUM)',
+# 'en' => '0x2809 English (BELIZE)',
+# 'es' => '0x400a Spanish (BOLIVIA)',
+# 'pt' => '0x0416 Portuguese (BRAZIL)',
+# 'ms' => '0x083e Malay (BRUNEI DARUSSALAM)',
+ 'bg' => '0x0402 Bulgarian',
+# 'fr' => '0x0c0c French (CANADA)',
+# 'es' => '0x340a Spanish (CHILE)',
+ 'zh' => '0x0804 Chinese (CHINA)',
+# 'es' => '0x240a Spanish (COLOMBIA)',
+# 'es' => '0x140a Spanish (COSTA RICA)',
+ 'hr' => '0x041a Croatian',
+ 'cs' => '0x0405 Czech',
+ 'da' => '0x0406 Danish',
+# 'es' => '0x1c0a Spanish (DOMINICAN REPUBLIC)',
+# 'es' => '0x300a Spanish (ECUADOR)',
+# 'ar' => '0x0c01 Arabic (EGYPT)',
+# 'es' => '0x440a Spanish (EL SALVADOR)',
+ 'et' => '0x0425 Estonian',
+ 'fo' => '0x0438 Faeroese',
+ 'fi' => '0x040b Finnish',
+ 'fr' => '0x040c French (FRANCE)',
+ 'de' => '0x0407 German (GERMANY)',
+ 'el' => '0x0408 Greek',
+# 'es' => '0x100a Spanish (GUATEMALA)',
+# 'es' => '0x480a Spanish (HONDURAS)',
+# 'zh' => '0x0c04 Chinese (HONG KONG)',
+ 'hu' => '0x040e Hungarian',
+ 'is' => '0x040f Icelandic',
+ 'hi' => '0x0439 Hindi',
+ 'in' => '0x04',
+ 'fa' => '0x0429 Farsi',
+# 'ar' => '0x0801 Arabic (IRAQ)',
+# 'en' => '0x1809 English (IRELAND)',
+ 'iw' => '0x04',
+ 'it' => '0x0410 Italian',
+# 'en' => '0x2009 English (JAMAICA)',
+ 'ja' => '0x0411 Japanese',
+# 'ar' => '0x2c01 Arabic (JORDAN)',
+ 'sw' => '0x0441 Swahili',
+ 'ko' => '0x0412 Korean',
+# 'ar' => '0x3401 Arabic (KUWAIT)',
+ 'al' => '0x0426 Latvian (Lettish)',
+# 'ar' => '0x3001 Arabic (LEBANON)',
+# 'ar' => '0x1001 Arabic (LIBYAN ARAB JAMAHIRIYA)',
+# 'de' => '0x1407 German (LIECHTENSTEIN)',
+ 'lt' => '0x0427 Lithuanian',
+# 'de' => '0x1007 German (LUXEMBOURG)',
+# 'zh' => '0x1404 Chinese (MACAU)',
+ 'mk' => '0x042f Macedonian',
+# 'ms' => '0x043e Malay (MALAYSIA)',
+# 'es' => '0x080a Spanish (MEXICO)',
+# 'fr' => '0x180c French (MONACO)',
+# 'ar' => '0x1801 Arabic (MOROCCO)',
+ 'nl' => '0x0413 Dutch',
+# 'en' => '0x1409 English (NEW ZEALAND)',
+# 'es' => '0x4c0a Spanish (NICARAGUA)',
+ 'no' => '0x0414 Norwegian',
+# 'ar' => '0x2001 Arabic (OMAN)',
+ 'ur' => '0x0420 Urdu',
+# 'es' => '0x180a Spanish (PANAMA)',
+# 'es' => '0x3c0a Spanish (PARAGUAY)',
+# 'es' => '0x280a Spanish (PERU)',
+# 'en' => '0x3409 English (PHILIPPINES)',
+ 'pl' => '0x0415 Polish',
+ 'pt' => '0x0816 Portuguese (PORTUGAL)',
+# 'es' => '0x500a Spanish (PUERTO RICO)',
+# 'ar' => '0x4001 Arabic (QATAR)',
+ 'ro' => '0x0418 Romanian',
+ 'ru' => '0x0419 Russian',
+ 'ar' => '0x0401 Arabic (SAUDI ARABIA)',
+# 'zh' => '0x1004 Chinese (SINGAPORE)',
+ 'sk' => '0x041b Slovak',
+ 'sl' => '0x0424 Slovenian',
+ 'af' => '0x0436 Afrikaans',
+ 'ca' => '0x0403 Catalan',
+ 'sv' => '0x041d Swedish',
+# 'de' => '0x0807 German (SWITZERLAND)',
+# 'ar' => '0x2801 Arabic (SYRIAN ARAB REPUBLIC)',
+# 'zh' => '0x0404 Chinese (TAIWAN, PROVINCE OF CHINA)',
+ 'th' => '0x041e Thai',
+# 'en' => '0x2c09 English (TRINIDAD AND TOBAGO)',
+# 'ar' => '0x1c01 Arabic (TUNISIA)',
+ 'tr' => '0x041f Turkish',
+ 'uk' => '0x0422 Ukrainian',
+# 'ar' => '0x3801 Arabic (UNITED ARAB EMIRATES)',
+# 'en' => '0x0809 English (UNITED KINGDOM)',
+# 'en' => '0x0409 English (UNITED STATES)',
+# 'es' => '0x380a Spanish (URUGUAY)',
+# 'es' => '0x200a Spanish (VENEZUELA)',
+ 'vi' => '0x242a Vietnamese',
+# 'ar' => '0x2401 Arabic (YEMEN)',
+# 'en' => '0x3009 English (ZIMBABWE)',
+ #'' => '',
+);
+
+my %hhk_global_property = (
+ 'ImageType' => 'Folder',
+);
+
+my %hhc_global_property = (
+ 'ImageType' => 'Folder',
+);
+
+
+######################################### not used
+#
+# if needed texi to unicode, maybe this could be in utf8.init, but currently
+# no unicode
+my %chm_texi_map = %texi_map;
+my %chm_simple_map_texi = %simple_map_texi;
+my %chm_style_map_texi = ();
+
+foreach my $command (keys(%style_map_texi))
+{
+ $chm_style_map_texi{$command} = {};
+ foreach my $key (keys (%{$style_map_texi{$command}}))
+ {
+#print STDERR "$command, $key, $style_map_texi{$command}->{$key}\n";
+ $chm_style_map_texi{$command}->{$key} =
+ $style_map_texi{$command}->{$key};
+ }
+}
+
+foreach my $key (keys(%unicode_accents))
+{
+# $chm_style_map{$key}->{'function'} = \&t2h_utf8_accent;
+ $chm_style_map_texi{$key}->{'function'} = \&t2h_utf8_accent;
+}
+
+foreach my $key (%things_map)
+{
+ if (exists($unicode_map{$key}) and ($unicode_map{$key} ne ''))
+ {
+# $chm_things_map{$key} = chr(hex($unicode_map{$key}));
+ $chm_texi_map{$key} = chr(hex($unicode_map{$key}));
+ }
+}
+
+$chm_simple_map_texi{"\n"} = ' ';
+######################################### end not used
+
+# at least kchmviewer has trouble with the corresponding textual entities
+foreach my $thing ('OE', 'oe', 'euro')
+{
+ $things_map{$thing} = $numeric_entity_map{$thing};
+ $pre_map{$thing} = $numeric_entity_map{$thing};
+ $simple_format_texi_map{$thing} = $numeric_entity_map{$thing};
+}
+
+my $hhp_lines;
+# this cannot be in chm_init_out, because it should be before toc_body
+# call.
+sub chm_initialize_variables()
+{
+ $hhp_lines = '';
+}
+
+sub chm_init_out()
+{
+ &$default_init_out();
+# Setting out file encoding to utf8 doesn't work. Seen on the web that
+# htmlhelp 1.x isn't utf8 aware
+# $Texi2HTML::THISDOC{'OUT_ENCODING'} = 'utf8';
+ return if ($null_device_file{$Texi2HTML::THISDOC{'filename'}->{'top'}});
+ my $hhk_file =
"$Texi2HTML::THISDOC{'destination_directory'}$Texi2HTML::THISDOC{'file_base_name'}"
. ".hhk";
+ open (IDXFILE, ">$hhk_file") or
+ die "Can't open $hhk_file for writing: $!\n";
+ if ($USE_UNICODE and defined($Texi2HTML::THISDOC{'OUT_ENCODING'}) and
$Texi2HTML::THISDOC{'OUT_ENCODING'} ne '')
+ {
+ binmode(IDXFILE, ":encoding($Texi2HTML::THISDOC{'OUT_ENCODING'})");
+ }
+
+ print "# writing HTML Help index in $hhk_file...\n" if $VERBOSE;
+ print IDXFILE "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">\n<HTML>\n";
+ print IDXFILE "<HEAD>\n<meta name=\"GENERATOR\"
content=\"$Texi2HTML::THISDOC{program}\">\n";
+ print IDXFILE "<!-- Sitemap 1.0 -->\n</HEAD>\n<BODY>\n";
+ print IDXFILE "<OBJECT type=\"text/site properties\">\n";
+ foreach my $property (keys(%hhk_global_property))
+ {
+ print IDXFILE "<param name=\"$property\"
value=\"$hhk_global_property{$property}\">\n";
+
+ }
+ print IDXFILE "</OBJECT>\n";
+
+ my $hhp_file =
"$Texi2HTML::THISDOC{'destination_directory'}$Texi2HTML::THISDOC{'file_base_name'}.hhp";
+ print "# writing HTML Help project in $hhp_file...\n" if $VERBOSE;
+ open (HHPFILE, ">$hhp_file") or
+ die "Can't open $hhp_file for writing: $!\n";
+ if ($USE_UNICODE and defined($Texi2HTML::THISDOC{'OUT_ENCODING'}) and
$Texi2HTML::THISDOC{'OUT_ENCODING'} ne '')
+ {
+ binmode(HHPFILE, ":encoding($Texi2HTML::THISDOC{'OUT_ENCODING'})");
+ }
+ my $language = $chm_languages{'en'};
+ my $documentlanguage = get_conf('documentlanguage');
+ $documentlanguage =~ s/_.*//;
+ if (exists ($chm_languages{$documentlanguage}))
+ {
+ $language = $chm_languages{$documentlanguage};
+ }
+ my $title = main::remove_texi($Texi2HTML::THISDOC{'title_texi'});
+ my $top_file = $Texi2HTML::THISDOC{'filename'}->{'top'};
+ print HHPFILE <<EOT;
+[OPTIONS]
+Compatibility=1.1 or later
+Compiled file=$Texi2HTML::THISDOC{'file_base_name'}.chm
+Contents file=$Texi2HTML::THISDOC{'file_base_name'}.hhc
+Default Window=Default
+Default topic=$top_file
+Display compile progress=No
+Full-text search=Yes
+Index file=$Texi2HTML::THISDOC{'file_base_name'}.hhk
+Language=$language
+Title=$title
+
+[WINDOWS]
+Default=,"$Texi2HTML::THISDOC{'file_base_name'}.hhc","$Texi2HTML::THISDOC{'file_base_name'}.hhk","$top_file","$top_file",,,,,0x22520,,0x384e,,,,,,,,0
+
+[FILES]
+EOT
+}
+
+sub chm_print_page_foot($)
+{
+ my $fh = shift;
+ print $fh <<EOT;
+<p>
+$PRE_BODY_CLOSE
+</p>
+</body>
+</html>
+EOT
+}
+
+sub chm_noop($$)
+{
+ return '';
+}
+
+# Convert texi to string
+sub chm_text($)
+{
+ my $text = shift;
+ return main::simple_format(undef,undef,$text);
+}
+
+
+my @hhc_lines;
+
+sub chm_toc_body($)
+{
+ my $elements_ref = shift;
+ &$default_toc_body($elements_ref);
+ my $level = 0;
+ my %chm_files;
+ @hhc_lines = ();
+ foreach my $element (@$elements_ref)
+ {
+ while ($level != $element->{'toc_level'})
+ {
+ if ($level < $element->{'toc_level'})
+ {
+ push (@hhc_lines, "<UL>\n");
+ $level++;
+ }
+ elsif ($level > $element->{'toc_level'})
+ {
+ push (@hhc_lines, "</UL>\n");
+ $level--;
+ }
+ }
+ my $text = '';
+ if ($NUMBER_SECTIONS)
+ {
+ $text .= $element->{'number'} . " ";
+
+ }
+ $text .= chm_text($element->{'texi'});
+ $text =~ s/^\s*//;
+ push (@hhc_lines, "<LI> <OBJECT type=\"text/sitemap\">\n<param
name=\"Name\" value=\"$text\">\n<param name=\"Local\"
value=\"$element->{'file'}#$element->{'target'}\">\n</OBJECT> </LI>\n");
+ if (!$chm_files{$element->{'file'}})
+ {
+ $hhp_lines .= "$element->{'file'}\n";
+ $chm_files{$element->{'file'}} = 1;
+ }
+ }
+ while ($level > 0)
+ {
+ push (@hhc_lines, "</UL>\n");
+ $level--;
+ }
+}
+
+# key:
+# origin_href:
+# entry:
+# texi entry:
+# element_href:
+# element_text:
+sub chm_index_summary_file_entry ($$$$$$$$)
+{
+ my $name = shift;
+ my $key = shift;
+ my $origin_href = shift;
+ my $entry = shift;
+ my $text = '';
+ #$entry = &$protect_text($key);
+ my $texi_entry = shift;
+ my $element_href = shift;
+ my $element_text = shift;
+ my $is_printed = shift;
+ $entry = chm_text($texi_entry);
+ print IDXFILE "<LI> <OBJECT type=\"text/sitemap\">\n<param name=\"Name\"
value=\"$entry\">\n<param name=\"Local\" value=\"$origin_href\">\n</OBJECT>
</LI>\n";
+}
+
+sub chm_index_summary_file_begin($$)
+{
+ my $name = shift;
+ my $is_printed = shift;
+}
+
+# file is not closed here but in finish_out.
+sub chm_index_summary_file_end($$)
+{
+ my $name = shift;
+ my $is_printed = shift;
+}
+
+sub chm_finish_out()
+{
+ return if ($null_device_file{$Texi2HTML::THISDOC{'filename'}->{'top'}});
+ print IDXFILE "</BODY>\n</HTML>\n";
+ close (IDXFILE);
+ my $hhc_file =
"$Texi2HTML::THISDOC{'destination_directory'}$Texi2HTML::THISDOC{'file_base_name'}.hhc";
+ open (HHCFILE, ">$hhc_file") or
+ die "Can't open $hhc_file for writing: $!\n";
+ if ($USE_UNICODE and defined($Texi2HTML::THISDOC{'OUT_ENCODING'}) and
$Texi2HTML::THISDOC{'OUT_ENCODING'} ne '')
+ {
+ binmode(HHCFILE, ":encoding($Texi2HTML::THISDOC{'OUT_ENCODING'})");
+ }
+
+ print HHCFILE "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">\n<HTML>\n";
+ print HHCFILE "<HEAD>\n<meta name=\"GENERATOR\"
content=\"$Texi2HTML::THISDOC{program}\">\n";
+ print HHCFILE "<!-- Sitemap 1.0 -->\n</HEAD>\n<BODY>\n";
+ print HHCFILE "<OBJECT type=\"text/site properties\">\n";
+ foreach my $property (keys(%hhc_global_property))
+ {
+ print HHCFILE "<param name=\"$property\"
value=\"$hhc_global_property{$property}\">\n";
+
+ }
+ print HHCFILE "</OBJECT>\n";
+ main::print_lines(\*HHCFILE, address@hidden);
+ print HHCFILE "</HTML>\n</BODY>\n";
+ print HHPFILE $hhp_lines;
+ close (HHPFILE);
+}
+
+1;
Index: maintained_extra/html32.init
===================================================================
RCS file: maintained_extra/html32.init
diff -N maintained_extra/html32.init
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ maintained_extra/html32.init 10 Sep 2009 20:32:28 -0000 1.1
@@ -0,0 +1,429 @@
+# -*-perl-*-
+#+##############################################################################
+#
+# html32.init: output HTML 3.2
+#
+# Copyright (C) 2003-2008 Patrice Dumas <address@hidden>
+#
+# 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
+#
+#-##############################################################################
+# 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
+
+use strict;
+
+html_default_load();
+
+$DOCTYPE = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"
"http://www.w3.org/TR/html32/loose.dtd">';
+
+$FRAMESET_DOCTYPE = $DOCTYPE;
+
+$BODYTEXT = 'bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080"
alink="#FF0000"';
+# this controls the pre style for menus
+$MENU_PRE_STYLE = '';
+
+$NO_BULLET_LIST_STYLE ='';
+
+$USE_ISO = 0;
+$MENU_SYMBOL = '*';
+
+# This lines are inserted before and after the shortcontents
+$BEFORE_OVERVIEW = "";
+$AFTER_OVERVIEW = '';
+
+# This lines are inserted before and after the contents
+$BEFORE_TOC_LINES = "";
+$AFTER_TOC_LINES = '';
+
+# html version for latex2html
+$L2H_HTML_VERSION = "3.2";
+
+# no class in html 32
+$NO_BULLET_LIST_ATTRIBUTE = '';
+
+# no css
+$CSS_LINES = "";
+%css_map = ();
+
+$things_map{'oe'} = 'œ';
+$things_map{'OE'} = 'Œ';
+$things_map{'dots'} = '<small>...</small>';
+$things_map{'enddots'} = '<small>...</small>';
+$things_map{'euro'} = 'Euro';
+$things_map{'geq'} = '>=';
+$things_map{'leq'} = '<=';
+$things_map{'quotedblleft'} = '``';
+$things_map{'quotedblright'} = "''";
+$things_map{'quoteleft'} = '`';
+$things_map{'quoteright'} = "'";
+$things_map{'quotedblbase'} = ',,';
+$things_map{'quotesinglbase'} = ',';
+$things_map{'guillemetleft'} = '<<';
+$things_map{'guillemetright'} = '>>';
+$things_map{'guillemotleft'} = '<<';
+$things_map{'guillemotright'} = '>>';
+$things_map{'guilsinglleft'} = '<';
+$things_map{'guilsinglright'} = '>';
+
+foreach my $style ('oe', 'OE', 'euro', 'geq', 'leq',
+ 'quotedblleft', 'quotedblright',
+ 'quoteleft', 'quoteright',
+ 'quotedblbase', 'quotesinglbase', 'guillemetleft', 'guillemetright',
+ 'guillemotleft', 'guillemotright', 'guilsinglleft', 'guilsinglright')
+{
+ $pre_map{$style} = $things_map{$style};
+}
+
+$style_map{'sansserif'} = {};
+$style_map{'r'} = {};
+$style_map_pre{'r'} = {};
+$style_map_pre{'sansserif'} = {};
+$style_map{'titlefont'} = {'function' => \&t2h_html32_titlefont,
+ 'type' => 'simple_style'};
+$style_map_pre{'titlefont'} = {};
+
+$format_map{'multitable'} = 'table';
+
+# Avoid adding h1 if the text is empty
+# no class in html 3.2
+sub t2h_html32_titlefont($$$)
+{
+ shift;
+ my $args = shift;
+ return "<h1>$args->[0]</h1>" if ($args->[0] =~ /\S/);
+ return '';
+}
+
+# formatting functions
+
+$summary_letter = \&t2h_html32_summary_letter;
+$print_index = \&t2h_html32_print_index;
+$protect_text = \&t2h_html32_protect_text;
+$normal_text = \&t2h_html32_normal_text;
+$heading = \&t2h_html32_heading;
+$preformatted = \&t2h_html32_preformatted;
+$raw = \&t2h_html32_raw;
+$menu = \&t2h_html32_menu;
+$foot_section = \&t2h_html32_foot_section;
+$cartouche = \&t2h_html32_cartouche;
+$listoffloats = \&t2h_html32_listoffloats;
+$float = \&t2h_html32_float;
+$acronym_like = \&t2h_html32_acronym_like;
+$row = \&t2h_html32_row;
+$cell = \&t2h_html32_cell;
+$quotation = \&t2h_html32_quotation;
+
+
+
+
+# " is not in html 3.2
+sub t2h_html32_protect_text($)
+{
+ my $text = shift;
+ $text =~ s/&/&/g;
+ $text =~ s/</</g;
+ $text =~ s/>/>/g;
+ $text =~ s/\"/"/g;
+ return $text;
+}
+
+sub t2h_html32_normal_text($$$$$)
+{
+ my $text = shift;
+ my $in_raw_text = shift;
+ my $in_preformatted = shift;
+ my $in_code = shift;
+ my $in_simple = shift;
+ my $style_stack = shift;
+ $text = uc($text) if (in_cmd($style_stack, 'sc'));
+ $text = &$protect_text($text) unless($in_raw_text);
+ if (! $in_code and !$in_preformatted)
+ {
+ if ($in_raw_text) #FIXME really do that ? It is done by makeinfo
+ {
+ $text =~ s/``/"/g;
+ $text =~ s/''/"/g;
+ }
+ else
+ {
+ $text =~ s/``/"/g;
+ $text =~ s/''/"/g;
+ }
+ # temporary reuse '' to store --- !....
+ # FIXME won't '---' be handled wrongly?
+ # FIXME really do that in raw text?
+ $text =~ s/---/''/g;
+ $text =~ s/--/-/g;
+ $text =~ s/''/--/g;
+ }
+ return $text;
+}
+
+# a preformatted section
+sub t2h_html32_preformatted($$$)
+{
+ my $text = shift;
+ my $pre_style = shift;
+ my $class = shift;
+
+ return '' if ($text eq '');
+ return "<pre>$text</pre>";
+}
+
+# a heading for an element
+sub t2h_html32_heading($)
+{
+ my $element = shift;
+ my $command = shift;
+ my $texi_line = shift;
+ my $line = shift;
+ my $in_preformatted = shift;
+ my $one_section = shift;
+ my $element_heading = shift;
+
+ my $level = 3;
+ if (!$element->{'node'})
+ {
+ $level = $element->{'level'};
+ }
+ else
+ {
+ return '' unless ($element->{'this'} and !$element->{'with_section'});
+ }
+ my $text = $element->{'text'};
+ # when it is a heading, the element is irrelevant, so the command and the
+ # line are used...
+ if (defined($command) and $command =~ /heading/)
+ {
+ $level = $main::sec2level{$command} if
(defined($main::sec2level{$command}));
+ if (defined($line))
+ {
+ $text = $line;
+ # this isn't done in main program in that case...
+ chomp ($text);
+ $text =~ s/^\s*//;
+ }
+ }
+ elsif (defined($element->{'tocid'}) and $TOC_LINKS)
+ {
+ $text = &$anchor ('',
"$Texi2HTML::THISDOC{'toc_file'}#$element->{'tocid'}", $text);
+ }
+ $level = 1 if ($level == 0);
+ return '' if ($text !~ /\S/);
+ if (!$in_preformatted)
+ {
+ return "<h$level> $text </h$level>\n";
+ }
+ else
+ {
+ return "<strong>$text</strong>\n";
+ }
+}
+
+# formatting of raw regions
+# ih L2H is true another mechanism is used for tex
+sub t2h_html32_raw($$)
+{
+ my $style = shift;
+ my $text = shift;
+ my $expanded = 1 if (grep {$style eq $_} @EXPAND);
+ if ($style eq 'verbatim' or $style eq 'verbatiminclude' or ($style eq
'tex' and $expanded))
+ {
+ return "<pre>" . &$protect_text($text) . '</pre>';
+ }
+ elsif ($style eq 'html' and $expanded)
+ {
+ chomp ($text);
+ return $text;
+ }
+ elsif ($expanded)
+ {
+ main::msg_debug ("(bug) unknown style $style");
+ return &$protect_text($text);
+ }
+ return '';
+}
+
+# a whole menu
+sub t2h_html32_menu($)
+{
+ my $text = shift;
+ if ($text =~ /\S/)
+ {
+ return "<table border=\"0\" cellspacing=\"0\">\n"
+ . $text . "</table>\n";
+ }
+}
+
+# a simple menu entry ref in case we aren't in a standard menu context
+sub t2h_html32_foot_section($)
+{
+ my $lines = shift;
+ unshift (@$lines, "<hr>\n", "<h3>Footnotes</h3>\n");
+ return $lines;
+}
+
+# a cartouche
+sub t2h_html32_cartouche($)
+{
+ my $text = shift;
+
+ if ($text =~ /\S/)
+ {
+ return "<table border=\"1\"><tr><td>\n" . $text .
"</td></tr></table>\n";
+ }
+ return '';
+}
+
+
+# no style
+sub t2h_html32_summary_letter($$$$$$$)
+{
+ my $letter = shift;
+ my $file = shift;
+ my $identifier = shift;
+ my $index_element_id = shift;
+ my $number = shift;
+ my $index_element = shift;
+ my $index_name = shift;
+
+ return &$anchor('', $file . '#' . $identifier, '<b>' .
&$protect_text($letter) . '</b>');
+}
+
+# format a whole index
+#
+# argument:
+# index text
+# index name
+sub t2h_html32_print_index($$)
+{
+ my $text = shift;
+ my $name = shift;
+ return '' if (!defined($text));
+ return "<table border=\"0\">\n" .
+ "<tr><td></td><th align=\"left\">" . &$I('Index Entry') . "</th><th
align=\"left\"> " . &$I('Section') . "</th></tr>\n"
+ . "<tr><td colspan=\"3\"> $DEFAULT_RULE</td></tr>\n" . $text .
+ "</table>\n";
+}
+
+sub t2h_html32_float($$$$$)
+{
+ my $text = shift;
+ my $float = shift;
+ my $caption = shift;
+ my $shortcaption = shift;
+
+ my $label = '';
+ if (exists($float->{'id'}))
+ {
+ $label = &$anchor($float->{'id'});
+ }
+ my $caption_text = '';
+
+ if (defined($float->{'caption_texi'}))
+ {
+ $caption_text = $caption;
+ }
+ elsif (defined($float->{'shortcaption_texi'}))
+ {
+ $caption_text = $shortcaption;
+ }
+ elsif (defined($caption))
+ {
+ $caption_text = $caption;
+ }
+
+ return "$label\n" . $text . $caption_text;
+}
+
+sub t2h_html32_listoffloats($$$)
+{
+ my $style_texi = shift;
+ my $style = shift;
+ my $float_entries = shift;
+
+ my $result = "<dl>\n" ;
+ foreach my $float_entry (@$float_entries)
+ {
+ $result .= $float_entry;
+ }
+ return $result . "</dl>\n";
+}
+
+# no acronym, and no abbr in html 3.2
+sub t2h_html32_acronym_like($$$$$$)
+{
+ my $command = shift;
+ my $acronym_texi = shift;
+ my $acronym_text = shift;
+ my $with_explanation = shift;
+ my $explanation_lines = shift;
+ my $explanation_text = shift;
+ my $explanation_simply_formatted = shift;
+
+ if ($with_explanation)
+ {
+ return &$I('%{acronym_like} (%{explanation})', {'acronym_like' =>
$acronym_text, 'explanation' => $explanation_text},{'duplicate'=>1})
+ }
+ else
+ {
+ return $acronym_text;
+ }
+}
+
+# row in multitable
+sub t2h_html32_row($$)
+{
+ my $text = shift;
+ my $macro = shift;
+
+ if ($text =~ /\S/)
+ {
+ return '<tr>' . $text . '</tr>' . "\n";
+ }
+ return '';
+}
+
+# cell in multitable
+sub t2h_html32_cell($$)
+{
+ my $text = shift;
+ my $row_macro = shift;
+ my $columnfractions = shift;
+ my $prototype_row = shift;
+
+ $text =~ s/^\s*//;
+ $text =~ s/\s*$//;
+
+ if ($row_macro eq 'headitem')
+ {
+ return "<th>" . $text . '</th>';
+ }
+ return "<td>" . $text . '</td>';
+}
+
+sub t2h_html32_quotation($$$$)
+{
+ my $command = shift;
+ my $text = shift;
+ my $argument_text = shift;
+ my $argument_text_texi = shift;
+ return "<blockquote>" . $text . "</blockquote>\n";
+}
+
Index: maintained_extra/tex4ht.init
===================================================================
RCS file: maintained_extra/tex4ht.init
diff -N maintained_extra/tex4ht.init
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ maintained_extra/tex4ht.init 10 Sep 2009 20:32:28 -0000 1.1
@@ -0,0 +1,345 @@
+# -*-perl-*-
+
+#+##############################################################################
+#
+# tex4ht.init: use tex4ht to convert tex to html
+#
+# Copyright (C) 2005-2008 Patrice Dumas <address@hidden>
+#
+# 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
+#
+#-##############################################################################
+# To customize the command and the options, you could set
+# $Texi2HTML::TeX4HT::STYLE_MATH to latex/tex
+# $Texi2HTML::TeX4HT::STYLE_TEX to latex/texi
+# and/or change
+# $Texi2HTML::TeX4HT::tex4ht_command_math
+# and $Texi2HTML::TeX4HT::tex4ht_options_math
+# $Texi2HTML::TeX4HT::tex4ht_command_tex
+# and $Texi2HTML::TeX4HT::tex4ht_options_tex
+
+
+if (defined($OUTPUT_FORMAT) and $OUTPUT_FORMAT eq 'html')
+{
+push @command_handler_init, \&Texi2HTML::TeX4HT::tex4ht_init;
+push @command_handler_process, \&Texi2HTML::TeX4HT::tex4ht_process;
+push @command_handler_finish, \&Texi2HTML::TeX4HT::tex4ht_finish;
+
+$command_handler{'math'} =
+ { 'init' => \&Texi2HTML::TeX4HT::tex4ht_to_latex,
+ 'expand' => \&Texi2HTML::TeX4HT::tex4ht_do_tex
+ };
+$command_handler{'tex'} =
+ { 'init' => \&Texi2HTML::TeX4HT::tex4ht_to_latex,
+ 'expand' => \&Texi2HTML::TeX4HT::tex4ht_do_tex
+ };
+}
+
+{
+use Cwd;
+
+package Texi2HTML::TeX4HT;
+
+$STYLE_MATH = 'texi' if (!defined($STYLE_MATH));
+$STYLE_TEX = 'tex' if (!defined($STYLE_TEX));
+
+if (!defined($tex4ht_command_math))
+{
+ $tex4ht_command_math = 'httexi';
+ $tex4ht_command_math = 'htlatex' if ($STYLE_MATH eq 'latex');
+ $tex4ht_command_math = 'httex' if ($STYLE_MATH eq 'tex');
+}
+if (!defined($tex4ht_command_tex))
+{
+ $tex4ht_command_tex = 'httex';
+ $tex4ht_command_tex = 'htlatex' if ($STYLE_TEX eq 'latex');
+ $tex4ht_command_tex = 'httexi' if ($STYLE_TEX eq 'texi');
+}
+
+my %commands = ();
+
+my $tex4ht_initial_dir;
+my $tex4ht_out_dir;
+my $tex4ht_latex_failed = 0;
+
+sub tex4ht_init
+{
+ # set file names
+ $tex4ht_initial_dir = Cwd::abs_path;
+ if ($null_device_file{$Texi2HTML::THISDOC{'filename'}->{'top'}})
+ {
+ #Â when output is a null device we skip entirely the tex4ht stuff.
+ $tex4ht_latex_failed = 1;
+ return;
+ }
+ $tex4ht_out_dir = "$Texi2HTML::THISDOC{'destination_directory'}";
+ $tex4ht_out_dir = './' if (!defined($tex4ht_out_dir) or $tex4ht_out_dir =~
/^\s*$/);
+ my $tex4ht_basename = "$Texi2HTML::THISDOC{'file_base_name'}_tex4ht";
+ $tex4ht_output_counter = 0;
+ %tex4ht_results = ();
+ $tex4ht_latex_failed = 0;
+ # this initialization doesn't seems to be needed, but it is cleaner anyway
+ %commands = ();
+ $commands{'math'}->{'style'} = $STYLE_MATH;
+ $commands{'tex'}->{'style'} = $STYLE_TEX;
+ $commands{'math'}->{'exec'} = $tex4ht_command_math;
+ $commands{'tex'}->{'exec'} = $tex4ht_command_tex;
+ foreach my $command ('math', 'tex')
+ {
+ my $style = $commands{$command}->{'style'};
+ $commands{$command}->{'basename'} = $tex4ht_basename . "_$command";
+ my $suffix = '.tex';
+ $suffix = '.texi' if ($style eq 'texi');
+ $commands{$command}->{'basefile'} = $commands{$command}->{'basename'} .
$suffix;
+ $commands{$command}->{'html_file'} = $commands{$command}->{'basename'} .
'.html';
+ $commands{$command}->{'rfile'} = $tex4ht_out_dir .
$commands{$command}->{'basefile'};
+ my $rfile = $commands{$command}->{'rfile'};
+ local *TEX4HT_TEXFILE;
+ unless (open (*TEX4HT_TEXFILE, ">$rfile"))
+ {
+ main::document_warn ("t2h_tex4ht error opening $rfile: $!");
+ $tex4ht_latex_failed = 1;
+ return;
+ }
+ $commands{$command}->{'handle'} = *TEX4HT_TEXFILE;
+ }
+ foreach my $command ('math', 'tex')
+ {
+ $commands{$command}->{'counter'} = 0;
+ my $style = $commands{$command}->{'style'};
+ my $fh = $commands{$command}->{'handle'};
+ my $comment = '@c';
+ $comment = '%' if ($style ne 'texi');
+ $comment .= " Automatically generated\n";
+ if ($style eq 'texi')
+ {
+ print $fh "\\input texinfo
address@hidden $commands{$command}->{'basename'}.info\n";
+ print $fh "$comment";
+ }
+ else
+ {
+ print $fh "$comment";
+ if ($style eq 'latex')
+ {
+ print $fh "\\documentstyle{article}\n\\begin{document}\n";
+ }
+ elsif ($style eq 'tex')
+ {
+ print $fh "\\csname tex4ht\\endcsname\n";
+ }
+ }
+ }
+}
+
+sub tex4ht_to_latex
+{
+ my $command = shift;
+ my $text = shift;
+ my $counter = shift;
+ my $style = $commands{$command}->{'style'};
+ my $fh = $commands{$command}->{'handle'};
+
+ # write to tex file
+ my $before_comment = "address@hidden";
+ $before_comment = "\\HCode{\\Hnewline " if ($style ne 'texi');
+ my $after_comment = "address@hidden verbatim\n";
+ $after_comment = "\\Hnewline}\n" if ($style ne 'texi');
+
+ my $begin_comment = "<!-- tex4ht_begin $commands{$command}->{'basename'}
$command $counter -->";
+ print $fh "$before_comment$begin_comment$after_comment";
+ if ($command eq 'tex')
+ {
+ print $fh $text;
+ }
+ elsif ($command eq 'math')
+ {
+ if ($style eq 'texi')
+ {
+ print $fh '@math{' . $text . "}\n";
+ }
+ else
+ {
+ print $fh "\\IgnorePar \$" . $text . "\$";
+ }
+ }
+ my $end_comment = "<!-- tex4ht_end $commands{$command}->{'basename'}
$command $counter -->";
+ print $fh "$before_comment$end_comment$after_comment";
+ $commands{$command}->{'counter'}++;
+ return 1;
+}
+
+my %tex4ht_results;
+
+sub tex4ht_process
+{
+ foreach my $command ('math', 'tex')
+ {
+ tex4ht_finish_latex($command);
+ }
+ unless (chdir $tex4ht_out_dir)
+ {
+ main::document_warn ("t2h_tex4ht chdir to $tex4ht_out_dir failed");
+ $tex4ht_latex_failed = 1;
+ return;
+ }
+ print STDERR "cwd($tex4ht_out_dir):" . Cwd::cwd() ."\n" if
($Texi2HTML::Config::VERBOSE);
+
+ foreach my $command ('math', 'tex')
+ {
+ tex4ht_process_command($command);
+ }
+ tex4ht_return_to_dir();
+}
+
+sub tex4ht_finish_latex
+{
+#print STDERR "$style $tex4ht_latex_failed $tex4ht_counter\n";
+ my $command = shift;
+ return if ($tex4ht_latex_failed);
+
+ my $style = $commands{$command}->{'style'};
+ my $fh = $commands{$command}->{'handle'};
+ # finish the tex file
+ if ($style eq 'latex')
+ {
+ print $fh "\\end{document}\n";
+ }
+ elsif ($style eq 'tex')
+ {
+ print $fh "\n\\bye\n";
+ }
+ else
+ {
+ print $fh "address@hidden";
+ }
+ close ($fh);
+}
+
+sub tex4ht_process_command
+{
+ my $command = shift;
+ return unless ($commands{$command}->{'counter'});
+ main::document_warn ("t2h_tex4ht $commands{$command}->{'basefile'} missing")
unless (-f $commands{$command}->{'basefile'});
+ my $style = $commands{$command}->{'style'};
+ # now run tex4ht
+ my $options = '';
+ $options = $tex4ht_options_math if (($style eq 'math') and
defined($tex4ht_options_math));
+ $options = $tex4ht_options_tex if (($style eq 'tex') and
defined($tex4ht_options_tex));
+ my $cmd = "$commands{$command}->{'exec'} $commands{$command}->{'basefile'}
$options";
+ print STDERR "tex4ht command: $cmd\n" if ($Texi2HTML::Config::VERBOSE);
+ if (system($cmd))
+ {
+ main::document_warn ("t2h_tex4ht command: $cmd failed");
+ tex4ht_return_to_dir();
+ $tex4ht_latex_failed = 1;
+ return;
+ }
+
+ # extract the html from the file created by tex4ht
+ my $html_basefile = $commands{$command}->{'html_file'};
+ unless (open (TEX4HT_HTMLFILE, $html_basefile))
+ {
+ main::document_warn ("t2h_tex4ht error opening $html_basefile: $!");
+ tex4ht_return_to_dir();
+ $tex4ht_latex_failed = 1;
+ return;
+ }
+ my $got_count = 0;
+ my $line;
+ while ($line = <TEX4HT_HTMLFILE>)
+ {
+ #print STDERR "while $line";
+ if ($line =~ /!-- tex4ht_begin $commands{$command}->{'basename'} (\w+)
(\d+) --/)
+ {
+ my $command = $1;
+ my $count = $2;
+ my $text = '';
+ my $end_found = 0;
+ while ($line = <TEX4HT_HTMLFILE>)
+ {
+ #print STDERR "while search $command $count $line";
+ if ($line =~ /!-- tex4ht_end $commands{$command}->{'basename'}
$command $count --/)
+ {
+ $got_count++;
+ chomp($text);
+ $tex4ht_results{"${command}_$count"} = $text;
+ $end_found = 1;
+ last;
+ }
+ else
+ {
+ $text .= $line;
+ }
+ }
+ unless ($end_found)
+ {
+ main::document_warn ("t2h_tex4ht: end of $command $count not
found");
+ }
+ }
+ }
+ if ($got_count != $commands{$command}->{'counter'} and
($Texi2HTML::Config::VERBOSE))
+ {
+ main::document_warn ("t2h_tex4ht: got $got_count for
$commands{$command}->{'counter'} items entered");
+ }
+ close (TEX4HT_HTMLFILE);
+
+ push @{$Texi2HTML::THISDOC{'css_import_lines'}}, "address@hidden
\"$commands{$command}->{'basename'}.css\";\n";
+
+}
+
+sub tex4ht_return_to_dir
+{
+ unless (chdir $tex4ht_initial_dir)
+ {
+ die "* t2h_tex4ht unable to return to the initial dir\n";
+ }
+}
+
+my $tex4ht_output_counter = 0;
+
+sub tex4ht_do_tex
+{
+ my $command = shift;
+ my $counter = shift;
+ # return the resulting html
+ if (exists ($tex4ht_results{"${command}_$counter"}) and
defined($tex4ht_results{"${command}_$counter"}))
+ {
+ $tex4ht_output_counter++;
+ return $tex4ht_results{"${command}_$counter"};
+ }
+ else
+ {
+ main::document_warn ("t2h_tex4ht: cannot find text to output for $command
number $counter");
+ return '';
+ }
+}
+
+sub tex4ht_finish
+{
+ my $tex4ht_in_counter = 0;
+ foreach my $command (keys(%commands))
+ {
+ $tex4ht_in_counter += $commands{$command}->{'counter'};
+ }
+ if (($tex4ht_output_counter != $tex4ht_in_counter) and
($Texi2HTML::Config::VERBOSE))
+ {
+ main::document_warn ("t2h_tex4ht: output $tex4ht_output_counter for
$tex4ht_in_counter items entered");
+ }
+}
+
+}
+1;
Index: doc/info_format_informations.txt
===================================================================
RCS file: doc/info_format_informations.txt
diff -N doc/info_format_informations.txt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ doc/info_format_informations.txt 10 Sep 2009 20:32:29 -0000 1.1
@@ -0,0 +1,100 @@
+Paragraph formatting and text indentation
+=========================================
+
+General formatting: after expanding Texinfo commands, of course, it just
+does simple text filling to column 72 (by default), breaking at
+whitespace.
+
+The biggest trick that comes to mind is that it's necessary
+to insert a second space when a sentence ends at the end of an input
+line. That is, given this input:
+
+ Blah some sentence foo.
+ Another sentence bar.
+
+The output would be:
+
+ Blah some sentence foo. Another sentence bar.
+
+with two spaces, not just one. (Ordinarily a newline would just become
+a single space when filled.) That is, unless @frenchspacing is in
+effect. See around line 2745 in makeinfo.c and the end_of_sentence_p
+function.
+
+However, we don't try to generalize this. If the input is:
+
+ Sentence foo. Sentence bar.
+
+We don't recognize that period as the end of a sentence and insert the
+extra space. It might actually be desirable to do that in theory, but
+in practice it's never been implement. The theory being that the author
+should have used two spaces in the Texinfo input file in the first
+place. (Whereas the author is not in control of how spaces are used in
+the first case above.)
+
+In general, what happens with whitespace is another case where the
+precise rules of what happens have never been written down. So if we
+see chances to improve things, or have slight variations, that's ok.
+
+
+Info output
+===========
+
+Well, let's see. Looking at the info.info and texinfo Info files, the
+general idea is as follows. Maybe we can turn this into a real
+definition eventually, but hopefully this will be enough to get started.
+I trust my metasyntax will be obvious.
+
+<info_file> ::=
+<preamble>
+<node>* | <indirect-table>
+<tag table>
+
+# The preamble is text at the beginning of each output file (if split).
+# It is ignored by Info readers.
+<preamble> ::=
+ <identification line> # "This is <filename>, produced by ..."
+ <copying text> # expansion of the @copying text
+ <dir entries> # from @dircategory and @direntry
+
+# The indirect table is used for the main file in the case of split
+# output. It specifies the starting byte position of each output file.
+# The positions are consecutive. We'll have to figure out the exact way
+# they are computed (eg, when the preamble bytes are counted and when
+# they're not), I don't have all that in my head.
+#
+<indirect-table> ::=
+"^_
+Indirect:"
+( <filename>: <bytepos> )*
+
+# Regular nodes. The next and prev pointers are omitted at the
+# last/first node.
+<node> ::=
+^_
+File: <filename>, Node: <nodeid>, Next: <nodeid>, Prev: <nodeid>, Up:
<nodeid>
+
+<then comes arbitrary text until the next ^_>
+
+
+# The tag table specifies the starting byte pos of each node and anchor
+# in the file. It appears last in the (main) output file.
+#
+# A split output file is the same as the main output file except it
+# omits the tag table. In particular, split files do include the
+# preamble text.
+#
+<tag table> ::=
+"^_
+Tag Table:"
+"(Indirect)" # this literal text appears only with split output
+( "Node" | "Ref" )":" <nodeid>"^?"<bytepos>
+"^_
+End Tag Table"
+
+# E.g., Node: Top^?1647 says that the node named "Top" starts at byte 1647
+# while Ref: Overview-Footnote-1^?30045 says that the anchor named
+# "Overview-Footnote-1" starts at byte 30045
+
+# The ^_ and ^? characters that I wrote out above are really one-byte
+# control characters, but you probably guessed that :).
Index: examples/tex4ht.init
===================================================================
RCS file: examples/tex4ht.init
diff -N examples/tex4ht.init
--- examples/tex4ht.init 3 Aug 2009 09:35:07 -0000 1.11
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,345 +0,0 @@
-# -*-perl-*-
-
-#+##############################################################################
-#
-# tex4ht.init: use tex4ht to convert tex to html
-#
-# Copyright (C) 2005-2008 Patrice Dumas <address@hidden>
-#
-# 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
-#
-#-##############################################################################
-# To customize the command and the options, you could set
-# $Texi2HTML::TeX4HT::STYLE_MATH to latex/tex
-# $Texi2HTML::TeX4HT::STYLE_TEX to latex/texi
-# and/or change
-# $Texi2HTML::TeX4HT::tex4ht_command_math
-# and $Texi2HTML::TeX4HT::tex4ht_options_math
-# $Texi2HTML::TeX4HT::tex4ht_command_tex
-# and $Texi2HTML::TeX4HT::tex4ht_options_tex
-
-
-if (defined($OUTPUT_FORMAT) and $OUTPUT_FORMAT eq 'html')
-{
-push @command_handler_init, \&Texi2HTML::TeX4HT::tex4ht_init;
-push @command_handler_process, \&Texi2HTML::TeX4HT::tex4ht_process;
-push @command_handler_finish, \&Texi2HTML::TeX4HT::tex4ht_finish;
-
-$command_handler{'math'} =
- { 'init' => \&Texi2HTML::TeX4HT::tex4ht_to_latex,
- 'expand' => \&Texi2HTML::TeX4HT::tex4ht_do_tex
- };
-$command_handler{'tex'} =
- { 'init' => \&Texi2HTML::TeX4HT::tex4ht_to_latex,
- 'expand' => \&Texi2HTML::TeX4HT::tex4ht_do_tex
- };
-}
-
-{
-use Cwd;
-
-package Texi2HTML::TeX4HT;
-
-$STYLE_MATH = 'texi' if (!defined($STYLE_MATH));
-$STYLE_TEX = 'tex' if (!defined($STYLE_TEX));
-
-if (!defined($tex4ht_command_math))
-{
- $tex4ht_command_math = 'httexi';
- $tex4ht_command_math = 'htlatex' if ($STYLE_MATH eq 'latex');
- $tex4ht_command_math = 'httex' if ($STYLE_MATH eq 'tex');
-}
-if (!defined($tex4ht_command_tex))
-{
- $tex4ht_command_tex = 'httex';
- $tex4ht_command_tex = 'htlatex' if ($STYLE_TEX eq 'latex');
- $tex4ht_command_tex = 'httexi' if ($STYLE_TEX eq 'texi');
-}
-
-my %commands = ();
-
-my $tex4ht_initial_dir;
-my $tex4ht_out_dir;
-my $tex4ht_latex_failed = 0;
-
-sub tex4ht_init
-{
- # set file names
- $tex4ht_initial_dir = Cwd::abs_path;
- if ($null_device_file{$Texi2HTML::THISDOC{'filename'}->{'top'}})
- {
- #Â when output is a null device we skip entirely the tex4ht stuff.
- $tex4ht_latex_failed = 1;
- return;
- }
- $tex4ht_out_dir = "$Texi2HTML::THISDOC{'destination_directory'}";
- $tex4ht_out_dir = './' if (!defined($tex4ht_out_dir) or $tex4ht_out_dir =~
/^\s*$/);
- my $tex4ht_basename = "$Texi2HTML::THISDOC{'file_base_name'}_tex4ht";
- $tex4ht_output_counter = 0;
- %tex4ht_results = ();
- $tex4ht_latex_failed = 0;
- # this initialization doesn't seems to be needed, but it is cleaner anyway
- %commands = ();
- $commands{'math'}->{'style'} = $STYLE_MATH;
- $commands{'tex'}->{'style'} = $STYLE_TEX;
- $commands{'math'}->{'exec'} = $tex4ht_command_math;
- $commands{'tex'}->{'exec'} = $tex4ht_command_tex;
- foreach my $command ('math', 'tex')
- {
- my $style = $commands{$command}->{'style'};
- $commands{$command}->{'basename'} = $tex4ht_basename . "_$command";
- my $suffix = '.tex';
- $suffix = '.texi' if ($style eq 'texi');
- $commands{$command}->{'basefile'} = $commands{$command}->{'basename'} .
$suffix;
- $commands{$command}->{'html_file'} = $commands{$command}->{'basename'} .
'.html';
- $commands{$command}->{'rfile'} = $tex4ht_out_dir .
$commands{$command}->{'basefile'};
- my $rfile = $commands{$command}->{'rfile'};
- local *TEX4HT_TEXFILE;
- unless (open (*TEX4HT_TEXFILE, ">$rfile"))
- {
- main::document_warn ("t2h_tex4ht error opening $rfile: $!");
- $tex4ht_latex_failed = 1;
- return;
- }
- $commands{$command}->{'handle'} = *TEX4HT_TEXFILE;
- }
- foreach my $command ('math', 'tex')
- {
- $commands{$command}->{'counter'} = 0;
- my $style = $commands{$command}->{'style'};
- my $fh = $commands{$command}->{'handle'};
- my $comment = '@c';
- $comment = '%' if ($style ne 'texi');
- $comment .= " Automatically generated\n";
- if ($style eq 'texi')
- {
- print $fh "\\input texinfo
address@hidden $commands{$command}->{'basename'}.info\n";
- print $fh "$comment";
- }
- else
- {
- print $fh "$comment";
- if ($style eq 'latex')
- {
- print $fh "\\documentstyle{article}\n\\begin{document}\n";
- }
- elsif ($style eq 'tex')
- {
- print $fh "\\csname tex4ht\\endcsname\n";
- }
- }
- }
-}
-
-sub tex4ht_to_latex
-{
- my $command = shift;
- my $text = shift;
- my $counter = shift;
- my $style = $commands{$command}->{'style'};
- my $fh = $commands{$command}->{'handle'};
-
- # write to tex file
- my $before_comment = "address@hidden";
- $before_comment = "\\HCode{\\Hnewline " if ($style ne 'texi');
- my $after_comment = "address@hidden verbatim\n";
- $after_comment = "\\Hnewline}\n" if ($style ne 'texi');
-
- my $begin_comment = "<!-- tex4ht_begin $commands{$command}->{'basename'}
$command $counter -->";
- print $fh "$before_comment$begin_comment$after_comment";
- if ($command eq 'tex')
- {
- print $fh $text;
- }
- elsif ($command eq 'math')
- {
- if ($style eq 'texi')
- {
- print $fh '@math{' . $text . "}\n";
- }
- else
- {
- print $fh "\\IgnorePar \$" . $text . "\$";
- }
- }
- my $end_comment = "<!-- tex4ht_end $commands{$command}->{'basename'}
$command $counter -->";
- print $fh "$before_comment$end_comment$after_comment";
- $commands{$command}->{'counter'}++;
- return 1;
-}
-
-my %tex4ht_results;
-
-sub tex4ht_process
-{
- foreach my $command ('math', 'tex')
- {
- tex4ht_finish_latex($command);
- }
- unless (chdir $tex4ht_out_dir)
- {
- main::document_warn ("t2h_tex4ht chdir to $tex4ht_out_dir failed");
- $tex4ht_latex_failed = 1;
- return;
- }
- print STDERR "cwd($tex4ht_out_dir):" . Cwd::cwd() ."\n" if
($Texi2HTML::Config::VERBOSE);
-
- foreach my $command ('math', 'tex')
- {
- tex4ht_process_command($command);
- }
- tex4ht_return_to_dir();
-}
-
-sub tex4ht_finish_latex
-{
-#print STDERR "$style $tex4ht_latex_failed $tex4ht_counter\n";
- my $command = shift;
- return if ($tex4ht_latex_failed);
-
- my $style = $commands{$command}->{'style'};
- my $fh = $commands{$command}->{'handle'};
- # finish the tex file
- if ($style eq 'latex')
- {
- print $fh "\\end{document}\n";
- }
- elsif ($style eq 'tex')
- {
- print $fh "\n\\bye\n";
- }
- else
- {
- print $fh "address@hidden";
- }
- close ($fh);
-}
-
-sub tex4ht_process_command
-{
- my $command = shift;
- return unless ($commands{$command}->{'counter'});
- main::document_warn ("t2h_tex4ht $commands{$command}->{'basefile'} missing")
unless (-f $commands{$command}->{'basefile'});
- my $style = $commands{$command}->{'style'};
- # now run tex4ht
- my $options = '';
- $options = $tex4ht_options_math if (($style eq 'math') and
defined($tex4ht_options_math));
- $options = $tex4ht_options_tex if (($style eq 'tex') and
defined($tex4ht_options_tex));
- my $cmd = "$commands{$command}->{'exec'} $commands{$command}->{'basefile'}
$options";
- print STDERR "tex4ht command: $cmd\n" if ($Texi2HTML::Config::VERBOSE);
- if (system($cmd))
- {
- main::document_warn ("t2h_tex4ht command: $cmd failed");
- tex4ht_return_to_dir();
- $tex4ht_latex_failed = 1;
- return;
- }
-
- # extract the html from the file created by tex4ht
- my $html_basefile = $commands{$command}->{'html_file'};
- unless (open (TEX4HT_HTMLFILE, $html_basefile))
- {
- main::document_warn ("t2h_tex4ht error opening $html_basefile: $!");
- tex4ht_return_to_dir();
- $tex4ht_latex_failed = 1;
- return;
- }
- my $got_count = 0;
- my $line;
- while ($line = <TEX4HT_HTMLFILE>)
- {
- #print STDERR "while $line";
- if ($line =~ /!-- tex4ht_begin $commands{$command}->{'basename'} (\w+)
(\d+) --/)
- {
- my $command = $1;
- my $count = $2;
- my $text = '';
- my $end_found = 0;
- while ($line = <TEX4HT_HTMLFILE>)
- {
- #print STDERR "while search $command $count $line";
- if ($line =~ /!-- tex4ht_end $commands{$command}->{'basename'}
$command $count --/)
- {
- $got_count++;
- chomp($text);
- $tex4ht_results{"${command}_$count"} = $text;
- $end_found = 1;
- last;
- }
- else
- {
- $text .= $line;
- }
- }
- unless ($end_found)
- {
- main::document_warn ("t2h_tex4ht: end of $command $count not
found");
- }
- }
- }
- if ($got_count != $commands{$command}->{'counter'} and
($Texi2HTML::Config::VERBOSE))
- {
- main::document_warn ("t2h_tex4ht: got $got_count for
$commands{$command}->{'counter'} items entered");
- }
- close (TEX4HT_HTMLFILE);
-
- push @{$Texi2HTML::THISDOC{'css_import_lines'}}, "address@hidden
\"$commands{$command}->{'basename'}.css\";\n";
-
-}
-
-sub tex4ht_return_to_dir
-{
- unless (chdir $tex4ht_initial_dir)
- {
- die "* t2h_tex4ht unable to return to the initial dir\n";
- }
-}
-
-my $tex4ht_output_counter = 0;
-
-sub tex4ht_do_tex
-{
- my $command = shift;
- my $counter = shift;
- # return the resulting html
- if (exists ($tex4ht_results{"${command}_$counter"}) and
defined($tex4ht_results{"${command}_$counter"}))
- {
- $tex4ht_output_counter++;
- return $tex4ht_results{"${command}_$counter"};
- }
- else
- {
- main::document_warn ("t2h_tex4ht: cannot find text to output for $command
number $counter");
- return '';
- }
-}
-
-sub tex4ht_finish
-{
- my $tex4ht_in_counter = 0;
- foreach my $command (keys(%commands))
- {
- $tex4ht_in_counter += $commands{$command}->{'counter'};
- }
- if (($tex4ht_output_counter != $tex4ht_in_counter) and
($Texi2HTML::Config::VERBOSE))
- {
- main::document_warn ("t2h_tex4ht: output $tex4ht_output_counter for
$tex4ht_in_counter items entered");
- }
-}
-
-}
-1;
Index: examples/chm.init
===================================================================
RCS file: examples/chm.init
diff -N examples/chm.init
--- examples/chm.init 30 Aug 2009 10:27:30 -0000 1.21
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,438 +0,0 @@
-# -*-perl-*-
-
-#+##############################################################################
-#
-# chm.init: convert to chm intermediate formats hhp, hhc, hhk and html files
-#
-# Copyright (C) 2004-2008 Patrice Dumas <address@hidden>
-#
-# 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
-#
-#-##############################################################################
-
-use strict;
-
-html_default_load();
-
-$TOP_NODE_FILE = undef;
-$TOP_FILE = undef;
-
-#$SECTION_NAVIGATION = 0; # to avoid headers in normal elements
-$SHOW_MENU = 0;
-$SPLIT = 'node';
-set_conf('contents', 1);
-$SPLIT_INDEX = undef;
-$IDX_SUMMARY = 1;
-
-$SMALL_RULE = '';
-$DEFAULT_RULE = '';
-$MIDDLE_RULE = '';
-$BIG_RULE = '';
-
-$DOCUMENT_DESCRIPTION = '';
-$FOOTNOTESTYLE = 'end';
-
-#FIXME remove that later
-$USE_SECTIONS = 1;
-
-push @command_handler_process, \&chm_initialize_variables;
-
-$index_summary_file_entry = \&chm_index_summary_file_entry;
-$index_summary_file_begin = \&chm_index_summary_file_begin;
-$index_summary_file_end = \&chm_index_summary_file_end;
-
-$print_page_foot = \&chm_print_page_foot;
-# no-ops to avoid headers and footers
-$print_head_navigation = \&chm_noop;
-#$print_Top_footer = \&chm_noop;
-$print_foot_navigation = \&chm_noop;
-$print_element_header = \&chm_noop;
-
-my $default_toc_body = $toc_body;
-$toc_body = \&chm_toc_body;
-
-$finish_out = \&chm_finish_out;
-my $default_init_out = $init_out;
-
-$init_out = \&chm_init_out;
-
-my %chm_languages = (
- 'en' => '0x409 English (United States)',
- 'sq' => '0x041c Albanian',
-# 'ar' => '0x1401 Arabic (ALGERIA)',
-# 'es' => '0x2c0a Spanish (ARGENTINA)',
-# 'en' => '0x0c09 English (AUSTRALIA)',
-# 'de' => '0x0c07 German (AUSTRIA)',
-# 'ar' => '0x3c01 Arabic (BAHRAIN)',
- 'be' => '0x0423 Byelorussian',
-# 'fr' => '0x080c French (BELGIUM)',
-# 'en' => '0x2809 English (BELIZE)',
-# 'es' => '0x400a Spanish (BOLIVIA)',
-# 'pt' => '0x0416 Portuguese (BRAZIL)',
-# 'ms' => '0x083e Malay (BRUNEI DARUSSALAM)',
- 'bg' => '0x0402 Bulgarian',
-# 'fr' => '0x0c0c French (CANADA)',
-# 'es' => '0x340a Spanish (CHILE)',
- 'zh' => '0x0804 Chinese (CHINA)',
-# 'es' => '0x240a Spanish (COLOMBIA)',
-# 'es' => '0x140a Spanish (COSTA RICA)',
- 'hr' => '0x041a Croatian',
- 'cs' => '0x0405 Czech',
- 'da' => '0x0406 Danish',
-# 'es' => '0x1c0a Spanish (DOMINICAN REPUBLIC)',
-# 'es' => '0x300a Spanish (ECUADOR)',
-# 'ar' => '0x0c01 Arabic (EGYPT)',
-# 'es' => '0x440a Spanish (EL SALVADOR)',
- 'et' => '0x0425 Estonian',
- 'fo' => '0x0438 Faeroese',
- 'fi' => '0x040b Finnish',
- 'fr' => '0x040c French (FRANCE)',
- 'de' => '0x0407 German (GERMANY)',
- 'el' => '0x0408 Greek',
-# 'es' => '0x100a Spanish (GUATEMALA)',
-# 'es' => '0x480a Spanish (HONDURAS)',
-# 'zh' => '0x0c04 Chinese (HONG KONG)',
- 'hu' => '0x040e Hungarian',
- 'is' => '0x040f Icelandic',
- 'hi' => '0x0439 Hindi',
- 'in' => '0x04',
- 'fa' => '0x0429 Farsi',
-# 'ar' => '0x0801 Arabic (IRAQ)',
-# 'en' => '0x1809 English (IRELAND)',
- 'iw' => '0x04',
- 'it' => '0x0410 Italian',
-# 'en' => '0x2009 English (JAMAICA)',
- 'ja' => '0x0411 Japanese',
-# 'ar' => '0x2c01 Arabic (JORDAN)',
- 'sw' => '0x0441 Swahili',
- 'ko' => '0x0412 Korean',
-# 'ar' => '0x3401 Arabic (KUWAIT)',
- 'al' => '0x0426 Latvian (Lettish)',
-# 'ar' => '0x3001 Arabic (LEBANON)',
-# 'ar' => '0x1001 Arabic (LIBYAN ARAB JAMAHIRIYA)',
-# 'de' => '0x1407 German (LIECHTENSTEIN)',
- 'lt' => '0x0427 Lithuanian',
-# 'de' => '0x1007 German (LUXEMBOURG)',
-# 'zh' => '0x1404 Chinese (MACAU)',
- 'mk' => '0x042f Macedonian',
-# 'ms' => '0x043e Malay (MALAYSIA)',
-# 'es' => '0x080a Spanish (MEXICO)',
-# 'fr' => '0x180c French (MONACO)',
-# 'ar' => '0x1801 Arabic (MOROCCO)',
- 'nl' => '0x0413 Dutch',
-# 'en' => '0x1409 English (NEW ZEALAND)',
-# 'es' => '0x4c0a Spanish (NICARAGUA)',
- 'no' => '0x0414 Norwegian',
-# 'ar' => '0x2001 Arabic (OMAN)',
- 'ur' => '0x0420 Urdu',
-# 'es' => '0x180a Spanish (PANAMA)',
-# 'es' => '0x3c0a Spanish (PARAGUAY)',
-# 'es' => '0x280a Spanish (PERU)',
-# 'en' => '0x3409 English (PHILIPPINES)',
- 'pl' => '0x0415 Polish',
- 'pt' => '0x0816 Portuguese (PORTUGAL)',
-# 'es' => '0x500a Spanish (PUERTO RICO)',
-# 'ar' => '0x4001 Arabic (QATAR)',
- 'ro' => '0x0418 Romanian',
- 'ru' => '0x0419 Russian',
- 'ar' => '0x0401 Arabic (SAUDI ARABIA)',
-# 'zh' => '0x1004 Chinese (SINGAPORE)',
- 'sk' => '0x041b Slovak',
- 'sl' => '0x0424 Slovenian',
- 'af' => '0x0436 Afrikaans',
- 'ca' => '0x0403 Catalan',
- 'sv' => '0x041d Swedish',
-# 'de' => '0x0807 German (SWITZERLAND)',
-# 'ar' => '0x2801 Arabic (SYRIAN ARAB REPUBLIC)',
-# 'zh' => '0x0404 Chinese (TAIWAN, PROVINCE OF CHINA)',
- 'th' => '0x041e Thai',
-# 'en' => '0x2c09 English (TRINIDAD AND TOBAGO)',
-# 'ar' => '0x1c01 Arabic (TUNISIA)',
- 'tr' => '0x041f Turkish',
- 'uk' => '0x0422 Ukrainian',
-# 'ar' => '0x3801 Arabic (UNITED ARAB EMIRATES)',
-# 'en' => '0x0809 English (UNITED KINGDOM)',
-# 'en' => '0x0409 English (UNITED STATES)',
-# 'es' => '0x380a Spanish (URUGUAY)',
-# 'es' => '0x200a Spanish (VENEZUELA)',
- 'vi' => '0x242a Vietnamese',
-# 'ar' => '0x2401 Arabic (YEMEN)',
-# 'en' => '0x3009 English (ZIMBABWE)',
- #'' => '',
-);
-
-my %hhk_global_property = (
- 'ImageType' => 'Folder',
-);
-
-my %hhc_global_property = (
- 'ImageType' => 'Folder',
-);
-
-
-######################################### not used
-#
-# if needed texi to unicode, maybe this could be in utf8.init, but currently
-# no unicode
-my %chm_texi_map = %texi_map;
-my %chm_simple_map_texi = %simple_map_texi;
-my %chm_style_map_texi = ();
-
-foreach my $command (keys(%style_map_texi))
-{
- $chm_style_map_texi{$command} = {};
- foreach my $key (keys (%{$style_map_texi{$command}}))
- {
-#print STDERR "$command, $key, $style_map_texi{$command}->{$key}\n";
- $chm_style_map_texi{$command}->{$key} =
- $style_map_texi{$command}->{$key};
- }
-}
-
-foreach my $key (keys(%unicode_accents))
-{
-# $chm_style_map{$key}->{'function'} = \&t2h_utf8_accent;
- $chm_style_map_texi{$key}->{'function'} = \&t2h_utf8_accent;
-}
-
-foreach my $key (%things_map)
-{
- if (exists($unicode_map{$key}) and ($unicode_map{$key} ne ''))
- {
-# $chm_things_map{$key} = chr(hex($unicode_map{$key}));
- $chm_texi_map{$key} = chr(hex($unicode_map{$key}));
- }
-}
-
-$chm_simple_map_texi{"\n"} = ' ';
-######################################### end not used
-
-# at least kchmviewer has trouble with the corresponding textual entities
-foreach my $thing ('OE', 'oe', 'euro')
-{
- $things_map{$thing} = $numeric_entity_map{$thing};
- $pre_map{$thing} = $numeric_entity_map{$thing};
- $simple_format_texi_map{$thing} = $numeric_entity_map{$thing};
-}
-
-my $hhp_lines;
-# this cannot be in chm_init_out, because it should be before toc_body
-# call.
-sub chm_initialize_variables()
-{
- $hhp_lines = '';
-}
-
-sub chm_init_out()
-{
- &$default_init_out();
-# Setting out file encoding to utf8 doesn't work. Seen on the web that
-# htmlhelp 1.x isn't utf8 aware
-# $Texi2HTML::THISDOC{'OUT_ENCODING'} = 'utf8';
- return if ($null_device_file{$Texi2HTML::THISDOC{'filename'}->{'top'}});
- my $hhk_file =
"$Texi2HTML::THISDOC{'destination_directory'}$Texi2HTML::THISDOC{'file_base_name'}"
. ".hhk";
- open (IDXFILE, ">$hhk_file") or
- die "Can't open $hhk_file for writing: $!\n";
- if ($USE_UNICODE and defined($Texi2HTML::THISDOC{'OUT_ENCODING'}) and
$Texi2HTML::THISDOC{'OUT_ENCODING'} ne '')
- {
- binmode(IDXFILE, ":encoding($Texi2HTML::THISDOC{'OUT_ENCODING'})");
- }
-
- print "# writing HTML Help index in $hhk_file...\n" if $VERBOSE;
- print IDXFILE "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">\n<HTML>\n";
- print IDXFILE "<HEAD>\n<meta name=\"GENERATOR\"
content=\"$Texi2HTML::THISDOC{program}\">\n";
- print IDXFILE "<!-- Sitemap 1.0 -->\n</HEAD>\n<BODY>\n";
- print IDXFILE "<OBJECT type=\"text/site properties\">\n";
- foreach my $property (keys(%hhk_global_property))
- {
- print IDXFILE "<param name=\"$property\"
value=\"$hhk_global_property{$property}\">\n";
-
- }
- print IDXFILE "</OBJECT>\n";
-
- my $hhp_file =
"$Texi2HTML::THISDOC{'destination_directory'}$Texi2HTML::THISDOC{'file_base_name'}.hhp";
- print "# writing HTML Help project in $hhp_file...\n" if $VERBOSE;
- open (HHPFILE, ">$hhp_file") or
- die "Can't open $hhp_file for writing: $!\n";
- if ($USE_UNICODE and defined($Texi2HTML::THISDOC{'OUT_ENCODING'}) and
$Texi2HTML::THISDOC{'OUT_ENCODING'} ne '')
- {
- binmode(HHPFILE, ":encoding($Texi2HTML::THISDOC{'OUT_ENCODING'})");
- }
- my $language = $chm_languages{'en'};
- my $documentlanguage = get_conf('documentlanguage');
- $documentlanguage =~ s/_.*//;
- if (exists ($chm_languages{$documentlanguage}))
- {
- $language = $chm_languages{$documentlanguage};
- }
- my $title = main::remove_texi($Texi2HTML::THISDOC{'title_texi'});
- my $top_file = $Texi2HTML::THISDOC{'filename'}->{'top'};
- print HHPFILE <<EOT;
-[OPTIONS]
-Compatibility=1.1 or later
-Compiled file=$Texi2HTML::THISDOC{'file_base_name'}.chm
-Contents file=$Texi2HTML::THISDOC{'file_base_name'}.hhc
-Default Window=Default
-Default topic=$top_file
-Display compile progress=No
-Full-text search=Yes
-Index file=$Texi2HTML::THISDOC{'file_base_name'}.hhk
-Language=$language
-Title=$title
-
-[WINDOWS]
-Default=,"$Texi2HTML::THISDOC{'file_base_name'}.hhc","$Texi2HTML::THISDOC{'file_base_name'}.hhk","$top_file","$top_file",,,,,0x22520,,0x384e,,,,,,,,0
-
-[FILES]
-EOT
-}
-
-sub chm_print_page_foot($)
-{
- my $fh = shift;
- print $fh <<EOT;
-<p>
-$PRE_BODY_CLOSE
-</p>
-</body>
-</html>
-EOT
-}
-
-sub chm_noop($$)
-{
- return '';
-}
-
-# Convert texi to string
-sub chm_text($)
-{
- my $text = shift;
- return main::simple_format(undef,undef,$text);
-}
-
-
-my @hhc_lines;
-
-sub chm_toc_body($)
-{
- my $elements_ref = shift;
- &$default_toc_body($elements_ref);
- my $level = 0;
- my %chm_files;
- @hhc_lines = ();
- foreach my $element (@$elements_ref)
- {
- while ($level != $element->{'toc_level'})
- {
- if ($level < $element->{'toc_level'})
- {
- push (@hhc_lines, "<UL>\n");
- $level++;
- }
- elsif ($level > $element->{'toc_level'})
- {
- push (@hhc_lines, "</UL>\n");
- $level--;
- }
- }
- my $text = '';
- if ($NUMBER_SECTIONS)
- {
- $text .= $element->{'number'} . " ";
-
- }
- $text .= chm_text($element->{'texi'});
- $text =~ s/^\s*//;
- push (@hhc_lines, "<LI> <OBJECT type=\"text/sitemap\">\n<param
name=\"Name\" value=\"$text\">\n<param name=\"Local\"
value=\"$element->{'file'}#$element->{'target'}\">\n</OBJECT> </LI>\n");
- if (!$chm_files{$element->{'file'}})
- {
- $hhp_lines .= "$element->{'file'}\n";
- $chm_files{$element->{'file'}} = 1;
- }
- }
- while ($level > 0)
- {
- push (@hhc_lines, "</UL>\n");
- $level--;
- }
-}
-
-# key:
-# origin_href:
-# entry:
-# texi entry:
-# element_href:
-# element_text:
-sub chm_index_summary_file_entry ($$$$$$$$)
-{
- my $name = shift;
- my $key = shift;
- my $origin_href = shift;
- my $entry = shift;
- my $text = '';
- #$entry = &$protect_text($key);
- my $texi_entry = shift;
- my $element_href = shift;
- my $element_text = shift;
- my $is_printed = shift;
- $entry = chm_text($texi_entry);
- print IDXFILE "<LI> <OBJECT type=\"text/sitemap\">\n<param name=\"Name\"
value=\"$entry\">\n<param name=\"Local\" value=\"$origin_href\">\n</OBJECT>
</LI>\n";
-}
-
-sub chm_index_summary_file_begin($$)
-{
- my $name = shift;
- my $is_printed = shift;
-}
-
-# file is not closed here but in finish_out.
-sub chm_index_summary_file_end($$)
-{
- my $name = shift;
- my $is_printed = shift;
-}
-
-sub chm_finish_out()
-{
- return if ($null_device_file{$Texi2HTML::THISDOC{'filename'}->{'top'}});
- print IDXFILE "</BODY>\n</HTML>\n";
- close (IDXFILE);
- my $hhc_file =
"$Texi2HTML::THISDOC{'destination_directory'}$Texi2HTML::THISDOC{'file_base_name'}.hhc";
- open (HHCFILE, ">$hhc_file") or
- die "Can't open $hhc_file for writing: $!\n";
- if ($USE_UNICODE and defined($Texi2HTML::THISDOC{'OUT_ENCODING'}) and
$Texi2HTML::THISDOC{'OUT_ENCODING'} ne '')
- {
- binmode(HHCFILE, ":encoding($Texi2HTML::THISDOC{'OUT_ENCODING'})");
- }
-
- print HHCFILE "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">\n<HTML>\n";
- print HHCFILE "<HEAD>\n<meta name=\"GENERATOR\"
content=\"$Texi2HTML::THISDOC{program}\">\n";
- print HHCFILE "<!-- Sitemap 1.0 -->\n</HEAD>\n<BODY>\n";
- print HHCFILE "<OBJECT type=\"text/site properties\">\n";
- foreach my $property (keys(%hhc_global_property))
- {
- print HHCFILE "<param name=\"$property\"
value=\"$hhc_global_property{$property}\">\n";
-
- }
- print HHCFILE "</OBJECT>\n";
- main::print_lines(\*HHCFILE, address@hidden);
- print HHCFILE "</HTML>\n</BODY>\n";
- print HHPFILE $hhp_lines;
- close (HHPFILE);
-}
-
-1;
Index: examples/html32.init
===================================================================
RCS file: examples/html32.init
diff -N examples/html32.init
--- examples/html32.init 8 Sep 2009 10:13:05 -0000 1.30
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,429 +0,0 @@
-# -*-perl-*-
-#+##############################################################################
-#
-# html32.init: output HTML 3.2
-#
-# Copyright (C) 2003-2008 Patrice Dumas <address@hidden>
-#
-# 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
-#
-#-##############################################################################
-# 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
-
-use strict;
-
-html_default_load();
-
-$DOCTYPE = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"
"http://www.w3.org/TR/html32/loose.dtd">';
-
-$FRAMESET_DOCTYPE = $DOCTYPE;
-
-$BODYTEXT = 'bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080"
alink="#FF0000"';
-# this controls the pre style for menus
-$MENU_PRE_STYLE = '';
-
-$NO_BULLET_LIST_STYLE ='';
-
-$USE_ISO = 0;
-$MENU_SYMBOL = '*';
-
-# This lines are inserted before and after the shortcontents
-$BEFORE_OVERVIEW = "";
-$AFTER_OVERVIEW = '';
-
-# This lines are inserted before and after the contents
-$BEFORE_TOC_LINES = "";
-$AFTER_TOC_LINES = '';
-
-# html version for latex2html
-$L2H_HTML_VERSION = "3.2";
-
-# no class in html 32
-$NO_BULLET_LIST_ATTRIBUTE = '';
-
-# no css
-$CSS_LINES = "";
-%css_map = ();
-
-$things_map{'oe'} = 'œ';
-$things_map{'OE'} = 'Œ';
-$things_map{'dots'} = '<small>...</small>';
-$things_map{'enddots'} = '<small>...</small>';
-$things_map{'euro'} = 'Euro';
-$things_map{'geq'} = '>=';
-$things_map{'leq'} = '<=';
-$things_map{'quotedblleft'} = '``';
-$things_map{'quotedblright'} = "''";
-$things_map{'quoteleft'} = '`';
-$things_map{'quoteright'} = "'";
-$things_map{'quotedblbase'} = ',,';
-$things_map{'quotesinglbase'} = ',';
-$things_map{'guillemetleft'} = '<<';
-$things_map{'guillemetright'} = '>>';
-$things_map{'guillemotleft'} = '<<';
-$things_map{'guillemotright'} = '>>';
-$things_map{'guilsinglleft'} = '<';
-$things_map{'guilsinglright'} = '>';
-
-foreach my $style ('oe', 'OE', 'euro', 'geq', 'leq',
- 'quotedblleft', 'quotedblright',
- 'quoteleft', 'quoteright',
- 'quotedblbase', 'quotesinglbase', 'guillemetleft', 'guillemetright',
- 'guillemotleft', 'guillemotright', 'guilsinglleft', 'guilsinglright')
-{
- $pre_map{$style} = $things_map{$style};
-}
-
-$style_map{'sansserif'} = {};
-$style_map{'r'} = {};
-$style_map_pre{'r'} = {};
-$style_map_pre{'sansserif'} = {};
-$style_map{'titlefont'} = {'function' => \&t2h_html32_titlefont,
- 'type' => 'simple_style'};
-$style_map_pre{'titlefont'} = {};
-
-$format_map{'multitable'} = 'table';
-
-# Avoid adding h1 if the text is empty
-# no class in html 3.2
-sub t2h_html32_titlefont($$$)
-{
- shift;
- my $args = shift;
- return "<h1>$args->[0]</h1>" if ($args->[0] =~ /\S/);
- return '';
-}
-
-# formatting functions
-
-$summary_letter = \&t2h_html32_summary_letter;
-$print_index = \&t2h_html32_print_index;
-$protect_text = \&t2h_html32_protect_text;
-$normal_text = \&t2h_html32_normal_text;
-$heading = \&t2h_html32_heading;
-$preformatted = \&t2h_html32_preformatted;
-$raw = \&t2h_html32_raw;
-$menu = \&t2h_html32_menu;
-$foot_section = \&t2h_html32_foot_section;
-$cartouche = \&t2h_html32_cartouche;
-$listoffloats = \&t2h_html32_listoffloats;
-$float = \&t2h_html32_float;
-$acronym_like = \&t2h_html32_acronym_like;
-$row = \&t2h_html32_row;
-$cell = \&t2h_html32_cell;
-$quotation = \&t2h_html32_quotation;
-
-
-
-
-# " is not in html 3.2
-sub t2h_html32_protect_text($)
-{
- my $text = shift;
- $text =~ s/&/&/g;
- $text =~ s/</</g;
- $text =~ s/>/>/g;
- $text =~ s/\"/"/g;
- return $text;
-}
-
-sub t2h_html32_normal_text($$$$$)
-{
- my $text = shift;
- my $in_raw_text = shift;
- my $in_preformatted = shift;
- my $in_code = shift;
- my $in_simple = shift;
- my $style_stack = shift;
- $text = uc($text) if (in_cmd($style_stack, 'sc'));
- $text = &$protect_text($text) unless($in_raw_text);
- if (! $in_code and !$in_preformatted)
- {
- if ($in_raw_text) #FIXME really do that ? It is done by makeinfo
- {
- $text =~ s/``/"/g;
- $text =~ s/''/"/g;
- }
- else
- {
- $text =~ s/``/"/g;
- $text =~ s/''/"/g;
- }
- # temporary reuse '' to store --- !....
- # FIXME won't '---' be handled wrongly?
- # FIXME really do that in raw text?
- $text =~ s/---/''/g;
- $text =~ s/--/-/g;
- $text =~ s/''/--/g;
- }
- return $text;
-}
-
-# a preformatted section
-sub t2h_html32_preformatted($$$)
-{
- my $text = shift;
- my $pre_style = shift;
- my $class = shift;
-
- return '' if ($text eq '');
- return "<pre>$text</pre>";
-}
-
-# a heading for an element
-sub t2h_html32_heading($)
-{
- my $element = shift;
- my $command = shift;
- my $texi_line = shift;
- my $line = shift;
- my $in_preformatted = shift;
- my $one_section = shift;
- my $element_heading = shift;
-
- my $level = 3;
- if (!$element->{'node'})
- {
- $level = $element->{'level'};
- }
- else
- {
- return '' unless ($element->{'this'} and !$element->{'with_section'});
- }
- my $text = $element->{'text'};
- # when it is a heading, the element is irrelevant, so the command and the
- # line are used...
- if (defined($command) and $command =~ /heading/)
- {
- $level = $main::sec2level{$command} if
(defined($main::sec2level{$command}));
- if (defined($line))
- {
- $text = $line;
- # this isn't done in main program in that case...
- chomp ($text);
- $text =~ s/^\s*//;
- }
- }
- elsif (defined($element->{'tocid'}) and $TOC_LINKS)
- {
- $text = &$anchor ('',
"$Texi2HTML::THISDOC{'toc_file'}#$element->{'tocid'}", $text);
- }
- $level = 1 if ($level == 0);
- return '' if ($text !~ /\S/);
- if (!$in_preformatted)
- {
- return "<h$level> $text </h$level>\n";
- }
- else
- {
- return "<strong>$text</strong>\n";
- }
-}
-
-# formatting of raw regions
-# ih L2H is true another mechanism is used for tex
-sub t2h_html32_raw($$)
-{
- my $style = shift;
- my $text = shift;
- my $expanded = 1 if (grep {$style eq $_} @EXPAND);
- if ($style eq 'verbatim' or $style eq 'verbatiminclude' or ($style eq
'tex' and $expanded))
- {
- return "<pre>" . &$protect_text($text) . '</pre>';
- }
- elsif ($style eq 'html' and $expanded)
- {
- chomp ($text);
- return $text;
- }
- elsif ($expanded)
- {
- main::msg_debug ("(bug) unknown style $style");
- return &$protect_text($text);
- }
- return '';
-}
-
-# a whole menu
-sub t2h_html32_menu($)
-{
- my $text = shift;
- if ($text =~ /\S/)
- {
- return "<table border=\"0\" cellspacing=\"0\">\n"
- . $text . "</table>\n";
- }
-}
-
-# a simple menu entry ref in case we aren't in a standard menu context
-sub t2h_html32_foot_section($)
-{
- my $lines = shift;
- unshift (@$lines, "<hr>\n", "<h3>Footnotes</h3>\n");
- return $lines;
-}
-
-# a cartouche
-sub t2h_html32_cartouche($)
-{
- my $text = shift;
-
- if ($text =~ /\S/)
- {
- return "<table border=\"1\"><tr><td>\n" . $text .
"</td></tr></table>\n";
- }
- return '';
-}
-
-
-# no style
-sub t2h_html32_summary_letter($$$$$$$)
-{
- my $letter = shift;
- my $file = shift;
- my $identifier = shift;
- my $index_element_id = shift;
- my $number = shift;
- my $index_element = shift;
- my $index_name = shift;
-
- return &$anchor('', $file . '#' . $identifier, '<b>' .
&$protect_text($letter) . '</b>');
-}
-
-# format a whole index
-#
-# argument:
-# index text
-# index name
-sub t2h_html32_print_index($$)
-{
- my $text = shift;
- my $name = shift;
- return '' if (!defined($text));
- return "<table border=\"0\">\n" .
- "<tr><td></td><th align=\"left\">" . &$I('Index Entry') . "</th><th
align=\"left\"> " . &$I('Section') . "</th></tr>\n"
- . "<tr><td colspan=\"3\"> $DEFAULT_RULE</td></tr>\n" . $text .
- "</table>\n";
-}
-
-sub t2h_html32_float($$$$$)
-{
- my $text = shift;
- my $float = shift;
- my $caption = shift;
- my $shortcaption = shift;
-
- my $label = '';
- if (exists($float->{'id'}))
- {
- $label = &$anchor($float->{'id'});
- }
- my $caption_text = '';
-
- if (defined($float->{'caption_texi'}))
- {
- $caption_text = $caption;
- }
- elsif (defined($float->{'shortcaption_texi'}))
- {
- $caption_text = $shortcaption;
- }
- elsif (defined($caption))
- {
- $caption_text = $caption;
- }
-
- return "$label\n" . $text . $caption_text;
-}
-
-sub t2h_html32_listoffloats($$$)
-{
- my $style_texi = shift;
- my $style = shift;
- my $float_entries = shift;
-
- my $result = "<dl>\n" ;
- foreach my $float_entry (@$float_entries)
- {
- $result .= $float_entry;
- }
- return $result . "</dl>\n";
-}
-
-# no acronym, and no abbr in html 3.2
-sub t2h_html32_acronym_like($$$$$$)
-{
- my $command = shift;
- my $acronym_texi = shift;
- my $acronym_text = shift;
- my $with_explanation = shift;
- my $explanation_lines = shift;
- my $explanation_text = shift;
- my $explanation_simply_formatted = shift;
-
- if ($with_explanation)
- {
- return &$I('%{acronym_like} (%{explanation})', {'acronym_like' =>
$acronym_text, 'explanation' => $explanation_text},{'duplicate'=>1})
- }
- else
- {
- return $acronym_text;
- }
-}
-
-# row in multitable
-sub t2h_html32_row($$)
-{
- my $text = shift;
- my $macro = shift;
-
- if ($text =~ /\S/)
- {
- return '<tr>' . $text . '</tr>' . "\n";
- }
- return '';
-}
-
-# cell in multitable
-sub t2h_html32_cell($$)
-{
- my $text = shift;
- my $row_macro = shift;
- my $columnfractions = shift;
- my $prototype_row = shift;
-
- $text =~ s/^\s*//;
- $text =~ s/\s*$//;
-
- if ($row_macro eq 'headitem')
- {
- return "<th>" . $text . '</th>';
- }
- return "<td>" . $text . '</td>';
-}
-
-sub t2h_html32_quotation($$$$)
-{
- my $command = shift;
- my $text = shift;
- my $argument_text = shift;
- my $argument_text_texi = shift;
- return "<blockquote>" . $text . "</blockquote>\n";
-}
-
Index: examples/book.init
===================================================================
RCS file: examples/book.init
diff -N examples/book.init
--- examples/book.init 8 Sep 2009 22:16:46 -0000 1.29
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,193 +0,0 @@
-# This is based on the scriptbasic style
-
-html_default_load();
-
-set_conf('contents', 1);
-
-$INLINE_CONTENTS = 1;
-$USE_TITLEPAGE_FOR_TITLE = 1;
-
address@hidden =
- (
- 'Back', 'Forward', ' ', 'Contents', 'Index', 'About'
- );
-
address@hidden = @SECTION_BUTTONS;
address@hidden = @SECTION_BUTTONS;
-
address@hidden = ('Contents', 'Index', 'About');
address@hidden = @SECTION_FOOTER_BUTTONS;
-
address@hidden = ('Back', 'Forward');
-
-$WORDS_IN_PAGE = undef;
-$SHOW_MENU = 0;
-
-$BIG_RULE = '<hr>';
-
-#FIXME lift that constraint once it is better supported
-$USE_SECTIONS = 1;
-$USE_NODES = undef;
-
-push @command_handler_init, \&book_initialize_variables;
-
-sub book_print_sub_toc($$);
-
-sub book_print_sub_toc($$)
-{
- my $parent_element = shift;
- my $element = shift;
- my $result = "<li> ".&$anchor('', main::href($element,
$parent_element->{'file'}), $element->{'text'}) . " </li>\n";
-#print STDERR "SUB_TOC $element->{'text'}\n"; #sleep 1;
- if (exists($element->{'child'}))
- {
-#print STDERR "SUB_TOC child $element->{'child'}->{'text'}\n";
- $result .= "<li><ul${NO_BULLET_LIST_ATTRIBUTE}>\n".
book_print_sub_toc($parent_element, $element->{'child'}) ."</ul></li>\n";
- }
- if (exists($element->{'sectionnext'}))
- {
-#print STDERR "SUB_TOC next($element->{'text'})
$element->{'next'}->{'text'}\n";
- $result .= book_print_sub_toc($parent_element,
$element->{'sectionnext'});
- }
- return $result;
-}
-
-sub book_print_up_toc($)
-{
- my $element = shift;
-
- my $result = '';
- my $current_element = $element;
- my @elements;
- while (defined($current_element->{'sectionup'}) and
($current_element->{'sectionup'} ne $current_element))
- {
- unshift (@elements, $current_element->{'sectionup'});
- $current_element = $current_element->{'sectionup'};
- }
- #print $fh "<ul>" . &$anchor('', $Texi2HTML::HREF{Contents}, '[' .
$Texi2HTML::NAME{Contents} . ']') . " <br>\n";
- my $elem = shift @elements;
- $result .= "<ul${NO_BULLET_LIST_ATTRIBUTE}><li>" . &$anchor('',
main::href($elem, $element->{'file'}), $elem->{'text'}) . " </li>\n";
- foreach my $elem (@elements)
- {
- $result .= "<li><ul${NO_BULLET_LIST_ATTRIBUTE}><li>" . &$anchor('',
main::href($elem, $element->{'file'}), $elem->{'text'}) . " </li>\n";
- }
- foreach my $elem (@elements)
- {
- $result .= "</ul></li>\n";
- }
- $result .= "</ul>\n";
-}
-
-#$print_section = \&book_print_section;
-$print_element_header = \&book_print_element_header;
-$element_file_name = \&book_element_file_name;
-
-sub book_print_element_header($$)
-{
- my $first_in_page = shift;
- my $previous_is_top = shift;
- my $buttons = address@hidden;
- my $result;
-
- if ($first_in_page and get_conf('headers'))
- {
- $result = book_print_up_toc($Texi2HTML::THIS_ELEMENT);
- $result .= &$print_head_navigation(undef, $buttons);
- }
- else
- { # got to do this here, as it isn't done in print_head_navigation
- $result = &$print_navigation($buttons) if (get_conf('headers'));
- }
- return $result;
-}
-
-my $unumbered_nr;
-my $previous_nr;
-my $previous_file_name;
-
-sub book_initialize_variables()
-{
- $unumbered_nr = -1;
- $previous_nr = undef;
- $previous_file_name = undef;
-}
-
-sub book_element_file_name($$$)
-{
- my $element = shift;
- my $type = shift;
- my $prefix = shift;
-
- return undef if ($NODE_FILENAMES or !get_conf('SPLIT'));
- return undef if (!defined($element));
-
- if (defined($previous_nr) and ($element->{'doc_nr'} == $previous_nr))
- {
- return $previous_file_name;
- }
- if ($type eq 'top')
- {
- $previous_file_name = "${prefix}_top.html";
- }
- elsif (defined($element->{'plain_number'}) and ($element->{'plain_number'}
ne ''))
- {
- my $number = $element->{'plain_number'};
- $number .= '.' unless ($number =~ /\.$/);
- $previous_file_name = "${prefix}_$number" . 'html';
- }
- else
- {
- $unumbered_nr++;
- $previous_file_name = "${prefix}_U." . $unumbered_nr . '.html';
- }
- $previous_nr = $element->{'doc_nr'};
- return $previous_file_name;
-}
-
-$heading = \&book_heading;
-
-sub book_heading($$$$$$;$$)
-{
- my $element = shift;
- my $command = shift;
- my $texi_line = shift;
- my $line = shift;
- my $in_preformatted = shift;
- my $one_section = shift;
- my $element_heading = shift;
-
- my $level = 3;
-
- if (!$element->{'node'})
- {
- $level = $element->{'level'};
- }
- else
- {
- return '' unless ($element->{'this'} and !$element->{'with_section'});
- }
- $level = 1 if ($level == 0);
- my $text = $element->{'text'};
- return '' if ($text !~ /\S/);
- my $class = $element->{'tag_level'};
- $class = 'unnumbered' if ($class eq 'top');
- if (defined($element->{'tocid'}) and $TOC_LINKS)
- {
- $text = &$anchor ('',
"$Texi2HTML::THISDOC{'toc_file'}#$element->{'tocid'}", $text);
- }
- $text = "<h$level class=\"$class\"> $text </h$level>\n";
- address@hidden should already have a table of contents, either because
there
- #Â is a @contents, or setcontentsaftertitlepage is set.
- # In any case it would just be a duplication
- #Â of the table of contents, better let the user decide where it should be.
- if (exists($element->{'child'})
- and ($element->{'tag_level'} !~ /heading/) and $element->{'tag'} ne
'top')
- {
- $text .= "<ul${NO_BULLET_LIST_ATTRIBUTE}>\n";
- $text .= "" . book_print_sub_toc($element, $element->{'child'});
- $text .= "</ul>\n";
- }
- return $text;
-}
-
-1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Texi2html-cvs] texi2html texi2html.pl NEWS TODO Makefile.in Ma...,
Patrice Dumas <=