From 2fc69584625a3ff3bc9e40e456d15f6c4e8b5691 Mon Sep 17 00:00:00 2001 From: Xicheng Guo Date: Wed, 12 Jun 2024 10:00:41 +0800 Subject: [PATCH] update sidebars --- src/.vitepress/sidebar.ts | 16 +- src/.vitepress/sidebar.yaml | 239 ---------------------- src/.vitepress/sidebars/ai.yaml | 21 ++ src/.vitepress/sidebars/backend.yaml | 10 + src/.vitepress/sidebars/cloud-native.yaml | 13 ++ src/.vitepress/sidebars/javascript.yaml | 112 ++++++++++ src/.vitepress/sidebars/react.yaml | 71 +++++++ src/.vitepress/sidebars/vue.yaml | 11 + 8 files changed, 250 insertions(+), 243 deletions(-) delete mode 100644 src/.vitepress/sidebar.yaml create mode 100644 src/.vitepress/sidebars/ai.yaml create mode 100644 src/.vitepress/sidebars/backend.yaml create mode 100644 src/.vitepress/sidebars/cloud-native.yaml create mode 100644 src/.vitepress/sidebars/javascript.yaml create mode 100644 src/.vitepress/sidebars/react.yaml create mode 100644 src/.vitepress/sidebars/vue.yaml diff --git a/src/.vitepress/sidebar.ts b/src/.vitepress/sidebar.ts index 49b8c69..a2c4e6e 100644 --- a/src/.vitepress/sidebar.ts +++ b/src/.vitepress/sidebar.ts @@ -1,6 +1,14 @@ -import yaml from 'js-yaml'; -import fs from 'fs'; +import yaml from "js-yaml"; +import fs from "fs"; export default function getSidebar() { - return yaml.load(fs.readFileSync('src/.vitepress/sidebar.yaml', 'utf8')); -} \ No newline at end of file + const sidebar = fs + .readdirSync("src/.vitepress/sidebars") + .reduce( + (acc, file) => + (acc += + fs.readFileSync(`src/.vitepress/sidebars/${file}`, "utf8") + "\n"), + "" + ); + return yaml.load(sidebar); +} diff --git a/src/.vitepress/sidebar.yaml b/src/.vitepress/sidebar.yaml deleted file mode 100644 index ad95d93..0000000 --- a/src/.vitepress/sidebar.yaml +++ /dev/null @@ -1,239 +0,0 @@ -/javascript: - - text: JavaScript 介绍 - items: - - text: 什么是 JavaScript - link: /javascript/introduction/what-is-javascript - - text: JavaScript 发展历程 - link: /javascript/introduction/history-of-javascript - - text: ECMAScript - items: - - text: ES 的版本 - link: /javascript/ecma-script/es-version - - text: JavaScript 引擎 - items: - - text: 调用栈 - link: /javascript/ecma-script/javascript-engine/call-stack - - text: 作用域 - link: /javascript/ecma-script/javascript-engine/scope - - text: 作用域链 - link: /javascript/ecma-script/javascript-engine/scope-chain - - text: this 关键字 - link: /javascript/ecma-script/javascript-engine/this-keyword - - text: 事件循环 - link: /javascript/ecma-script/javascript-engine/event-loop - - text: 变量声明 - link: /javascript/ecma-script/variable-declaration - - text: 比较算法 - link: /javascript/ecma-script/comparison-algorithm - - text: 浅拷贝和深拷贝 - link: /javascript/ecma-script/shallow-copy-and-deep-copy - - text: 表达式与操作符 - items: - - text: 条件访问表达式 - link: /javascript/ecma-script/expression-and-operator/conditional-access-expression - - text: 逻辑表达式 - link: /javascript/ecma-script/expression-and-operator/logical-expression - - text: 空值合并操作符 - link: /javascript/ecma-script/expression-and-operator/nullish-coalescing-operator - - text: 逻辑赋值操作符 - link: /javascript/ecma-script/expression-and-operator/logical-assignment-operator - - text: 基本引用 - base: /javascript/ecma-script/basic-reference - items: - - text: Date - link: /date - - text: 正则表达式 - link: /reg-exp - - text: 集合引用 - base: /javascript/ecma-script/collection-reference - items: - - text: Array - items: - - text: 创建数组 - link: /array/create-array - - text: 迭代数组 - link: /array/iterate-array - - text: 搜索数组 - link: /array/search-array - - text: 数组排序 - link: /array/sort-array - - text: 添加或删除元素 - link: /array/add-or-remove-element - - text: 检测数组 - link: /array/detect-array - - text: 数组扁平化 - link: /array/flatten-array - - text: 切片或连接数组 - link: /array/slice-or-concat-array - - text: Map - link: /map - - text: Set - link: /set - - text: 迭代器与生成器 - items: - - text: 迭代器 - link: /javascript/ecma-script/iterators-and-generators/iterator - - text: 自定义迭代器 - link: /javascript/ecma-script/iterators-and-generators/custom-iterator - - text: 生成器 - link: /javascript/ecma-script/iterators-and-generators/generator - - text: JSON - items: - - text: 什么是 JSON - link: /javascript/ecma-script/json/what-is-json - - text: JSON 数据格式 - link: /javascript/ecma-script/json/json-data-format - - text: 序列化 - link: /javascript/ecma-script/json/serialization - - text: 反序列化 - link: /javascript/ecma-script/json/deserialization - - text: 函数 - items: - - text: 定义函数 - link: /javascript/ecma-script/function/define-function - - text: 函数参数 - link: /javascript/ecma-script/function/function-arguments - - text: 闭包 - link: /javascript/ecma-script/function/closure - - text: 对象 - items: - - text: 原型 - link: /javascript/ecma-script/object/prototype - - text: 原型链 - link: /javascript/ecma-script/object/prototype-chain - - text: 异步 - items: - - text: 手写 Promise - link: /javascript/ecma-script/async/write-promise - - text: BOM - base: /javascript/bom - items: - - text: screen - link: /screen -/frontend/vue: - - text: Vue 介绍 - items: - - text: 什么是 Vue - link: /frontend/vue/introduction/what-is-vue - - text: Vue - items: - - text: 核心概念 - items: - - text: 模版语法 - link: /frontend/vue/core-concepts/template-syntax -/frontend/react: - - text: React 介绍 - items: - - text: 什么是 React - link: /frontend/react/introduction/what-is-react - - text: React - items: - - text: 核心概念 - items: - - text: JSX 语法 - link: /frontend/react/core-concepts/jsx - - text: children - link: /frontend/react/core-concepts/children - - text: createPortal - link: /frontend/react/core-concepts/create-portal - - text: 错误边界 - link: /frontend/react/core-concepts/error-boundaries - - text: styles - items: - - text: 内联样式 - link: /frontend/react/core-concepts/styles/inline-style - - text: 外部样式 - link: /frontend/react/core-concepts/styles/external-style - - text: CSS Modules - link: /frontend/react/core-concepts/styles/css-modules - - text: Styled Components - link: /frontend/react/core-concepts/styles/styled-components - - text: Tailwind CSS - link: /frontend/react/core-concepts/styles/tailwind-css - - text: 状态管理 - items: - - text: state - link: /frontend/react/core-concepts/state-management/state - - text: props - link: /frontend/react/core-concepts/state-management/props - - text: 状态提升 - link: /frontend/react/core-concepts/state-management/lifting-state-up - - text: Context - link: /frontend/react/core-concepts/state-management/context - - text: Reducer 和 Context - link: /frontend/react/core-concepts/state-management/reducer-and-context - - text: Hook API - items: - - text: useRef - link: /frontend/react/hook-api/use-ref - - text: useImperativeHandle - link: /frontend/react/hook-api/use-imperative-handle - - text: useEffect - link: /frontend/react/hook-api/use-effect - - text: useCallback - link: /frontend/react/hook-api/use-callback - - text: useMemo - link: /frontend/react/hook-api/use-memo - - text: useContext - link: /frontend/react/hook-api/use-context - - text: 自定义 Hook - link: /frontend/react/hook-api/custom-hook - - text: React Redux - items: - - text: Redux 核心概念 - link: /frontend/react/react-redux/redux-core-concept - - text: Redux Toolkit - link: /frontend/react/react-redux/redux-toolkit - - text: 表单 - items: - - text: 受控组件 - link: /frontend/react/form/controlled - - text: 非受控组件 - link: /frontend/react/form/uncontrolled - - text: FormData - link: /frontend/react/form/form-data -/backend: - - text: NodeJS - link: /backend/nodejs/index - items: - - text: 关于 NodeJS - link: /backend/nodejs/about-nodejs - - text: EventEmitter - link: /backend/nodejs/event-emitter - - text: File System - link: /backend/nodejs/file-system -/cloud-native: - - text: docker - items: - - text: docker 的架构 - link: /cloud-native/docker/docker-architecture - - text: docker 的镜像结构 - link: /cloud-native/docker/docker-image-structure - - text: 安装 docker - link: /cloud-native/docker/install-docker - - text: docker 基本使用命令 - link: /cloud-native/docker/basic-commands - - text: 构建 docker 镜像 - link: /cloud-native/docker/build-docker-image -/ai: - - text: AI 发展历程 - link: /ai/history-of-ai - - text: AI 领域 - link: /ai/ai-field - - text: LangChain - items: - - text: LangChain 介绍 - link: /ai/lang-chain/introduction - - text: 用例 - items: - - text: 标记文本 - link: /ai/lang-chain/use-case/tagging - - text: 文档内容总结 - link: /ai/lang-chain/use-case/summarization - - text: LangServe - items: - - text: LangServe 介绍 - link: /ai/lang-chain/lang-serve/introduction - - text: 构建 LangServe 应用 - link: /ai/lang-chain/lang-serve/build-application - diff --git a/src/.vitepress/sidebars/ai.yaml b/src/.vitepress/sidebars/ai.yaml new file mode 100644 index 0000000..31da1e5 --- /dev/null +++ b/src/.vitepress/sidebars/ai.yaml @@ -0,0 +1,21 @@ +/ai: + - text: AI 发展历程 + link: /ai/history-of-ai + - text: AI 领域 + link: /ai/ai-field + - text: LangChain + items: + - text: LangChain 介绍 + link: /ai/lang-chain/introduction + - text: 用例 + items: + - text: 标记文本 + link: /ai/lang-chain/use-case/tagging + - text: 文档内容总结 + link: /ai/lang-chain/use-case/summarization + - text: LangServe + items: + - text: LangServe 介绍 + link: /ai/lang-chain/lang-serve/introduction + - text: 构建 LangServe 应用 + link: /ai/lang-chain/lang-serve/build-application \ No newline at end of file diff --git a/src/.vitepress/sidebars/backend.yaml b/src/.vitepress/sidebars/backend.yaml new file mode 100644 index 0000000..694d646 --- /dev/null +++ b/src/.vitepress/sidebars/backend.yaml @@ -0,0 +1,10 @@ +/backend: + - text: NodeJS + link: /backend/nodejs/index + items: + - text: 关于 NodeJS + link: /backend/nodejs/about-nodejs + - text: EventEmitter + link: /backend/nodejs/event-emitter + - text: File System + link: /backend/nodejs/file-system \ No newline at end of file diff --git a/src/.vitepress/sidebars/cloud-native.yaml b/src/.vitepress/sidebars/cloud-native.yaml new file mode 100644 index 0000000..927a8a3 --- /dev/null +++ b/src/.vitepress/sidebars/cloud-native.yaml @@ -0,0 +1,13 @@ +/cloud-native: + - text: docker + items: + - text: docker 的架构 + link: /cloud-native/docker/docker-architecture + - text: docker 的镜像结构 + link: /cloud-native/docker/docker-image-structure + - text: 安装 docker + link: /cloud-native/docker/install-docker + - text: docker 基本使用命令 + link: /cloud-native/docker/basic-commands + - text: 构建 docker 镜像 + link: /cloud-native/docker/build-docker-image \ No newline at end of file diff --git a/src/.vitepress/sidebars/javascript.yaml b/src/.vitepress/sidebars/javascript.yaml new file mode 100644 index 0000000..3075226 --- /dev/null +++ b/src/.vitepress/sidebars/javascript.yaml @@ -0,0 +1,112 @@ +/javascript: + - text: JavaScript 介绍 + items: + - text: 什么是 JavaScript + link: /javascript/introduction/what-is-javascript + - text: JavaScript 发展历程 + link: /javascript/introduction/history-of-javascript + - text: ECMAScript + items: + - text: ES 的版本 + link: /javascript/ecma-script/es-version + - text: JavaScript 引擎 + items: + - text: 调用栈 + link: /javascript/ecma-script/javascript-engine/call-stack + - text: 作用域 + link: /javascript/ecma-script/javascript-engine/scope + - text: 作用域链 + link: /javascript/ecma-script/javascript-engine/scope-chain + - text: this 关键字 + link: /javascript/ecma-script/javascript-engine/this-keyword + - text: 事件循环 + link: /javascript/ecma-script/javascript-engine/event-loop + - text: 变量声明 + link: /javascript/ecma-script/variable-declaration + - text: 比较算法 + link: /javascript/ecma-script/comparison-algorithm + - text: 浅拷贝和深拷贝 + link: /javascript/ecma-script/shallow-copy-and-deep-copy + - text: 表达式与操作符 + items: + - text: 条件访问表达式 + link: /javascript/ecma-script/expression-and-operator/conditional-access-expression + - text: 逻辑表达式 + link: /javascript/ecma-script/expression-and-operator/logical-expression + - text: 空值合并操作符 + link: /javascript/ecma-script/expression-and-operator/nullish-coalescing-operator + - text: 逻辑赋值操作符 + link: /javascript/ecma-script/expression-and-operator/logical-assignment-operator + - text: 基本引用 + base: /javascript/ecma-script/basic-reference + items: + - text: Date + link: /date + - text: 正则表达式 + link: /reg-exp + - text: 集合引用 + base: /javascript/ecma-script/collection-reference + items: + - text: Array + items: + - text: 创建数组 + link: /array/create-array + - text: 迭代数组 + link: /array/iterate-array + - text: 搜索数组 + link: /array/search-array + - text: 数组排序 + link: /array/sort-array + - text: 添加或删除元素 + link: /array/add-or-remove-element + - text: 检测数组 + link: /array/detect-array + - text: 数组扁平化 + link: /array/flatten-array + - text: 切片或连接数组 + link: /array/slice-or-concat-array + - text: Map + link: /map + - text: Set + link: /set + - text: 迭代器与生成器 + items: + - text: 迭代器 + link: /javascript/ecma-script/iterators-and-generators/iterator + - text: 自定义迭代器 + link: /javascript/ecma-script/iterators-and-generators/custom-iterator + - text: 生成器 + link: /javascript/ecma-script/iterators-and-generators/generator + - text: JSON + items: + - text: 什么是 JSON + link: /javascript/ecma-script/json/what-is-json + - text: JSON 数据格式 + link: /javascript/ecma-script/json/json-data-format + - text: 序列化 + link: /javascript/ecma-script/json/serialization + - text: 反序列化 + link: /javascript/ecma-script/json/deserialization + - text: 函数 + items: + - text: 定义函数 + link: /javascript/ecma-script/function/define-function + - text: 函数参数 + link: /javascript/ecma-script/function/function-arguments + - text: 闭包 + link: /javascript/ecma-script/function/closure + - text: 对象 + items: + - text: 原型 + link: /javascript/ecma-script/object/prototype + - text: 原型链 + link: /javascript/ecma-script/object/prototype-chain + - text: 异步 + items: + - text: 手写 Promise + link: /javascript/ecma-script/async/write-promise + - text: BOM + base: /javascript/bom + items: + - text: screen + link: /screen \ No newline at end of file diff --git a/src/.vitepress/sidebars/react.yaml b/src/.vitepress/sidebars/react.yaml new file mode 100644 index 0000000..9a0608d --- /dev/null +++ b/src/.vitepress/sidebars/react.yaml @@ -0,0 +1,71 @@ +/frontend/react: + - text: React 介绍 + items: + - text: 什么是 React + link: /frontend/react/introduction/what-is-react + - text: React + items: + - text: 核心概念 + items: + - text: JSX 语法 + link: /frontend/react/core-concepts/jsx + - text: children + link: /frontend/react/core-concepts/children + - text: createPortal + link: /frontend/react/core-concepts/create-portal + - text: 错误边界 + link: /frontend/react/core-concepts/error-boundaries + - text: styles + items: + - text: 内联样式 + link: /frontend/react/core-concepts/styles/inline-style + - text: 外部样式 + link: /frontend/react/core-concepts/styles/external-style + - text: CSS Modules + link: /frontend/react/core-concepts/styles/css-modules + - text: Styled Components + link: /frontend/react/core-concepts/styles/styled-components + - text: Tailwind CSS + link: /frontend/react/core-concepts/styles/tailwind-css + - text: 状态管理 + items: + - text: state + link: /frontend/react/core-concepts/state-management/state + - text: props + link: /frontend/react/core-concepts/state-management/props + - text: 状态提升 + link: /frontend/react/core-concepts/state-management/lifting-state-up + - text: Context + link: /frontend/react/core-concepts/state-management/context + - text: Reducer 和 Context + link: /frontend/react/core-concepts/state-management/reducer-and-context + - text: Hook API + items: + - text: useRef + link: /frontend/react/hook-api/use-ref + - text: useImperativeHandle + link: /frontend/react/hook-api/use-imperative-handle + - text: useEffect + link: /frontend/react/hook-api/use-effect + - text: useCallback + link: /frontend/react/hook-api/use-callback + - text: useMemo + link: /frontend/react/hook-api/use-memo + - text: useContext + link: /frontend/react/hook-api/use-context + - text: 自定义 Hook + link: /frontend/react/hook-api/custom-hook + - text: React Redux + items: + - text: Redux 核心概念 + link: /frontend/react/react-redux/redux-core-concept + - text: Redux Toolkit + link: /frontend/react/react-redux/redux-toolkit + - text: 表单 + items: + - text: 受控组件 + link: /frontend/react/form/controlled + - text: 非受控组件 + link: /frontend/react/form/uncontrolled + - text: FormData + link: /frontend/react/form/form-data \ No newline at end of file diff --git a/src/.vitepress/sidebars/vue.yaml b/src/.vitepress/sidebars/vue.yaml new file mode 100644 index 0000000..e1ce770 --- /dev/null +++ b/src/.vitepress/sidebars/vue.yaml @@ -0,0 +1,11 @@ +/frontend/vue: + - text: Vue 介绍 + items: + - text: 什么是 Vue + link: /frontend/vue/introduction/what-is-vue + - text: Vue + items: + - text: 核心概念 + items: + - text: 模版语法 + link: /frontend/vue/core-concepts/template-syntax \ No newline at end of file