Skip to content

Commit 2113cbd

Browse files
committed
fix toc on GH
1 parent 19519e0 commit 2113cbd

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ For more information, take a look a the [VSCode documentation](https://code.visu
88

99
## Snippet list
1010

11-
<!-- ##TOC-BUILDER## -->Snippet|Description|Type
11+
<!-- ##TOC-BUILDER## -->
12+
Snippet|Description|Type
1213
---|---|---
1314
fastify hello server|Create an hello world server|ffhello
1415
fastify register|Add an empty plugin|ffregister, ffplugin
@@ -28,7 +29,8 @@ fastify hook onTimeout|Add an instance fastify onTimeout hook|ffontimeout, hooko
2829
fastify application hook onReady|Add the fastify onReady application hook|ffonready, hookonready
2930
fastify application hook onClose|Add the fastify onClose application hook|ffonclose, hookonclose
3031
fastify application hook onRoute|Add the fastify onRoute application hook|ffonroute, hookonroute
31-
fastify application hook onRegister|Add the fastify onRegister application hook|ffonregister, hookonregister<!-- ##TOC-BUILDER-END## -->
32+
fastify application hook onRegister|Add the fastify onRegister application hook|ffonregister, hookonregister
33+
<!-- ##TOC-BUILDER-END## -->
3234

3335
## Contribute
3436

toc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ const rows = content.map(([snippet, descriptor]) => {
1313
})
1414

1515
const toc = [
16-
'Snippet|Description|Type',
16+
'\nSnippet|Description|Type',
1717
'---|---|---'
1818
]
1919
.concat(rows)
2020
.join('\n')
2121

2222
const regex = /(?<=<!-- ##TOC-BUILDER## -->)[\w\W]*(?=<!-- ##TOC-BUILDER-END## -->)/gm
23-
const updated = readme.replace(regex, toc)
23+
const updated = readme.replace(regex, toc + '\n')
2424

2525
fs.writeFileSync('./README.md', updated)

0 commit comments

Comments
 (0)