1
- import { defineConfig , DefaultTheme } from 'vitepress'
1
+ import { DefaultTheme , defineConfig } from 'vitepress'
2
2
import llmstxt from 'vitepress-plugin-llms'
3
3
4
4
const gaScript = `
@@ -15,60 +15,75 @@ const sidebar: DefaultTheme.Sidebar = [
15
15
items : [
16
16
{ text : 'Quick Start' , link : '/guide/quick-start.html' } ,
17
17
{ text : 'Pattern Syntax' , link : '/guide/pattern-syntax.html' } ,
18
- { text : 'Rule Essentials' , link : '/guide/rule-config.html' , collapsed : true ,
19
- items :[
18
+ {
19
+ text : 'Rule Essentials' ,
20
+ link : '/guide/rule-config.html' ,
21
+ collapsed : true ,
22
+ items : [
20
23
{ text : 'Atomic Rule' , link : '/guide/rule-config/atomic-rule.html' } ,
21
24
{ text : 'Relational Rule' , link : '/guide/rule-config/relational-rule.html' } ,
22
25
{ text : 'Composite Rule' , link : '/guide/rule-config/composite-rule.html' } ,
23
26
{ text : 'Utility Rule' , link : '/guide/rule-config/utility-rule.html' } ,
24
- ] , } ,
27
+ ] ,
28
+ } ,
25
29
{
26
- text : 'Project Setup' , collapsed : true , link : '/guide/scan-project.html' ,
30
+ text : 'Project Setup' ,
31
+ collapsed : true ,
32
+ link : '/guide/scan-project.html' ,
27
33
items : [
28
34
{ text : 'Project Configuration' , link : '/guide/project/project-config.html' } ,
29
35
{ text : 'Lint Rule' , link : '/guide/project/lint-rule.html' } ,
30
36
{ text : 'Test Your Rule' , link : '/guide/test-rule.html' } ,
31
37
{ text : 'Error Report' , link : '/guide/project/severity.html' } ,
32
38
] ,
33
39
} ,
34
- { text : 'Rewrite Code' , link : '/guide/rewrite-code.html' , collapsed : true ,
40
+ {
41
+ text : 'Rewrite Code' ,
42
+ link : '/guide/rewrite-code.html' ,
43
+ collapsed : true ,
35
44
items : [
36
45
{ text : 'Transform Code' , link : '/guide/rewrite/transform.html' } ,
37
46
{ text : 'Rewriter Rule' , link : '/guide/rewrite/rewriter.html' } ,
38
47
] ,
39
48
} ,
40
49
{
41
- text : 'Tooling Overview' , link : '/guide/tooling-overview.html' , collapsed : true ,
50
+ text : 'Tooling Overview' ,
51
+ link : '/guide/tooling-overview.html' ,
52
+ collapsed : true ,
42
53
items : [
43
54
{ text : 'Editor Integration' , link : '/guide/tools/editors.html' } ,
44
55
{ text : 'JSON mode' , link : '/guide/tools/json.html' } ,
45
56
] ,
46
57
} ,
47
- { text : 'API Usage' , link : '/guide/api-usage.html' , collapsed : true ,
48
- items :[
58
+ {
59
+ text : 'API Usage' ,
60
+ link : '/guide/api-usage.html' ,
61
+ collapsed : true ,
62
+ items : [
49
63
{ text : 'JavaScript API' , link : '/guide/api-usage/js-api.html' } ,
50
64
{ text : 'Python API' , link : '/guide/api-usage/py-api.html' } ,
51
65
{ text : 'Performance Tip' , link : '/guide/api-usage/performance-tip.html' } ,
52
- ] } ,
66
+ ] ,
67
+ } ,
53
68
] ,
54
69
collapsed : false ,
55
70
} ,
56
71
{
57
72
text : 'Examples' ,
58
73
link : '/catalog' ,
59
74
items : [
60
- { text : 'C' , link : '/catalog/c/' } ,
61
- { text : 'C++' , link : '/catalog/cpp/' } ,
62
- { text : 'Go' , link : '/catalog/go/' } ,
63
- { text : 'HTML' , link : '/catalog/html/' } ,
64
- { text : 'Java' , link : '/catalog/java/' } ,
65
- { text : 'Kotlin' , link : '/catalog/kotlin/' } ,
66
- { text : 'Python' , link : '/catalog/python/' } ,
67
- { text : 'Ruby' , link : '/catalog/ruby/' } ,
68
- { text : 'Rust' , link : '/catalog/rust/' } ,
69
- { text : 'TypeScript' , link : '/catalog/typescript/' } ,
70
- { text : 'TSX' , link : '/catalog/tsx/' } ,
71
- { text : 'YAML' , link : '/catalog/yaml/' } ,
75
+ { text : 'C' , link : '/catalog/c/' } ,
76
+ { text : 'C++' , link : '/catalog/cpp/' } ,
77
+ { text : 'Go' , link : '/catalog/go/' } ,
78
+ { text : 'HTML' , link : '/catalog/html/' } ,
79
+ { text : 'Java' , link : '/catalog/java/' } ,
80
+ { text : 'Kotlin' , link : '/catalog/kotlin/' } ,
81
+ { text : 'Python' , link : '/catalog/python/' } ,
82
+ { text : 'Ruby' , link : '/catalog/ruby/' } ,
83
+ { text : 'Rust' , link : '/catalog/rust/' } ,
84
+ { text : 'TypeScript' , link : '/catalog/typescript/' } ,
85
+ { text : 'TSX' , link : '/catalog/tsx/' } ,
86
+ { text : 'YAML' , link : '/catalog/yaml/' } ,
72
87
] ,
73
88
collapsed : true ,
74
89
} ,
@@ -83,7 +98,10 @@ const sidebar: DefaultTheme.Sidebar = [
83
98
{
84
99
text : 'Reference' ,
85
100
items : [
86
- { text : 'Command Line Interface' , link : '/reference/cli.html' , collapsed : true ,
101
+ {
102
+ text : 'Command Line Interface' ,
103
+ link : '/reference/cli.html' ,
104
+ collapsed : true ,
87
105
items : [
88
106
{ text : 'ast-grep run' , link : '/reference/cli/run.html' } ,
89
107
{ text : 'ast-grep scan' , link : '/reference/cli/scan.html' } ,
@@ -92,7 +110,10 @@ const sidebar: DefaultTheme.Sidebar = [
92
110
] ,
93
111
} ,
94
112
{ text : 'Project Config' , link : '/reference/sgconfig.html' } ,
95
- { text : 'Rule Config' , link : '/reference/yaml.html' , collapsed : false ,
113
+ {
114
+ text : 'Rule Config' ,
115
+ link : '/reference/yaml.html' ,
116
+ collapsed : false ,
96
117
items : [
97
118
{ text : 'fix' , link : '/reference/yaml/fix.html' } ,
98
119
{ text : 'transformation' , link : '/reference/yaml/transformation.html' } ,
@@ -109,18 +130,21 @@ const sidebar: DefaultTheme.Sidebar = [
109
130
{
110
131
text : 'Advanced Topics' ,
111
132
items : [
112
- { text : 'Frequently Asked Questions' , link : '/advanced/faq.html' } ,
113
- { text : 'How ast-grep Works' , link : '/advanced/how-ast-grep-works.html' , collapsed : false ,
133
+ { text : 'Frequently Asked Questions' , link : '/advanced/faq.html' } ,
134
+ {
135
+ text : 'How ast-grep Works' ,
136
+ link : '/advanced/how-ast-grep-works.html' ,
137
+ collapsed : false ,
114
138
items : [
115
- { text : 'Core Concepts' , link : '/advanced/core-concepts.html' } ,
116
- { text : 'Pattern Syntax' , link : '/advanced/pattern-parse.html' } ,
117
- { text : 'Pattern Match Algorithm' , link : '/advanced/match-algorithm.html' } ,
118
- { text : 'How Rewrite Works' , link : '/advanced/find-n-patch.html' } ,
119
- ] ,
139
+ { text : 'Core Concepts' , link : '/advanced/core-concepts.html' } ,
140
+ { text : 'Pattern Syntax' , link : '/advanced/pattern-parse.html' } ,
141
+ { text : 'Pattern Match Algorithm' , link : '/advanced/match-algorithm.html' } ,
142
+ { text : 'How Rewrite Works' , link : '/advanced/find-n-patch.html' } ,
143
+ ] ,
120
144
} ,
121
- { text : 'Custom Language Support' , link : '/advanced/custom-language.html' } ,
122
- { text : 'Multi-Language Documents' , link : '/advanced/language-injection.html' } ,
123
- { text : 'Comparison with Other Tools' , link : '/advanced/tool-comparison.html' } ,
145
+ { text : 'Custom Language Support' , link : '/advanced/custom-language.html' } ,
146
+ { text : 'Multi-Language Documents' , link : '/advanced/language-injection.html' } ,
147
+ { text : 'Comparison with Other Tools' , link : '/advanced/tool-comparison.html' } ,
124
148
] ,
125
149
collapsed : true ,
126
150
} ,
@@ -139,10 +163,13 @@ const sidebar: DefaultTheme.Sidebar = [
139
163
{ text : 'Playground' , link : '/playground.html' } ,
140
164
{ text : 'Codemod Studio' , link : 'https://app.codemod.com/studio' } ,
141
165
{ text : 'Blog' , link : '/blog.html' } ,
142
- { text : 'VSCode' , link : 'https://marketplace.visualstudio.com/items?itemName=ast-grep.ast-grep-vscode' } ,
143
- { text : 'Discord' , link : 'https://discord.com/invite/4YZjf6htSQ' } ,
144
- { text : 'StackOverflow' , link : 'https://stackoverflow.com/questions/tagged/ast-grep' } ,
145
- { text : 'Reddit' , link : 'https://www.reddit.com/r/astgrep/' } ,
166
+ {
167
+ text : 'VSCode' ,
168
+ link : 'https://marketplace.visualstudio.com/items?itemName=ast-grep.ast-grep-vscode' ,
169
+ } ,
170
+ { text : 'Discord' , link : 'https://discord.com/invite/4YZjf6htSQ' } ,
171
+ { text : 'StackOverflow' , link : 'https://stackoverflow.com/questions/tagged/ast-grep' } ,
172
+ { text : 'Reddit' , link : 'https://www.reddit.com/r/astgrep/' } ,
146
173
{ text : 'Docs.rs' , link : 'https://docs.rs/ast-grep-core/latest/ast_grep_core/' } ,
147
174
] ,
148
175
collapsed : true ,
@@ -152,9 +179,10 @@ const sidebar: DefaultTheme.Sidebar = [
152
179
export default defineConfig ( {
153
180
lang : 'en-US' ,
154
181
title : 'ast-grep' ,
155
- description : 'ast-grep(sg) is a lightning fast and user friendly tool for code searching, linting, rewriting at large scale.' ,
182
+ description :
183
+ 'ast-grep(sg) is a lightning fast and user friendly tool for code searching, linting, rewriting at large scale.' ,
156
184
head : [
157
- [ 'script' , { async : 'async' , src : 'https://www.googletagmanager.com/gtag/js?id=G-EZSJ3YF2RG' } ] ,
185
+ [ 'script' , { async : 'async' , src : 'https://www.googletagmanager.com/gtag/js?id=G-EZSJ3YF2RG' } ] ,
158
186
[ 'script' , { } , gaScript ] ,
159
187
] ,
160
188
outDir : './dist' ,
@@ -182,7 +210,7 @@ export default defineConfig({
182
210
{ text : 'Rule Config' , link : '/reference/yaml.html' } ,
183
211
{ text : 'Rule Object' , link : '/reference/rule.html' } ,
184
212
{ text : 'Playground Manual' , link : '/reference/playground.html' } ,
185
- ]
213
+ ] ,
186
214
} ,
187
215
{
188
216
text : 'Resources' ,
@@ -201,16 +229,19 @@ export default defineConfig({
201
229
{ icon : 'discord' , link : 'https://discord.com/invite/4YZjf6htSQ' } ,
202
230
] ,
203
231
editLink : {
204
- pattern : 'https://github.com/ast-grep/ast-grep.github.io/edit/main/website/:path'
232
+ pattern : 'https://github.com/ast-grep/ast-grep.github.io/edit/main/website/:path' ,
205
233
} ,
206
234
sidebar : {
207
235
'/blog/' : [
208
236
{ text : 'Blog List' , link : '/blog.html' } ,
209
237
{ text : 'Homepage' , link : '/' } ,
210
- { text : 'VSCode' , link : 'https://marketplace.visualstudio.com/items?itemName=ast-grep.ast-grep-vscode' } ,
211
- { text : 'Discord' , link : 'https://discord.com/invite/4YZjf6htSQ' } ,
212
- { text : 'StackOverflow' , link : 'https://stackoverflow.com/questions/tagged/ast-grep' } ,
213
- { text : 'Reddit' , link : 'https://www.reddit.com/r/astgrep/' } ,
238
+ {
239
+ text : 'VSCode' ,
240
+ link : 'https://marketplace.visualstudio.com/items?itemName=ast-grep.ast-grep-vscode' ,
241
+ } ,
242
+ { text : 'Discord' , link : 'https://discord.com/invite/4YZjf6htSQ' } ,
243
+ { text : 'StackOverflow' , link : 'https://stackoverflow.com/questions/tagged/ast-grep' } ,
244
+ { text : 'Reddit' , link : 'https://www.reddit.com/r/astgrep/' } ,
214
245
{ text : 'Docs.rs' , link : 'https://docs.rs/ast-grep-core/latest/ast_grep_core/' } ,
215
246
] ,
216
247
'/' : sidebar ,
@@ -226,4 +257,4 @@ export default defineConfig({
226
257
sitemap : {
227
258
hostname : 'https://ast-grep.github.io' ,
228
259
} ,
229
- } )
260
+ } )
0 commit comments