author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Thu, 08 Sep 2011 02:13:07 +0300 | |
changeset 985 | 6a75b1b2976b |
parent 933 | 245108d3edbd |
child 1031 | 1febb0de8647 |
permissions | -rw-r--r-- |
902
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
1 |
#!/bin/sh |
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
2 |
|
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
3 |
echo '<html>' |
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
4 |
echo '<head>' |
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
5 |
echo ' <meta http-equiv="Content-Type" content="text/html; charset=utf-8">' |
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
6 |
echo ' <title>Tips</title>' |
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
7 |
echo ' <style type="text/css">' |
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
8 |
echo ' body { background-color: linen; }' |
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
9 |
echo ' a { text-decoration:none; }' |
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
10 |
echo ' a:link { color: brown; }' |
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
11 |
echo ' a:visited { color: IndianRed; }' |
933
245108d3edbd
Use contract color..
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
903
diff
changeset
|
12 |
echo ' a:hover { background: LightPink; border-radius: 10px; padding: 1px; }' |
902
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
13 |
echo ' </style>' |
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
14 |
echo '</head>' |
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
15 |
echo '<body>' |
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
16 |
echo '<h1>Tips</h1>' |
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
17 |
echo '<ul>' |
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
18 |
|
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
19 |
for file in *.rst *.txt; do |
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
20 |
ext=${file##*.} |
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
21 |
name=${file%.${ext}} |
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
22 |
case $ext in |
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
23 |
txt) |
903
9ead7d97be34
Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
902
diff
changeset
|
24 |
case "$1" in |
9ead7d97be34
Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
902
diff
changeset
|
25 |
chm) printf ' <li><a href="%s.txt">%s</a>\n' $name $name ;; |
9ead7d97be34
Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
902
diff
changeset
|
26 |
frame) printf ' <li><a href="%s.txt" target="article">%s</a>\n' $name $name ;; |
9ead7d97be34
Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
902
diff
changeset
|
27 |
esac |
902
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
28 |
;; |
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
29 |
rst) |
903
9ead7d97be34
Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
902
diff
changeset
|
30 |
case "$1" in |
9ead7d97be34
Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
902
diff
changeset
|
31 |
chm) printf ' <li><a href="%s.html">%s</a>\n' $name $name ;; |
9ead7d97be34
Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
902
diff
changeset
|
32 |
frame) printf ' <li><a href="%s.html" target="article">%s</a>\n' $name $name ;; |
9ead7d97be34
Add chm output format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
902
diff
changeset
|
33 |
esac |
902
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
34 |
;; |
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
35 |
esac |
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
36 |
done |
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
37 |
|
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
38 |
echo '<p>' |
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
39 |
echo '<address>' |
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
40 |
echo ' <a href="mailto:gavenkoa@gmail.com">Oleksandr Gavenko</a>' |
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
41 |
echo '</address>' |
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
42 |
echo '</body>' |
034aeeb2a16d
Build html version of tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
43 |
echo '</html>' |