87a1847f352c770447538fd1807afb57b1877904
[grml-tips.git] / html / grml-tips2html.sh
1 #!/bin/sh
2
3 OUTFILE=grml_tips.html
4 INFILE=grml_tips
5 count=0
6
7 cp grml_tips grml_tips.orig
8 cp grml_tips grml_tips.sed
9 sed -i 's/>/\>/' grml_tips.sed
10 sed -i 's/</\&lt;/' grml_tips.sed
11 mv grml_tips.sed grml_tips
12
13 :> grml_tips.html
14 cat >> $OUTFILE << EOF
15 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
16 <head>
17 <title>grml.org - grml Tips</title>
18 <meta name="Title" content="grml.org - grml Tips" />
19 <meta name="Author" content="the grml team [www.grml.org/team/]" />
20 <meta name="Keywords" content="grml.org, grml" />
21 <meta name="Description" content="grml Tips" />
22 <meta name="Abstract" content="grml, just another linux-distribution" />
23 <meta name="fdse-index-as" content="http://www.grml.org/tips/" />
24 <meta name="Robots" content="index,follow" />
25 <meta name="Language" content="english" />
26 <meta name="identifier-url" content="http://www.grml.org/" />
27 <meta name="MSSmartTagsPreventParsing" content="true" />
28 <meta http-equiv="imagetoolbar" content="no" />
29 <link rel="home" href="/" title="grml.org" />
30 <link rel="help" href="/features/" title="About" />
31 <link rel="author" href="/team/" title="Team" />
32 <link rel="contents" href="/sitemap/" title="Sitemap" />
33 <link rel="search" href="/search/" title="Search" />
34 <link rel="icon" href="/favicon.png" type="image/png" />
35 <meta http-equiv="content-Type" content="application/xhtml+xml; charset=iso-8859-1" />
36 <link rel="stylesheet" href="/style.css" type="text/css" />
37 </head>
38 <body>
39
40 EOF
41
42 echo "<a name=\"$count\"></a>" >> $OUTFILE
43 echo "<pre>" >> $OUTFILE
44 oifs=$IFS
45 IFS=''
46 while read LINE
47 do  
48     case $LINE in
49         --\ *)
50           count=$(($count + 1))
51           LINE="<a name=\"$count\"></a><hr />${LINE#-- }"
52           echo "</pre>" >> $OUTFILE
53           echo $LINE >> $OUTFILE
54           echo "<pre>" >> $OUTFILE
55           ;;
56         *)
57           echo $LINE >> $OUTFILE
58           ;;
59     esac
60 done < $INFILE
61 IFS=$oifs
62
63 cat >> $OUTFILE << EOF
64
65 </body>
66 </html>
67 EOF