[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Texi2html-cvs] texi2html/examples info.init
From: |
Patrice Dumas |
Subject: |
[Texi2html-cvs] texi2html/examples info.init |
Date: |
Sat, 22 Nov 2008 14:47:52 +0000 |
CVSROOT: /cvsroot/texi2html
Module name: texi2html
Changes by: Patrice Dumas <pertusus> 08/11/22 14:47:52
Modified files:
examples : info.init
Log message:
Correct style commands formatting.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texi2html/examples/info.init?cvsroot=texi2html&r1=1.1&r2=1.2
Patches:
Index: info.init
===================================================================
RCS file: /cvsroot/texi2html/texi2html/examples/info.init,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- info.init 22 Nov 2008 13:31:26 -0000 1.1
+++ info.init 22 Nov 2008 14:47:51 -0000 1.2
@@ -45,10 +45,13 @@
%things_map = %ascii_things_map;
%pre_map = %things_map;
-my @bold_commands = ('strong', 'b', 'email');
-my @italic_commands = ('cite', 'dfn', 'emph', 'i', 'var', 'slanted');
-my @fixed_command = ('code', 'command', 'ctrl', 'env', 'file', 'kbd', 'key',
- 'math', 'option', 'samp', 't', 'verb');
+# sc and var upcase.
+my @simple_quoted_commands = ('cite', 'code', 'command', 'env', 'file', 'kbd',
+ 'option', 'samp');
+# slanted?
+my @asis_commands = ('asis', 'b', 'ctrl', 'dmn', 'i', 'math', 'sc', 't', 'r',
+ 'slanted', 'var', 'titlefont', 'verb');
+my @chevron_commands = ('key', 'indicateurl');
foreach my $accent_command ('tieaccent', 'dotless', keys(%unicode_accents),
keys(%accent_map))
{
@@ -59,29 +62,36 @@
foreach my $command (keys(%style_map))
{
delete $style_map{$command}->{'attribute'} if
(exists($style_map{$command}->{'attribute'}));
- if (grep {$_ eq $command} @bold_commands)
+ delete $style_map{$command}->{'quote'} if
(exists($style_map{$command}->{'quote'}));
+ if (grep {$_ eq $command} @simple_quoted_commands)
{
delete $style_map{$command}->{'function'} if
(exists($style_map{$command}->{'function'}));
- $style_map{$command}->{'begin'} = '*';
- $style_map{$command}->{'end'} = '*';
+ $style_map{$command}->{'begin'} = '`';
+ $style_map{$command}->{'end'} = "'";
next;
}
- elsif (grep {$_ eq $command} @italic_commands)
+ elsif (grep {$_ eq $command} @asis_commands)
{
delete $style_map{$command}->{'function'} if
(exists($style_map{$command}->{'function'}));
- $style_map{$command}->{'begin'} = '_';
- $style_map{$command}->{'end'} = '_';
- next;
+ delete $style_map{$command}->{'begin'} if
(exists($style_map{$command}->{'begin'}));
+ delete $style_map{$command}->{'end'} if
(exists($style_map{$command}->{'end'}));
}
- elsif (grep {$_ eq $command} @fixed_commands)
+ if (grep {$_ eq $command} @chevron_commands)
{
delete $style_map{$command}->{'function'} if
(exists($style_map{$command}->{'function'}));
- $style_map{$command}->{'begin'} = '??';
- $style_map{$command}->{'end'} = '??';
+ $style_map{$command}->{'begin'} = '<';
+ $style_map{$command}->{'end'} = '>';
next;
}
}
+$style_map{'strong'}->{'begin'} = '*';
+$style_map{'strong'}->{'end'} = '*';
+$style_map{'dfn'}->{'begin'} = '"';
+$style_map{'dfn'}->{'end'} = '"';
+$style_map{'emph'}->{'begin'} = '_';
+$style_map{'emph'}->{'end'} = '_';
+
foreach my $command (keys(%style_map))
{
$style_map_pre{$command} = {};
@@ -93,6 +103,43 @@
}
}
+$style_map{'uref'}->{'function'} = \&info_default_uref;
+$style_map{'url'}->{'function'} = \&info_default_uref;
+
+sub info_default_uref($$)
+{
+ shift;
+ my $args = shift;
+ my $url = shift @$args;
+ my $text = shift @$args;
+ my $replacement = shift @$args;
+ #$url =~ s/\s*$//;
+ #$url =~ s/^\s*//;
+ $url = main::normalise_space($url);
+ $replacement = '' if (!defined($replacement));
+ $replacement = main::normalise_space($replacement);
+ return $replacement if ($replacement ne '');
+ $text = '' if (!defined($text));
+ $text = main::normalise_space($text);
+ return "`$url'" if ($text eq '');
+ return "$text ($url)";
+}
+
+$style_map{'email'}->{'function'} = \&info_default_email;
+sub info_default_email($$)
+{
+ my $command = shift;
+ my $args = shift;
+ my $mail = shift @$args;
+ my $text = shift @$args;
+ $mail = main::normalise_space($mail);
+ $text = '' if (!defined($text));
+ $text = main::normalise_space($text);
+ $mail = "<$mail>";
+ return $mail unless ($text ne '');
+ return "$text $mail";
+}
+
my $default_style_reference = $style;
$style = \&info_default_style;
@@ -372,6 +419,27 @@
return '';
}
+sub info_default_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 "$acronym_text ($explanation_text)";
+ }
+ else
+ {
+ return "$acronym_text";
+ }
+}
+
+
sub info_default_print_page_foot($)
{
my $fh = shift;