Release new version 0.7.3
[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="icon" href="/favicon.png" type="image/png" />
33 <link rel="stylesheet" href="/style.css" type="text/css" />
34 </head>
35 <body>
36
37 EOF
38
39 echo "<a name=\"$count\"></a>" >> $OUTFILE
40 echo "<pre>" >> $OUTFILE
41 oifs=$IFS
42 IFS=''
43 while read LINE
44 do  
45     case $LINE in
46         --\ *)
47           count=$(($count + 1))
48           LINE="<a name=\"$count\"></a><hr />${LINE#-- }"
49           echo "</pre>" >> $OUTFILE
50           echo $LINE >> $OUTFILE
51           echo "<pre>" >> $OUTFILE
52           ;;
53         *)
54           echo $LINE >> $OUTFILE
55           ;;
56     esac
57 done < $INFILE
58 IFS=$oifs
59
60 cat >> $OUTFILE << EOF
61
62 </body>
63 </html>
64 EOF