Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 60dc00a

Browse files
committed
configure remark
1 parent 33b9419 commit 60dc00a

File tree

5 files changed

+30
-3
lines changed

5 files changed

+30
-3
lines changed

build/plugins/remark.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,36 @@
11
const remark = require('remark');
22
const lint = require('remark-preset-lint-recommended');
33
const html = require('remark-html');
4+
const highlight = require('remark-highlight.js');
5+
const slug = require('remark-slug');
6+
const github = require('remark-github');
7+
const headings = require('remark-autolink-headings');
8+
const squeezeParagraphs = require('remark-squeeze-paragraphs');
9+
const remarkPing = require('remark-ping');
410
const report = require('vfile-reporter');
511

612
function processMarkdown(contents) {
713
return new Promise((resolve, reject) => {
814
remark()
915
.use(lint)
16+
.use(slug)
17+
// todo: figure out why this isn't creating any anchors
18+
// .use(headings, {
19+
// behaviour: 'wrap',
20+
// })
21+
.use(highlight)
22+
.use(squeezeParagraphs)
23+
.use(github, {
24+
repository: 'rigor789/nativescript-vue'
25+
})
26+
.use(remarkPing, {
27+
pingUsername: () => true,
28+
userURL: (user) => `https://github.com/${user}`
29+
})
1030
.use(html)
1131
.process(contents, (err, file) => {
1232
if (err) reject(err);
13-
33+
// console.log(file.toString());
1434
resolve(file);
1535
})
1636
})

layouts/_partials/meta.ejs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
<meta name="viewport"
33
content="width=device-width, initial-scale=1.0">
44
<meta http-equiv="X-UA-Compatible" content="ie=edge">
5+
<link rel="stylesheet" href="https://unpkg.com/[email protected]/styles/paraiso-dark.css">
56
<link rel="stylesheet" href="https://unpkg.com/[email protected]/github-markdown.css">
67
<link rel="stylesheet" href="/styles.css">

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,14 @@
3535
"multimatch": "^2.1.0",
3636
"permalinks": "^1.2.1",
3737
"remark": "^8.0.0",
38+
"remark-autolink-headings": "^5.0.0",
39+
"remark-github": "^7.0.2",
40+
"remark-highlight.js": "^5.0.0",
3841
"remark-html": "^7.0.0",
42+
"remark-ping": "^1.0.8",
3943
"remark-preset-lint-recommended": "^3.0.1",
44+
"remark-slug": "^5.0.0",
45+
"remark-squeeze-paragraphs": "^3.0.1",
4046
"table-of-contents-json": "^1.2.0",
4147
"tailwindcss": "^0.4.0",
4248
"vfile-reporter": "^4.0.0"

src/styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@
3030

3131
.markdown-body {
3232
@apply .mt-8;
33-
}
33+
}

static/styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13480,4 +13480,4 @@ button,
1348013480
.xl\:bg-docs-gradient {
1348113481
background: linear-gradient(90deg, #f1f5f8 50%, #fff 50%);
1348213482
}
13483-
}
13483+
}

0 commit comments

Comments
 (0)