1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-10-02 18:46:21 +03:00

Generate a PDF with the all the current sheets.

- scripts/schhist2web: don't generate PDF for sheets that no longer exist
  at HEAD
- scripts/schhist2web: generate a PDF containing all sheets existing at
  HEAD
- scripts/schps2pdf: prefix was set to the wrong argument
- scripts/schps2pdf: removed left-over (and functionless) cat into gs
- scripts/schps2pdf: corrected quoting of the TOC entry
This commit is contained in:
Werner Almesberger 2010-08-30 04:13:20 -03:00
parent 337f13a0df
commit ab89a00f5c
2 changed files with 19 additions and 10 deletions

View File

@ -238,6 +238,7 @@ fi
index="$out/index.html"
all=
{
cat <<EOF
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
@ -259,10 +260,19 @@ EOF
<TR bgcolor="$FNAME_COLOR">
EOF
while read m; do
mkdir -p "$out/pdf_$head"
schps2pdf -o "$out/pdf_$head/$m.pdf" "$cache/ps_$head/$m.ps" || exit
echo "<TD><A href="pdf_$head/$m.pdf"><B>$m</B></A>"
ps="$cache/ps_$head/$m.ps"
if [ -r "$ps" ]; then
mkdir -p "$out/pdf_$head"
schps2pdf -o "$out/pdf_$head/$m.pdf" "$ps" || exit
all="$all \"$ps\""
echo "<TD><A href=\"pdf_$head/$m.pdf\"><B>$m</B></A>"
else
echo "<TD><B>$m</B>"
fi
done < <(ls -1 "$out/names")
proj=`basename "$sch" .sch`
eval schps2pdf -t \""$proj-"\" -o \""$out/pdf_$proj.pdf"\" $all
echo "<TD><A href=\"pdf_$proj.pdf\">All sheets</A>"
} >"$index"

View File

@ -32,7 +32,7 @@ while true; do
shift 2;;
-t) [ -z "$2" ] && usage
toc=true
prefix="$1"
prefix="$2"
shift 2;;
-*)
usage;;
@ -44,9 +44,8 @@ done
in=${1:--}
shift
cat "$in" |
eval gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=\""$out\"" -f \
`for n in "$in" "$@"; do \
name=\`basename "$n" .ps\` \
echo "<($toc && echo '[ /Title (${name#$prefix}) /OUT pdfmark';
cat \"$n\";)"; done`
eval gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=\""$out\"" -f \
`for n in "$in" "$@"; do \
echo "<(sheet=\`basename \"$n\" .ps\`;
$toc && echo '[ /Title ('\"\\${sheet#$prefix}\"') /OUT pdfmark';
cat \"$n\";)"; done`