Skip to content

Commit

Permalink
tools: added remark-frontmatter
Browse files Browse the repository at this point in the history
remark-frontmatter allows the use of frontmatter metadata in markdown
files

PR-URL: #38717
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Daijiro Wachi <[email protected]>
Reviewed-By: Derek Lewis <[email protected]>
  • Loading branch information
benhalverson authored and BethGriggs committed Jul 29, 2021
1 parent 19e9acc commit 4c32aa0
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/doc/generate.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import htmlStringify from 'rehype-stringify';
import gfm from 'remark-gfm';
import markdown from 'remark-parse';
import remark2rehype from 'remark-rehype';
import frontmatter from 'remark-frontmatter';
import unified from 'unified';

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

const content = await unified()
.use(frontmatter)
.use(replaceLinks, { filename, linksMapper })
.use(markdown)
.use(gfm)
Expand Down
106 changes: 106 additions & 0 deletions tools/doc/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tools/doc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"js-yaml": "4.1.0",
"rehype-raw": "5.1.0",
"rehype-stringify": "8.0.0",
"remark-frontmatter": "^3.0.0",
"remark-gfm": "^1.0.0",
"remark-html": "13.0.1",
"remark-parse": "^9.0.0",
Expand Down

0 comments on commit 4c32aa0

Please sign in to comment.