diff options
author | nikai <nikai> | 2002-03-21 17:03:01 +0000 |
---|---|---|
committer | nikai <nikai> | 2002-03-21 17:03:01 +0000 |
commit | 0d5abc99a21dadf81681fa6226caa7fc96177cb3 (patch) | |
tree | 70b50f65567cb492165b92978d13ef3936cb8be2 /tools | |
parent | 7d301026e02027f9bfb695162a59c726a8861da2 (diff) | |
download | sylpheeddoc-doc-0d5abc99a21dadf81681fa6226caa7fc96177cb3.tar.gz sylpheeddoc-doc-0d5abc99a21dadf81681fa6226caa7fc96177cb3.tar.xz sylpheeddoc-doc-0d5abc99a21dadf81681fa6226caa7fc96177cb3.zip |
tool for html post-processing
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/pnght | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tools/pnght b/tools/pnght new file mode 100755 index 0000000..11f9cbc --- /dev/null +++ b/tools/pnght @@ -0,0 +1,39 @@ +#!/bin/sh + +# Hooray! My first little bash script. Look, how ugly it is. +# +# What it does: some HTML postprocessing +# +# (1) it will extract height information from png images +# in $doc/manual/$lang/snapshots/ +# (2) it will paste this information into the htmls +# in $doc/manual/HTML/$lang/ +# (3) it will strip <FIGURE>, <PH> and </FIGURE> tags +# which aren't legal in HTML 3.2 +# (4) and will strip empty lines + +doc=~/sites/sylpheed/doc +lang=de + +# modify to your needs. enjoy. nikai. + +rm $doc/manual/HTML/par*.tmp +cd $doc/manual/$lang/snapshots/ +for x in *.png +do + echo $x $(($(hexdump -o -s 22 -n 1 $x | sed -e 's/[0-9][0-9][0-9][0-9][0-9][0-9][0-9]//g') * 256 + $(hexdump -o -s 23 -n 1 $x | sed -e 's/[0-9][0-9][0-9][0-9][0-9][0-9][0-9]//g'))) >> $doc/manual/HTML/par1.tmp +done +sed -e 's/[.]png//g' $doc/manual/HTML/par1.tmp >> $doc/manual/HTML/par.tmp +cd $doc/manual/HTML/$lang/ +pen=$(awk '{print $1}' $doc/manual/HTML/par.tmp) +for y in $pen +do + peh=$(awk '($1==y) {print $2}' y=$y $doc/manual/HTML/par.tmp) + for x in *.html + do + z="s/\/$y.png\">/\/$y.png\"height=\"$peh\">/g" + sed -e $z -e 's/\"height/\" height/g' -e 's/<PH[^>]*>//g' -e 's/<[/]*FIG[^>]*>//g' -e '/^$/d' $x > $x.tmp + mv $x.tmp $x + done +done +rm $doc/manual/HTML/par*.tmp |