428 |
my ($title,$subtitle,$nr) = @_; |
my ($title,$subtitle,$nr) = @_; |
429 |
$title =~ s/\r//ig; # remove the windows CR+LF |
$title =~ s/\r//ig; # remove the windows CR+LF |
430 |
$title =~ s/<[^>]+>//g; |
$title =~ s/<[^>]+>//g; |
431 |
|
$subtitle =~ s/<[^>]+>//g; |
432 |
|
|
433 |
if (! $title) { |
if (! $title) { |
434 |
return 1; |
return 1; |
611 |
} else { |
} else { |
612 |
$page= new Text::FastTemplate key => 'title'; |
$page= new Text::FastTemplate key => 'title'; |
613 |
} |
} |
614 |
$page_data{template_dir}='' if ($pack); |
|
615 |
print SLIDE $page->output( \%page_data ); |
if ($pack) { |
616 |
extract_files($page->output( \%page_data )) if ($pack); |
$page_data{template_dir}=''; |
617 |
|
print SLIDE extract_files($page->output( \%page_data )); |
618 |
|
} else { |
619 |
|
print SLIDE $page->output( \%page_data ); |
620 |
|
} |
621 |
|
|
622 |
close(SLIDE); |
close(SLIDE); |
623 |
return 0; |
return 0; |
624 |
} |
} |
736 |
} |
} |
737 |
|
|
738 |
############################################################################## |
############################################################################## |
739 |
# extract files referenced in presentation |
# extract files referenced in presentation and remove dirs from slide html |
740 |
|
|
741 |
sub extract_files { |
sub extract_files { |
742 |
my $tmp = $_[0]; |
my $tmp = $slide = $_[0]; |
743 |
while ($tmp =~ s/href="*([^"\s]+)"*//ism || |
while ($tmp =~ s/href="*([^"\s]+)"*//ism || |
744 |
$tmp =~ s/src="*([^"\s]+)"*//ism) { |
$tmp =~ s/src="*([^"\s]+)"*//ism) { |
745 |
if ("$1" !~ m/[hf]t?tp:/ && -f "$1" && !grep(/$1/,@pack_additional)) { |
if ("$1" !~ m/[hf]t?tp:/ && -f "$1" && !grep(/$1/,@pack_additional)) { |
746 |
push @pack_additional,$1; |
my $file=$1; |
747 |
|
push @pack_additional,$file; |
748 |
|
if ($file =~ m,^(.+)/([^/]+),) { |
749 |
|
my ($d,$f) = ($1,$2); |
750 |
|
$slide =~ s,${d}/${f},${f},g; |
751 |
|
} |
752 |
} |
} |
753 |
} |
} |
754 |
|
return $slide; |
755 |
} |
} |
756 |
|
|
757 |
############################################################################## |
############################################################################## |