11#! /bin/bash
2- paper=${1% .md}
2+
3+ readonly paper=" ${1% .md} "
4+
35(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+ }
516
617body{
718 color:#444;
8- font-family:Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman',
9- "Hiragino Sans GB", "STXihei", "微软雅黑", serif;
1019 font-size:12px;
1120 line-height:1.5em;
1221 background:#fefefe;
4453max-width:100%;
4554}
4655
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% ;
5160}
5261h4,h5,h6{ font-weight: bold; }
5362h1{ font-size:2.5em; }
@@ -66,17 +75,16 @@ border-left: 0.5em #EEE solid;
6675hr { display: block; height: 2px; border: 0; border-top: 1px solid #aaa;border-bottom: 1px solid #eee; margin: 1em 0; padding: 0; }
6776
6877
69- pre , code, kbd, samp {
78+ pre, code, kbd, samp {
79+ font-family: "DejaVu Sans Mono", Consolas, Courier, serif;
80+ }
81+ kbd, samp {
7082 color: #000;
71- font-family: monospace;
72- font-size: 0.88em;
7383 border-radius:3px;
7484 background-color: #F8F8F8;
7585 border: 1px solid #CCC;
7686}
7787pre { 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; }
8088
8189b, strong { font-weight: bold; }
8290
@@ -92,7 +100,8 @@ sub { bottom: -0.25em; }
92100
93101ul, ol { margin: 1em 0; padding: 0 0 0 2em; }
94102ul 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 }
96105dd { margin: 0 0 0 2em; }
97106
98107img { border: 0; -ms-interpolation-mode: bicubic; vertical-align: middle; }
@@ -126,7 +135,7 @@ body{font-size:16px;}
126135}
127136HEAD
128137
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>"
130139
131- markdown " $1 "
132- ) > $ paper .html
140+ markdown " ${1} "
141+ ) > " ${ paper} .html"
0 commit comments