@@ -11,6 +11,13 @@ const pathDocsApiPages = resolve(pathDocsDir, '.vitepress', 'api-pages.mjs');
11
11
12
12
const scriptCommand = 'pnpm run generate:api-docs' ;
13
13
14
+ // Moved here because this must not be formatted by prettier
15
+ const vitePressInFileOptions = `---
16
+ editLink: false
17
+ ---
18
+
19
+ ` ;
20
+
14
21
const prettierMarkdown : Options = {
15
22
...prettierConfig ,
16
23
parser : 'markdown' ,
@@ -59,10 +66,16 @@ export function writeApiDocsModulePage(
59
66
60
67
:::
61
68
69
+ <ul>
70
+ <li v-for="method of methods" :key="method.name">
71
+ <a :href="'#' + method.name">{{ method.title }}</a>
72
+ </li>
73
+ </ul>
74
+
62
75
<ApiDocsMethod v-for="method of methods" :key="method.name" :method="method" v-once />
63
76
` . replace ( / \n + / g, '\n' ) ;
64
77
65
- content = format ( content , prettierMarkdown ) ;
78
+ content = vitePressInFileOptions + format ( content , prettierMarkdown ) ;
66
79
67
80
writeFileSync ( resolve ( pathOutputDir , lowerModuleName + '.md' ) , content ) ;
68
81
}
@@ -85,7 +98,7 @@ export function writeApiDocsDirectPage(methodName: string): void {
85
98
<ApiDocsMethod v-for="method of methods" :key="method.name" :method="method" v-once />
86
99
` . replace ( / \n + / g, '\n' ) ;
87
100
88
- content = format ( content , prettierMarkdown ) ;
101
+ content = vitePressInFileOptions + format ( content , prettierMarkdown ) ;
89
102
90
103
writeFileSync ( resolve ( pathOutputDir , methodName + '.md' ) , content ) ;
91
104
}
0 commit comments