Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Commit 5346772

Browse files
committed
Switch markdown parser to markdown-it
Marked was no longer actively maintained and had several bugs the new docs were hitting. The other good option here is Remark, which is a bit slower but more flexible.
1 parent 2ca1dd4 commit 5346772

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

gulpfile.babel.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import gulp from 'gulp';
22
import path from 'path';
33
import Metalsmith from 'metalsmith';
44
import _ from 'lodash';
5+
import markdownItAnchor from 'markdown-it-anchor';
56
import util from 'util';
67
import fs from 'fs';
78
import hbars from './gulp/handlebars';
@@ -88,7 +89,18 @@ gulp.task('build', ['src:symlink-repos', "js:copy-vendor"], done => {
8889
]
8990
}))
9091
.use(renameReadme)
91-
.use($m.markdown())
92+
.use($m.markdownit({
93+
html: true,
94+
linkify: true,
95+
typographer: true
96+
}).use(markdownItAnchor, {
97+
// We can pre-generate the links & remove src/js/headingAnchorShortcut.js
98+
// Off for now, though.
99+
// permalink: true,
100+
// permalinkClass: 'anchorShortcut',
101+
// permalinkSymbol: '',
102+
// permalinkBefore: true
103+
}))
92104
.use($m.inPlace(_.extend({}, templateOptions, {
93105
pattern: '*.handlebars'
94106
})))

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@
1616
"handlebars": "^4.0.2",
1717
"load-metalsmith-plugins": "^0.1.1",
1818
"lodash": "^3.10.1",
19+
"markdown-it-anchor": "^2.5.0",
1920
"metalsmith": "git+https://github.com/stellar/metalsmith.git",
2021
"metalsmith-autoprefixer": "^1.1.0",
2122
"metalsmith-concat": "^3.0.3",
2223
"metalsmith-fingerprint": "^1.0.3",
2324
"metalsmith-in-place": "^1.3.1",
2425
"metalsmith-layouts": "^1.4.1",
25-
"metalsmith-markdown": "^0.2.1",
26+
"metalsmith-markdownit": "^0.3.0",
2627
"metalsmith-metadata": "0.0.1",
2728
"metalsmith-sass": "^1.3.0",
2829
"minimatch": "^2.0.10",

0 commit comments

Comments
 (0)