File: postproc.sh

package info (click to toggle)
geda-doc 20061020-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 6,148 kB
  • ctags: 826
  • sloc: sh: 731; makefile: 135
file content (33 lines) | stat: -rwxr-xr-x 1,050 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh

if [ ! -e "geda_faq.html" ]
then
	echo "You must start this program in the toplevel wiki directory"
	echo "wherever geda_faq.html lives."
	exit 1
fi

files=`find . -name \*.html -print`

for i in $files
do
	echo $i
	mv -f $i $i.old
	cat $i.old | sed '/\<script type/d' > $i

	rm -f $i.old

	mv -f $i $i.old2
	isdetail=`echo $i | grep _detail`
	if [ "$isdetail" = "" ] 
	then
		cat $i.old2 | sed 's%media="screen" type="text/css" href="http://geda.seul.org/wiki/lib/exe/css.php"%media="screen" type="text/css" href="lib/exe/css"%g' | sed 's%media="print" type="text/css" href="http://geda.seul.org/wiki/lib/exe/css.php?print=1"%media="print" type="text/css" href="lib/exe/001css"%g' > $i
	else
		cat $i.old2 | sed 's%media="screen" type="text/css" href="http://geda.seul.org/wiki/lib/exe/css.php"%media="screen" type="text/css" href="../lib/exe/css"%g' | sed 's%media="print" type="text/css" href="http://geda.seul.org/wiki/lib/exe/css.php?print=1"%media="print" type="text/css" href="../lib/exe/001css"%g' > $i
	fi


	rm -f $i.old2

done