From 20184edd252241fd0a874628e63bf0bdb788e6f0 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Mon, 30 Aug 2010 20:56:41 -0300 Subject: [PATCH] Files in the first commit didn't have an HTML wrapper with PDF link. - scripts/schhist2web: moved generation of a HTML-wrapped PNG with link to PDF to new function wrapped_png - scripts/schhist2web: generate a PDF with link also for files in the very first commit --- scripts/schhist2web | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/scripts/schhist2web b/scripts/schhist2web index dad196b..54f1a70 100755 --- a/scripts/schhist2web +++ b/scripts/schhist2web @@ -78,6 +78,23 @@ EOF } +wrapped_png() +{ + local dir=$1 commit=$2 file=$3 + + mkdir -p "$dir/html_$commit" + echo "" + cat <"$dir/html_$commit/$file.html" + + +$file + + + +EOF +} + + usage() { cat <&1 @@ -346,16 +363,7 @@ for n in `cd "$dir" && git rev-list $first..HEAD~1` $first; do echo "$s" >>"$index" s= empty=false - mkdir -p "$out/html_$next" - echo "" >>"$index" - cat <"$out/html_$next/$m.html" - - -$m - - - -EOF + wrapped_png "$out" "$next" "$m" >>"$index" done < <(ls -1 "$out/names") if ! $empty; then echo "$s" >>"$index" @@ -384,7 +392,10 @@ if [ -d "$cache/ppm_$next" ]; then # could this ever be false ? pngdiff shrink "$thumb" -f $THUMB_OPTS -c 0,1,0 "$fat" "$fat" \ || exit empty=false - echo "" >>"$index" + mkdir -p "$out/pdf_$next" + schps2pdf -T NEW -o "$out/pdf_$next/$m.pdf" \ + "$cache/ps_$next/$m.ps" || exit + wrapped_png "$out" "$next" "$m" >>"$index" done < <(ls -1 "$out/names") if ! $empty; then echo "" >>"$index"