Skip to content

Commit 63494e4

Browse files
Trottcodebytere
authored andcommitted
tools: update doc tools to remark-parse@9.0.0
PR-URL: #36049 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
1 parent 500e709 commit 63494e4

6 files changed

Lines changed: 1362 additions & 63 deletions

File tree

‎tools/doc/addon-verify.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ const { resolve } = require('path');
1111
constvfile=require('to-vfile');
1212
constunified=require('unified');
1313
constremarkParse=require('remark-parse');
14+
constgfm=require('remark-gfm');
1415

1516
constrootDir=resolve(__dirname,'..','..');
1617
constdoc=resolve(rootDir,'doc','api','addons.md');
1718
constverifyDir=resolve(rootDir,'test','addons');
1819

1920
constfile=vfile.readSync(doc,'utf8');
20-
consttree=unified().use(remarkParse).parse(file);
21+
consttree=unified().use(remarkParse).use(gfm).parse(file);
2122
constaddons={};
2223
letid=0;
2324
letcurrentHeader;

‎tools/doc/checkLinks.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ function findMarkdownFilesRecursively(dirPath) {
4545
functioncheckFile(path){
4646
consttree=unified()
4747
.use(require('remark-parse'))
48+
.use(require('remark-gfm'))
4849
.parse(fs.readFileSync(path));
4950

5051
constbase=pathToFileURL(path);

‎tools/doc/generate.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const { promises: fs } = require('fs');
2525
constpath=require('path');
2626
constunified=require('unified');
2727
constmarkdown=require('remark-parse');
28+
constgfm=require('remark-gfm');
2829
constremark2rehype=require('remark-rehype');
2930
constraw=require('rehype-raw');
3031
consthtmlStringify=require('rehype-stringify');
@@ -82,6 +83,7 @@ async function main() {
8283
constcontent=awaitunified()
8384
.use(replaceLinks,{ filename, linksMapper })
8485
.use(markdown)
86+
.use(gfm)
8587
.use(html.preprocessText,{ nodeVersion })
8688
.use(json.jsonAPI,{ filename })
8789
.use(html.firstHeader)

‎tools/doc/html.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const unified = require('unified');
2727
constfind=require('unist-util-find');
2828
constvisit=require('unist-util-visit');
2929
constmarkdown=require('remark-parse');
30+
constgfm=require('remark-gfm');
3031
constremark2rehype=require('remark-rehype');
3132
constraw=require('rehype-raw');
3233
consthtmlStringify=require('rehype-stringify');
@@ -56,6 +57,7 @@ const gtocMD = fs.readFileSync(gtocPath, 'utf8')
5657
.replace(/^<!--.*?-->/gms,'');
5758
constgtocHTML=unified()
5859
.use(markdown)
60+
.use(gfm)
5961
.use(remark2rehype,{allowDangerousHtml: true})
6062
.use(raw)
6163
.use(navClasses)
@@ -283,6 +285,7 @@ function parseYAML(text) {
283285
meta.changes.forEach((change)=>{
284286
constdescription=unified()
285287
.use(markdown)
288+
.use(gfm)
286289
.use(remark2rehype,{allowDangerousHtml: true})
287290
.use(raw)
288291
.use(htmlStringify)
@@ -381,6 +384,7 @@ function buildToc({ filename, apilinks }) {
381384

382385
file.toc=unified()
383386
.use(markdown)
387+
.use(gfm)
384388
.use(remark2rehype,{allowDangerousHtml: true})
385389
.use(raw)
386390
.use(htmlStringify)

0 commit comments

Comments
 (0)