use Getopt::Long;
use Encode;
use UUID;
-#use encoding 'utf-8';
+use utf8;
binmode(STDOUT, ":utf8");
my $haveimagick = eval { require Image::Magick; };
}
my $term = new Term::ReadLine "Edit Title";
+binmode($term->IN, ':utf8');
FsObj->new(getcwd)->iterate;
my $self = shift;
my $fullpath = $self->{-fullpath};
my $title;
+ my $titleimage;
my $T;
- if (open($T,'<'.$fullpath.'/.title')) {
- binmode($T, ":utf8");
+ my $TI;
+ if (open($T,'<:encoding(utf8)', $fullpath.'/.title')) {
$title = <$T>;
$title =~ s/[\r\n]*$//;
close($T);
print $OUT "Enter title for $fullpath\n";
$title = $term->readline($prompt.' >',$title);
$term->addhistory($title) if ($title);
- if (open($T,'>'.$fullpath.'/.title')) {
+ if (open($T,'>:encoding(utf8)', $fullpath.'/.title')) {
print $T $title,"\n";
close($T);
}
$title=$self->{-relpath};
}
$self->{-title}=$title;
+ if (open($TI,'<:encoding(utf8)', $fullpath.'/.titleimage')) {
+ $titleimage = <$TI>;
+ $titleimage =~ s/[\r\n]*$//;
+ close($TI);
+ #print STDERR "found title image \"",$titleimage,"\"\n";
+ $self->{-titleimage}=$titleimage;
+ }
print "title in $fullpath is $title\n" if ($debug);
}
$toggletext = 'Play->';
}
my $F;
- unless (open($F,'>'.$fn)) {
+ unless (open($F,'>:encoding(utf8)', $fn)) {
warn "cannot open \"$fn\": $!";
next;
}
- binmode($F, ":utf8");
if ($refresh eq 'slide') {
print $F start_html(
-encoding=>"utf-8",
my $fn = sprintf("%s/.html/%s-info.html",$dn,$name);
if (isnewer($self->{-fullpath},$fn)) {
my $F;
- unless (open($F,'>'.$fn)) {
+ unless (open($F,'>:encoding(utf8)', $fn)) {
warn "cannot open \"$fn\": $!";
return;
}
- binmode($F, ":utf8");
my $imgsrc = sprintf("../.%s/%s",$sizes[0],$name);
print $F start_html(-title=>$title,
-encoding=>"utf-8",
my $block = $self->{-fullpath}.'/.noindex';
$fn = '/dev/null' if ( -f $block );
my $IND;
- unless (open($IND,'>'.$fn)) {
+ unless (open($IND,'>:encoding(utf8)', $fn)) {
warn "cannot open $fn: $!";
return;
}
- binmode($IND, ":utf8");
$self->{-IND} = $IND;
my $inc = $self->{-inc}.$incdir.'/';
my $title = $self->{-title};
+ my $titleimage = $self->{-titleimage};
print $IND start_html(-title => $title,
-encoding=>"utf-8",
-style=>[
-id => 'indexContainer'}),
"\n";
my $EVL;
- if (open($EVL,$self->{-toppath}.'/'.$incdir.'/header.pl')) {
+ if (open($EVL, '<:encoding(utf8)', $self->{-toppath}.'/'.$incdir.'/header.pl')) {
my $prm;
while (<$EVL>) {
$prm .= $_;
-version => $version,
-depth => $self->{-depth},
-title => $title,
+ -titleimage => $titleimage,
-path => $self->{-fullpath},
-breadcrumbs => "breadcrumbs unimplemented",
);
print STDERR "could not open ",
$self->{-toppath}.'/'.$incdir.'/header.pl',
" ($!), reverting to default header";
- print $IND a({-href=>"../index.html"},"UP"),"\n",
- h1({-class=>'title'},$title),"\n",
+ print $IND a({-href=>"../index.html"},"UP"),"\n";
+ if ($titleimage) {
+ print $IND img({-src=>$titleimage,
+ -class=>'titleimage',
+ -alt=>'Title Image'}),"\n";
+ }
+ print $IND h1({-class=>'title'},$title),
+ br({-clear=>'all'}),"\n";
}
}
print $IND end_div;
my $EVL;
- if (open($EVL,$self->{-toppath}.'/'.$incdir.'/footer.pl')) {
+ if (open($EVL, '<:encoding(utf8)', $self->{-toppath}.'/'.$incdir.'/footer.pl')) {
my $prm;
while (<$EVL>) {
$prm .= $_;
-version => $version,
-depth => $self->{-depth},
-title => $self->{-title},
+ -titleimage => $self->{-titleimage},
-breadcrumbs => "breadcrumbs unimplemented",
);
print $IND eval $prm,"\n";