md-server2 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a66f3ad3e8171b454f459129f852eb1356f4763a
4
+ data.tar.gz: 7cd944495ad857f04a34a860bf27e7df0ecb930f
5
+ SHA512:
6
+ metadata.gz: 593f1320a6bfc517d91cad1f0f0b5e051b2d786aa048caebf556009182efc47e762d6d2aaa6f20249349710368a8c22e6bfa27cf45a690f3df22fbd062caad69
7
+ data.tar.gz: 7ef078fcea039d4cf9b07ac07f8c73091f4528c3252df1c9f34c33109d49cf7f6806e4e42d1a6da8758f50a05d069359ef5cd6d90ff3dd761550a97e94212d12
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "http://ruby.taobao.org/"
2
+
3
+ gem "sinatra"
4
+ gem "sinatra-contrib"
5
+ gem "markdown"
6
+ gem "optparse"
data/Gemfile.lock ADDED
@@ -0,0 +1,39 @@
1
+ GEM
2
+ remote: http://ruby.taobao.org/
3
+ specs:
4
+ backports (3.3.5)
5
+ eventmachine (1.0.3)
6
+ kramdown (1.2.0)
7
+ logutils (0.6.0)
8
+ markdown (1.1.1)
9
+ kramdown (>= 1.0.2)
10
+ props (>= 1.0.0)
11
+ textutils (>= 0.6.4)
12
+ props (1.0.3)
13
+ rack (1.5.2)
14
+ rack-protection (1.5.1)
15
+ rack
16
+ rack-test (0.6.2)
17
+ rack (>= 1.0)
18
+ sinatra (1.4.4)
19
+ rack (~> 1.4)
20
+ rack-protection (~> 1.4)
21
+ tilt (~> 1.3, >= 1.3.4)
22
+ sinatra-contrib (1.4.0)
23
+ backports (>= 2.0)
24
+ eventmachine
25
+ rack-protection
26
+ rack-test
27
+ sinatra (~> 1.4.2)
28
+ tilt (~> 1.3)
29
+ textutils (0.7.0)
30
+ logutils (~> 0.5)
31
+ tilt (1.4.1)
32
+
33
+ PLATFORMS
34
+ ruby
35
+
36
+ DEPENDENCIES
37
+ markdown
38
+ sinatra
39
+ sinatra-contrib
data/bin/md-server ADDED
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "optparse"
4
+
5
+ $:.unshift(File.join(File.dirname(__FILE__), "/../lib"))
6
+ require "md-server"
7
+
8
+ opts = {
9
+ :port => 8000
10
+ }
11
+
12
+ OptionParser.new do |o|
13
+ o.banner = "USAGE: #{$0} [options]"
14
+
15
+ o.on("-p",
16
+ "--port [PORT]",
17
+ "HTTP port to start server, default is 8000.") do |p|
18
+ opts[:port] = p
19
+ end
20
+
21
+ o.on("-h", "--help", "Show help documentation") do |h|
22
+ puts o
23
+ exit
24
+ end
25
+ end.parse!
26
+
27
+ set :port, opts[:port]
28
+ enable :run
data/lib/config.ru ADDED
@@ -0,0 +1,4 @@
1
+
2
+ require "./md-server"
3
+ run Sinatra::Application
4
+
data/lib/md-server.rb ADDED
@@ -0,0 +1,44 @@
1
+ # encoding: utf-8
2
+
3
+ require "sinatra"
4
+ require "sinatra/reloader" if development?
5
+ require "markdown"
6
+
7
+ DOC_PATH = Dir.pwd
8
+
9
+ def get_html(path)
10
+ content = File.read path
11
+ Markdown.new(content).to_html
12
+ end
13
+
14
+ def get_path(path)
15
+ path = path + "README.md" if path[-1] == "/"
16
+ path = File.join DOC_PATH, path
17
+ path
18
+ end
19
+
20
+ def get_ext(path)
21
+ path.split(".")[-1]
22
+ end
23
+
24
+ ################
25
+ # Routes.
26
+
27
+ get "*" do |path|
28
+ ext = get_ext path
29
+ if ext && ext.match(/ico|jpg|gif|jpg|jpeg/)
30
+ return ""
31
+ end
32
+
33
+ path = get_path path
34
+
35
+ if File.exist?(path)
36
+ content = get_html path
37
+ erb :markdown, :locals => {
38
+ :content => content
39
+ }
40
+ else
41
+ error "sorry, file can't be found."
42
+ end
43
+
44
+ end
@@ -0,0 +1,146 @@
1
+ h1,
2
+ h2,
3
+ h3,
4
+ h4,
5
+ h5,
6
+ h6,
7
+ p,
8
+ blockquote {
9
+ margin: 0;
10
+ padding: 0;
11
+ }
12
+ body {
13
+ font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", Arial, sans-serif;
14
+ font-size: 13px;
15
+ line-height: 18px;
16
+ color: #fff;
17
+ background-color: #282a36;
18
+ margin: 10px 13px 10px 13px;
19
+ }
20
+ table {
21
+ margin: 10px 0 15px 0;
22
+ border-collapse: collapse;
23
+ }
24
+ td,th {
25
+ border: 1px solid #ddd;
26
+ padding: 3px 10px;
27
+ }
28
+ th {
29
+ padding: 5px 10px;
30
+ }
31
+ a {
32
+ color: #59acf3;
33
+ }
34
+ a:hover {
35
+ color: #a7d8ff;
36
+ text-decoration: none;
37
+ }
38
+ a img {
39
+ border: none;
40
+ }
41
+ p {
42
+ margin-bottom: 9px;
43
+ }
44
+ h1,
45
+ h2,
46
+ h3,
47
+ h4,
48
+ h5,
49
+ h6 {
50
+ color: #fff;
51
+ line-height: 36px;
52
+ }
53
+ h1 {
54
+ margin-bottom: 18px;
55
+ font-size: 30px;
56
+ }
57
+ h2 {
58
+ font-size: 24px;
59
+ }
60
+ h3 {
61
+ font-size: 18px;
62
+ }
63
+ h4 {
64
+ font-size: 16px;
65
+ }
66
+ h5 {
67
+ font-size: 14px;
68
+ }
69
+ h6 {
70
+ font-size: 13px;
71
+ }
72
+ hr {
73
+ margin: 0 0 19px;
74
+ border: 0;
75
+ border-bottom: 1px solid #ccc;
76
+ }
77
+ blockquote {
78
+ padding: 13px 13px 21px 15px;
79
+ margin-bottom: 18px;
80
+ font-family:georgia,serif;
81
+ font-style: italic;
82
+ }
83
+ blockquote:before {
84
+ content:"\201C";
85
+ font-size:40px;
86
+ margin-left:-10px;
87
+ font-family:georgia,serif;
88
+ color:#eee;
89
+ }
90
+ blockquote p {
91
+ font-size: 14px;
92
+ font-weight: 300;
93
+ line-height: 18px;
94
+ margin-bottom: 0;
95
+ font-style: italic;
96
+ }
97
+ code, pre {
98
+ font-family: Monaco, Andale Mono, Courier New, monospace;
99
+ }
100
+ code {
101
+ color: #ff4a14;
102
+ padding: 1px 3px;
103
+ font-size: 12px;
104
+ -webkit-border-radius: 3px;
105
+ -moz-border-radius: 3px;
106
+ border-radius: 3px;
107
+ }
108
+ pre {
109
+ display: block;
110
+ padding: 14px;
111
+ margin: 0 0 18px;
112
+ line-height: 16px;
113
+ font-size: 11px;
114
+ border: 1px solid #bf370f;
115
+ white-space: pre;
116
+ white-space: pre-wrap;
117
+ word-wrap: break-word;
118
+ }
119
+ pre code {
120
+ background-color: #282a36;
121
+ color: #ff4a14;
122
+ font-size: 11px;
123
+ padding: 0;
124
+ }
125
+ sup {
126
+ font-size: 0.83em;
127
+ vertical-align: super;
128
+ line-height: 0;
129
+ }
130
+ * {
131
+ -webkit-print-color-adjust: exact;
132
+ }
133
+ @media screen and (min-width: 914px) {
134
+ body {
135
+ width: 854px;
136
+ margin:10px auto;
137
+ }
138
+ }
139
+ @media print {
140
+ body,code,pre code,h1,h2,h3,h4,h5,h6 {
141
+ color: black;
142
+ }
143
+ table, pre {
144
+ page-break-inside: avoid;
145
+ }
146
+ }
@@ -0,0 +1,147 @@
1
+ h1,
2
+ h2,
3
+ h3,
4
+ h4,
5
+ h5,
6
+ h6,
7
+ p,
8
+ blockquote {
9
+ margin: 0;
10
+ padding: 0;
11
+ }
12
+ body {
13
+ font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", Arial, sans-serif;
14
+ font-size: 13px;
15
+ line-height: 18px;
16
+ color: #737373;
17
+ background-color: white;
18
+ margin: 20px 13px 20px 13px;
19
+ }
20
+ table {
21
+ margin: 10px 0 15px 0;
22
+ border-collapse: collapse;
23
+ }
24
+ td,th {
25
+ border: 1px solid #ddd;
26
+ padding: 3px 10px;
27
+ }
28
+ th {
29
+ padding: 5px 10px;
30
+ }
31
+
32
+ a {
33
+ color: #0069d6;
34
+ }
35
+ a:hover {
36
+ color: #0050a3;
37
+ text-decoration: none;
38
+ }
39
+ a img {
40
+ border: none;
41
+ }
42
+ p, ul {
43
+ margin-bottom: 9px;
44
+ }
45
+ h1,
46
+ h2,
47
+ h3,
48
+ h4,
49
+ h5,
50
+ h6 {
51
+ color: #404040;
52
+ line-height: 36px;
53
+ }
54
+ h1 {
55
+ margin-bottom: 18px;
56
+ font-size: 30px;
57
+ }
58
+ h2 {
59
+ font-size: 24px;
60
+ }
61
+ h3 {
62
+ font-size: 18px;
63
+ }
64
+ h4 {
65
+ font-size: 16px;
66
+ }
67
+ h5 {
68
+ font-size: 14px;
69
+ }
70
+ h6 {
71
+ font-size: 13px;
72
+ }
73
+ hr {
74
+ margin: 0 0 19px;
75
+ border: 0;
76
+ border-bottom: 1px solid #ccc;
77
+ }
78
+ blockquote {
79
+ padding: 13px 13px 21px 15px;
80
+ margin-bottom: 18px;
81
+ font-family:georgia,serif;
82
+ font-style: italic;
83
+ }
84
+ blockquote:before {
85
+ content:"\201C";
86
+ font-size:40px;
87
+ margin-left:-10px;
88
+ font-family:georgia,serif;
89
+ color:#eee;
90
+ }
91
+ blockquote p {
92
+ font-size: 14px;
93
+ font-weight: 300;
94
+ line-height: 18px;
95
+ margin-bottom: 0;
96
+ font-style: italic;
97
+ }
98
+ code, pre {
99
+ font-family: Monaco, Andale Mono, Courier New, monospace;
100
+ }
101
+ code {
102
+ background-color: #fee9cc;
103
+ color: rgba(0, 0, 0, 0.75);
104
+ padding: 1px 3px;
105
+ font-size: 12px;
106
+ -webkit-border-radius: 3px;
107
+ -moz-border-radius: 3px;
108
+ border-radius: 3px;
109
+ }
110
+ pre {
111
+ display: block;
112
+ padding: 14px;
113
+ margin: 0 0 18px;
114
+ line-height: 16px;
115
+ font-size: 11px;
116
+ border: 1px solid #d9d9d9;
117
+ white-space: pre-wrap;
118
+ word-wrap: break-word;
119
+ }
120
+ pre code {
121
+ background-color: #fff;
122
+ color:#737373;
123
+ font-size: 11px;
124
+ padding: 0;
125
+ }
126
+ sup {
127
+ font-size: 0.83em;
128
+ vertical-align: super;
129
+ line-height: 0;
130
+ }
131
+ * {
132
+ -webkit-print-color-adjust: exact;
133
+ }
134
+ @media screen and (min-width: 914px) {
135
+ body {
136
+ width: 854px;
137
+ margin:20px auto;
138
+ }
139
+ }
140
+ @media print {
141
+ body,code,pre code,h1,h2,h3,h4,h5,h6 {
142
+ color: black;
143
+ }
144
+ table, pre {
145
+ page-break-inside: avoid;
146
+ }
147
+ }
@@ -0,0 +1,90 @@
1
+ *{margin:0;padding:0;}
2
+ body {
3
+ font:13.34px helvetica,arial,freesans,clean,sans-serif;
4
+ color:black;
5
+ line-height:1.4em;
6
+ background-color: #F8F8F8;
7
+ padding: 0.7em;
8
+ }
9
+ p {
10
+ margin:1em 0;
11
+ line-height:1.5em;
12
+ }
13
+ table {
14
+ font-size:inherit;
15
+ font:100%;
16
+ margin:1em;
17
+ }
18
+ table th{border-bottom:1px solid #bbb;padding:.2em 1em;}
19
+ table td{border-bottom:1px solid #ddd;padding:.2em 1em;}
20
+ input[type=text],input[type=password],input[type=image],textarea{font:99% helvetica,arial,freesans,sans-serif;}
21
+ select,option{padding:0 .25em;}
22
+ optgroup{margin-top:.5em;}
23
+ pre,code{font:12px Monaco,"Courier New","DejaVu Sans Mono","Bitstream Vera Sans Mono",monospace;}
24
+ pre {
25
+ margin:1em 0;
26
+ font-size:12px;
27
+ background-color:#eee;
28
+ border:1px solid #ddd;
29
+ padding:5px;
30
+ line-height:1.5em;
31
+ color:#444;
32
+ overflow:auto;
33
+ -webkit-box-shadow:rgba(0,0,0,0.07) 0 1px 2px inset;
34
+ -webkit-border-radius:3px;
35
+ -moz-border-radius:3px;border-radius:3px;
36
+ }
37
+ pre code {
38
+ padding:0;
39
+ font-size:12px;
40
+ background-color:#eee;
41
+ border:none;
42
+ }
43
+ code {
44
+ font-size:12px;
45
+ background-color:#f8f8ff;
46
+ color:#444;
47
+ padding:0 .2em;
48
+ border:1px solid #dedede;
49
+ }
50
+ img{border:0;max-width:100%;}
51
+ abbr{border-bottom:none;}
52
+ a{color:#4183c4;text-decoration:none;}
53
+ a:hover{text-decoration:underline;}
54
+ a code,a:link code,a:visited code{color:#4183c4;}
55
+ h2,h3{margin:1em 0;}
56
+ h1,h2,h3,h4,h5,h6{border:0;}
57
+ h1{font-size:170%;border-top:4px solid #aaa;padding-top:.5em;margin-top:1.5em;}
58
+ h1:first-child{margin-top:0;padding-top:.25em;border-top:none;}
59
+ h2{font-size:150%;margin-top:1.5em;border-top:4px solid #e0e0e0;padding-top:.5em;}
60
+ h3{margin-top:1em;}
61
+ hr{border:1px solid #ddd;}
62
+ ul{margin:1em 0 1em 2em;}
63
+ ol{margin:1em 0 1em 2em;}
64
+ ul li,ol li{margin-top:.5em;margin-bottom:.5em;}
65
+ ul ul,ul ol,ol ol,ol ul{margin-top:0;margin-bottom:0;}
66
+ blockquote{margin:1em 0;border-left:5px solid #ddd;padding-left:.6em;color:#555;}
67
+ dt{font-weight:bold;margin-left:1em;}
68
+ dd{margin-left:2em;margin-bottom:1em;}
69
+ sup {
70
+ font-size: 0.83em;
71
+ vertical-align: super;
72
+ line-height: 0;
73
+ }
74
+ * {
75
+ -webkit-print-color-adjust: exact;
76
+ }
77
+ @media screen and (min-width: 914px) {
78
+ body {
79
+ width: 854px;
80
+ margin:0 auto;
81
+ }
82
+ }
83
+ @media print {
84
+ table, pre {
85
+ page-break-inside: avoid;
86
+ }
87
+ pre {
88
+ word-wrap: break-word;
89
+ }
90
+ }
@@ -0,0 +1,297 @@
1
+ body {
2
+ font-family: Helvetica, arial, sans-serif;
3
+ font-size: 14px;
4
+ line-height: 1.6;
5
+ padding-top: 10px;
6
+ padding-bottom: 10px;
7
+ background-color: white;
8
+ padding: 30px; }
9
+
10
+ body > *:first-child {
11
+ margin-top: 0 !important; }
12
+ body > *:last-child {
13
+ margin-bottom: 0 !important; }
14
+
15
+ a {
16
+ color: #4183C4; }
17
+ a.absent {
18
+ color: #cc0000; }
19
+ a.anchor {
20
+ display: block;
21
+ padding-left: 30px;
22
+ margin-left: -30px;
23
+ cursor: pointer;
24
+ position: absolute;
25
+ top: 0;
26
+ left: 0;
27
+ bottom: 0; }
28
+
29
+ h1, h2, h3, h4, h5, h6 {
30
+ margin: 20px 0 10px;
31
+ padding: 0;
32
+ font-weight: bold;
33
+ -webkit-font-smoothing: antialiased;
34
+ cursor: text;
35
+ position: relative; }
36
+
37
+ h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, h5:hover a.anchor, h6:hover a.anchor {
38
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA09pVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoMTMuMCAyMDEyMDMwNS5tLjQxNSAyMDEyLzAzLzA1OjIxOjAwOjAwKSAgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OUM2NjlDQjI4ODBGMTFFMTg1ODlEODNERDJBRjUwQTQiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OUM2NjlDQjM4ODBGMTFFMTg1ODlEODNERDJBRjUwQTQiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo5QzY2OUNCMDg4MEYxMUUxODU4OUQ4M0REMkFGNTBBNCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo5QzY2OUNCMTg4MEYxMUUxODU4OUQ4M0REMkFGNTBBNCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PsQhXeAAAABfSURBVHjaYvz//z8DJYCRUgMYQAbAMBQIAvEqkBQWXI6sHqwHiwG70TTBxGaiWwjCTGgOUgJiF1J8wMRAIUA34B4Q76HUBelAfJYSA0CuMIEaRP8wGIkGMA54bgQIMACAmkXJi0hKJQAAAABJRU5ErkJggg==) no-repeat 10px center;
39
+ text-decoration: none; }
40
+
41
+ h1 tt, h1 code {
42
+ font-size: inherit; }
43
+
44
+ h2 tt, h2 code {
45
+ font-size: inherit; }
46
+
47
+ h3 tt, h3 code {
48
+ font-size: inherit; }
49
+
50
+ h4 tt, h4 code {
51
+ font-size: inherit; }
52
+
53
+ h5 tt, h5 code {
54
+ font-size: inherit; }
55
+
56
+ h6 tt, h6 code {
57
+ font-size: inherit; }
58
+
59
+ h1 {
60
+ font-size: 28px;
61
+ color: black; }
62
+
63
+ h2 {
64
+ font-size: 24px;
65
+ border-bottom: 1px solid #cccccc;
66
+ color: black; }
67
+
68
+ h3 {
69
+ font-size: 18px; }
70
+
71
+ h4 {
72
+ font-size: 16px; }
73
+
74
+ h5 {
75
+ font-size: 14px; }
76
+
77
+ h6 {
78
+ color: #777777;
79
+ font-size: 14px; }
80
+
81
+ p, blockquote, ul, ol, dl, li, table, pre {
82
+ margin: 15px 0; }
83
+
84
+ hr {
85
+ background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAECAYAAACtBE5DAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OENDRjNBN0E2NTZBMTFFMEI3QjRBODM4NzJDMjlGNDgiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OENDRjNBN0I2NTZBMTFFMEI3QjRBODM4NzJDMjlGNDgiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4Q0NGM0E3ODY1NkExMUUwQjdCNEE4Mzg3MkMyOUY0OCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo4Q0NGM0E3OTY1NkExMUUwQjdCNEE4Mzg3MkMyOUY0OCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PqqezsUAAAAfSURBVHjaYmRABcYwBiM2QSA4y4hNEKYDQxAEAAIMAHNGAzhkPOlYAAAAAElFTkSuQmCC) repeat-x 0 0;
86
+ border: 0 none;
87
+ color: #cccccc;
88
+ height: 4px;
89
+ padding: 0;
90
+ }
91
+
92
+ body > h2:first-child {
93
+ margin-top: 0;
94
+ padding-top: 0; }
95
+ body > h1:first-child {
96
+ margin-top: 0;
97
+ padding-top: 0; }
98
+ body > h1:first-child + h2 {
99
+ margin-top: 0;
100
+ padding-top: 0; }
101
+ body > h3:first-child, body > h4:first-child, body > h5:first-child, body > h6:first-child {
102
+ margin-top: 0;
103
+ padding-top: 0; }
104
+
105
+ a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6 {
106
+ margin-top: 0;
107
+ padding-top: 0; }
108
+
109
+ h1 p, h2 p, h3 p, h4 p, h5 p, h6 p {
110
+ margin-top: 0; }
111
+
112
+ li p.first {
113
+ display: inline-block; }
114
+ li {
115
+ margin: 0; }
116
+ ul, ol {
117
+ padding-left: 30px; }
118
+
119
+ ul :first-child, ol :first-child {
120
+ margin-top: 0; }
121
+
122
+ dl {
123
+ padding: 0; }
124
+ dl dt {
125
+ font-size: 14px;
126
+ font-weight: bold;
127
+ font-style: italic;
128
+ padding: 0;
129
+ margin: 15px 0 5px; }
130
+ dl dt:first-child {
131
+ padding: 0; }
132
+ dl dt > :first-child {
133
+ margin-top: 0; }
134
+ dl dt > :last-child {
135
+ margin-bottom: 0; }
136
+ dl dd {
137
+ margin: 0 0 15px;
138
+ padding: 0 15px; }
139
+ dl dd > :first-child {
140
+ margin-top: 0; }
141
+ dl dd > :last-child {
142
+ margin-bottom: 0; }
143
+
144
+ blockquote {
145
+ border-left: 4px solid #dddddd;
146
+ padding: 0 15px;
147
+ color: #777777; }
148
+ blockquote > :first-child {
149
+ margin-top: 0; }
150
+ blockquote > :last-child {
151
+ margin-bottom: 0; }
152
+
153
+ table {
154
+ padding: 0;border-collapse: collapse; }
155
+ table tr {
156
+ border-top: 1px solid #cccccc;
157
+ background-color: white;
158
+ margin: 0;
159
+ padding: 0; }
160
+ table tr:nth-child(2n) {
161
+ background-color: #f8f8f8; }
162
+ table tr th {
163
+ font-weight: bold;
164
+ border: 1px solid #cccccc;
165
+ margin: 0;
166
+ padding: 6px 13px; }
167
+ table tr td {
168
+ border: 1px solid #cccccc;
169
+ margin: 0;
170
+ padding: 6px 13px; }
171
+ table tr th :first-child, table tr td :first-child {
172
+ margin-top: 0; }
173
+ table tr th :last-child, table tr td :last-child {
174
+ margin-bottom: 0; }
175
+
176
+ img {
177
+ max-width: 100%; }
178
+
179
+ span.frame {
180
+ display: block;
181
+ overflow: hidden; }
182
+ span.frame > span {
183
+ border: 1px solid #dddddd;
184
+ display: block;
185
+ float: left;
186
+ overflow: hidden;
187
+ margin: 13px 0 0;
188
+ padding: 7px;
189
+ width: auto; }
190
+ span.frame span img {
191
+ display: block;
192
+ float: left; }
193
+ span.frame span span {
194
+ clear: both;
195
+ color: #333333;
196
+ display: block;
197
+ padding: 5px 0 0; }
198
+ span.align-center {
199
+ display: block;
200
+ overflow: hidden;
201
+ clear: both; }
202
+ span.align-center > span {
203
+ display: block;
204
+ overflow: hidden;
205
+ margin: 13px auto 0;
206
+ text-align: center; }
207
+ span.align-center span img {
208
+ margin: 0 auto;
209
+ text-align: center; }
210
+ span.align-right {
211
+ display: block;
212
+ overflow: hidden;
213
+ clear: both; }
214
+ span.align-right > span {
215
+ display: block;
216
+ overflow: hidden;
217
+ margin: 13px 0 0;
218
+ text-align: right; }
219
+ span.align-right span img {
220
+ margin: 0;
221
+ text-align: right; }
222
+ span.float-left {
223
+ display: block;
224
+ margin-right: 13px;
225
+ overflow: hidden;
226
+ float: left; }
227
+ span.float-left span {
228
+ margin: 13px 0 0; }
229
+ span.float-right {
230
+ display: block;
231
+ margin-left: 13px;
232
+ overflow: hidden;
233
+ float: right; }
234
+ span.float-right > span {
235
+ display: block;
236
+ overflow: hidden;
237
+ margin: 13px auto 0;
238
+ text-align: right; }
239
+
240
+ code, tt {
241
+ margin: 0 2px;
242
+ padding: 0 5px;
243
+ white-space: nowrap;
244
+ border: 1px solid #eaeaea;
245
+ background-color: #f8f8f8;
246
+ border-radius: 3px; }
247
+
248
+ pre code {
249
+ margin: 0;
250
+ padding: 0;
251
+ white-space: pre;
252
+ border: none;
253
+ background: transparent; }
254
+
255
+ .highlight pre {
256
+ background-color: #f8f8f8;
257
+ border: 1px solid #cccccc;
258
+ font-size: 13px;
259
+ line-height: 19px;
260
+ overflow: auto;
261
+ padding: 6px 10px;
262
+ border-radius: 3px; }
263
+
264
+ pre {
265
+ background-color: #f8f8f8;
266
+ border: 1px solid #cccccc;
267
+ font-size: 13px;
268
+ line-height: 19px;
269
+ overflow: auto;
270
+ padding: 6px 10px;
271
+ border-radius: 3px; }
272
+ pre code, pre tt {
273
+ background-color: transparent;
274
+ border: none; }
275
+
276
+ sup {
277
+ font-size: 0.83em;
278
+ vertical-align: super;
279
+ line-height: 0;
280
+ }
281
+ * {
282
+ -webkit-print-color-adjust: exact;
283
+ }
284
+ @media screen and (min-width: 914px) {
285
+ body {
286
+ width: 854px;
287
+ margin:0 auto;
288
+ }
289
+ }
290
+ @media print {
291
+ table, pre {
292
+ page-break-inside: avoid;
293
+ }
294
+ pre {
295
+ word-wrap: break-word;
296
+ }
297
+ }
@@ -0,0 +1,20 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title></title>
6
+ <link rel="stylesheet" href="/css/Clearness.css" />
7
+ </head>
8
+ <body>
9
+
10
+ <%= content %>
11
+
12
+ <script>
13
+ var h1El = document.getElementsByTagName("h1")[0];
14
+ if (h1El) {
15
+ document.title = h1El.innerHTML;
16
+ }
17
+ </script>
18
+
19
+ </body>
20
+ </html>
data/md-server.gemspec ADDED
@@ -0,0 +1,22 @@
1
+
2
+ Gem::Specification.new do |s|
3
+ s.name = "md-server2"
4
+ s.version = "0.1.0"
5
+ s.platform = Gem::Platform::RUBY
6
+ s.authors = ["ChenCheng"]
7
+ s.email = "sorrycc@gmail.com"
8
+ s.homepage = "http://www.github.com/sorrycc/md-server"
9
+ s.summary = %q{Markdown Server.}
10
+ s.description = %q{Markdown Server.}
11
+
12
+ s.required_ruby_version = '>= 1.9.3'
13
+
14
+ # s.add_dependency "sinatra", ">= 1.4.4"
15
+ # s.add_dependency "sinatra-contrib", ">= 1.4.0"
16
+ # s.add_dependency "markdown", ">= 1.1.1"
17
+ # s.add_dependency "optparse", ""
18
+
19
+ s.files = `git ls-files`.split("\n")
20
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
21
+ s.require_paths = ["lib"]
22
+ end
metadata ADDED
@@ -0,0 +1,54 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: md-server2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - ChenCheng
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-12-05 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Markdown Server.
14
+ email: sorrycc@gmail.com
15
+ executables:
16
+ - md-server
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - Gemfile
21
+ - Gemfile.lock
22
+ - bin/md-server
23
+ - lib/config.ru
24
+ - lib/md-server.rb
25
+ - lib/public/css/Clearness Dark.css
26
+ - lib/public/css/Clearness.css
27
+ - lib/public/css/GitHub.css
28
+ - lib/public/css/GitHub2.css
29
+ - lib/views/markdown.erb
30
+ - md-server.gemspec
31
+ homepage: http://www.github.com/sorrycc/md-server
32
+ licenses: []
33
+ metadata: {}
34
+ post_install_message:
35
+ rdoc_options: []
36
+ require_paths:
37
+ - lib
38
+ required_ruby_version: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - '>='
41
+ - !ruby/object:Gem::Version
42
+ version: 1.9.3
43
+ required_rubygems_version: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ requirements: []
49
+ rubyforge_project:
50
+ rubygems_version: 2.1.10
51
+ signing_key:
52
+ specification_version: 4
53
+ summary: Markdown Server.
54
+ test_files: []