1 |
#!/usr/local/bin/perl |
#!/usr/bin/perl |
2 |
# |
# |
3 |
# SLies Copyright 2001 Dobrica Pavlinusic <dpavlin@rot13.org> |
# PLies Copyright 2001 Dobrica Pavlinusic <dpavlin@rot13.org> |
4 |
# |
# |
5 |
# this tool is based on SlideMaker and XLSies tool |
# this tool is based on SlideMaker and XLSies tool |
6 |
# split a all.htm into slide*.htm |
# split a all.htm into slide*.htm |
42 |
# |
# |
43 |
# Sami Lempinen - lempinen@iki.fi |
# Sami Lempinen - lempinen@iki.fi |
44 |
# http://www.snowman.sgic.fi/ssl/xslies/ |
# http://www.snowman.sgic.fi/ssl/xslies/ |
45 |
|
# |
46 |
|
# Text::FastTemplate: |
47 |
|
# Robert Lehr - bozzio@the-lehrs.com |
48 |
|
|
49 |
make_dotgif("pero.gif"); |
use Text::FastTemplate; |
50 |
|
|
51 |
############################################################################## |
############################################################################## |
52 |
## default values of variables |
## default values of variables |
53 |
## |
## |
54 |
|
|
55 |
|
## show debug output |
56 |
|
my $debug=1; |
57 |
|
|
58 |
## default DOCTYPE added on the slides |
## default DOCTYPE added on the slides |
59 |
$doctype = '<html xmlns="http://www.w3.org/TR/REC-html40">'; |
$doctype = '<html xmlns="http://www.w3.org/TR/REC-html40">'; |
60 |
|
|
107 |
## standard style sheets |
## standard style sheets |
108 |
$cssStandard = '../PLies/css/default.css'; |
$cssStandard = '../PLies/css/default.css'; |
109 |
|
|
110 |
|
## template name |
111 |
|
$template = '../PLies/default'; |
112 |
|
|
113 |
## default charset use in meta tag http-equiv (undef to skip) |
## default charset use in meta tag http-equiv (undef to skip) |
114 |
#$charset = 'ISO-8859-1'; |
#$charset = 'ISO-8859-1'; |
115 |
|
|
129 |
############################################################################## |
############################################################################## |
130 |
|
|
131 |
## globals |
## globals |
|
my $logo_html; |
|
|
my $date_html; |
|
132 |
my $last_toc_title; |
my $last_toc_title; |
133 |
|
my %page_data; |
134 |
|
my %overview_data; |
135 |
|
|
136 |
############################################################################## |
############################################################################## |
137 |
## reading user input from $infos |
## reading user input from $infos |
142 |
|
|
143 |
# read parameters from infos.txt and put them in @PARAM |
# read parameters from infos.txt and put them in @PARAM |
144 |
if (open(INFOS, $infos)) { |
if (open(INFOS, $infos)) { |
145 |
print STDOUT "--- Reading parameters file $infos ---\n"; |
print STDOUT "--- Reading parameters file $infos ---\n"; |
146 |
local(@file,$counter); |
local(@file,$counter); |
147 |
$counter = 0; |
$counter = 0; |
148 |
@file = <INFOS>; |
@file = <INFOS>; |
149 |
@PARAM = (); |
@PARAM = (); |
150 |
do { |
do { |
151 |
if ($file[0] && $file[0] =~ /^[^#\n\r]/) { |
if ($file[0] && $file[0] =~ /^[^#\n\r]/) { |
152 |
$file[0] =~ s/\n//; # remove UNIX \n |
$file[0] =~ s/\n//; # remove UNIX \n |
153 |
$file[0] =~ s/\r//; # remove WINDOWS \r |
$file[0] =~ s/\r//; # remove WINDOWS \r |
154 |
$file[0] =~ s/ *= */=/; |
$file[0] =~ s/ *= */=/; |
155 |
$PARAM[$counter++] = $file[0]; |
$PARAM[$counter++] = $file[0]; |
156 |
print "$file[0]\n"; |
print "$file[0]\n"; |
157 |
} |
} |
158 |
} while (shift(@file)); |
} while (shift(@file)); |
159 |
} |
} |
160 |
## @PARAM is now a table with the user preferences for his presentation |
## @PARAM is now a table with the user preferences for his presentation |
161 |
|
|
162 |
## process arguments |
## process arguments |
163 |
## each preset variable is now re-attributed using the user preferences |
## each preset variable is now re-attributed using the user preferences |
164 |
foreach (@PARAM) { |
foreach (@PARAM) { |
165 |
@_ = split(/ *= */,$_,2); |
my ($var,$value) = split(/ *= */,$_,2); |
166 |
$cmd="\$$_[0] = \'$_[1]\';"; |
$value=~s/'/\\'/g; |
167 |
if (length $_[1] != 0) { |
$cmd="\$$var = \'$value\';"; |
168 |
eval($cmd); |
if ($value) { |
169 |
} |
eval($cmd) || die "problem with eval of: $cmd"; |
170 |
|
} else { |
171 |
|
die "no value defined for $var"; |
172 |
|
} |
173 |
} |
} |
174 |
|
|
175 |
## use charset |
## use charset |
180 |
$http_equiv=''; |
$http_equiv=''; |
181 |
} |
} |
182 |
|
|
|
|
|
|
## build an html string for the author variable |
|
|
## containing the presentation author name linked to |
|
|
## a location of his choice |
|
|
if ($authorUrl) { |
|
|
$author = "<a href=\"$authorUrl\">$author</a>"; |
|
|
} |
|
|
|
|
|
## same string is built if there is a second author for the presentation |
|
|
if ($author2Url) { |
|
|
$author2 = "<br><a href=\"$author2Url\">$author2</a>"; |
|
|
} elsif ($author2) { |
|
|
$author2 = "<br>$author2"; |
|
|
} |
|
|
|
|
183 |
############################################################################## |
############################################################################## |
184 |
## read the raw html presentation |
## read the raw html presentation |
185 |
## |
## |
187 |
## copy file in memory |
## copy file in memory |
188 |
my $sep = $/; |
my $sep = $/; |
189 |
$/ = undef; |
$/ = undef; |
190 |
if (!open(ALL, $all)) { |
open(ALL, $all) || die "Error: Cannot open file: $all"; |
|
print "Error: Cannot open file: $all\n"; |
|
|
exit 0; |
|
|
} |
|
191 |
my $buf = <ALL>; |
my $buf = <ALL>; |
192 |
|
$buf =~ s/\r//g; # remove WINDOWS \r |
193 |
close(ALL); |
close(ALL); |
194 |
$/ = $sep; |
$/ = $sep; |
195 |
|
|
225 |
## start the slide count so we can number them |
## start the slide count so we can number them |
226 |
$slideCount = 1; |
$slideCount = 1; |
227 |
|
|
228 |
|
## pre-load template slides using $template dir |
229 |
|
Text::FastTemplate->defaults( |
230 |
|
path => [ $template ] |
231 |
|
); |
232 |
|
|
233 |
|
Text::FastTemplate->preload( [ |
234 |
|
{ file => 'slide.html', key => 'slide' }, |
235 |
|
{ file => 'overview.html', key => 'overview' }, |
236 |
|
{ file => 'title.html', key => 'title' }, |
237 |
|
]); |
238 |
|
|
239 |
|
## unroll relative anchors (#something) into links with slides |
240 |
|
|
241 |
|
my %anchor_on_slide; |
242 |
|
|
243 |
|
## step 1: record anchors |
244 |
|
for($i=0; $i<$total; $i++) { |
245 |
|
my $tmp = $table[($i*2)].$table[($i*2)+1]; |
246 |
|
while ($tmp =~ s,<a +name="*([^>"]+)"*>,,i) { |
247 |
|
$anchor_on_slide{$1}=($i+1); |
248 |
|
print "\tslide ",($i+1)," anchor: $1\n" if ($debug); |
249 |
|
} |
250 |
|
} |
251 |
|
|
252 |
|
## step 2: fix links |
253 |
|
for($i=0; $i<$total; $i++) { |
254 |
|
foreach (keys %anchor_on_slide) { |
255 |
|
$table[($i*2)] =~ s,href="*#$_"*>,href="slide$anchor_on_slide{$_}\.html#$_">,gi; |
256 |
|
} |
257 |
|
} |
258 |
|
|
259 |
## @table is the array containing each slide with its title |
## @table is the array containing each slide with its title |
260 |
## for each slide to be generated |
## for each slide to be generated |
261 |
## we delete each slide and its title when generated |
## we delete each slide and its title when generated |
262 |
## so that the current slide and its title are always at $table[0] (for the title) |
## so that the current slide and its title are always at $table[0] (for the title) |
263 |
## and $table[1] (for the slide content) |
## and $table[1] (for the slide content) |
264 |
|
|
265 |
|
undef $prev_title; |
266 |
|
undef $next_title; |
267 |
|
|
268 |
do { |
do { |
269 |
|
|
270 |
## get rid of the first element contained by the raw presentation array |
## get rid of the first element contained by the raw presentation array |
280 |
## need to check if the title contains any anchor |
## need to check if the title contains any anchor |
281 |
## if so it needs to be removed |
## if so it needs to be removed |
282 |
## because the title is being used in the table of content to link to the corresponding slide |
## because the title is being used in the table of content to link to the corresponding slide |
283 |
$table[0] =~ s/(.*)<A[^>]*>(.*)<\/A>(.*)/$1$2$3/i; |
$table[0] = remove_anchor($table[0]); |
284 |
|
|
285 |
## grab next slide title $table[2] (if there's a next slide) |
## grab next slide title $table[2] (if there's a next slide) |
286 |
## to be able to use in the 'next' navigation button |
## to be able to use in the 'next' navigation button |
287 |
## keep in mind that $table[1] contains the slide corresponding to the title $table[0] |
## keep in mind that $table[1] contains the slide corresponding to the title $table[0] |
288 |
$next_slide_title = $table[2] if $table[2]; |
if ($table[2]) { |
289 |
## remove any anchor from the next slide title |
$next_title= remove_anchor($table[2]); |
290 |
$next_slide_title =~ s/(.*)<A[^>]*>(.*)<\/A>(.*)/$1$2$3/i; |
} |
291 |
|
|
292 |
## the current slide content is stored $table[1] |
## the current slide content is stored $table[1] |
293 |
## there is an attempt to make sure it's clean HTML |
## there is an attempt to make sure it's clean HTML |
297 |
|
|
298 |
## extract slide Sub Title <h2> |
## extract slide Sub Title <h2> |
299 |
undef $slideSubTitle; |
undef $slideSubTitle; |
300 |
if ($slideContent =~ s/<[hH]2[^>]*>([^<]+)<\/[hH]2[^>]*>//) { |
if ($slideContent =~ s/<[hH]2[^>]*>(.+)<\/[hH]2[^>]*>//sm) { |
301 |
$slideSubTitle=$1; |
$slideSubTitle=remove_anchor($1); |
302 |
} |
} |
303 |
|
|
304 |
## add the title of the current slide to the table of content |
## add the title of the current slide to the table of content |
307 |
## generate the current slide |
## generate the current slide |
308 |
## parameters are: |
## parameters are: |
309 |
## title of the slide, its content, the slide number, the title of the previous slide and the title of the next slide |
## title of the slide, its content, the slide number, the title of the previous slide and the title of the next slide |
310 |
&createSlide($slideTitle,$slideSubTitle,$slideContent ,$slideCount++,$previous_slide_title,$next_slide_title); |
&createSlide($slideTitle,$slideSubTitle,$slideContent ,$slideCount++,$prev_title,$next_title); |
311 |
|
|
312 |
## save the title of the previous slide to be displayed in the 'previous' navigation button |
## save the title of the previous slide to be displayed in the 'previous' navigation button |
313 |
$previous_slide_title="$table[0]"; |
$prev_title=remove_anchor($table[0]); |
314 |
} |
} |
315 |
## process the next slide |
## process the next slide |
316 |
while (shift(@table)); |
while (shift(@table)); |
345 |
## here is the standard style sheet |
## here is the standard style sheet |
346 |
$stylelink .= "<link href=\"$cssStandard\" rel=\"stylesheet\" type=\"text/css\" title=\"Talk\" media=\"screen\">"; |
$stylelink .= "<link href=\"$cssStandard\" rel=\"stylesheet\" type=\"text/css\" title=\"Talk\" media=\"screen\">"; |
347 |
|
|
348 |
if ($logoFile) { |
%overview_data = ( |
349 |
$logo_html="<a href=\"$logoLink\"><img src=\"$logoFile\" alt=\"$logoAlt\" border=\"0\"></a>"; |
doctype => $doctype, |
350 |
} |
title => $title, |
351 |
|
http_equiv => $http_equiv, |
352 |
|
stylelink => $stylelink, |
353 |
|
body => $body, |
354 |
|
|
355 |
|
logoLink => $logoLink, |
356 |
|
logoFile => $logoFile, |
357 |
|
logoAlt => $logoAlt, |
358 |
|
logoLink2 => $logoLink2, |
359 |
|
logoFile2 => $logoFile2, |
360 |
|
logoAlt2 => $logoAlt2, |
361 |
|
|
362 |
|
talkTitle => $talkTitle, |
363 |
|
talkSubTitle => $talkSubTitle, |
364 |
|
|
365 |
|
content_hight => $content_hight, |
366 |
|
|
367 |
|
author => $author, |
368 |
|
authorUrl => $authorUrl, |
369 |
|
author2 => $author2, |
370 |
|
authorUrl2 => $authorUrl2, |
371 |
|
|
372 |
if ($logoFile2) { |
date => $date, |
|
$logo_html.="<a href=\"$logoLink2\"><img src=\"$logoFile2\" alt=\"$logoAlt2\" border=\"0\"></a>"; |
|
|
} |
|
373 |
|
|
374 |
$title_html="<h1>$talkTitle</h1>"; |
toc => $loc_toc, |
375 |
if (length $talkSubTitle != 0) { |
); |
|
$title_html.="<h2>$talkSubTitle</h2>"; |
|
|
} |
|
|
|
|
|
if (length $date != 0) { |
|
|
$date_html="($date)"; |
|
|
} |
|
|
|
|
|
print FOO <<END; |
|
|
$doctype |
|
|
<head> |
|
|
<title>$talkTitle - $loc_toc</title> |
|
|
$http_equiv |
|
|
$stylelink |
|
|
</head> |
|
|
$body |
|
|
<table height="100%" width="100%"> |
|
|
<tr> |
|
|
<td class="header-first" valign="top"> |
|
|
<table width="100%" border="0"> |
|
|
<tr> |
|
|
<td class="cell-logo">$logo_html</td> |
|
|
<td class="cell-heading">$title_html</td> |
|
|
</tr> |
|
|
</table> |
|
|
</td> |
|
|
</tr> |
|
|
<tr> |
|
|
<td height="$content_hight" class="body" valign="top"> |
|
|
<div class="body"> |
|
|
<h3>$loc_toc</h3> |
|
|
<ul> |
|
|
END |
|
376 |
|
|
377 |
} |
} |
378 |
## |
## |
384 |
|
|
385 |
sub closeOverview |
sub closeOverview |
386 |
{ |
{ |
387 |
my $slide_html=make_progress_bar(0,$total); |
$overview_data{slide_html} = make_progress_bar(0,$total); |
388 |
print FOO <<END; |
$overview_data{toc_entries} = [ @toc_entries ]; |
389 |
</ul> |
|
390 |
</div> |
my $page= new Text::FastTemplate key => 'overview'; |
391 |
</td> |
print FOO $page->output( \%overview_data ); |
|
</tr> |
|
|
<tr> |
|
|
<td class="footer"> |
|
|
<table border="0" width="100%"> |
|
|
<tr> |
|
|
<td width="33%" class="footer-info"> |
|
|
<p> |
|
|
<i>$talkTitle</i> |
|
|
<br>$author $date_html |
|
|
</p> |
|
|
</td><td width="33%" class="footer-nav"> |
|
|
<table border="0"> |
|
|
<tr> |
|
|
<td> |
|
|
[ <a href="slide1.html">On with the show</a> ] |
|
|
</td> |
|
|
</tr> |
|
|
</table> |
|
|
</td><td width="33%" class="footer-count"> |
|
|
$slide_html |
|
|
$author2</td> |
|
|
</tr> |
|
|
</table> |
|
|
</td> |
|
|
</tr> |
|
|
</table> |
|
|
</body> |
|
|
</html> |
|
|
END |
|
392 |
|
|
393 |
close(FOO); |
close(FOO); |
394 |
} |
} |
414 |
if ($nr % $toc_on_page == 0) { |
if ($nr % $toc_on_page == 0) { |
415 |
my $toc_nr=int($nr/$toc_on_page); |
my $toc_nr=int($nr/$toc_on_page); |
416 |
|
|
417 |
print FOO <<END; |
$item = { |
418 |
<br><small><a accesskey=" " tabindex=" " href="index-toc$toc_nr.html">...</a></small></br> |
pre_html => $pre_ul, |
419 |
END |
accesskey => " ", # space |
420 |
|
href => "index-toc$toc_nr.html", |
421 |
|
title => "...", |
422 |
|
post_html => $post_ul, |
423 |
|
more => 1, # use style for more pages link (...) |
424 |
|
}; |
425 |
|
push @toc_entries, $item; |
426 |
|
|
427 |
&closeOverview; |
&closeOverview; |
428 |
|
undef @toc_entries; |
429 |
&openOverview("$overview-toc$toc_nr"); |
&openOverview("$overview-toc$toc_nr"); |
430 |
$last_toc_title=''; |
$last_toc_title=''; |
431 |
} |
} |
432 |
|
|
433 |
$ul1=$ul2=''; |
$pre_ul=$post_ul=''; |
434 |
if ($last_toc_title eq $title) { |
if ($last_toc_title eq $title && $subtitle) { |
435 |
$title = $subtitle; |
$title = $subtitle; |
436 |
$ul1='<ul>'; |
$pre_ul='<ul>'; |
437 |
$ul2='</ul>'; |
$post_ul='</ul>'; |
438 |
} else { |
} else { |
439 |
$last_toc_title=$title; |
$last_toc_title=$title; |
440 |
} |
} |
442 |
# add accesskey for first 9 slides (`1' - `9') or just for first |
# add accesskey for first 9 slides (`1' - `9') or just for first |
443 |
# TOC page, and tabindex for all slides |
# TOC page, and tabindex for all slides |
444 |
if ($nr < 10 && $nr < $toc_on_page) { |
if ($nr < 10 && $nr < $toc_on_page) { |
445 |
print FOO <<END; |
$item = { |
446 |
$ul1<li><a accesskey="$nr" tabindex="$nr" href="slide$nr.html">$title</a></li>$ul2 |
pre_html => $pre_ul, |
447 |
END |
accesskey => "$nr", |
448 |
|
tabindex => "$nr", |
449 |
|
href => "slide$nr.html", |
450 |
|
title => $title, |
451 |
|
post_html => $post_ul, |
452 |
|
more => 0, |
453 |
|
}; |
454 |
|
push @toc_entries,$item; |
455 |
} else { |
} else { |
456 |
print FOO <<END; |
$item = { |
457 |
$ul1<li><a tabindex="$nr" href="slide$nr.html">$title</a></li>$ul2 |
pre_html => $pre_ul, |
458 |
END |
tabindex => "$nr", |
459 |
|
href => "slide$nr.html", |
460 |
|
title => $title, |
461 |
|
post_html => $post_ul, |
462 |
|
}; |
463 |
|
push @toc_entries,$item; |
464 |
} |
} |
465 |
} |
} |
466 |
## |
## |
475 |
# parameters are respectively the slide title, its content, |
# parameters are respectively the slide title, its content, |
476 |
# its number, the next slide title and the previous slide title |
# its number, the next slide title and the previous slide title |
477 |
|
|
478 |
my ($title,$subtitle,$content,$nr,$next_title,$prev_title) = @_; |
my ($title,$subtitle,$content,$nr,$prev_title,$next_title) = @_; |
479 |
|
|
480 |
if (! $title) { |
if (! $title) { |
481 |
return 1; |
return 1; |
510 |
## write to the slide |
## write to the slide |
511 |
open(SLIDE, ">slide$nr.html") || die "can't save slide$nr.html: $!"; |
open(SLIDE, ">slide$nr.html") || die "can't save slide$nr.html: $!"; |
512 |
|
|
513 |
my $toclink = "[ <a href=\"$overview\.html\" title=\"Contents\">Contents</a> ]"; |
my $toc_link = "$overview\.html"; |
514 |
|
|
515 |
## initialization of the navigation links |
## initialization of the navigation links |
516 |
my $nextlink = ""; |
my $next_link = ""; |
517 |
my $prevlink = ""; |
my $prev_link = ""; |
518 |
|
|
519 |
if ($nr>1) { |
if ($nr>1) { |
520 |
$prevlink = "<a href=\"slide".($nr-1).".html\" title=\"Previous\"><<</a>"; |
$prev_link = "slide".($nr-1).".html"; |
521 |
# } else { |
# } else { |
522 |
# ## add a link back to the toc for the first slide --CMN 19991102 |
# ## add a link back to the toc for the first slide --CMN 19991102 |
523 |
# $prevlink = "<a href=\"$overview\.html\" title=\"Previous\"><<</a>"; |
# $prev_link = "$overview\.html"; |
524 |
} |
} |
525 |
|
|
526 |
if ($nr != $total) { |
if ($nr != $total) { |
527 |
$nextlink = "<a href=\"slide".($nr+1).".html\" title=\"Next\">>></a>"; |
$next_link = "slide".($nr+1).".html"; |
528 |
} |
} |
529 |
|
|
530 |
$stylelink = ""; |
$stylelink = ""; |
531 |
# here is the standard style sheet |
# here is the standard style sheet |
532 |
$stylelink .= "<link href=\"$cssStandard\" rel=\"stylesheet\" type=\"text/css\" title=\"Talk\">"; |
$stylelink .= "<link href=\"$cssStandard\" rel=\"stylesheet\" type=\"text/css\" title=\"Talk\">"; |
533 |
|
|
|
$title_html="<h1>$title</h1>"; |
|
|
if ($subtitle) { |
|
|
$title_html.="<h2>$subtitle</h2>"; |
|
|
} |
|
|
|
|
534 |
my $slide_html=make_progress_bar($nr,$total); |
my $slide_html=make_progress_bar($nr,$total); |
535 |
|
|
536 |
print SLIDE <<END; |
# undefine body if no content is found (so that template can show |
537 |
$doctype |
# only title and sub-title |
538 |
<head> |
if ($content !~ m/\S/g) { |
539 |
<title>$talkTitle - $title</title> |
undef $content; |
540 |
$http_equiv |
} |
541 |
$stylelink |
|
542 |
</head> |
%page_data = ( |
543 |
$body |
doctype => $doctype, |
544 |
<table height="100%" width="100%"> |
talkTitle => $talkTitle, |
545 |
<tr> |
title => $title, |
546 |
<td class="header-first" valign="top"> |
subtitle => $subtitle, |
547 |
<table width="100%" border="0"> |
http_equiv => $http_equiv, |
548 |
<tr> |
stylelink => $stylelink, |
549 |
<td class="cell-logo">$logo_html</td> |
body => $body, |
550 |
<td class="cell-heading">$title_html</td> |
|
551 |
</tr> |
logoLink => $logoLink, |
552 |
</table> |
logoFile => $logoFile, |
553 |
</td> |
logoAlt => $logoAlt, |
554 |
</tr> |
logoLink2 => $logoLink2, |
555 |
<tr> |
logoFile2 => $logoFile2, |
556 |
<td height="$content_hight" class="body" valign="top"> |
logoAlt2 => $logoAlt2, |
557 |
<div class="body"> |
|
558 |
$content |
|
559 |
</div> |
content_hight => $content_hight, |
560 |
</td> |
content => $content, |
561 |
</tr> |
|
562 |
<tr> |
prev_link => $prev_link, |
563 |
<td class="footer"> |
toc_link => $toc_link, |
564 |
<table border="0" width="100%"> |
next_link => $next_link, |
565 |
<tr> |
prev_title => $prev_title, |
566 |
<td width="33%" class="footer-info"> |
next_title => $next_title, |
567 |
<p> |
|
568 |
<i>$talkTitle</i> |
author => $author, |
569 |
<br>$author $date_html |
authorUrl => $authorUrl, |
570 |
</p> |
author2 => $author2, |
571 |
</td><td width="33%" class="footer-nav"> |
authorUrl2 => $authorUrl2, |
572 |
<table border="0"> |
|
573 |
<tr> |
date => $date, |
574 |
<td> |
|
575 |
$prevlink |
slide_html => $slide_html, |
576 |
$toclink |
|
577 |
$nextlink |
); |
578 |
</td> |
|
579 |
</tr> |
my $page; |
580 |
</table> |
if ($content) { |
581 |
</td><td width="33%" class="footer-count"> |
$page= new Text::FastTemplate key => 'slide'; |
582 |
$slide_html |
} else { |
583 |
$author2</td> |
$page= new Text::FastTemplate key => 'title'; |
584 |
</tr> |
} |
585 |
</table> |
print SLIDE $page->output( \%page_data ); |
|
</td> |
|
|
</tr> |
|
|
</table> |
|
|
</body> |
|
|
</html> |
|
|
END |
|
586 |
|
|
587 |
close(SLIDE); |
close(SLIDE); |
588 |
return 0; |
return 0; |
641 |
# clean the html of the slide |
# clean the html of the slide |
642 |
# remove all <div class="comment">blabla</div> |
# remove all <div class="comment">blabla</div> |
643 |
sub clean_html { |
sub clean_html { |
644 |
$_[0] =~ s/<div\s+class\s*=\s*(?:comment[\s>]|\"comment\").*?<\/div>//igs; |
my $tmp=$_[0]; |
645 |
return $_[0]; |
$tmp =~ s/<div\s+class\s*=\s*(?:comment[\s>]|\"comment\").*?<\/div>//igs; |
646 |
|
$tmp =~ s,</*font[^>]+>,,ig; |
647 |
|
return $tmp; |
648 |
} |
} |
649 |
|
|
650 |
############################################################################## |
############################################################################## |
677 |
} else { |
} else { |
678 |
$r=$t; |
$r=$t; |
679 |
} |
} |
680 |
$html='<table border="0" width="30%" cellpadding="0" cellspacing="0" align="right"><tr><td width="'.$pcnt_done.'%" class="pcnt-done">'.$l.'</td><td width="'.$pcnt_left.'%" class="pcnt-left">'.$r.'</td></tr></table>'; |
$html='<table border="0" width="50%" cellpadding="0" cellspacing="0" align="right"><tr><td width="'.$pcnt_done.'%" class="pcnt-done">'.$l.'</td><td width="'.$pcnt_left.'%" class="pcnt-left">'.$r.'</td></tr></table>'; |
681 |
} else { |
} else { |
682 |
$html="$loc_slide $nr $loc_of $total"; |
$html="$loc_slide $nr $loc_of $total"; |
683 |
} |
} |
685 |
return $html; |
return $html; |
686 |
} |
} |
687 |
|
|
688 |
|
############################################################################## |
689 |
|
# make slide progress bar |
690 |
|
sub remove_anchor { |
691 |
|
my $tmp = $_[0]; |
692 |
|
$tmp =~ s/(.*)<A[^>]*>(.*)<\/A>(.*)/$1$2$3/ig; |
693 |
|
return $tmp; |
694 |
|
} |