143 |
# of the slidemaker tool |
# of the slidemaker tool |
144 |
#when the parameters were in Makefile or make.bat |
#when the parameters were in Makefile or make.bat |
145 |
|
|
146 |
# read parameters from infos.txt and put them in @PARAM |
my @file; |
147 |
if (open(INFOS, $infos)) { |
|
148 |
print STDERR "--- Reading parameters file $infos ---\n"; |
############################################################################## |
149 |
local(@file); |
sub parse_infos { |
150 |
@file = <INFOS>; |
my @file=@_; |
|
# @PARAM = (); # don't reset param, use @ARGV |
|
151 |
do { |
do { |
152 |
if ($file[0] && $file[0] =~ /^[^#\n\r]/) { |
if ($file[0] && $file[0] =~ /^[^#\n\r]/) { |
153 |
$file[0] =~ s/\n//; # remove UNIX \n |
$file[0] =~ s/\n//; # remove UNIX \n |
154 |
$file[0] =~ s/\r//; # remove WINDOWS \r |
$file[0] =~ s/\r//; # remove WINDOWS \r |
155 |
$file[0] =~ s/ *= */=/; |
my ($var,$value) = split(/ *= */,$file[0],2); |
156 |
push @PARAM,$file[0]; |
$value=~s/'/\\'/g; |
157 |
|
$cmd="\$$var = \'$value\';"; |
158 |
|
if (defined($value)) { |
159 |
|
eval($cmd) || warn "problem with eval of: $cmd"; |
160 |
|
} else { |
161 |
|
die "no value defined for $var"; |
162 |
|
} |
163 |
print STDERR "$file[0]\n"; |
print STDERR "$file[0]\n"; |
164 |
} |
} |
165 |
} while (shift(@file)); |
} while (shift(@file)); |
166 |
} |
} |
167 |
## @PARAM is now a table with the user preferences for his presentation |
############################################################################## |
168 |
|
|
169 |
## process arguments |
# read parameters from infos.txt and put them in @PARAM |
170 |
## each preset variable is now re-attributed using the user preferences |
if (open(INFOS, $infos)) { |
171 |
foreach (@PARAM) { |
print STDERR "--- Reading parameters file $infos ---\n"; |
172 |
my ($var,$value) = split(/ *= */,$_,2); |
@file = <INFOS>; |
173 |
$value=~s/'/\\'/g; |
parse_infos(@file); |
|
$cmd="\$$var = \'$value\';"; |
|
|
if ($value) { |
|
|
eval($cmd) || die "problem with eval of: $cmd"; |
|
|
} else { |
|
|
die "no value defined for $var"; |
|
|
} |
|
174 |
} |
} |
175 |
|
|
176 |
|
# try to read local infos.txt for template |
177 |
|
if (-f "$template/$infos" && open(INFOS,"$template/$infos")) { |
178 |
|
print STDERR "--- Reading template parameters file $template/$infos ---\n"; |
179 |
|
@file = <INFOS>; |
180 |
|
parse_infos(@file); |
181 |
|
close(INFOS); |
182 |
|
} |
183 |
|
|
184 |
|
## @PARAM is now a table with the user preferences for his presentation |
185 |
|
|
186 |
## use charset |
## use charset |
187 |
|
|
188 |
if ($charset) { |
if ($charset) { |
394 |
|
|
395 |
date => $date, |
date => $date, |
396 |
|
|
397 |
toc => $loc_toc, |
toc_title => $loc_toc, |
398 |
|
template => $template, |
399 |
); |
); |
400 |
|
|
401 |
} |
} |
588 |
toc_link => $toc_link, |
toc_link => $toc_link, |
589 |
next_link => $next_link, |
next_link => $next_link, |
590 |
prev_title => $prev_title, |
prev_title => $prev_title, |
591 |
|
toc_title => $loc_toc, |
592 |
next_title => $next_title, |
next_title => $next_title, |
593 |
|
|
594 |
author => $author, |
author => $author, |
600 |
|
|
601 |
slide_html => $slide_html, |
slide_html => $slide_html, |
602 |
|
|
603 |
|
template => $template, |
604 |
); |
); |
605 |
|
|
606 |
my $page; |
my $page; |
696 |
my $pcnt_done=int($nr*100/$total); |
my $pcnt_done=int($nr*100/$total); |
697 |
my $pcnt_left=100-$pcnt_done; |
my $pcnt_left=100-$pcnt_done; |
698 |
|
|
699 |
if ($progress_bar) { |
if ($progress_bar && uc($progress_bar) ne "NO") { |
700 |
my $l=$r=" "; |
my $l=$r=" "; |
701 |
my $t="$nr of $total"; |
my $t="$nr of $total"; |
702 |
if ($pcnt_done > 50) { |
if ($pcnt_done > 50) { |