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; |
526 |
$content =~ s/<\/body>//i; # remove if any |
$content =~ s/<\/body>//i; # remove if any |
527 |
$content =~ s/<\/html>//i; # remove if any |
$content =~ s/<\/html>//i; # remove if any |
528 |
|
|
529 |
$status = sprintf "Slide %2d: %s %s\n", $nr, $title, $subtitle; |
$status = sprintf "Slide %2d: %s %s", $nr, $title, $subtitle; |
530 |
$status =~ s/<[^>]+>//g; |
$status =~ s/<[^>]+>//g; |
531 |
print STDERR $status; |
$status =~ s/[\n\r]+/ /g; |
532 |
|
print STDERR "$status\n"; |
533 |
|
|
534 |
&verify_html($content); # check the html |
&verify_html($content); # check the html |
535 |
&check_tags($content); # check open and closed tags |
&check_tags($content); # check open and closed tags |
612 |
} else { |
} else { |
613 |
$page= new Text::FastTemplate key => 'title'; |
$page= new Text::FastTemplate key => 'title'; |
614 |
} |
} |
615 |
$page_data{template_dir}='' if ($pack); |
|
616 |
print SLIDE $page->output( \%page_data ); |
if ($pack) { |
617 |
extract_files($page->output( \%page_data )) if ($pack); |
$page_data{template_dir}=''; |
618 |
|
print SLIDE extract_files($page->output( \%page_data )); |
619 |
|
} else { |
620 |
|
print SLIDE $page->output( \%page_data ); |
621 |
|
} |
622 |
|
|
623 |
close(SLIDE); |
close(SLIDE); |
624 |
return 0; |
return 0; |
625 |
} |
} |
737 |
} |
} |
738 |
|
|
739 |
############################################################################## |
############################################################################## |
740 |
# extract files referenced in presentation |
# extract files referenced in presentation and remove dirs from slide html |
741 |
|
|
742 |
sub extract_files { |
sub extract_files { |
743 |
my $tmp = $_[0]; |
my $tmp = $slide = $_[0]; |
744 |
while ($tmp =~ s/href="*([^"\s]+)"*//ism || |
while ($tmp =~ s/href="*([^"\s]+)"*//ism || |
745 |
$tmp =~ s/src="*([^"\s]+)"*//ism) { |
$tmp =~ s/src="*([^"\s]+)"*//ism) { |
746 |
if ("$1" !~ m/[hf]t?tp:/ && -f "$1" && !grep(/$1/,@pack_additional)) { |
if ("$1" !~ m/[hf]t?tp:/ && -f "$1" && !grep(/$1/,@pack_additional)) { |
747 |
push @pack_additional,$1; |
my $file=$1; |
748 |
|
push @pack_additional,$file; |
749 |
|
if ($file =~ m,^(.+)/([^/]+),) { |
750 |
|
my ($d,$f) = ($1,$2); |
751 |
|
$slide =~ s,${d}/${f},${f},g; |
752 |
|
} |
753 |
} |
} |
754 |
} |
} |
755 |
|
return $slide; |
756 |
} |
} |
757 |
|
|
758 |
############################################################################## |
############################################################################## |