Skip to content

Commit 25de570

Browse files
committed
chore: update devDependencies.
1 parent 9f78f8a commit 25de570

5 files changed

Lines changed: 44 additions & 76 deletions

File tree

build/build.mjs

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,7 @@ import path from 'path';
33
import stylus from 'stylus';
44
import * as ejs from 'ejs';
55
import UglifyJS from 'uglify-js';
6-
import { unified } from 'unified';
7-
import rehypeAttrs from 'rehype-attr';
8-
import * as rehypePrism from '@mapbox/rehype-prism';
9-
import rehypeRaw from 'rehype-raw';
10-
import rehypeSlug from 'rehype-slug';
11-
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
12-
import stringify from 'rehype-stringify';
13-
import remarkParse from 'remark-parse';
14-
import remark2rehype from 'remark-rehype';
6+
import { create } from 'markdown-to-html-cli';
157
import _ from 'colors-cli/toxic.js';
168

179
const deployDir = path.resolve(process.cwd(), '.deploy');
@@ -189,7 +181,7 @@ const cssPath = path.resolve(deployDir, 'css', 'index.css');
189181
const mdhtml = await markdownToHTML(READMESTR.toString());
190182
html = html.replace(/{{content}}/, mdhtml);
191183
await FS.outputFile(toPath, html);
192-
console.log(` ${'♻️ →'.green} ${toPath.replace(process.cwd(), '')}`);
184+
console.log(` ${'♻️ →'.green} ${path.relative(process.cwd(), toPath)}`);
193185
// marked(READMESTR.toString(), (err, mdhtml) => {
194186
// if (err) return reject(err);
195187
// html = html.replace(/{{content}}/, mdhtml);
@@ -199,7 +191,7 @@ const cssPath = path.resolve(deployDir, 'css', 'index.css');
199191
// });
200192
} else {
201193
await FS.outputFile(toPath, html);
202-
console.log(` ${'→'.green} ${toPath.replace(process.cwd(), '')}`);
194+
console.log(` ${'♻️ →'.green} ${path.relative(process.cwd(), toPath)}`);
203195
resolve(html);
204196
}
205197
} catch (err) {
@@ -209,17 +201,7 @@ const cssPath = path.resolve(deployDir, 'css', 'index.css');
209201
}
210202

211203
function markdownToHTML(str) {
212-
return unified()
213-
.use(remarkParse)
214-
.use(remark2rehype, { allowDangerousHtml: true })
215-
.use(rehypeRaw)
216-
.use(rehypeSlug)
217-
.use(rehypeAutolinkHeadings)
218-
.use(rehypePrism.default)
219-
.use(rehypeAttrs, { properties: 'attr' })
220-
.use(stringify)
221-
.processSync(str)
222-
.toString()
204+
return create({ markdown: str, document: undefined, 'github-corners': 'https://github.com/jaywcjlove/linux-command.git' });
223205
}
224206

225207
/**

package.json

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,15 @@
2525
"url": "git+https://github.com/jaywcjlove/linux-command.git"
2626
},
2727
"devDependencies": {
28-
"@mapbox/rehype-prism": "0.7.0",
29-
"unified": "10.1.0",
30-
"rehype-stringify": "9.0.2",
31-
"rehype-raw": "6.1.0",
32-
"rehype-slug": "5.0.0",
33-
"rehype-autolink-headings": "6.1.0",
34-
"remark-parse": "10.0.0",
35-
"remark-rehype": "9.0.0",
36-
"rehype-attr": "1.4.2",
3728
"archiver": "5.3.0",
38-
"colors-cli": "1.0.27",
29+
"colors-cli": "1.0.28",
3930
"ejs": "3.1.6",
4031
"fs-extra": "10.0.0",
32+
"markdown-to-html-cli": "2.0.0",
4133
"sitemap-generator": "8.5.1",
4234
"sqlite3": "5.0.2",
43-
"stylus": "0.54.8",
44-
"uglify-js": "3.14.1"
35+
"stylus": "0.55.0",
36+
"uglify-js": "3.14.2"
4537
},
4638
"engines": {
4739
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"

template/search.ejs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<a href="https://github.com/jaywcjlove/linux-command" target="_blank" class="github-corner"> <svg viewBox="0 0 250 250"><!-- kenny wang <wowohoo@qq.com> https://github.com/jaywcjlove --> <title>logo</title> <desc>Linux Command Logo. https://github.com/jaywcjlove</desc><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg> </a>
21
<div class="header<%if(type=='list'){%> header_list<%}%>">
32
<div class="logo">
43
<a href="/">

template/styl/index.styl

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -298,17 +298,4 @@ a {
298298
.search_list, .hotlist {
299299
padding 129px 27px
300300
}
301-
div.markdown-body{
302-
padding: 140px 10px 10px 13px;
303-
}
304-
div.markdown-body .edit_btn + *{
305-
margin-top: 0 !important;
306-
}
307-
div.markdown-body .edit_btn {
308-
top: 9px;
309-
a {
310-
background #f1f1f1
311-
color #a3a3a3
312-
}
313-
}
314301
}

template/styl/mixins/markdown.styl

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,47 @@
11

2-
.markdown-body {
2+
mq-mobile = "screen and (max-width: 479px)"
3+
4+
.edit_btn {
5+
position relative
6+
right 38px
7+
float right
8+
top 110px
9+
z-index 2
10+
11+
@media mq-mobile {
12+
top 140px
13+
right 15px
14+
}
15+
.split {
16+
display inline-block
17+
height 13px
18+
vertical-align middle
19+
width 1px
20+
border-left 1px solid #dfdfdf
21+
margin -1px 0 0 0
22+
}
23+
a {
24+
text-decoration none
25+
background #2196F3
26+
color #fff
27+
border-radius 3px
28+
padding 2px 5px
29+
&:hover{
30+
color #333
31+
background #e6e6e6
32+
}
33+
}
34+
}
35+
36+
.wmde-markdown {
337
padding 70px 35px 30px 35px
438
word-wrap break-word
539
font-family: "SFMono-Regular",Consolas,"Liberation Mono",Menlo,Courier,monospace;
640
font-size 14px
741
line-height 1.6
842
color #333
943
@media mq-mobile {
10-
padding-right 0
11-
}
12-
.edit_btn {
13-
position relative
14-
right 0
15-
float right
16-
top 48px
17-
z-index 2
18-
.split {
19-
display inline-block
20-
height 13px
21-
vertical-align middle
22-
width 1px
23-
border-left 1px solid #dfdfdf
24-
margin -1px 0 0 0
25-
}
26-
a {
27-
text-decoration none
28-
background #2196F3
29-
color #fff
30-
border-radius 3px
31-
padding 2px 5px
32-
&:hover{
33-
color #333
34-
background #e6e6e6
35-
}
36-
}
44+
padding: 120px 15px 30px 15px;
3745
}
3846
h1, h2, h3, h4, h5, h6 {
3947
a {

0 commit comments

Comments
 (0)