From 5dec41c34256f71e19c2e700a60c3a517d9c6900 Mon Sep 17 00:00:00 2001 From: chufan Date: Mon, 21 Sep 2026 17:15:53 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E7=A7=BB=E9=99=A4=E6=80=9D=E7=BB=B4?= =?UTF-8?q?=E5=AF=BC=E5=9B=BE=E7=BB=84=E4=BB=B6=E4=B8=8E=E7=94=9F=E6=88=90?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 删除 XMind 组件、mind-map 静态页及 mark-map 构建脚本,为站点精简做准备。 --- docs/.vuepress/components/XMindManager.vue | 206 -------------------- docs/.vuepress/public/mind-map/ccp-map.html | 41 ---- docs/.vuepress/public/mind-map/cn-map.html | 41 ---- docs/.vuepress/public/mind-map/ds-map.html | 41 ---- docs/.vuepress/public/mind-map/os-map.html | 41 ---- docs/mark-map/index.json | 30 --- docs/mark-map/mark-map.sidebar.ts | 9 - scripts/core/mark-map.ts | 72 ------- scripts/mark-map | 3 - 9 files changed, 484 deletions(-) delete mode 100644 docs/.vuepress/components/XMindManager.vue delete mode 100644 docs/.vuepress/public/mind-map/ccp-map.html delete mode 100644 docs/.vuepress/public/mind-map/cn-map.html delete mode 100644 docs/.vuepress/public/mind-map/ds-map.html delete mode 100644 docs/.vuepress/public/mind-map/os-map.html delete mode 100644 docs/mark-map/index.json delete mode 100644 docs/mark-map/mark-map.sidebar.ts delete mode 100644 scripts/core/mark-map.ts delete mode 100755 scripts/mark-map diff --git a/docs/.vuepress/components/XMindManager.vue b/docs/.vuepress/components/XMindManager.vue deleted file mode 100644 index 681e96d..0000000 --- a/docs/.vuepress/components/XMindManager.vue +++ /dev/null @@ -1,206 +0,0 @@ - - - - - - diff --git a/docs/.vuepress/public/mind-map/ccp-map.html b/docs/.vuepress/public/mind-map/ccp-map.html deleted file mode 100644 index 01c8d5a..0000000 --- a/docs/.vuepress/public/mind-map/ccp-map.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - -Markmap - - - - - - - - diff --git a/docs/.vuepress/public/mind-map/cn-map.html b/docs/.vuepress/public/mind-map/cn-map.html deleted file mode 100644 index bdc5602..0000000 --- a/docs/.vuepress/public/mind-map/cn-map.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - -Markmap - - - - - - - - diff --git a/docs/.vuepress/public/mind-map/ds-map.html b/docs/.vuepress/public/mind-map/ds-map.html deleted file mode 100644 index 115f000..0000000 --- a/docs/.vuepress/public/mind-map/ds-map.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - -Markmap - - - - - - - - diff --git a/docs/.vuepress/public/mind-map/os-map.html b/docs/.vuepress/public/mind-map/os-map.html deleted file mode 100644 index 2625add..0000000 --- a/docs/.vuepress/public/mind-map/os-map.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - -Markmap - - - - - - - - diff --git a/docs/mark-map/index.json b/docs/mark-map/index.json deleted file mode 100644 index 52e3573..0000000 --- a/docs/mark-map/index.json +++ /dev/null @@ -1,30 +0,0 @@ -[ - { - "name": "数据结构", - "originXmindFileName": "数据结构.xmind", - "targetXmindFileName": "ds.xmind", - "xMindPath": "../mark-map/ds.xmind", - "mdPath": "../mark-map/ds-map.md" - }, - { - "name": "操作系统", - "originXmindFileName": "操作系统.xmind", - "targetXmindFileName": "os.xmind", - "xMindPath": "../mark-map/os.xmind", - "mdPath": "../mark-map/os-map.md" - }, - { - "name": "计算机组成原理", - "originXmindFileName": "计算机组成原理.xmind", - "targetXmindFileName": "cpp.xmind", - "xMindPath": "../mark-map/cpp.xmind", - "mdPath": "../mark-map/ccp-map.md" - }, - { - "name": "计算机网络", - "originXmindFileName": "计算机网络.xmind", - "targetXmindFileName": "cn.xmind", - "xMindPath": "../mark-map/cn.xmind", - "mdPath": "../mark-map/cn-map.md" - } -] diff --git a/docs/mark-map/mark-map.sidebar.ts b/docs/mark-map/mark-map.sidebar.ts deleted file mode 100644 index c7f2720..0000000 --- a/docs/mark-map/mark-map.sidebar.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * 思维导图 - */ -export const MarkMapSidebar = [ - { text: '📙 数据结构', link: 'ds-map.md' }, - { text: '📕 操作系统', link: 'os-map.md' }, - { text: '📘 计算机组成原理', link: 'ccp-map.md' }, - { text: '📗 计算机网络', link: 'cn-map.md' }, -] diff --git a/scripts/core/mark-map.ts b/scripts/core/mark-map.ts deleted file mode 100644 index 5862df5..0000000 --- a/scripts/core/mark-map.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { VipExecutor, VipNodeJS } from '@142vip/utils' - -const __dirname = VipNodeJS.getProcessCwd() - -const markMapSourcePath = VipNodeJS.pathJoin(__dirname, 'docs/mark-map') -const markMapTargetPath = VipNodeJS.pathJoin(__dirname, 'docs/.vuepress/public/mind-map') - -/** - * 扫描目录 - */ -function scanDirectory(directory: string, fileType: string): (string | null)[] { - const fileList = VipNodeJS.readdirSync(directory) - - return fileList - .map((file) => { - const filePath = VipNodeJS.pathJoin(directory, file) - const fileExtension = VipNodeJS.pathExtname(file).toLowerCase() - - if (fileExtension === `.${fileType.toLowerCase()}`) { - return filePath - } - return null - }) - // 过滤空 - .filter(c => c != null) -} - -/** - * 将思维导图的md格式转化为html,提供在线预览 - * 链接:https://www.npmjs.com/package/markmap-cli - */ - -async function markMapMain(): Promise { - /** - * 第一步: 清空站点思维导图文件存放目录 - */ - const delHtmlDir = `rm -rf ${VipNodeJS.pathJoin(markMapTargetPath, '*')}` - - /** - * 第二步: 将md文档转化为思维导图网页 - */ - const mdList = scanDirectory(markMapSourcePath, 'md') - const mdToHtmlCmdStr = mdList.map(md => `npx markmap --no-open ${md}`).join(' && ') - - /** - * 第三步: 根据文件类型将思维导图网页文件移动到站点指定目录 - */ - const mdHtmlByFileType = VipNodeJS.pathJoin(markMapSourcePath, '*.html') - const moveHtmlCmdStr = `mv -f ${mdHtmlByFileType} ${markMapTargetPath}` - - await VipExecutor.commandStandardExecutor([ - delHtmlDir, - mdToHtmlCmdStr, - moveHtmlCmdStr, - ]) - - // /** - // * 第四步: 对mind-map中的xmind文件重命名 - // */ - // console.log(markMapSourcePath, import.meta.url) - // const markMapData = createRequire(import.meta.url)('../../docs/mark-map/index.json') - // console.log(111, markMapData) - // for (const { originXmindFileName, targetXmindFileName } of markMapData) { - // const originPath = path.join(markMapTargetPath, originXmindFileName) - // const targetPath = path.join(markMapTargetPath, targetXmindFileName) - // - // // html文件 - // await fs.renameSync(originPath, targetPath) - // } -} - -void markMapMain() diff --git a/scripts/mark-map b/scripts/mark-map deleted file mode 100755 index 48a4f9a..0000000 --- a/scripts/mark-map +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -npx node --loader ts-node/esm --no-warnings scripts/core/mark-map.ts