Skip to content

Commit

Permalink
feat: 新增markdown转思维导图脚本,导航栏改版
Browse files Browse the repository at this point in the history
  • Loading branch information
chu fan committed Oct 8, 2023
1 parent 898b8ec commit 67cee8c
Show file tree
Hide file tree
Showing 14 changed files with 319 additions and 81 deletions.
21 changes: 20 additions & 1 deletion docs/.vuepress/config/navbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,27 @@ export const navbar = [
},
{
text: '思维导图',
link: "/manuscripts/note-map"
// link: "/manuscripts/mark-map",
children: [
{
text: '数据结构',
link: '/manuscripts/mark-map/ds-map.md'
},
{
text: '操作系统',
link: '/manuscripts/mark-map/os-map.md'
},
{
text: '计算机组成原理',
link: '/manuscripts/mark-map/ccp-map.md'
},
{
text: '计算机网络',
link: '/manuscripts/mark-map/cn-map.md'
}
]
},
// http://localhost:4200/mark-map/job-poster-bytedance.html
{
text: "网站",
children: [
Expand Down
3 changes: 1 addition & 2 deletions docs/.vuepress/config/sidebar.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {dsSidebar} from "../../manuscripts/ds/ds.sidebar";
import {cppSidebar} from "../../manuscripts/ccp/cpp.sidebar";
import {cnSidebar} from "../../manuscripts/cn/cn.sidebar";
import {noteMapSidebar} from "../../manuscripts/note-map/note-map.sidebar";
import {noteMapSidebar} from "../../manuscripts/mark-map/note-map.sidebar";
import {osSidebar} from "../../manuscripts/os/os.sidebar";

/**
Expand All @@ -12,5 +12,4 @@ export const sidebar = {
"/manuscripts/os": osSidebar,
"/manuscripts/ccp": cppSidebar,
"/manuscripts/cn": cnSidebar,
"/manuscripts/note-map": noteMapSidebar
}
2 changes: 2 additions & 0 deletions docs/.vuepress/config/theme.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ export default {
include: true,
// 容器
container: true,
// mermaid
mermaid: true,
},
components: {
// 插件选项
Expand Down
40 changes: 40 additions & 0 deletions docs/.vuepress/public/mark-map/ccp-map.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Markmap</title>
<style>
* {
margin: 0;
padding: 0;
}
#mindmap {
display: block;
width: 100vw;
height: 100vh;
}
</style>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/style.css">
</head>
<body>
<svg id="mindmap"></svg>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/d3.min.js"></script><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/browser/index.js"></script><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/index.js"></script><script>(r => {
setTimeout(r);
})(() => {
const {
markmap,
mm
} = window;
const toolbar = new markmap.Toolbar();
toolbar.attach(mm);
const el = toolbar.render();
el.setAttribute('style', 'position:absolute;bottom:20px;right:20px');
document.body.append(el);
})</script><script>((getMarkmap, getOptions, root, jsonOptions) => {
const markmap = getMarkmap();
window.mm = markmap.Markmap.create('svg#mindmap', (getOptions || markmap.deriveOptions)(jsonOptions), root);
})(() => window.markmap,null,{"type":"heading","depth":0,"payload":{"lines":[1,2]},"content":"计算机组成原理","children":[]},null)</script>
</body>
</html>
40 changes: 40 additions & 0 deletions docs/.vuepress/public/mark-map/cn-map.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Markmap</title>
<style>
* {
margin: 0;
padding: 0;
}
#mindmap {
display: block;
width: 100vw;
height: 100vh;
}
</style>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/style.css">
</head>
<body>
<svg id="mindmap"></svg>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/d3.min.js"></script><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/browser/index.js"></script><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/index.js"></script><script>(r => {
setTimeout(r);
})(() => {
const {
markmap,
mm
} = window;
const toolbar = new markmap.Toolbar();
toolbar.attach(mm);
const el = toolbar.render();
el.setAttribute('style', 'position:absolute;bottom:20px;right:20px');
document.body.append(el);
})</script><script>((getMarkmap, getOptions, root, jsonOptions) => {
const markmap = getMarkmap();
window.mm = markmap.Markmap.create('svg#mindmap', (getOptions || markmap.deriveOptions)(jsonOptions), root);
})(() => window.markmap,null,{"type":"heading","depth":0,"payload":{"lines":[1,2]},"content":"计算机网络","children":[]},null)</script>
</body>
</html>
40 changes: 40 additions & 0 deletions docs/.vuepress/public/mark-map/ds-map.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Markmap</title>
<style>
* {
margin: 0;
padding: 0;
}
#mindmap {
display: block;
width: 100vw;
height: 100vh;
}
</style>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/style.css">
</head>
<body>
<svg id="mindmap"></svg>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/d3.min.js"></script><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/browser/index.js"></script><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/index.js"></script><script>(r => {
setTimeout(r);
})(() => {
const {
markmap,
mm
} = window;
const toolbar = new markmap.Toolbar();
toolbar.attach(mm);
const el = toolbar.render();
el.setAttribute('style', 'position:absolute;bottom:20px;right:20px');
document.body.append(el);
})</script><script>((getMarkmap, getOptions, root, jsonOptions) => {
const markmap = getMarkmap();
window.mm = markmap.Markmap.create('svg#mindmap', (getOptions || markmap.deriveOptions)(jsonOptions), root);
})(() => window.markmap,null,{"type":"heading","depth":0,"payload":{"lines":[1,2]},"content":"数据结构","children":[]},null)</script>
</body>
</html>
40 changes: 40 additions & 0 deletions docs/.vuepress/public/mark-map/os-map.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Markmap</title>
<style>
* {
margin: 0;
padding: 0;
}
#mindmap {
display: block;
width: 100vw;
height: 100vh;
}
</style>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/style.css">
</head>
<body>
<svg id="mindmap"></svg>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/d3.min.js"></script><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/browser/index.js"></script><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/index.js"></script><script>(r => {
setTimeout(r);
})(() => {
const {
markmap,
mm
} = window;
const toolbar = new markmap.Toolbar();
toolbar.attach(mm);
const el = toolbar.render();
el.setAttribute('style', 'position:absolute;bottom:20px;right:20px');
document.body.append(el);
})</script><script>((getMarkmap, getOptions, root, jsonOptions) => {
const markmap = getMarkmap();
window.mm = markmap.Markmap.create('svg#mindmap', (getOptions || markmap.deriveOptions)(jsonOptions), root);
})(() => window.markmap,null,{"type":"heading","depth":0,"payload":{"lines":[1,2]},"content":"操作系统","children":[]},null)</script>
</body>
</html>
40 changes: 40 additions & 0 deletions docs/.vuepress/public/mark-map/readme.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Markmap</title>
<style>
* {
margin: 0;
padding: 0;
}
#mindmap {
display: block;
width: 100vw;
height: 100vh;
}
</style>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/style.css">
</head>
<body>
<svg id="mindmap"></svg>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/d3.min.js"></script><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/browser/index.js"></script><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/index.js"></script><script>(r => {
setTimeout(r);
})(() => {
const {
markmap,
mm
} = window;
const toolbar = new markmap.Toolbar();
toolbar.attach(mm);
const el = toolbar.render();
el.setAttribute('style', 'position:absolute;bottom:20px;right:20px');
document.body.append(el);
})</script><script>((getMarkmap, getOptions, root, jsonOptions) => {
const markmap = getMarkmap();
window.mm = markmap.Markmap.create('svg#mindmap', (getOptions || markmap.deriveOptions)(jsonOptions), root);
})(() => window.markmap,null,{"type":"heading","depth":0,"payload":{"lines":[1,2]},"content":"思维导图","children":[{"type":"list_item","depth":1,"payload":{"lines":[4,5]},"content":"<a href=\"../../mark-map/ds-map.html\" target=\"_blank\">数据结构</a>","children":[]},{"type":"list_item","depth":1,"payload":{"lines":[5,6]},"content":"<a href=\"../../mark-map/os-map.html\" target=\"_blank\">操作系统</a>","children":[]},{"type":"list_item","depth":1,"payload":{"lines":[6,7]},"content":"<a href=\"../../mark-map/ccp-map.html\" target=\"_blank\">计算机组成原理</a>","children":[]},{"type":"list_item","depth":1,"payload":{"lines":[7,8]},"content":"<a href=\"../../mark-map/cn-map.html\" target=\"_blank\">计算机网络</a>","children":[]}]},null)</script>
</body>
</html>
6 changes: 0 additions & 6 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
---
icon: clock
---


# 变更记录

该文件包含 `408CSFamily` 仓库和网站所有显着更改。

<!-- more -->

<!-- @include: ../CHANGELOG.md#recent-alpha -->

Expand Down
18 changes: 9 additions & 9 deletions docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ features:
details: 官方插件的基础上,抽象、封装出适合自己功能的plus插件,能够快速集成、使用在新的项目中。
- title: 反复反复
details: 通过以项目Demo示例的方式,对框架常用的功能进行Code编写和整理,提供有效且易用的代码封装。
- title: 王道论坛
details: 全平台都可以关注。
link: https://github.com/zpfz/vuepress-theme-antdocs
- title: 研招网
link: https://github.com/zpfz/vuepress-theme-antdocs
details: 考研最新消息。
- title: 开源共享
link: https://github.com/zpfz/vuepress-theme-antdocs
details: 通过以项目Demo示例的方式,对框架常用的功能进行Code编写和整理,提供有效且易用的代码封装。
# - title: 王道论坛
# details: 全平台都可以关注。
# link: https://github.com/zpfz/vuepress-theme-antdocs
# - title: 研招网
# link: https://github.com/zpfz/vuepress-theme-antdocs
# details: 考研最新消息。
# - title: 开源共享
# link: https://github.com/zpfz/vuepress-theme-antdocs
# details: 通过以项目Demo示例的方式,对框架常用的功能进行Code编写和整理,提供有效且易用的代码封装。
---


Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,19 @@
"url": "https://github.com/142vip"
},
"scripts": {
"preinstall": "chmod +x ./scripts/*",
"prepare": "rm -f .husky/pre-commit && husky install && npx husky add .husky/pre-commit \"./scripts/lint --fix\" && chmod +x .husky/pre-commit",
"dev": "vuepress dev docs",
"build": "./scripts/bundle build",
"build": "./scripts/bundle build && npm run build:mark-map",
"build:mark-map": "./scripts/mark-map",
"build:proxy": "./scripts/bundle build_proxy",
"deploy:vercel": "vercel --prod",
"clean": "find . -name \"node_modules\" -type d -exec rm -rf '{}' + "
},
"scripts-info": {
"preinstall": "在安装依赖前分配脚本权限",
"prepare": "安装依赖预执行脚本",
"build:mark-map": "./scripts/mark-map",
"dev": "本地启动项目",
"clean": "快速删除本地依赖"
},
Expand Down
53 changes: 26 additions & 27 deletions scripts/.exec
Original file line number Diff line number Diff line change
Expand Up @@ -5,54 +5,53 @@
const {join} = require('path')
const cwd = join(__dirname, '..')
process.env.PATH = `${join(cwd, 'node_modules', '.bin')}:${process.env.PATH}`
const {exec,exit} = require('shelljs');
const {exec, exit} = require('shelljs');

/**
* 监听进程
* - 退出进程
*/
process.on('exit', () => {
exit()
exit()
})

/**
* 执行shell指令
* @param commands
*/
exports.execShell = async commands => {
let runCommands=[]
if(typeof commands ==='string'){
runCommands.push(commands)
}
let runCommands = []
if (typeof commands === 'string') {
runCommands.push(commands)
}

// 批量执行
if(Array.isArray(commands)){
runCommands=commands
}
// 批量执行
if (Array.isArray(commands)) {
runCommands = commands
}

for (let index=0;index<runCommands.length;index++) {
const command=runCommands[index]
const count=index+1
console.log(`>>>command(${count}):\n${command} \n<<<command(${count})--start === \n`)
// await syncExec(command)
const execResult=await exec(command)
for (let index = 0; index < runCommands.length; index++) {
const command = runCommands[index]
const count = index + 1
console.log(`>>>command(${count}):\n${command} \n<<<command(${count})--start === \n`)
// await syncExec(command)
const execResult = await exec(command)

console.log(`\n<<<command(${count})--ending === `)
// 指令异常,不执行后续指令
if(execResult.code!==0){
break;
}
console.log(`\n<<<command(${count})--ending === `)
// 指令异常,不执行后续指令
if (execResult.code !== 0) {
break;
}
}
}

/**
* 脚本基础设置
*/
exports.BaseSetting={
successLogger:"\033[36m",
errorLogger:"\033[1;31m",
warnLogger:"\033[1;33m",
exports.BaseSetting = {
successLogger: "\033[36m",
errorLogger: "\033[1;31m",
warnLogger: "\033[1;33m",
// 定义时间
currentTime:'$(date "+%Y-%m-%d %H:%M:%S")'
currentTime: '$(date "+%Y-%m-%d %H:%M:%S")'
}

Loading

0 comments on commit 67cee8c

Please sign in to comment.