--- burst.pl 2001/05/05 19:20:27 1.7 +++ burst.pl 2001/05/05 20:21:29 1.10 @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# SLies Copyright 2001 Dobrica Pavlinusic +# PLies Copyright 2001 Dobrica Pavlinusic # # this tool is based on SlideMaker and XLSies tool # split a all.htm into slide*.htm @@ -240,7 +240,7 @@ ## step 1: record anchors for($i=0; $i<$total; $i++) { - my $tmp = $table[($i*2)]; + my $tmp = $table[($i*2)].$table[($i*2)+1]; while ($tmp =~ s,,,i) { $anchor_on_slide{$1}=($i+1); print "\tslide ",($i+1)," anchor: $1\n" if ($debug); @@ -278,15 +278,13 @@ ## need to check if the title contains any anchor ## if so it needs to be removed ## because the title is being used in the table of content to link to the corresponding slide - $table[0] =~ s/(.*)]*>(.*)<\/A>(.*)/$1$2$3/i; + $table[0] = remove_anchor($table[0]); ## grab next slide title $table[2] (if there's a next slide) ## to be able to use in the 'next' navigation button ## keep in mind that $table[1] contains the slide corresponding to the title $table[0] if ($table[2]) { - $next_title= $table[2]; - ## remove any anchor from the next slide title - $next_title =~ s/(.*)]*>(.*)<\/A>(.*)/$1$2$3/i; + $next_title= remove_anchor($table[2]); } ## the current slide content is stored $table[1] @@ -297,8 +295,8 @@ ## extract slide Sub Title

undef $slideSubTitle; - if ($slideContent =~ s/<[hH]2[^>]*>([^<]+)<\/[hH]2[^>]*>//) { - $slideSubTitle=$1; + if ($slideContent =~ s/<[hH]2[^>]*>(.+)<\/[hH]2[^>]*>//sm) { + $slideSubTitle=remove_anchor($1); } ## add the title of the current slide to the table of content @@ -310,7 +308,7 @@ &createSlide($slideTitle,$slideSubTitle,$slideContent ,$slideCount++,$prev_title,$next_title); ## save the title of the previous slide to be displayed in the 'previous' navigation button - $prev_title="$table[0]"; + $prev_title=remove_anchor($table[0]); } ## process the next slide while (shift(@table)); @@ -414,17 +412,18 @@ if ($nr % $toc_on_page == 0) { my $toc_nr=int($nr/$toc_on_page); - %item = ( + $item = { pre_html => $pre_ul, accesskey => " ", # space href => "index-toc$toc_nr.html", title => "...", post_html => $post_ul, more => 1, # use style for more pages link (...) - ) -# push @toc_entries, %item; + }; + push @toc_entries, $item; &closeOverview; + undef @toc_entries; &openOverview("$overview-toc$toc_nr"); $last_toc_title=''; } @@ -452,14 +451,14 @@ }; push @toc_entries,$item; } else { - %item = ( + $item = { pre_html => $pre_ul, tabindex => "$nr", href => "slide$nr.html", title => $title, post_html => $post_ul, - ) -# push @toc_entries,\%item; + }; + push @toc_entries,$item; } } ## @@ -629,8 +628,10 @@ # clean the html of the slide # remove all
blabla
sub clean_html { - $_[0] =~ s/]|\"comment\").*?<\/div>//igs; - return $_[0]; + my $tmp=$_[0]; + $tmp =~ s/]|\"comment\").*?<\/div>//igs; + $tmp =~ s,]+>,,ig; + return $tmp; } ############################################################################## @@ -671,3 +672,10 @@ return $html; } +############################################################################## +# make slide progress bar +sub remove_anchor { + my $tmp = $_[0]; + $tmp =~ s/(.*)]*>(.*)<\/A>(.*)/$1$2$3/ig; + return $tmp; +}