-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathmkreadme
executable file
·51 lines (42 loc) · 1.29 KB
/
mkreadme
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
set -euC
head=$(cat <<EOF
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Hello, CSS!</title>
<link rel="shortcut icon" href="/favicon.ico">
<link rel="stylesheet" href="../base.css">
EOF
)
nav=$(cat <<EOF
</head>
<body>
<nav class="center">
<a href="README.html">README</a> |
<a href="README-fancy.html">Fancier README</a> |
<a href="index.html">Full demo</a> |
<a href="http://github.com/arp242/hello-css">GitHub</a>
</nav>
<div class="page">
EOF
)
echo "$head" >| "demo/README.html"
echo "$head" >| "demo/README-fancy.html"
cat <<EOF >> "demo/README-fancy.html"
<link rel="stylesheet" href="../aside.css">
<link rel="stylesheet" href="../blockquote.css">
<link rel="stylesheet" href="../permalink.css">
<link rel="stylesheet" href="../postscript.css">
EOF
echo "$nav" >> "demo/README.html"
echo "$nav" >> "demo/README-fancy.html"
html=$(kramdown < "README.markdown")
echo "$html" >> "demo/README.html"
echo "$html" | sed \
's/<pre>/<pre class="full">/; s/<table>/<table class="full">/; s/<!--//; s/-->//' \
>> "demo/README-fancy.html"
echo "</div></body></html>" >> "demo/README.html"
echo "</div></body></html>" >> "demo/README-fancy.html"