1- import { defineConfig , DefaultTheme } from 'vitepress'
1+ import { DefaultTheme , defineConfig } from 'vitepress'
22import llmstxt from 'vitepress-plugin-llms'
33
44const gaScript = `
@@ -15,60 +15,75 @@ const sidebar: DefaultTheme.Sidebar = [
1515 items : [
1616 { text : 'Quick Start' , link : '/guide/quick-start.html' } ,
1717 { 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 : [
2023 { text : 'Atomic Rule' , link : '/guide/rule-config/atomic-rule.html' } ,
2124 { text : 'Relational Rule' , link : '/guide/rule-config/relational-rule.html' } ,
2225 { text : 'Composite Rule' , link : '/guide/rule-config/composite-rule.html' } ,
2326 { text : 'Utility Rule' , link : '/guide/rule-config/utility-rule.html' } ,
24- ] , } ,
27+ ] ,
28+ } ,
2529 {
26- text : 'Project Setup' , collapsed : true , link : '/guide/scan-project.html' ,
30+ text : 'Project Setup' ,
31+ collapsed : true ,
32+ link : '/guide/scan-project.html' ,
2733 items : [
2834 { text : 'Project Configuration' , link : '/guide/project/project-config.html' } ,
2935 { text : 'Lint Rule' , link : '/guide/project/lint-rule.html' } ,
3036 { text : 'Test Your Rule' , link : '/guide/test-rule.html' } ,
3137 { text : 'Error Report' , link : '/guide/project/severity.html' } ,
3238 ] ,
3339 } ,
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 ,
3544 items : [
3645 { text : 'Transform Code' , link : '/guide/rewrite/transform.html' } ,
3746 { text : 'Rewriter Rule' , link : '/guide/rewrite/rewriter.html' } ,
3847 ] ,
3948 } ,
4049 {
41- text : 'Tooling Overview' , link : '/guide/tooling-overview.html' , collapsed : true ,
50+ text : 'Tooling Overview' ,
51+ link : '/guide/tooling-overview.html' ,
52+ collapsed : true ,
4253 items : [
4354 { text : 'Editor Integration' , link : '/guide/tools/editors.html' } ,
4455 { text : 'JSON mode' , link : '/guide/tools/json.html' } ,
4556 ] ,
4657 } ,
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 : [
4963 { text : 'JavaScript API' , link : '/guide/api-usage/js-api.html' } ,
5064 { text : 'Python API' , link : '/guide/api-usage/py-api.html' } ,
5165 { text : 'Performance Tip' , link : '/guide/api-usage/performance-tip.html' } ,
52- ] } ,
66+ ] ,
67+ } ,
5368 ] ,
5469 collapsed : false ,
5570 } ,
5671 {
5772 text : 'Examples' ,
5873 link : '/catalog' ,
5974 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/' } ,
7287 ] ,
7388 collapsed : true ,
7489 } ,
@@ -83,7 +98,10 @@ const sidebar: DefaultTheme.Sidebar = [
8398 {
8499 text : 'Reference' ,
85100 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 ,
87105 items : [
88106 { text : 'ast-grep run' , link : '/reference/cli/run.html' } ,
89107 { text : 'ast-grep scan' , link : '/reference/cli/scan.html' } ,
@@ -92,7 +110,10 @@ const sidebar: DefaultTheme.Sidebar = [
92110 ] ,
93111 } ,
94112 { 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 ,
96117 items : [
97118 { text : 'fix' , link : '/reference/yaml/fix.html' } ,
98119 { text : 'transformation' , link : '/reference/yaml/transformation.html' } ,
@@ -109,18 +130,21 @@ const sidebar: DefaultTheme.Sidebar = [
109130 {
110131 text : 'Advanced Topics' ,
111132 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 ,
114138 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+ ] ,
120144 } ,
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' } ,
124148 ] ,
125149 collapsed : true ,
126150 } ,
@@ -139,10 +163,13 @@ const sidebar: DefaultTheme.Sidebar = [
139163 { text : 'Playground' , link : '/playground.html' } ,
140164 { text : 'Codemod Studio' , link : 'https://app.codemod.com/studio' } ,
141165 { 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/' } ,
146173 { text : 'Docs.rs' , link : 'https://docs.rs/ast-grep-core/latest/ast_grep_core/' } ,
147174 ] ,
148175 collapsed : true ,
@@ -152,9 +179,10 @@ const sidebar: DefaultTheme.Sidebar = [
152179export default defineConfig ( {
153180 lang : 'en-US' ,
154181 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.' ,
156184 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' } ] ,
158186 [ 'script' , { } , gaScript ] ,
159187 ] ,
160188 outDir : './dist' ,
@@ -182,7 +210,7 @@ export default defineConfig({
182210 { text : 'Rule Config' , link : '/reference/yaml.html' } ,
183211 { text : 'Rule Object' , link : '/reference/rule.html' } ,
184212 { text : 'Playground Manual' , link : '/reference/playground.html' } ,
185- ]
213+ ] ,
186214 } ,
187215 {
188216 text : 'Resources' ,
@@ -201,16 +229,19 @@ export default defineConfig({
201229 { icon : 'discord' , link : 'https://discord.com/invite/4YZjf6htSQ' } ,
202230 ] ,
203231 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' ,
205233 } ,
206234 sidebar : {
207235 '/blog/' : [
208236 { text : 'Blog List' , link : '/blog.html' } ,
209237 { 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/' } ,
214245 { text : 'Docs.rs' , link : 'https://docs.rs/ast-grep-core/latest/ast_grep_core/' } ,
215246 ] ,
216247 '/' : sidebar ,
@@ -226,4 +257,4 @@ export default defineConfig({
226257 sitemap : {
227258 hostname : 'https://ast-grep.github.io' ,
228259 } ,
229- } )
260+ } )
0 commit comments