1
1
#! /bin/bash
2
- paper=${1% .md}
2
+
3
+ readonly paper=" ${1% .md} "
4
+
3
5
(cat << HEAD
4
- <!DOCTYPE html><html><head><meta charset="utf-8"><style>html { font-size: 100%; overflow-y: scroll; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
6
+ <!DOCTYPE html>
7
+ <html><head><meta charset="utf-8">
8
+ <style>
9
+ html {
10
+ font-size: 100%;
11
+ font-family: "DejaVu Serif", Georgia, Times, serif;
12
+ overflow-y: scroll;
13
+ -webkit-text-size-adjust: 100%;
14
+ -ms-text-size-adjust: 100%;
15
+ }
5
16
6
17
body{
7
18
color:#444;
8
- font-family:Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman',
9
- "Hiragino Sans GB", "STXihei", "微软雅黑", serif;
10
19
font-size:12px;
11
20
line-height:1.5em;
12
21
background:#fefefe;
44
53
max-width:100%;
45
54
}
46
55
47
- h1,h2,h3,h4,h5,h6{
48
- font-weight:normal;
49
- color:#111;
50
- line-height:1em ;
56
+ h1,h2,h3,h4,h5,h6 {
57
+ font-weight:normal;
58
+ color:#111;
59
+ line-height: 135% ;
51
60
}
52
61
h4,h5,h6{ font-weight: bold; }
53
62
h1{ font-size:2.5em; }
@@ -66,17 +75,16 @@ border-left: 0.5em #EEE solid;
66
75
hr { display: block; height: 2px; border: 0; border-top: 1px solid #aaa;border-bottom: 1px solid #eee; margin: 1em 0; padding: 0; }
67
76
68
77
69
- pre , code, kbd, samp {
78
+ pre, code, kbd, samp {
79
+ font-family: "DejaVu Sans Mono", Consolas, Courier, serif;
80
+ }
81
+ kbd, samp {
70
82
color: #000;
71
- font-family: monospace;
72
- font-size: 0.88em;
73
83
border-radius:3px;
74
84
background-color: #F8F8F8;
75
85
border: 1px solid #CCC;
76
86
}
77
87
pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; padding: 5px 12px;}
78
- pre code { border: 0px !important; padding: 0;}
79
- code { padding: 0 3px 0 3px; }
80
88
81
89
b, strong { font-weight: bold; }
82
90
@@ -92,7 +100,8 @@ sub { bottom: -0.25em; }
92
100
93
101
ul, ol { margin: 1em 0; padding: 0 0 0 2em; }
94
102
ul ul, ul ol, ol ul, ol ol { margin: 0; padding: 0 0 0 1em; }
95
- li p:last-child { margin:0 }
103
+ li { padding: 1ex 0; }
104
+ li p:last-child { margin: 0 }
96
105
dd { margin: 0 0 0 2em; }
97
106
98
107
img { border: 0; -ms-interpolation-mode: bicubic; vertical-align: middle; }
@@ -126,7 +135,7 @@ body{font-size:16px;}
126
135
}
127
136
HEAD
128
137
129
- echo " </style><title>$( echo -n " $paper " | tr prn PRN) </title></head><body>"
138
+ echo -e " </style>\n <title>$( echo -n " ${ paper} " | tr prn PRN) </title>\n </head>\n <body>"
130
139
131
- markdown " $1 "
132
- ) > $ paper .html
140
+ markdown " ${1} "
141
+ ) > " ${ paper} .html"
0 commit comments