ruki 6 miesięcy temu
rodzic
commit
7e54fd7b2e
3 zmienionych plików z 37 dodań i 7 usunięć
  1. 17 2
      docs/config.ts
  2. 3 3
      docs/zh/api/index.md
  3. 17 2
      docs/zh/config.ts

+ 17 - 2
docs/config.ts

@@ -13,8 +13,9 @@ export default defineAdditionalConfig({
 
     sidebar: {
       '/guide/': { base: '/guide/', items: sidebarGuide() },
-      '/api/description': { base: '/api/description', items: descriptionApiGuide() },
-      '/api/scripts': { base: '/api/scripts', items: scriptsApiGuide() },
+      '/api/description': { base: '/api/description/', items: descriptionApiGuide() },
+      '/api/scripts': { base: '/api/scripts/', items: scriptsApiGuide() },
+      '/api/': { base: '/api/', items: apiGuide() },
       '/examples/': { base: '/examples/', items: examplesGuide() },
     },
 
@@ -74,6 +75,20 @@ function sidebarGuide(): DefaultTheme.SidebarItem[] {
   ]
 }
 
+function apiGuide(): DefaultTheme.SidebarItem[] {
+  return [
+    { text: 'API Reference', link: '/#api-reference' },
+    {
+      text: 'Next Steps',
+      collapsed: false,
+      items: [
+        { text: 'Guide', link: '../guide/what-is-xmake' },
+        { text: 'Examples', link: '../examples/cpp/basic' },
+      ]
+    }
+  ]
+}
+
 function descriptionApiGuide(): DefaultTheme.SidebarItem[] {
   return [
     { text: 'Specification', link: '/specification' },

+ 3 - 3
docs/zh/api/index.md

@@ -2,9 +2,9 @@
 outline: deep
 ---
 
-# API 手册
+# API 手册 {#api-reference}
 
-## 描述域 API
+## 描述域 API {#description-api}
 
 - [接口规范](/zh/api/description/specification)
 - [条件判断](/zh/api/description/conditions)
@@ -13,7 +13,7 @@ outline: deep
 - [工程目标](/zh/api/description/project-target)
 - [配置选项](/zh/api/description/configuration-option)
 
-## 脚本域 API
+## 脚本域 API {#scripts-api}
 
 - [目标实例](/zh/api/scripts/target_instance)
 - [包实例](/zh/api/scripts/package_instance)

+ 17 - 2
docs/zh/config.ts

@@ -15,8 +15,9 @@ export default defineAdditionalConfig({
 
     sidebar: {
       '/zh/guide/': { base: '/zh/guide/', items: sidebarGuide() },
-      '/zh/api/description': { base: '/zh/api/description', items: descriptionApiGuide() },
-      '/zh/api/scripts': { base: '/zh/api/scripts', items: scriptsApiGuide() },
+      '/zh/api/description': { base: '/zh/api/description/', items: descriptionApiGuide() },
+      '/zh/api/scripts': { base: '/zh/api/scripts/', items: scriptsApiGuide() },
+      '/zh/api/': { base: '/zh/api/', items: apiGuide() },
       '/zh/examples/': { base: '/zh/examples/', items: examplesGuide() },
     },
 
@@ -111,6 +112,20 @@ function sidebarGuide(): DefaultTheme.SidebarItem[] {
   ]
 }
 
+function apiGuide(): DefaultTheme.SidebarItem[] {
+  return [
+    { text: 'API 手册', link: '/#api-reference' },
+    {
+      text: '下一步',
+      collapsed: false,
+      items: [
+        { text: '使用指南', link: '../guide/what-is-xmake' },
+        { text: '示例', link: '../examples/cpp/basic' },
+      ]
+    }
+  ]
+}
+
 function descriptionApiGuide(): DefaultTheme.SidebarItem[] {
   return [
     { text: '接口规范', link: '/specification' },