Skip to content

Commit 4c32aa0

Browse files
benhalversonBethGriggs
authored andcommitted
tools: added remark-frontmatter
remark-frontmatter allows the use of frontmatter metadata in markdown files PR-URL: #38717 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
1 parent 19e9acc commit 4c32aa0

File tree

3 files changed

+109
-0
lines changed

3 files changed

+109
-0
lines changed

tools/doc/generate.mjs

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import htmlStringify from 'rehype-stringify';
2727
import gfm from 'remark-gfm';
2828
import markdown from 'remark-parse';
2929
import remark2rehype from 'remark-rehype';
30+
import frontmatter from 'remark-frontmatter';
3031
import unified from 'unified';
3132

3233
import * as html from './html.mjs';
@@ -82,6 +83,7 @@ async function main() {
8283
const input = await fs.readFile(filename, 'utf8');
8384

8485
const content = await unified()
86+
.use(frontmatter)
8587
.use(replaceLinks, { filename, linksMapper })
8688
.use(markdown)
8789
.use(gfm)

tools/doc/package-lock.json

+106
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/doc/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"js-yaml": "4.1.0",
1212
"rehype-raw": "5.1.0",
1313
"rehype-stringify": "8.0.0",
14+
"remark-frontmatter": "^3.0.0",
1415
"remark-gfm": "^1.0.0",
1516
"remark-html": "13.0.1",
1617
"remark-parse": "^9.0.0",

0 commit comments

Comments
 (0)