diff options
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/docs/.vitepress/config.mts | 201 |
1 files changed, 79 insertions, 122 deletions
diff --git a/doc/docs/.vitepress/config.mts b/doc/docs/.vitepress/config.mts index 188c2fa..a6c0ce7 100644 --- a/doc/docs/.vitepress/config.mts +++ b/doc/docs/.vitepress/config.mts | |||
| @@ -23,132 +23,89 @@ const yuescriptLanguage = { | |||
| 23 | function createSidebar(basePath: string, zh: boolean) { | 23 | function createSidebar(basePath: string, zh: boolean) { |
| 24 | return [ | 24 | return [ |
| 25 | { | 25 | { |
| 26 | text: zh ? '介绍' : 'Introduction', | 26 | text: zh ? '起步' : 'Getting Started', |
| 27 | link: `${basePath}/introduction`, | 27 | items: [ |
| 28 | { text: zh ? '介绍' : 'Introduction', link: `${basePath}/getting-started/introduction` }, | ||
| 29 | { text: zh ? '安装' : 'Installation', link: `${basePath}/getting-started/installation` }, | ||
| 30 | { text: zh ? '使用方法' : 'Usage', link: `${basePath}/getting-started/usage` }, | ||
| 31 | ] | ||
| 28 | }, | 32 | }, |
| 29 | { | 33 | { |
| 30 | text: zh ? '安装' : 'Installation', | 34 | text: zh ? '语言基础' : 'Language Basics', |
| 31 | link: `${basePath}/installation`, | 35 | collapsed: true, |
| 32 | }, | 36 | items: [ |
| 33 | { | 37 | { text: zh ? '空白' : 'Whitespace', link: `${basePath}/language-basics/whitespace` }, |
| 34 | text: zh ? '使用方法' : 'Usage', | 38 | { text: zh ? '注释' : 'Comment', link: `${basePath}/language-basics/comment` }, |
| 35 | link: `${basePath}/usage`, | 39 | { text: zh ? '字面量' : 'Literals', link: `${basePath}/language-basics/literals` }, |
| 36 | }, | 40 | { text: zh ? '操作符' : 'Operator', link: `${basePath}/language-basics/operator` }, |
| 37 | { | 41 | { text: zh ? '属性' : 'Attributes', link: `${basePath}/language-basics/attributes` }, |
| 38 | text: zh ? '宏' : 'Macro', | 42 | ] |
| 39 | link: `${basePath}/macro`, | ||
| 40 | }, | ||
| 41 | { | ||
| 42 | text: zh ? '操作符' : 'Operator', | ||
| 43 | link: `${basePath}/operator`, | ||
| 44 | }, | ||
| 45 | { | ||
| 46 | text: zh ? '模块' : 'Module', | ||
| 47 | link: `${basePath}/module`, | ||
| 48 | }, | 43 | }, |
| 49 | { | 44 | { |
| 50 | text: zh ? '赋值' : 'Assignment', | 45 | text: zh ? '赋值' : 'Assignment', |
| 51 | link: `${basePath}/assignment`, | 46 | collapsed: true, |
| 52 | }, | 47 | items: [ |
| 53 | { | 48 | { text: zh ? '赋值' : 'Assignment', link: `${basePath}/assignment/assignment` }, |
| 54 | text: zh ? '解构赋值' : 'Destructuring Assignment', | 49 | { text: zh ? '解构赋值' : 'Destructuring Assignment', link: `${basePath}/assignment/destructuring-assignment` }, |
| 55 | link: `${basePath}/destructuring-assignment`, | 50 | { text: zh ? 'if 赋值' : 'If Assignment', link: `${basePath}/assignment/if-assignment` }, |
| 56 | }, | 51 | { text: zh ? '可变参数赋值' : 'Varargs Assignment', link: `${basePath}/assignment/varargs-assignment` }, |
| 57 | { | 52 | { text: zh ? '使用 using 语句' : 'The Using Clause', link: `${basePath}/assignment/the-using-clause-controlling-destructive-assignment` }, |
| 58 | text: zh ? 'if 赋值' : 'If Assignment', | 53 | ] |
| 59 | link: `${basePath}/if-assignment`, | 54 | }, |
| 60 | }, | 55 | { |
| 61 | { | 56 | text: zh ? '函数' : 'Functions', |
| 62 | text: zh ? '可变参数赋值' : 'Varargs Assignment', | 57 | collapsed: true, |
| 63 | link: `${basePath}/varargs-assignment`, | 58 | items: [ |
| 64 | }, | 59 | { text: zh ? '函数字面量' : 'Function Literals', link: `${basePath}/functions/function-literals` }, |
| 65 | { | 60 | { text: zh ? '反向回调' : 'Backcalls', link: `${basePath}/functions/backcalls` }, |
| 66 | text: zh ? '空白' : 'Whitespace', | 61 | { text: zh ? '函数存根' : 'Function Stubs', link: `${basePath}/functions/function-stubs` }, |
| 67 | link: `${basePath}/whitespace`, | 62 | ] |
| 68 | }, | 63 | }, |
| 69 | { | 64 | { |
| 70 | text: zh ? '注释' : 'Comment', | 65 | text: zh ? '控制流' : 'Control Flow', |
| 71 | link: `${basePath}/comment`, | 66 | collapsed: true, |
| 72 | }, | 67 | items: [ |
| 73 | { | 68 | { text: zh ? '条件语句' : 'Conditionals', link: `${basePath}/control-flow/conditionals` }, |
| 74 | text: zh ? '错误处理' : 'Try', | 69 | { text: zh ? 'for 循环' : 'For Loop', link: `${basePath}/control-flow/for-loop` }, |
| 75 | link: `${basePath}/try`, | 70 | { text: zh ? 'while 循环' : 'While Loop', link: `${basePath}/control-flow/while-loop` }, |
| 76 | }, | 71 | { text: zh ? 'continue 语句' : 'Continue Statement', link: `${basePath}/control-flow/continue` }, |
| 77 | { | 72 | { text: zh ? 'switch 语句' : 'Switch', link: `${basePath}/control-flow/switch` }, |
| 78 | text: zh ? '属性' : 'Attributes', | 73 | ] |
| 79 | link: `${basePath}/attributes`, | 74 | }, |
| 80 | }, | 75 | { |
| 81 | { | 76 | text: zh ? '数据结构' : 'Data Structures', |
| 82 | text: zh ? '字面量' : 'Literals', | 77 | collapsed: true, |
| 83 | link: `${basePath}/literals`, | 78 | items: [ |
| 84 | }, | 79 | { text: zh ? '表格字面量' : 'Table Literals', link: `${basePath}/data-structures/table-literals` }, |
| 85 | { | 80 | { text: zh ? '推导式' : 'Comprehensions', link: `${basePath}/data-structures/comprehensions` }, |
| 86 | text: zh ? '函数字面量' : 'Function Literals', | 81 | ] |
| 87 | link: `${basePath}/function-literals`, | 82 | }, |
| 88 | }, | 83 | { |
| 89 | { | 84 | text: zh ? '面向对象' : 'Objects', |
| 90 | text: zh ? '反向回调' : 'Backcalls', | 85 | collapsed: true, |
| 91 | link: `${basePath}/backcalls`, | 86 | items: [ |
| 92 | }, | 87 | { text: zh ? '面向对象编程' : 'Object Oriented Programming', link: `${basePath}/objects/object-oriented-programming` }, |
| 93 | { | 88 | { text: zh ? 'with 语句' : 'With Statement', link: `${basePath}/objects/with-statement` }, |
| 94 | text: zh ? '表格字面量' : 'Table Literals', | 89 | ] |
| 95 | link: `${basePath}/table-literals`, | 90 | }, |
| 96 | }, | 91 | { |
| 97 | { | 92 | text: zh ? '高级特性' : 'Advanced Features', |
| 98 | text: zh ? '推导式' : 'Comprehensions', | 93 | collapsed: true, |
| 99 | link: `${basePath}/comprehensions`, | 94 | items: [ |
| 100 | }, | 95 | { text: zh ? '宏' : 'Macro', link: `${basePath}/advanced/macro` }, |
| 101 | { | 96 | { text: zh ? '模块' : 'Module', link: `${basePath}/advanced/module` }, |
| 102 | text: zh ? 'for 循环' : 'For Loop', | 97 | { text: zh ? '代码行修饰符' : 'Line Decorators', link: `${basePath}/advanced/line-decorators` }, |
| 103 | link: `${basePath}/for-loop`, | 98 | { text: zh ? 'do 语句' : 'Do', link: `${basePath}/advanced/do` }, |
| 104 | }, | 99 | { text: zh ? '错误处理' : 'Try', link: `${basePath}/advanced/try` }, |
| 105 | { | 100 | ] |
| 106 | text: zh ? 'while 循环' : 'While Loop', | 101 | }, |
| 107 | link: `${basePath}/while-loop`, | 102 | { |
| 108 | }, | 103 | text: zh ? '参考' : 'Reference', |
| 109 | { | 104 | collapsed: true, |
| 110 | text: zh ? 'continue 语句' : 'Continue Statement', | 105 | items: [ |
| 111 | link: `${basePath}/continue`, | 106 | { text: zh ? '月之脚本语言库' : 'The YueScript Library', link: `${basePath}/reference/the-yuescript-library` }, |
| 112 | }, | 107 | { text: zh ? 'MIT 许可证' : 'License: MIT', link: `${basePath}/reference/license-mit` }, |
| 113 | { | 108 | ] |
| 114 | text: zh ? '条件语句' : 'Conditionals', | ||
| 115 | link: `${basePath}/conditionals`, | ||
| 116 | }, | ||
| 117 | { | ||
| 118 | text: zh ? '代码行修饰符' : 'Line Decorators', | ||
| 119 | link: `${basePath}/line-decorators`, | ||
| 120 | }, | ||
| 121 | { | ||
| 122 | text: zh ? 'switch 语句' : 'Switch', | ||
| 123 | link: `${basePath}/switch`, | ||
| 124 | }, | ||
| 125 | { | ||
| 126 | text: zh ? '面向对象编程' : 'Object Oriented Programming', | ||
| 127 | link: `${basePath}/object-oriented-programming`, | ||
| 128 | }, | ||
| 129 | { | ||
| 130 | text: zh ? 'with 语句' : 'With Statement', | ||
| 131 | link: `${basePath}/with-statement`, | ||
| 132 | }, | ||
| 133 | { | ||
| 134 | text: zh ? 'do 语句' : 'Do', | ||
| 135 | link: `${basePath}/do`, | ||
| 136 | }, | ||
| 137 | { | ||
| 138 | text: zh ? '函数存根' : 'Function Stubs', | ||
| 139 | link: `${basePath}/function-stubs`, | ||
| 140 | }, | ||
| 141 | { | ||
| 142 | text: zh ? '使用 using 语句:防止破坏性赋值' : 'The Using Clause; Controlling Destructive Assignment', | ||
| 143 | link: `${basePath}/the-using-clause-controlling-destructive-assignment`, | ||
| 144 | }, | ||
| 145 | { | ||
| 146 | text: zh ? '月之脚本语言库' : 'The YueScript Library', | ||
| 147 | link: `${basePath}/the-yuescript-library`, | ||
| 148 | }, | ||
| 149 | { | ||
| 150 | text: zh ? 'MIT 许可证' : 'License: MIT', | ||
| 151 | link: `${basePath}/license-mit`, | ||
| 152 | }, | 109 | }, |
| 153 | ] | 110 | ] |
| 154 | } | 111 | } |
| @@ -219,7 +176,7 @@ export default defineConfig({ | |||
| 219 | description: 'A language that compiles to Lua', | 176 | description: 'A language that compiles to Lua', |
| 220 | themeConfig: { | 177 | themeConfig: { |
| 221 | nav: [ | 178 | nav: [ |
| 222 | { text: 'Document', link: '/doc/' }, | 179 | { text: 'Documentation', link: '/doc/' }, |
| 223 | { text: 'Try yue!', link: '/try/' }, | 180 | { text: 'Try yue!', link: '/try/' }, |
| 224 | { text: 'GitHub', link: 'https://github.com/IppClub/Yuescript' } | 181 | { text: 'GitHub', link: 'https://github.com/IppClub/Yuescript' } |
| 225 | ], | 182 | ], |
