markdown-to-html-cli 2.2.1 → 3.0.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.
- package/README.md +23 -5
- package/lib/create.js +1 -1
- package/lib/nodes/octiconLink.js +2 -17
- package/lib/nodes/octiconLink.js.map +1 -1
- package/lib/styles/github.css +858 -275
- package/package.json +5 -1
- package/.github/workflows/ci.yml +0 -63
- package/README-zh.md +0 -200
- package/renovate.json +0 -5
- package/src/cli.ts +0 -5
- package/src/create.ts +0 -85
- package/src/index.ts +0 -160
- package/src/nodes/githubCorners.ts +0 -64
- package/src/nodes/githubCornersFork.ts +0 -25
- package/src/nodes/octiconLink.ts +0 -27
- package/src/styles/github-fork-ribbon.css +0 -91
- package/src/styles/github.css +0 -393
- package/test/create.test.ts +0 -93
- package/test/index.test.ts +0 -89
- package/tsconfig.json +0 -21
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
.github-fork-ribbon {
|
|
2
|
-
width: 12.1em;
|
|
3
|
-
height: 12.1em;
|
|
4
|
-
position: absolute;
|
|
5
|
-
overflow: hidden;
|
|
6
|
-
top: 0;
|
|
7
|
-
right: 0;
|
|
8
|
-
z-index: 9999;
|
|
9
|
-
pointer-events: none;
|
|
10
|
-
font-size: 13px;
|
|
11
|
-
text-decoration: none;
|
|
12
|
-
text-indent: -999999px;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.github-fork-ribbon.fixed {
|
|
16
|
-
position: fixed;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.github-fork-ribbon:hover, .github-fork-ribbon:active {
|
|
20
|
-
background-color: rgba(0, 0, 0, 0.0);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.github-fork-ribbon:before, .github-fork-ribbon:after {
|
|
24
|
-
/* The right and left classes determine the side we attach our banner to */
|
|
25
|
-
position: absolute;
|
|
26
|
-
display: block;
|
|
27
|
-
width: 15.38em;
|
|
28
|
-
height: 1.54em;
|
|
29
|
-
|
|
30
|
-
top: 3.23em;
|
|
31
|
-
right: -3.23em;
|
|
32
|
-
|
|
33
|
-
-webkit-box-sizing: content-box;
|
|
34
|
-
-moz-box-sizing: content-box;
|
|
35
|
-
box-sizing: content-box;
|
|
36
|
-
|
|
37
|
-
-webkit-transform: rotate(45deg);
|
|
38
|
-
-moz-transform: rotate(45deg);
|
|
39
|
-
-ms-transform: rotate(45deg);
|
|
40
|
-
-o-transform: rotate(45deg);
|
|
41
|
-
transform: rotate(45deg);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.github-fork-ribbon:before {
|
|
45
|
-
content: "";
|
|
46
|
-
|
|
47
|
-
/* Add a bit of padding to give some substance outside the "stitching" */
|
|
48
|
-
padding: .38em 0;
|
|
49
|
-
|
|
50
|
-
/* Set the base colour */
|
|
51
|
-
background-color: #a00;
|
|
52
|
-
|
|
53
|
-
/* Set a gradient: transparent black at the top to almost-transparent black at the bottom */
|
|
54
|
-
background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0)), to(rgba(0, 0, 0, 0.15)));
|
|
55
|
-
background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15));
|
|
56
|
-
background-image: -moz-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15));
|
|
57
|
-
background-image: -ms-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15));
|
|
58
|
-
background-image: -o-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15));
|
|
59
|
-
background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15));
|
|
60
|
-
|
|
61
|
-
/* Add a drop shadow */
|
|
62
|
-
-webkit-box-shadow: 0 .15em .23em 0 rgba(0, 0, 0, 0.5);
|
|
63
|
-
-moz-box-shadow: 0 .15em .23em 0 rgba(0, 0, 0, 0.5);
|
|
64
|
-
box-shadow: 0 .15em .23em 0 rgba(0, 0, 0, 0.5);
|
|
65
|
-
|
|
66
|
-
pointer-events: auto;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.github-fork-ribbon:after {
|
|
70
|
-
/* Set the text from the data-ribbon attribute */
|
|
71
|
-
content: attr(data-ribbon);
|
|
72
|
-
|
|
73
|
-
/* Set the text properties */
|
|
74
|
-
color: #fff;
|
|
75
|
-
font: 700 1em "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
76
|
-
line-height: 1.54em;
|
|
77
|
-
text-decoration: none;
|
|
78
|
-
text-shadow: 0 -.08em rgba(0, 0, 0, 0.5);
|
|
79
|
-
text-align: center;
|
|
80
|
-
text-indent: 0;
|
|
81
|
-
|
|
82
|
-
/* Set the layout properties */
|
|
83
|
-
padding: .15em 0;
|
|
84
|
-
margin: .15em 0;
|
|
85
|
-
|
|
86
|
-
/* Add "stitching" effect */
|
|
87
|
-
border-width: .08em 0;
|
|
88
|
-
border-style: dotted;
|
|
89
|
-
border-color: #fff;
|
|
90
|
-
border-color: rgba(255, 255, 255, 0.7);
|
|
91
|
-
}
|
package/src/styles/github.css
DELETED
|
@@ -1,393 +0,0 @@
|
|
|
1
|
-
.task-list-item {
|
|
2
|
-
list-style-type: none;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.task-list-item label {
|
|
6
|
-
font-weight: 400;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.task-list-item.enabled label {
|
|
10
|
-
cursor: pointer;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.task-list-item+.task-list-item {
|
|
14
|
-
margin-top: 3px;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.task-list-item .handle {
|
|
18
|
-
display: none;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.task-list-item-checkbox {
|
|
22
|
-
margin: 0 .2em .25em -1.6em;
|
|
23
|
-
vertical-align: middle;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.wmde-markdown h1,.wmde-markdown h2,.wmde-markdown h3,.wmde-markdown h4,.wmde-markdown h5,.wmde-markdown h6 {
|
|
27
|
-
font-weight: 600;
|
|
28
|
-
line-height: 1.25;
|
|
29
|
-
margin-bottom: 16px;
|
|
30
|
-
margin-top: 24px;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.wmde-markdown h1 .anchor,.wmde-markdown h2 .anchor,.wmde-markdown h3 .anchor,.wmde-markdown h4 .anchor,.wmde-markdown h5 .anchor,.wmde-markdown h6 .anchor {
|
|
34
|
-
float: left;
|
|
35
|
-
padding-right: 4px;
|
|
36
|
-
margin-left: -20px;
|
|
37
|
-
line-height: 1;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.wmde-markdown h1 .octicon-link,.wmde-markdown h2 .octicon-link,.wmde-markdown h3 .octicon-link,.wmde-markdown h4 .octicon-link,.wmde-markdown h5 .octicon-link,.wmde-markdown h6 .octicon-link {
|
|
41
|
-
visibility: hidden;
|
|
42
|
-
vertical-align: middle;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.wmde-markdown h1:hover .octicon-link,.wmde-markdown h2:hover .octicon-link,.wmde-markdown h3:hover .octicon-link,.wmde-markdown h4:hover .octicon-link,.wmde-markdown h5:hover .octicon-link,.wmde-markdown h6:hover .octicon-link {
|
|
46
|
-
visibility: visible;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
.github-corner:hover .octo-arm {
|
|
51
|
-
-webkit-animation: octocat-wave .56s ease-in-out;
|
|
52
|
-
animation: octocat-wave .56s ease-in-out;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
@-webkit-keyframes octocat-wave {
|
|
56
|
-
0%, to {
|
|
57
|
-
-webkit-transform: rotate(0);
|
|
58
|
-
transform: rotate(0);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
20%, 60% {
|
|
62
|
-
-webkit-transform: rotate(-25deg);
|
|
63
|
-
transform: rotate(-25deg);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
40%, 80% {
|
|
67
|
-
-webkit-transform: rotate(10deg);
|
|
68
|
-
transform: rotate(10deg);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
@keyframes octocat-wave {
|
|
73
|
-
0%, to {
|
|
74
|
-
-webkit-transform: rotate(0);
|
|
75
|
-
transform: rotate(0)
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
20%, 60% {
|
|
79
|
-
-webkit-transform: rotate(-25deg);
|
|
80
|
-
transform: rotate(-25deg);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
40%, 80% {
|
|
84
|
-
-webkit-transform: rotate(10deg);
|
|
85
|
-
transform: rotate(10deg);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
.wmde-markdown {
|
|
91
|
-
font-size: 16px;
|
|
92
|
-
line-height: 1.5;
|
|
93
|
-
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;
|
|
94
|
-
max-width: 1024px;
|
|
95
|
-
margin: 28px auto 60px auto;
|
|
96
|
-
}
|
|
97
|
-
.wmde-markdown > :first-child {
|
|
98
|
-
margin-top: 0 !important;
|
|
99
|
-
}
|
|
100
|
-
.wmde-markdown > :last-child {
|
|
101
|
-
margin-bottom: 0 !important;
|
|
102
|
-
}
|
|
103
|
-
.wmde-markdown code[class*="language-"],
|
|
104
|
-
.wmde-markdown pre[class*="language-"] {
|
|
105
|
-
color: black;
|
|
106
|
-
text-align: left;
|
|
107
|
-
white-space: pre;
|
|
108
|
-
word-spacing: normal;
|
|
109
|
-
word-break: normal;
|
|
110
|
-
word-wrap: normal;
|
|
111
|
-
-webkit-hyphens: none;
|
|
112
|
-
hyphens: none;
|
|
113
|
-
}
|
|
114
|
-
.wmde-markdown pre code {
|
|
115
|
-
background: none;
|
|
116
|
-
overflow-wrap: normal;
|
|
117
|
-
white-space: inherit;
|
|
118
|
-
-moz-tab-size: 2;
|
|
119
|
-
tab-size: 2;
|
|
120
|
-
padding: 16px;
|
|
121
|
-
font-size: 95%;
|
|
122
|
-
line-height: 1.5;
|
|
123
|
-
display: block;
|
|
124
|
-
text-shadow: 0 1px #fff;
|
|
125
|
-
}
|
|
126
|
-
.wmde-markdown pre {
|
|
127
|
-
margin-bottom: 18px;
|
|
128
|
-
font-size: 85%;
|
|
129
|
-
line-height: 1.45;
|
|
130
|
-
position: relative;
|
|
131
|
-
overflow-x: auto;
|
|
132
|
-
background-color: #f6f8fa;
|
|
133
|
-
border-radius: 3px;
|
|
134
|
-
}
|
|
135
|
-
.wmde-markdown code,
|
|
136
|
-
.wmde-markdown tt {
|
|
137
|
-
background-color: rgba(27, 31, 35, 0.05);
|
|
138
|
-
border-radius: 3px;
|
|
139
|
-
font-size: 85%;
|
|
140
|
-
margin: 0;
|
|
141
|
-
padding: 0.2em 0.4em;
|
|
142
|
-
}
|
|
143
|
-
.wmde-markdown pre,
|
|
144
|
-
.wmde-markdown code,
|
|
145
|
-
.wmde-markdown tt {
|
|
146
|
-
font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
|
|
147
|
-
}
|
|
148
|
-
.wmde-markdown img {
|
|
149
|
-
max-width: 100%;
|
|
150
|
-
}
|
|
151
|
-
.wmde-markdown input {
|
|
152
|
-
vertical-align: middle;
|
|
153
|
-
margin: 0 0.2em 0.25em -1.6em;
|
|
154
|
-
}
|
|
155
|
-
.wmde-markdown input + p {
|
|
156
|
-
display: inline;
|
|
157
|
-
}
|
|
158
|
-
.wmde-markdown h1,
|
|
159
|
-
.wmde-markdown h2 {
|
|
160
|
-
border-bottom: 1px solid #eaecef;
|
|
161
|
-
padding-bottom: 0.3em;
|
|
162
|
-
}
|
|
163
|
-
.wmde-markdown h1,
|
|
164
|
-
.wmde-markdown h2,
|
|
165
|
-
.wmde-markdown h3,
|
|
166
|
-
.wmde-markdown h4,
|
|
167
|
-
.wmde-markdown h5,
|
|
168
|
-
.wmde-markdown h6 {
|
|
169
|
-
font-weight: 600;
|
|
170
|
-
line-height: 1.25;
|
|
171
|
-
margin-bottom: 16px;
|
|
172
|
-
margin-top: 24px;
|
|
173
|
-
}
|
|
174
|
-
.wmde-markdown h1 .anchor,
|
|
175
|
-
.wmde-markdown h2 .anchor,
|
|
176
|
-
.wmde-markdown h3 .anchor,
|
|
177
|
-
.wmde-markdown h4 .anchor,
|
|
178
|
-
.wmde-markdown h5 .anchor,
|
|
179
|
-
.wmde-markdown h6 .anchor {
|
|
180
|
-
float: left;
|
|
181
|
-
padding-right: 4px;
|
|
182
|
-
margin-left: -20px;
|
|
183
|
-
line-height: 1;
|
|
184
|
-
}
|
|
185
|
-
.wmde-markdown h1 .octicon-link,
|
|
186
|
-
.wmde-markdown h2 .octicon-link,
|
|
187
|
-
.wmde-markdown h3 .octicon-link,
|
|
188
|
-
.wmde-markdown h4 .octicon-link,
|
|
189
|
-
.wmde-markdown h5 .octicon-link,
|
|
190
|
-
.wmde-markdown h6 .octicon-link {
|
|
191
|
-
visibility: hidden;
|
|
192
|
-
vertical-align: middle;
|
|
193
|
-
}
|
|
194
|
-
.wmde-markdown h1:hover .octicon-link,
|
|
195
|
-
.wmde-markdown h2:hover .octicon-link,
|
|
196
|
-
.wmde-markdown h3:hover .octicon-link,
|
|
197
|
-
.wmde-markdown h4:hover .octicon-link,
|
|
198
|
-
.wmde-markdown h5:hover .octicon-link,
|
|
199
|
-
.wmde-markdown h6:hover .octicon-link {
|
|
200
|
-
visibility: visible;
|
|
201
|
-
}
|
|
202
|
-
.wmde-markdown h1 {
|
|
203
|
-
font-size: 2em;
|
|
204
|
-
}
|
|
205
|
-
.wmde-markdown h2 {
|
|
206
|
-
font-size: 1.5em;
|
|
207
|
-
}
|
|
208
|
-
.wmde-markdown h3 {
|
|
209
|
-
font-size: 1.25em;
|
|
210
|
-
}
|
|
211
|
-
.wmde-markdown h4 {
|
|
212
|
-
font-size: 1em;
|
|
213
|
-
}
|
|
214
|
-
.wmde-markdown h5 {
|
|
215
|
-
font-size: 0.875em;
|
|
216
|
-
}
|
|
217
|
-
.wmde-markdown h6 {
|
|
218
|
-
font-size: 0.85em;
|
|
219
|
-
}
|
|
220
|
-
.wmde-markdown ol,
|
|
221
|
-
.wmde-markdown ul {
|
|
222
|
-
padding-left: 2em;
|
|
223
|
-
}
|
|
224
|
-
.wmde-markdown ol > p,
|
|
225
|
-
.wmde-markdown ul > p {
|
|
226
|
-
margin-bottom: 0;
|
|
227
|
-
}
|
|
228
|
-
.wmde-markdown ul {
|
|
229
|
-
margin-bottom: 16px;
|
|
230
|
-
margin-top: 0;
|
|
231
|
-
list-style: initial;
|
|
232
|
-
}
|
|
233
|
-
.wmde-markdown > blockquote,
|
|
234
|
-
.wmde-markdown > blockquote blockquote {
|
|
235
|
-
margin: 0;
|
|
236
|
-
border-left: 0.25em solid #dfe2e5;
|
|
237
|
-
color: #6a737d;
|
|
238
|
-
padding: 0 1em;
|
|
239
|
-
}
|
|
240
|
-
.wmde-markdown > blockquote > :last-child,
|
|
241
|
-
.wmde-markdown > blockquote blockquote > :last-child {
|
|
242
|
-
margin-bottom: 0;
|
|
243
|
-
}
|
|
244
|
-
.wmde-markdown > blockquote > :first-child,
|
|
245
|
-
.wmde-markdown > blockquote blockquote > :first-child {
|
|
246
|
-
margin-top: 0;
|
|
247
|
-
}
|
|
248
|
-
.wmde-markdown hr {
|
|
249
|
-
margin: 1.5em auto;
|
|
250
|
-
border: 0;
|
|
251
|
-
border-top: 2px dotted #eee;
|
|
252
|
-
height: 1px;
|
|
253
|
-
}
|
|
254
|
-
.wmde-markdown > table,
|
|
255
|
-
.wmde-markdown > blockquote table {
|
|
256
|
-
display: block;
|
|
257
|
-
overflow: auto;
|
|
258
|
-
width: 100%;
|
|
259
|
-
border-collapse: collapse;
|
|
260
|
-
border-spacing: 0;
|
|
261
|
-
font-size: 14px;
|
|
262
|
-
}
|
|
263
|
-
.wmde-markdown > table tr,
|
|
264
|
-
.wmde-markdown > blockquote table tr {
|
|
265
|
-
background-color: #fff;
|
|
266
|
-
border-top: 1px solid #c6cbd1;
|
|
267
|
-
}
|
|
268
|
-
.wmde-markdown > table td,
|
|
269
|
-
.wmde-markdown > blockquote table td,
|
|
270
|
-
.wmde-markdown > table th,
|
|
271
|
-
.wmde-markdown > blockquote table th {
|
|
272
|
-
border: 1px solid #dfe2e5;
|
|
273
|
-
padding: 6px 13px;
|
|
274
|
-
}
|
|
275
|
-
.wmde-markdown blockquote,
|
|
276
|
-
.wmde-markdown details,
|
|
277
|
-
.wmde-markdown dl,
|
|
278
|
-
.wmde-markdown ol,
|
|
279
|
-
.wmde-markdown p,
|
|
280
|
-
.wmde-markdown pre,
|
|
281
|
-
.wmde-markdown table,
|
|
282
|
-
.wmde-markdown ul {
|
|
283
|
-
margin-bottom: 16px;
|
|
284
|
-
margin-top: 0;
|
|
285
|
-
}
|
|
286
|
-
.wmde-markdown a {
|
|
287
|
-
color: #0366d6;
|
|
288
|
-
text-decoration: none;
|
|
289
|
-
}
|
|
290
|
-
.wmde-markdown a:hover {
|
|
291
|
-
text-decoration: underline;
|
|
292
|
-
}
|
|
293
|
-
.wmde-markdown .namespace {
|
|
294
|
-
opacity: 0.7;
|
|
295
|
-
}
|
|
296
|
-
.wmde-markdown .token.important {
|
|
297
|
-
font-weight: normal;
|
|
298
|
-
}
|
|
299
|
-
.wmde-markdown .token.bold {
|
|
300
|
-
font-weight: bold;
|
|
301
|
-
}
|
|
302
|
-
.wmde-markdown .token.italic {
|
|
303
|
-
font-style: italic;
|
|
304
|
-
}
|
|
305
|
-
.wmde-markdown .token.entity {
|
|
306
|
-
cursor: help;
|
|
307
|
-
}
|
|
308
|
-
.wmde-markdown kbd {
|
|
309
|
-
background-color: #fafbfc;
|
|
310
|
-
border-bottom-color: #d1d5da;
|
|
311
|
-
border: 1px solid #d1d5da;
|
|
312
|
-
border-radius: 3px;
|
|
313
|
-
box-shadow: inset 0 -1px 0 #d1d5da;
|
|
314
|
-
color: #56595d;
|
|
315
|
-
display: inline-block;
|
|
316
|
-
font-size: 10px;
|
|
317
|
-
font-family: ui-monospace, SFMono-Regular, SF Mono, Consolas, Liberation Mono, Menlo, monospace;
|
|
318
|
-
line-height: 10px;
|
|
319
|
-
padding: 2px 4px;
|
|
320
|
-
vertical-align: middle;
|
|
321
|
-
}
|
|
322
|
-
.wmde-markdown .token.tag .attr-value {
|
|
323
|
-
color: #032f62;
|
|
324
|
-
}
|
|
325
|
-
.wmde-markdown .token.property,
|
|
326
|
-
.wmde-markdown .token.tag,
|
|
327
|
-
.wmde-markdown .token.boolean,
|
|
328
|
-
.wmde-markdown .token.number,
|
|
329
|
-
.wmde-markdown .token.function-name,
|
|
330
|
-
.wmde-markdown .token.constant,
|
|
331
|
-
.wmde-markdown .token.symbol,
|
|
332
|
-
.wmde-markdown .token.deleted {
|
|
333
|
-
color: #0060c9;
|
|
334
|
-
}
|
|
335
|
-
.wmde-markdown .token.punctuation {
|
|
336
|
-
color: #a0a0a0;
|
|
337
|
-
}
|
|
338
|
-
.wmde-markdown code[class*="language-"] {
|
|
339
|
-
color: black;
|
|
340
|
-
}
|
|
341
|
-
.wmde-markdown code[class*="language-"] .token.selector,
|
|
342
|
-
.wmde-markdown code[class*="language-"] .token.attr-name,
|
|
343
|
-
.wmde-markdown code[class*="language-"] .token.string,
|
|
344
|
-
.wmde-markdown code[class*="language-"] .token.char,
|
|
345
|
-
.wmde-markdown code[class*="language-"] .token.function,
|
|
346
|
-
.wmde-markdown code[class*="language-"] .token.builtin {
|
|
347
|
-
color: #6f42c1;
|
|
348
|
-
}
|
|
349
|
-
.wmde-markdown code[class*="language-"] .token.inserted {
|
|
350
|
-
color: #22863a;
|
|
351
|
-
background-color: #f0fff4;
|
|
352
|
-
}
|
|
353
|
-
.wmde-markdown code[class*="language-"] .token.deleted {
|
|
354
|
-
color: #b31d28;
|
|
355
|
-
background-color: #ffeef0;
|
|
356
|
-
}
|
|
357
|
-
.wmde-markdown code[class*="language-"] .token.class-name {
|
|
358
|
-
color: #6f42c1;
|
|
359
|
-
}
|
|
360
|
-
.wmde-markdown code[class*="language-"] .code-block {
|
|
361
|
-
color: #032f62;
|
|
362
|
-
}
|
|
363
|
-
.wmde-markdown code[class*="language-"] .token.comment,
|
|
364
|
-
.wmde-markdown code[class*="language-"] .token.block-comment,
|
|
365
|
-
.wmde-markdown code[class*="language-"] .token.prolog,
|
|
366
|
-
.wmde-markdown code[class*="language-"] .token.doctype,
|
|
367
|
-
.wmde-markdown code[class*="language-"] .token.cdata {
|
|
368
|
-
color: #7D8B99;
|
|
369
|
-
}
|
|
370
|
-
.wmde-markdown code[class*="language-"] .token.punctuation {
|
|
371
|
-
color: #a0a0a0;
|
|
372
|
-
}
|
|
373
|
-
.wmde-markdown code[class*="language-"] .token.operator,
|
|
374
|
-
.wmde-markdown code[class*="language-"] .token.entity,
|
|
375
|
-
.wmde-markdown code[class*="language-"] .token.url,
|
|
376
|
-
.wmde-markdown code[class*="language-"] .token.variable {
|
|
377
|
-
color: #d73a49;
|
|
378
|
-
background: rgba(255, 255, 255, 0.5);
|
|
379
|
-
}
|
|
380
|
-
.wmde-markdown code[class*="language-"] .token.atrule,
|
|
381
|
-
.wmde-markdown code[class*="language-"] .token.attr-value {
|
|
382
|
-
color: #004698;
|
|
383
|
-
}
|
|
384
|
-
.wmde-markdown code[class*="language-"] .token.keyword {
|
|
385
|
-
color: #d63200;
|
|
386
|
-
}
|
|
387
|
-
.wmde-markdown code[class*="language-"] .token.regex,
|
|
388
|
-
.wmde-markdown code[class*="language-"] .token.important {
|
|
389
|
-
color: #e90;
|
|
390
|
-
}
|
|
391
|
-
.wmde-markdown code[class*="language-"] .token.string {
|
|
392
|
-
color: #0a53c1;
|
|
393
|
-
}
|
package/test/create.test.ts
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { create } from '../src/create';
|
|
2
|
-
|
|
3
|
-
it('options test case', async () => {
|
|
4
|
-
const html = create({
|
|
5
|
-
markdown: 'Hello World! **Bold**\n# Title\n[doc](README.md)',
|
|
6
|
-
'github-corners': 'https://github.com/jaywcjlove/markdown-to-html-cli',
|
|
7
|
-
document: {
|
|
8
|
-
style: 'body { background: red; }',
|
|
9
|
-
title: 'Hello World!',
|
|
10
|
-
link: [{
|
|
11
|
-
rel: 'shortcut icon',
|
|
12
|
-
type: 'image/x-icon',
|
|
13
|
-
href: '../favicon.png',
|
|
14
|
-
}, {
|
|
15
|
-
rel: 'stylesheet',
|
|
16
|
-
href: '../base.css',
|
|
17
|
-
}]
|
|
18
|
-
},
|
|
19
|
-
reurls: {
|
|
20
|
-
"README.md": "index.html"
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
expect(html.indexOf('<!doctype html>') > -1).toBeTruthy();
|
|
24
|
-
expect(html.indexOf('<title>Hello World!</title>') > -1).toBeTruthy();
|
|
25
|
-
expect(html.indexOf('https://github.com/jaywcjlove/markdown-to-html-cli') > -1).toBeTruthy();
|
|
26
|
-
expect(html.indexOf('<strong>Bold</strong>') > -1).toBeTruthy();
|
|
27
|
-
expect(html.indexOf('<h1 id="title">') > -1).toBeTruthy();
|
|
28
|
-
expect(html.indexOf('<a href="index.html">doc</a>') > -1).toBeTruthy();
|
|
29
|
-
expect(html.indexOf('<link rel="shortcut icon" type="image/x-icon" href="../favicon.png">') > -1).toBeTruthy();
|
|
30
|
-
expect(html.indexOf('<link rel="stylesheet" href="../base.css">') > -1).toBeTruthy();
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
it('options.document.style=[] test case', async () => {
|
|
34
|
-
const html = create({
|
|
35
|
-
markdown: 'Hello World! **Bold**\n# Title\n[doc](README.md)',
|
|
36
|
-
document: {
|
|
37
|
-
style: ['body { background: red; }'],
|
|
38
|
-
link: {
|
|
39
|
-
rel: 'shortcut icon',
|
|
40
|
-
type: 'image/x-icon',
|
|
41
|
-
href: '../favicon.png',
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
expect(html.indexOf('<link rel="shortcut icon" type="image/x-icon" href="../favicon.png">') > -1).toBeTruthy();
|
|
46
|
-
expect(html.indexOf('<style>body { background: red; }</style>') > -1).toBeTruthy();
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it('options=undefined test case', async () => {
|
|
50
|
-
expect(create()).toEqual('\n<div class="wmde-markdown"></div>\n');
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it('options.document=undefined test case', async () => {
|
|
54
|
-
const html = create({ document: undefined });
|
|
55
|
-
expect(html.indexOf('<!doctype html>') === -1).toBeTruthy();
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
it('github-corners test case', async () => {
|
|
59
|
-
let html = create({
|
|
60
|
-
markdown: 'Hello World!',
|
|
61
|
-
'github-corners': 'https://github.com/jaywcjlove/markdown-to-html-cli',
|
|
62
|
-
document: {},
|
|
63
|
-
});
|
|
64
|
-
expect(html.indexOf('<body><a aria-label="View source on GitHub"') > 0).toBeTruthy();
|
|
65
|
-
|
|
66
|
-
html = create({
|
|
67
|
-
markdown: 'Hello World!',
|
|
68
|
-
'github-corners': 'https://github.com/jaywcjlove/markdown-to-html-cli',
|
|
69
|
-
document: undefined,
|
|
70
|
-
});
|
|
71
|
-
expect(html.indexOf('<a aria-label="View source on GitHub" target="__blank" class="github-corner"') === 0).toBeTruthy();
|
|
72
|
-
expect(html.indexOf('https://github.com/jaywcjlove/markdown-to-html-cli') > -1).toBeTruthy();
|
|
73
|
-
|
|
74
|
-
html = create({
|
|
75
|
-
'github-corners-fork': true,
|
|
76
|
-
'github-corners': 'https://github.com/jaywcjlove/markdown-to-html-cli',
|
|
77
|
-
markdown: 'Hello World!',
|
|
78
|
-
document: {},
|
|
79
|
-
});
|
|
80
|
-
expect(html.indexOf('data-ribbon="Fork me on GitHub"') > 0).toBeTruthy();
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
it('rewrite test case', async () => {
|
|
84
|
-
let html = create({
|
|
85
|
-
markdown: 'Hello World!',
|
|
86
|
-
rewrite: (node) => {
|
|
87
|
-
if (node.type === 'element' && node.tagName === 'p') {
|
|
88
|
-
node.properties.className = 'test';
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
expect(html.indexOf('<p class="test">Hello World!</p>') > 0).toBeTruthy();
|
|
93
|
-
});
|
package/test/index.test.ts
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import FS from 'fs-extra';
|
|
2
|
-
import { githubCorners } from '../src/nodes/githubCorners';
|
|
3
|
-
import { githubCornersFork } from '../src/nodes/githubCornersFork';
|
|
4
|
-
import { cliHelp, exampleHelp, run } from '../src';
|
|
5
|
-
import pkg from '../package.json';
|
|
6
|
-
|
|
7
|
-
console.log = jest.fn();
|
|
8
|
-
|
|
9
|
-
it('githubCorners test case', async () => {
|
|
10
|
-
expect(githubCorners({ })).toBeUndefined();
|
|
11
|
-
expect(githubCornersFork({ })).toBeUndefined();
|
|
12
|
-
expect(Object.keys(githubCorners({ href: 'https://github.com/jaywcjlove/markdown-to-html-cli' }))).toEqual(expect.arrayContaining(['type', 'tagName', 'properties', 'children']));
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it('exampleHelp test case', async () => {
|
|
16
|
-
expect(typeof exampleHelp).toEqual('string');
|
|
17
|
-
expect(typeof cliHelp).toEqual('string');
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
it('description options test case', async () => {
|
|
22
|
-
expect(run({ description: 'description test case.' })).toBeUndefined();
|
|
23
|
-
// @ts-ignore
|
|
24
|
-
expect(console.log.mock.calls[0][0]).toBe('\nmarkdown-to-html: \x1b[32;1mindex.html\x1b[0m\n');
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it('cli test case', async () => {
|
|
28
|
-
expect(require('../src/cli')).toEqual({});
|
|
29
|
-
// @ts-ignore
|
|
30
|
-
expect(console.log.mock.calls[0][0]).toBe('\nmarkdown-to-html: \x1b[32;1mindex.html\x1b[0m\n');
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
it('run test case', async () => {
|
|
34
|
-
expect(typeof run({ v: true })).toEqual('string');
|
|
35
|
-
// @ts-ignore
|
|
36
|
-
expect(console.log.mock.calls[0][0]).toBe(`\n \x1b[35mmarkdown-to-html-cli\x1b[0m v${pkg.version}\n`);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it('help test case', async () => {
|
|
40
|
-
expect(typeof exampleHelp).toEqual('string');
|
|
41
|
-
expect(typeof cliHelp).toEqual('string');
|
|
42
|
-
expect(run({ h: true })).toBeUndefined();
|
|
43
|
-
// @ts-ignore
|
|
44
|
-
expect(console.log.mock.calls[0][0]).toBe(`${cliHelp}${exampleHelp}`);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('config test case', async () => {
|
|
48
|
-
await FS.mkdirs('test/demo');
|
|
49
|
-
await FS.writeJSON('test/demo/config.json', {
|
|
50
|
-
"repository": "https://github.com/jaywcjlove/markdown-to-html-cli.git",
|
|
51
|
-
"keywords": ["html", "cli"],
|
|
52
|
-
"markdown-to-html": {
|
|
53
|
-
"favicon": "data:image/svg+xml",
|
|
54
|
-
"reurls": {
|
|
55
|
-
"README.md": "index.html"
|
|
56
|
-
},
|
|
57
|
-
"wrap": { wrapper: 'div.wmde-markdown.good' },
|
|
58
|
-
}
|
|
59
|
-
})
|
|
60
|
-
expect(run({ config: 'test/demo/config.json', output: 'test/demo/index.html', author: 'kenny', markdown: 'Hello World! [](README.md)' })).toBeUndefined();
|
|
61
|
-
const htmlStr = await FS.readFile('test/demo/index.html');
|
|
62
|
-
expect(htmlStr.toString().indexOf('Hello World!<a href="index.html">') > 0).toBeTruthy();
|
|
63
|
-
expect(htmlStr.toString().indexOf('https://github.com/jaywcjlove/markdown-to-html-cli.git') > 0).toBeTruthy();
|
|
64
|
-
expect(htmlStr.toString().indexOf('data:image/svg+xml') > 0).toBeTruthy();
|
|
65
|
-
expect(htmlStr.toString().indexOf('html,cli') > 0).toBeTruthy();
|
|
66
|
-
expect(htmlStr.toString().indexOf('kenny') > 0).toBeTruthy();
|
|
67
|
-
expect(htmlStr.toString().indexOf('wmde-markdown good') > 0).toBeTruthy();
|
|
68
|
-
await FS.remove('test/demo');
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
it('keywords test case', async () => {
|
|
72
|
-
await FS.mkdirs('test/demo');
|
|
73
|
-
await FS.writeJSON('test/demo/config.json', {
|
|
74
|
-
"keywords": ["html", "cli"],
|
|
75
|
-
"markdown-to-html": {
|
|
76
|
-
"favicon": "data:image/svg+xml",
|
|
77
|
-
'github-corners': 'https://github.com/jaywcjlove/markdown-to-html-cli.git',
|
|
78
|
-
"reurls": {
|
|
79
|
-
"README.md": "index.html"
|
|
80
|
-
},
|
|
81
|
-
"wrap": { wrapper: 'div.wmde-markdown.good' },
|
|
82
|
-
}
|
|
83
|
-
})
|
|
84
|
-
expect(run({ config: 'test/demo/config.json', output: 'test/demo/index.html', keywords: 'html,cli', markdown: 'Hello World! [](README.md)' })).toBeUndefined();
|
|
85
|
-
const htmlStr = await FS.readFile('test/demo/index.html');
|
|
86
|
-
expect(htmlStr.toString().indexOf('html,cli') > 0).toBeTruthy();
|
|
87
|
-
expect(htmlStr.toString().indexOf('https://github.com/jaywcjlove/markdown-to-html-cli.git') > 0).toBeTruthy();
|
|
88
|
-
await FS.remove('test/demo');
|
|
89
|
-
});
|
package/tsconfig.json
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"module": "ES2020",
|
|
4
|
-
// "module": "es2015",
|
|
5
|
-
"target": "ESNext",
|
|
6
|
-
"esModuleInterop": true,
|
|
7
|
-
"declaration": true,
|
|
8
|
-
"noImplicitAny": true,
|
|
9
|
-
// "resolveJsonModule": true,
|
|
10
|
-
"moduleResolution": "node",
|
|
11
|
-
"allowSyntheticDefaultImports": true,
|
|
12
|
-
"emitDecoratorMetadata": true,
|
|
13
|
-
"experimentalDecorators": true,
|
|
14
|
-
"sourceMap": true,
|
|
15
|
-
"strict": false,
|
|
16
|
-
"skipLibCheck": true,
|
|
17
|
-
"outDir": "lib",
|
|
18
|
-
"baseUrl": "."
|
|
19
|
-
},
|
|
20
|
-
"include": ["src/**/*"]
|
|
21
|
-
}
|