@tnotesjs/core 0.1.28 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/{chunk-4KG6RXFS.js → chunk-5QN44ES5.js} +2946 -1533
- package/dist/{chunk-AGSL3VZE.js → chunk-5Y5IYS6C.js} +7 -0
- package/dist/cli/index.js +343 -40
- package/dist/index.js +1 -1
- package/dist/vitepress/config/index.js +573 -65
- package/package.json +4 -1
- package/templates/sub-repo/.gitattributes +30 -0
- package/templates/sub-repo/.github/workflows/deploy.yml +87 -0
- package/templates/sub-repo/.vitepress/config.mts +12 -0
- package/templates/sub-repo/.vitepress/env.d.ts +10 -0
- package/templates/sub-repo/.vitepress/theme/index.ts +12 -0
- package/templates/sub-repo/.vscode/settings.json +330 -0
- package/templates/sub-repo/.vscode/tnotes.code-snippets +110 -0
- package/templates/sub-repo/public/favicon.ico +0 -0
- package/templates/sub-repo/public/logo.png +0 -0
- package/templates/sub-repo/tsconfig.json +45 -0
- package/vitepress/assets/icons/icon__setting_dark.svg +4 -0
- package/vitepress/assets/icons/icon__setting_light.svg +4 -0
- package/vitepress/assets/icons/index.ts +2 -2
- package/vitepress/client/localSearchIndexBridge.ts +24 -0
- package/vitepress/components/Discussions/Discussions.vue +1 -1
- package/vitepress/components/Footprints/Footprints.vue +90 -25
- package/vitepress/components/Layout/CustomSidebar.vue +489 -117
- package/vitepress/components/Layout/Layout.vue +5 -0
- package/vitepress/components/Layout/NavBarSettingsTrigger.vue +10 -2
- package/vitepress/components/Layout/SidebarItems.vue +517 -342
- package/vitepress/components/Layout/SidebarNavBefore.vue +1 -50
- package/vitepress/components/Layout/SidebarResizeHandle.vue +6 -23
- package/vitepress/components/Layout/composables/docLayoutLogic.ts +59 -0
- package/vitepress/components/Layout/composables/useDocLayout.test.ts +69 -0
- package/vitepress/components/Layout/composables/useDocLayout.ts +128 -0
- package/vitepress/components/Layout/composables/useSidebarDrag.ts +514 -0
- package/vitepress/components/Layout/composables/useSidebarLayout.ts +25 -8
- package/vitepress/components/Layout/composables/useVSCodeIntegration.ts +8 -3
- package/vitepress/components/Layout/sidebarCollapsedState.test.ts +183 -0
- package/vitepress/components/Layout/sidebarCollapsedState.ts +241 -0
- package/vitepress/components/Layout/sidebarDragLogic.test.ts +1146 -0
- package/vitepress/components/Layout/sidebarDragLogic.ts +1307 -0
- package/vitepress/components/Layout/sidebarHitTest.test.ts +572 -0
- package/vitepress/components/Layout/sidebarHitTest.ts +801 -0
- package/vitepress/components/Layout/sidebarItemRenderLogic.test.ts +53 -0
- package/vitepress/components/Layout/sidebarItemRenderLogic.ts +50 -0
- package/vitepress/components/MarkMap/MarkMap.vue +67 -10
- package/vitepress/components/Settings/Settings.vue +78 -74
- package/vitepress/components/SidebarCard/FolderTreeItems.vue +268 -0
- package/vitepress/components/SidebarCard/SidebarCard.vue +125 -274
- package/vitepress/components/constants.ts +18 -6
- package/vitepress/components/sidebar.data.ts +13 -11
- package/vitepress/components/sidebarTreeHelpers.test.ts +142 -0
- package/vitepress/components/sidebarTreeHelpers.ts +168 -0
- package/vitepress/components/utils/vscodePaths.test.ts +41 -0
- package/vitepress/components/utils/vscodePaths.ts +52 -0
- package/vitepress/config/index.ts +2 -0
- package/vitepress/plugins/localSearchIndexBuilder.ts +209 -0
- package/vitepress/plugins/localSearchReindex.test.ts +46 -0
- package/vitepress/plugins/localSearchReindexLogic.ts +50 -0
- package/vitepress/plugins/localSearchReindexPatch.test.ts +30 -0
- package/vitepress/plugins/localSearchReindexPatch.ts +37 -0
- package/vitepress/plugins/localSearchReindexPlugin.ts +318 -0
- package/vitepress/plugins/sidebarStructurePlugin.ts +209 -63
- package/vitepress/theme/index.ts +8 -0
- package/vitepress/theme/styles/base.scss +0 -8
- package/vitepress/theme/styles/components/markmap.scss +23 -2
- package/vitepress/theme/styles/components/swiper.scss +1 -1
- package/vitepress/theme/styles/doc-layout.scss +212 -0
- package/vitepress/theme/styles/index.scss +3 -0
- package/vitepress/theme/styles/layout.scss +60 -10
- package/vitepress/assets/icons/icon__mindmap.svg +0 -1
- package/vitepress/assets/icons/icon__setting.svg +0 -1
- package/vitepress/components/SidebarCard/MindMapView.vue +0 -488
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tnotesjs/core",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "TNotes 知识库核心框架 —— 基于 VitePress 的笔记管理系统",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@10.17.1",
|
|
@@ -24,11 +24,13 @@
|
|
|
24
24
|
"files": [
|
|
25
25
|
"config/defaultConfig.ts",
|
|
26
26
|
"dist/",
|
|
27
|
+
"templates/",
|
|
27
28
|
"vitepress/",
|
|
28
29
|
"types/"
|
|
29
30
|
],
|
|
30
31
|
"scripts": {
|
|
31
32
|
"build": "tsup",
|
|
33
|
+
"prepublishOnly": "pnpm build",
|
|
32
34
|
"build:check": "tsc --noEmit -p tsconfig.build.json",
|
|
33
35
|
"typecheck": "vue-tsc --noEmit -p tsconfig.build.json",
|
|
34
36
|
"dev": "tsup --watch",
|
|
@@ -52,6 +54,7 @@
|
|
|
52
54
|
"markdown-it-mathjax3": "^4.3.2",
|
|
53
55
|
"markdown-it-task-lists": "^2.1.1",
|
|
54
56
|
"marked": "^15.0.11",
|
|
57
|
+
"minisearch": "^7.2.0",
|
|
55
58
|
"markmap-lib": "^0.18.12",
|
|
56
59
|
"markmap-toolbar": "^0.18.12",
|
|
57
60
|
"markmap-view": "^0.18.12",
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# 自动检测文本文件并进行行尾符规范化
|
|
2
|
+
* text=auto
|
|
3
|
+
|
|
4
|
+
# Markdown 文件统一使用 LF
|
|
5
|
+
*.md text eol=lf
|
|
6
|
+
|
|
7
|
+
# 源代码文件统一使用 LF
|
|
8
|
+
*.ts text eol=lf
|
|
9
|
+
*.js text eol=lf
|
|
10
|
+
*.tsx text eol=lf
|
|
11
|
+
*.jsx text eol=lf
|
|
12
|
+
*.vue text eol=lf
|
|
13
|
+
*.css text eol=lf
|
|
14
|
+
*.scss text eol=lf
|
|
15
|
+
*.json text eol=lf
|
|
16
|
+
*.yml text eol=lf
|
|
17
|
+
*.yaml text eol=lf
|
|
18
|
+
|
|
19
|
+
# 配置文件统一使用 LF
|
|
20
|
+
.gitignore text eol=lf
|
|
21
|
+
.gitattributes text eol=lf
|
|
22
|
+
|
|
23
|
+
# 二进制文件不进行行尾符转换
|
|
24
|
+
*.png binary
|
|
25
|
+
*.jpg binary
|
|
26
|
+
*.jpeg binary
|
|
27
|
+
*.gif binary
|
|
28
|
+
*.ico binary
|
|
29
|
+
*.pdf binary
|
|
30
|
+
*.zip binary
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# doc => https://vitepress.dev/zh/guide/deploy
|
|
2
|
+
# 构建 VitePress 站点并将其部署到 GitHub Pages 的示例工作流程
|
|
3
|
+
name: Deploy VitePress site to Pages
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
# 在针对 `main` 分支的推送上运行。如果你
|
|
7
|
+
# 使用 `master` 分支作为默认分支,请将其更改为 `master`
|
|
8
|
+
push:
|
|
9
|
+
branches: [main]
|
|
10
|
+
|
|
11
|
+
# 允许你从 Actions 选项卡手动运行此工作流程
|
|
12
|
+
workflow_dispatch:
|
|
13
|
+
|
|
14
|
+
schedule:
|
|
15
|
+
- cron: '0 0 1 * *' # 每月 1 号 UTC 00:00 自动触发 deploy
|
|
16
|
+
# 设置 GITHUB_TOKEN 的权限,以允许部署到 GitHub Pages
|
|
17
|
+
permissions:
|
|
18
|
+
contents: read
|
|
19
|
+
pages: write
|
|
20
|
+
id-token: write
|
|
21
|
+
|
|
22
|
+
# 只允许同时进行一次部署,跳过正在运行和最新队列之间的运行队列
|
|
23
|
+
# 但是,不要取消正在进行的运行,因为我们希望允许这些生产部署完成
|
|
24
|
+
concurrency:
|
|
25
|
+
group: pages
|
|
26
|
+
cancel-in-progress: false
|
|
27
|
+
|
|
28
|
+
jobs:
|
|
29
|
+
# 构建工作
|
|
30
|
+
build:
|
|
31
|
+
runs-on: ubuntu-latest
|
|
32
|
+
steps:
|
|
33
|
+
- name: Checkout
|
|
34
|
+
uses: actions/checkout@v4
|
|
35
|
+
with:
|
|
36
|
+
fetch-depth: 0 # 如果未启用 lastUpdated,则不需要
|
|
37
|
+
submodules: true
|
|
38
|
+
- uses: pnpm/action-setup@v3 # 如果使用 pnpm,请取消此区域注释
|
|
39
|
+
with:
|
|
40
|
+
version: 10
|
|
41
|
+
# - uses: oven-sh/setup-bun@v1 # 如果使用 Bun,请取消注释
|
|
42
|
+
- name: Setup Node
|
|
43
|
+
uses: actions/setup-node@v4
|
|
44
|
+
with:
|
|
45
|
+
node-version: 20
|
|
46
|
+
cache: pnpm # npm 或 pnpm / yarn
|
|
47
|
+
- name: Setup Pages
|
|
48
|
+
uses: actions/configure-pages@v4
|
|
49
|
+
- name: Install dependencies
|
|
50
|
+
run: pnpm install # npm ci 或 pnpm install / yarn install / bun install
|
|
51
|
+
- name: Gen Toc
|
|
52
|
+
run: pnpm tn:update
|
|
53
|
+
- name: Build with VitePress
|
|
54
|
+
env:
|
|
55
|
+
NODE_OPTIONS: --max-old-space-size=8192
|
|
56
|
+
run: pnpm tn:build
|
|
57
|
+
- name: Upload artifact
|
|
58
|
+
uses: actions/upload-pages-artifact@v3
|
|
59
|
+
with:
|
|
60
|
+
path: .vitepress/dist
|
|
61
|
+
|
|
62
|
+
# 部署工作
|
|
63
|
+
deploy:
|
|
64
|
+
environment:
|
|
65
|
+
name: github-pages
|
|
66
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
67
|
+
needs: build
|
|
68
|
+
runs-on: ubuntu-latest
|
|
69
|
+
name: Deploy
|
|
70
|
+
steps:
|
|
71
|
+
- name: Deploy to GitHub Pages
|
|
72
|
+
id: deployment
|
|
73
|
+
uses: actions/deploy-pages@v4
|
|
74
|
+
|
|
75
|
+
# 通知根仓库收集元数据
|
|
76
|
+
notify:
|
|
77
|
+
needs: deploy
|
|
78
|
+
runs-on: ubuntu-latest
|
|
79
|
+
name: Notify TNotes
|
|
80
|
+
steps:
|
|
81
|
+
- name: Trigger root repo collect
|
|
82
|
+
run: |
|
|
83
|
+
curl -s -X POST \
|
|
84
|
+
-H "Accept: application/vnd.github.v3+json" \
|
|
85
|
+
-H "Authorization: token ${{ secrets.TNOTES_DISPATCH_TOKEN }}" \
|
|
86
|
+
https://api.github.com/repos/tnotesjs/TNotes/dispatches \
|
|
87
|
+
-d '{"event_type":"sub_repo_updated","client_payload":{"repo":"${{ github.event.repository.name }}"}}'
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* .vitepress/config.mts
|
|
3
|
+
*
|
|
4
|
+
* VitePress 站点配置文件 - 连接层
|
|
5
|
+
*
|
|
6
|
+
* 所有配置逻辑封装在 @tnotesjs/core 中,此文件仅作为 VitePress 入口。
|
|
7
|
+
*
|
|
8
|
+
* !注意:主题入口文件模块的位置是 VitePress 规定的,不能更改位置!
|
|
9
|
+
*/
|
|
10
|
+
import { defineNotesConfig } from '@tnotesjs/core/vitepress/config'
|
|
11
|
+
|
|
12
|
+
export default defineNotesConfig()
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
2
|
+
/// <reference types="vue/macros-global" />
|
|
3
|
+
/// <reference types="vitepress/client" />
|
|
4
|
+
|
|
5
|
+
declare module '*.vue' {
|
|
6
|
+
import type { DefineComponent } from 'vue'
|
|
7
|
+
|
|
8
|
+
const component: DefineComponent<{}, {}, any>
|
|
9
|
+
export default component
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* .vitepress/theme/index.ts
|
|
3
|
+
*
|
|
4
|
+
* 主题入口文件模块 - 连接层
|
|
5
|
+
*
|
|
6
|
+
* 所有主题逻辑封装在 @tnotesjs/core 中,此文件仅作为 VitePress 入口。
|
|
7
|
+
*
|
|
8
|
+
* !注意:主题入口文件模块的位置是 VitePress 规定的,不能更改位置!
|
|
9
|
+
*/
|
|
10
|
+
import { defineNotesTheme } from '@tnotesjs/core/vitepress/theme'
|
|
11
|
+
|
|
12
|
+
export default defineNotesTheme()
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
{
|
|
2
|
+
// -------------------------------------------
|
|
3
|
+
// #region - TNotes 所使用的 VSCode 内置配置
|
|
4
|
+
// -------------------------------------------
|
|
5
|
+
|
|
6
|
+
// #region - Workbench(工作台相关配置)
|
|
7
|
+
// 控制列表和树是否具有平滑滚动效果。
|
|
8
|
+
"workbench.list.smoothScrolling": false,
|
|
9
|
+
// 控制树形视图的缩进像素值
|
|
10
|
+
"workbench.tree.indent": 20,
|
|
11
|
+
// 高亮显示已修改但未保存的标签页
|
|
12
|
+
"workbench.editor.highlightModifiedTabs": true,
|
|
13
|
+
// 当文件被删除时自动关闭对应的编辑器
|
|
14
|
+
"workbench.editor.closeOnFileDelete": true,
|
|
15
|
+
// 启用打开编辑器数量限制
|
|
16
|
+
"workbench.editor.limit.enabled": true,
|
|
17
|
+
// 每个编辑器组单独限制打开的编辑器数量
|
|
18
|
+
"workbench.editor.limit.perEditorGroup": true,
|
|
19
|
+
// "workbench.editor.limit.value": 5,
|
|
20
|
+
// 设置文件图标主题
|
|
21
|
+
"workbench.iconTheme": "vscode-icons",
|
|
22
|
+
// 启动时不打开任何编辑器
|
|
23
|
+
"workbench.startupEditor": "none",
|
|
24
|
+
// 隐藏空编辑器的提示信息
|
|
25
|
+
"workbench.editor.empty.hint": "hidden",
|
|
26
|
+
// 将固定的标签页显示在单独的行上
|
|
27
|
+
"workbench.editor.pinnedTabsOnSeparateRow": true,
|
|
28
|
+
// 配置特定文件类型的默认编辑器
|
|
29
|
+
"workbench.editorAssociations": {
|
|
30
|
+
"*.copilotmd": "vscode.markdown.preview.editor",
|
|
31
|
+
"*.svg": "default"
|
|
32
|
+
},
|
|
33
|
+
// 当标签页过多时自动换行显示
|
|
34
|
+
"workbench.editor.wrapTabs": true,
|
|
35
|
+
// 将面板默认显示在右侧
|
|
36
|
+
"workbench.panel.defaultLocation": "right",
|
|
37
|
+
|
|
38
|
+
// #endregion
|
|
39
|
+
|
|
40
|
+
// #region - Editor(编辑器相关配置)
|
|
41
|
+
|
|
42
|
+
// 启用代码镜头功能,显示引用、实现等信息
|
|
43
|
+
"editor.codeLens": true,
|
|
44
|
+
// 在输入触发字符时显示建议
|
|
45
|
+
"editor.suggestOnTriggerCharacters": true,
|
|
46
|
+
// 配置快速建议的触发时机
|
|
47
|
+
"editor.quickSuggestions": {
|
|
48
|
+
"other": "on",
|
|
49
|
+
"comments": "off",
|
|
50
|
+
"strings": "off"
|
|
51
|
+
},
|
|
52
|
+
// 设置编辑器字体大小
|
|
53
|
+
"editor.fontSize": 14,
|
|
54
|
+
// 设置小地图中章节标题的字体大小
|
|
55
|
+
"editor.minimap.sectionHeaderFontSize": 10,
|
|
56
|
+
// 设置制表符对应的空格数
|
|
57
|
+
"editor.tabSize": 2,
|
|
58
|
+
// 设置编辑器字体系列
|
|
59
|
+
"editor.fontFamily": "'Consolas', 'Fira Code', 'Menlo'",
|
|
60
|
+
// 禁用自动检测文件缩进方式
|
|
61
|
+
"editor.detectIndentation": false,
|
|
62
|
+
// 设置光标闪烁动画为扩展式
|
|
63
|
+
"editor.cursorBlinking": "expand",
|
|
64
|
+
// 禁用大文件优化,确保完整功能
|
|
65
|
+
"editor.largeFileOptimizations": false,
|
|
66
|
+
// 关闭辅助功能支持
|
|
67
|
+
"editor.accessibilitySupport": "off",
|
|
68
|
+
// 启用光标平滑移动动画
|
|
69
|
+
"editor.cursorSmoothCaretAnimation": "on",
|
|
70
|
+
// 仅在活动括号对处显示括号对指南
|
|
71
|
+
"editor.guides.bracketPairs": "active",
|
|
72
|
+
// 启用内联建议功能
|
|
73
|
+
"editor.inlineSuggest.enabled": true,
|
|
74
|
+
// 根据前缀最近使用的项目选择建议
|
|
75
|
+
"editor.suggestSelection": "recentlyUsedByPrefix",
|
|
76
|
+
// 智能模式下按回车键接受建议
|
|
77
|
+
"editor.acceptSuggestionOnEnter": "smart",
|
|
78
|
+
// 允许代码片段与快速建议同时显示
|
|
79
|
+
"editor.suggest.snippetsPreventQuickSuggestions": false,
|
|
80
|
+
// 启用粘性滚动,保持函数或类定义可见
|
|
81
|
+
"editor.stickyScroll.enabled": true,
|
|
82
|
+
// 悬停提示保持粘性,鼠标移开后不立即消失
|
|
83
|
+
"editor.hover.sticky": true,
|
|
84
|
+
// 建议插入模式为替换而非插入
|
|
85
|
+
"editor.suggest.insertMode": "replace",
|
|
86
|
+
// 启用括号对颜色匹配
|
|
87
|
+
"editor.bracketPairColorization.enabled": true,
|
|
88
|
+
// 仅在空白字符前自动闭合括号
|
|
89
|
+
"editor.autoClosingBrackets": "beforeWhitespace",
|
|
90
|
+
// 删除时始终自动删除配对的括号或引号
|
|
91
|
+
"editor.autoClosingDelete": "always",
|
|
92
|
+
// 输入时始终自动覆盖配对的括号或引号
|
|
93
|
+
"editor.autoClosingOvertype": "always",
|
|
94
|
+
// 仅在空白字符前自动闭合引号
|
|
95
|
+
"editor.autoClosingQuotes": "beforeWhitespace",
|
|
96
|
+
// 定义单词分隔符,用于双击选择等操作
|
|
97
|
+
"editor.wordSeparators": "`~!@#%^&*()=+[{]}\\|;:'\",.<>/?",
|
|
98
|
+
// 配置保存时执行的代码操作
|
|
99
|
+
"editor.codeActionsOnSave": {
|
|
100
|
+
"source.fixAll.eslint": "explicit",
|
|
101
|
+
"source.fixAll.stylelint": "explicit",
|
|
102
|
+
"source.organizeImports": "never"
|
|
103
|
+
},
|
|
104
|
+
// 设置默认代码格式化工具为 Prettier
|
|
105
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
106
|
+
// 保存文件时自动格式化
|
|
107
|
+
"editor.formatOnSave": true,
|
|
108
|
+
// 输入时自动格式化
|
|
109
|
+
"editor.formatOnType": true,
|
|
110
|
+
// 小地图中不渲染实际字符,使用色块代替
|
|
111
|
+
"editor.minimap.renderCharacters": false,
|
|
112
|
+
// 小地图滑块始终显示
|
|
113
|
+
"editor.minimap.showSlider": "always",
|
|
114
|
+
|
|
115
|
+
// HTML 文件的编辑器配置
|
|
116
|
+
"[html]": {
|
|
117
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
118
|
+
"prettier.htmlWhitespaceSensitivity": "ignore"
|
|
119
|
+
},
|
|
120
|
+
// CSS 文件的编辑器配置
|
|
121
|
+
"[css]": {
|
|
122
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
123
|
+
},
|
|
124
|
+
// SCSS 文件的编辑器配置
|
|
125
|
+
"[scss]": {
|
|
126
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
127
|
+
},
|
|
128
|
+
// JavaScript 文件的编辑器配置
|
|
129
|
+
"[javascript]": {
|
|
130
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
131
|
+
},
|
|
132
|
+
// TypeScript 文件的编辑器配置
|
|
133
|
+
"[typescript]": {
|
|
134
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
135
|
+
},
|
|
136
|
+
// JSON 文件的编辑器配置
|
|
137
|
+
"[json]": {
|
|
138
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
139
|
+
},
|
|
140
|
+
// Markdown 文件的编辑器配置
|
|
141
|
+
"[markdown]": {
|
|
142
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
143
|
+
"prettier.proseWrap": "never"
|
|
144
|
+
},
|
|
145
|
+
// JSONC 文件的编辑器配置
|
|
146
|
+
"[jsonc]": {
|
|
147
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
148
|
+
},
|
|
149
|
+
// Vue 文件的编辑器配置
|
|
150
|
+
"[vue]": {
|
|
151
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
152
|
+
},
|
|
153
|
+
// SVG 文件的编辑器配置
|
|
154
|
+
"[svg]": {
|
|
155
|
+
"editor.defaultFormatter": "jock.svg",
|
|
156
|
+
"editor.formatOnSave": false
|
|
157
|
+
},
|
|
158
|
+
|
|
159
|
+
// #endregion
|
|
160
|
+
|
|
161
|
+
// #region - Extensions(扩展相关配置)
|
|
162
|
+
|
|
163
|
+
// 忽略扩展推荐提示
|
|
164
|
+
"extensions.ignoreRecommendations": true,
|
|
165
|
+
|
|
166
|
+
// #endregion - Extensions(扩展相关配置)
|
|
167
|
+
|
|
168
|
+
// #region - Terminal(终端相关配置)
|
|
169
|
+
|
|
170
|
+
// 启用终端光标闪烁
|
|
171
|
+
"terminal.integrated.cursorBlinking": true,
|
|
172
|
+
// "editor.mouseWheelZoom": true,
|
|
173
|
+
// 禁用持久会话恢复进程
|
|
174
|
+
"terminal.integrated.persistentSessionReviveProcess": "never",
|
|
175
|
+
// 启用终端标签页功能
|
|
176
|
+
"terminal.integrated.tabs.enabled": true,
|
|
177
|
+
// 设置终端滚动缓冲区行数
|
|
178
|
+
"terminal.integrated.scrollback": 10000,
|
|
179
|
+
// 启用终端粘性滚动
|
|
180
|
+
"terminal.integrated.stickyScroll.enabled": true,
|
|
181
|
+
// 启用终端平滑滚动
|
|
182
|
+
"terminal.integrated.smoothScrolling": true,
|
|
183
|
+
// 设置终端字体大小
|
|
184
|
+
"terminal.integrated.fontSize": 14,
|
|
185
|
+
// "terminal.integrated.cursorStyle": "underline",
|
|
186
|
+
|
|
187
|
+
// #endregion - Terminal(终端相关配置)
|
|
188
|
+
|
|
189
|
+
// #region - Files(文件相关配置)
|
|
190
|
+
|
|
191
|
+
// 禁用文件参与者超时限制
|
|
192
|
+
"files.participants.timeout": 0,
|
|
193
|
+
// 设置文件行尾符为 LF
|
|
194
|
+
"files.eol": "\n",
|
|
195
|
+
// 保存文件时在末尾插入空行
|
|
196
|
+
"files.insertFinalNewline": true,
|
|
197
|
+
// 启用简单对话框模式
|
|
198
|
+
"files.simpleDialog.enable": true,
|
|
199
|
+
// 配置文件类型关联
|
|
200
|
+
"files.associations": {
|
|
201
|
+
"*.ejs": "html",
|
|
202
|
+
"*.art": "html",
|
|
203
|
+
"**/tsconfig.json": "jsonc",
|
|
204
|
+
".vscode/settings.json": "jsonc",
|
|
205
|
+
"*.json": "jsonc",
|
|
206
|
+
"package.json": "json",
|
|
207
|
+
"*.md": "markdown"
|
|
208
|
+
},
|
|
209
|
+
|
|
210
|
+
// 配置在资源管理器中隐藏的文件和文件夹
|
|
211
|
+
"files.exclude": {
|
|
212
|
+
"**/.eslintcache": true,
|
|
213
|
+
"**/bower_components": true,
|
|
214
|
+
"**/.turbo": true,
|
|
215
|
+
"**/.idea": true,
|
|
216
|
+
"**/tmp": true,
|
|
217
|
+
"**/.git": true,
|
|
218
|
+
"**/.svn": true,
|
|
219
|
+
"**/.hg": true,
|
|
220
|
+
"**/CVS": true,
|
|
221
|
+
"**/.stylelintcache": true,
|
|
222
|
+
"**/.DS_Store": true,
|
|
223
|
+
"**/vite.config.mts.*": true,
|
|
224
|
+
"**/tea.yaml": true
|
|
225
|
+
},
|
|
226
|
+
// 配置文件监视器排除的文件和文件夹
|
|
227
|
+
"files.watcherExclude": {
|
|
228
|
+
"**/.git/objects/**": true,
|
|
229
|
+
"**/.git/subtree-cache/**": true,
|
|
230
|
+
"**/.vscode/**": true,
|
|
231
|
+
"**/node_modules/**": true,
|
|
232
|
+
"**/tmp/**": true,
|
|
233
|
+
"**/bower_components/**": true,
|
|
234
|
+
"**/dist/**": true,
|
|
235
|
+
"**/yarn.lock": true
|
|
236
|
+
},
|
|
237
|
+
|
|
238
|
+
// #endregion - Files(文件相关配置)
|
|
239
|
+
|
|
240
|
+
// #region - Search(搜索相关配置)
|
|
241
|
+
|
|
242
|
+
// 搜索编辑器中单击结果时预览定义
|
|
243
|
+
"search.searchEditor.singleClickBehaviour": "peekDefinition",
|
|
244
|
+
// 搜索时不跟踪符号链接
|
|
245
|
+
"search.followSymlinks": false,
|
|
246
|
+
|
|
247
|
+
// 在使用搜索功能时,将这些文件夹/文件排除在外
|
|
248
|
+
"search.exclude": {
|
|
249
|
+
"**/node_modules": true,
|
|
250
|
+
"**/.git": true,
|
|
251
|
+
"**/.gitignore": true,
|
|
252
|
+
"**/.DS_Store": true,
|
|
253
|
+
"**/.vitepress/cache": true,
|
|
254
|
+
"out": true,
|
|
255
|
+
"dist": true,
|
|
256
|
+
"node_modules": true
|
|
257
|
+
},
|
|
258
|
+
|
|
259
|
+
// #endregion - Search(搜索相关配置)
|
|
260
|
+
|
|
261
|
+
// #region - Explorer(资源管理器相关配置)
|
|
262
|
+
|
|
263
|
+
// 删除文件时显示确认对话框
|
|
264
|
+
"explorer.confirmDelete": true,
|
|
265
|
+
// 拖放文件时显示确认对话框
|
|
266
|
+
"explorer.confirmDragAndDrop": true,
|
|
267
|
+
|
|
268
|
+
// 控制相关文件嵌套展示
|
|
269
|
+
"explorer.fileNesting.enabled": true,
|
|
270
|
+
// 默认不展开嵌套的文件
|
|
271
|
+
"explorer.fileNesting.expand": false,
|
|
272
|
+
// 配置文件嵌套规则
|
|
273
|
+
"explorer.fileNesting.patterns": {
|
|
274
|
+
"*.ts": "$(capture).test.ts, $(capture).test.tsx, $(capture).spec.ts, $(capture).spec.tsx, $(capture).d.ts",
|
|
275
|
+
"*.tsx": "$(capture).test.ts, $(capture).test.tsx, $(capture).spec.ts, $(capture).spec.tsx,$(capture).d.ts",
|
|
276
|
+
"*.vue": "$(capture).module.scss",
|
|
277
|
+
"*.env": "$(capture).env.*",
|
|
278
|
+
"README.md": "README*,CHANGELOG*,LICENSE,CNAME",
|
|
279
|
+
"package.json": ".gitignore,package-lock.json,.gitattributes,tsconfig.json,pnpm-lock.yaml,.vitepress-pid",
|
|
280
|
+
"eslint.config.mjs": ".eslintignore,.prettierignore,.stylelintignore,.commitlintrc.*,.prettierrc.*,stylelint.config.*,.lintstagedrc.mjs,cspell.json",
|
|
281
|
+
"tailwind.config.mjs": "postcss.*",
|
|
282
|
+
".tnotes.json": "Settings.md,sidebar.json,TOC.md,Words.md,References.md,Introduction.md,index.md,Loading.md"
|
|
283
|
+
},
|
|
284
|
+
|
|
285
|
+
// #endregion - Explorer(资源管理器相关配置)
|
|
286
|
+
|
|
287
|
+
// #region - breadcrumbs(面包屑导航)
|
|
288
|
+
|
|
289
|
+
// 面包屑导航中仅显示最后一个符号
|
|
290
|
+
"breadcrumbs.symbolPath": "last",
|
|
291
|
+
|
|
292
|
+
// #endregion - breadcrumbs(面包屑导航)
|
|
293
|
+
|
|
294
|
+
// #region - markdown
|
|
295
|
+
// Markdown 语法检查配置
|
|
296
|
+
"markdownlint.config": {
|
|
297
|
+
"no-bare-urls": false,
|
|
298
|
+
"no-inline-html": false,
|
|
299
|
+
"MD007": false,
|
|
300
|
+
"MD022": false,
|
|
301
|
+
"MD029": false,
|
|
302
|
+
"MD031": false,
|
|
303
|
+
"MD032": false,
|
|
304
|
+
"MD040": false,
|
|
305
|
+
"MD051": false
|
|
306
|
+
},
|
|
307
|
+
// #endregion - markdown
|
|
308
|
+
|
|
309
|
+
// #region - Others(其他相关配置)
|
|
310
|
+
|
|
311
|
+
// 任务出错时仍然继续调试
|
|
312
|
+
"debug.onTaskErrors": "debugAnyway",
|
|
313
|
+
// 差异编辑器不忽略首尾空白字符
|
|
314
|
+
"diffEditor.ignoreTrimWhitespace": false,
|
|
315
|
+
// 指定 npm 包管理器
|
|
316
|
+
"npm.packageManager": "npm",
|
|
317
|
+
|
|
318
|
+
// 禁用 CSS 内置验证
|
|
319
|
+
"css.validate": false,
|
|
320
|
+
// 禁用 Less 内置验证
|
|
321
|
+
"less.validate": false,
|
|
322
|
+
// 禁用 SCSS 内置验证
|
|
323
|
+
"scss.validate": false
|
|
324
|
+
|
|
325
|
+
// #endregion - Others(其他相关配置)
|
|
326
|
+
|
|
327
|
+
// -------------------------------------------
|
|
328
|
+
// #endregion - TNotes 所使用的 VSCode 内置配置
|
|
329
|
+
// -------------------------------------------
|
|
330
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Place your TNotes.react 工作区 snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
|
|
3
|
+
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
|
|
4
|
+
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
|
|
5
|
+
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
|
|
6
|
+
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
|
|
7
|
+
// Placeholders with the same ids are connected.
|
|
8
|
+
// Example:
|
|
9
|
+
// "Print to console": {
|
|
10
|
+
// "scope": "javascript,typescript",
|
|
11
|
+
// "prefix": "log",
|
|
12
|
+
// "body": [
|
|
13
|
+
// "console.log('$1');",
|
|
14
|
+
// "$2"
|
|
15
|
+
// ],
|
|
16
|
+
// "description": "Log output to console"
|
|
17
|
+
// }
|
|
18
|
+
//
|
|
19
|
+
// You can also restrict snippets to specific files using include/exclude patterns:
|
|
20
|
+
// "Test snippet": {
|
|
21
|
+
// "scope": "javascript,typescript",
|
|
22
|
+
// "prefix": "test",
|
|
23
|
+
// "body": "test('$1', () => {\n\t$0\n});",
|
|
24
|
+
// "include": ["**/*.test.ts", "*.spec.ts"],
|
|
25
|
+
// "exclude": ["**/temp/*.ts"],
|
|
26
|
+
// "description": "Insert test block"
|
|
27
|
+
// }
|
|
28
|
+
|
|
29
|
+
// TNotes 中支持的一些推荐写法
|
|
30
|
+
|
|
31
|
+
"TNotes Tip": {
|
|
32
|
+
"scope": "markdown",
|
|
33
|
+
"prefix": [":::tip"],
|
|
34
|
+
"body": ["::: tip 💡 ${1:TIP}", "", "$2", "", ":::", "$0"],
|
|
35
|
+
"description": "插入 TNotes 提示块(Tip)",
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
"TNotes Warning": {
|
|
39
|
+
"scope": "markdown",
|
|
40
|
+
"prefix": [":::warning"],
|
|
41
|
+
"body": ["::: warning ⚠️ ${1:WARNING}", "", "$2", "", ":::", "$0"],
|
|
42
|
+
"description": "插入 TNotes 警告块(Warning)",
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
"TNotes Error": {
|
|
46
|
+
"scope": "markdown",
|
|
47
|
+
"prefix": [":::error"],
|
|
48
|
+
"body": ["::: error ❌ ${1:ERROR}", "", "$2", "", ":::", "$0"],
|
|
49
|
+
"description": "插入 TNotes 错误块(Error)",
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
"TNotes Details": {
|
|
53
|
+
"scope": "markdown",
|
|
54
|
+
"prefix": [":::details"],
|
|
55
|
+
"body": ["::: details 🔍 ${1:DETAILS}", "", "$2", "", ":::", "$0"],
|
|
56
|
+
"description": "插入 TNotes 细节块(Details)",
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
"TNotes Code": {
|
|
60
|
+
"scope": "markdown",
|
|
61
|
+
"prefix": [":::code"],
|
|
62
|
+
"body": ["", "```${1:js}", "$2", "```", "", "$0"],
|
|
63
|
+
"description": "插入 TNotes 代码块(Code)",
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
"TNotes Code Group": {
|
|
67
|
+
"scope": "markdown",
|
|
68
|
+
"prefix": [":::code-group"],
|
|
69
|
+
"body": [
|
|
70
|
+
"::: code-group",
|
|
71
|
+
"",
|
|
72
|
+
"```${1:js} [${2:1}]",
|
|
73
|
+
"$3",
|
|
74
|
+
"```",
|
|
75
|
+
"",
|
|
76
|
+
"```${4:js} [${5:2}]",
|
|
77
|
+
"$6",
|
|
78
|
+
"```",
|
|
79
|
+
"",
|
|
80
|
+
":::",
|
|
81
|
+
"",
|
|
82
|
+
"$0",
|
|
83
|
+
],
|
|
84
|
+
"description": "插入 TNotes 代码组(Code Group)",
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
"TNotes Swiper": {
|
|
88
|
+
"scope": "markdown",
|
|
89
|
+
"prefix": [":::swiper"],
|
|
90
|
+
"body": [
|
|
91
|
+
"::: swiper",
|
|
92
|
+
"",
|
|
93
|
+
"<!-- 图片 1 -->$1",
|
|
94
|
+
"",
|
|
95
|
+
"<!-- 图片 2 -->$2",
|
|
96
|
+
"",
|
|
97
|
+
":::",
|
|
98
|
+
"",
|
|
99
|
+
"$0",
|
|
100
|
+
],
|
|
101
|
+
"description": "插入 TNotes 图片轮播组(Swiper)",
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
"TNotes NotesTable": {
|
|
105
|
+
"scope": "markdown",
|
|
106
|
+
"prefix": [":::notestable"],
|
|
107
|
+
"body": ["<N :ids=\"[", " '$1',", "]\" />", "$0"],
|
|
108
|
+
"description": "插入 TNotes 笔记表格",
|
|
109
|
+
},
|
|
110
|
+
}
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2021",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"lib": ["ES2021", "DOM", "DOM.Iterable"],
|
|
6
|
+
"moduleResolution": "bundler",
|
|
7
|
+
"resolveJsonModule": true,
|
|
8
|
+
"allowJs": true,
|
|
9
|
+
"checkJs": false,
|
|
10
|
+
"noEmit": true,
|
|
11
|
+
"strict": false,
|
|
12
|
+
"noImplicitAny": false,
|
|
13
|
+
"strictNullChecks": false,
|
|
14
|
+
"strictFunctionTypes": false,
|
|
15
|
+
"noUnusedLocals": false,
|
|
16
|
+
"noUnusedParameters": false,
|
|
17
|
+
"esModuleInterop": true,
|
|
18
|
+
"skipLibCheck": true,
|
|
19
|
+
"allowSyntheticDefaultImports": true,
|
|
20
|
+
"forceConsistentCasingInFileNames": true,
|
|
21
|
+
"isolatedModules": true,
|
|
22
|
+
"types": ["node"],
|
|
23
|
+
"jsx": "preserve",
|
|
24
|
+
"baseUrl": ".",
|
|
25
|
+
"paths": {
|
|
26
|
+
"@/*": ["./*"]
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"vueCompilerOptions": {
|
|
30
|
+
"target": 3,
|
|
31
|
+
"strictTemplates": false
|
|
32
|
+
},
|
|
33
|
+
"include": [
|
|
34
|
+
".vitepress/**/*.ts",
|
|
35
|
+
".vitepress/**/*.d.ts",
|
|
36
|
+
".vitepress/**/*.tsx",
|
|
37
|
+
".vitepress/**/*.vue"
|
|
38
|
+
],
|
|
39
|
+
"exclude": [
|
|
40
|
+
"node_modules",
|
|
41
|
+
".vitepress/dist",
|
|
42
|
+
".vitepress/cache",
|
|
43
|
+
".vitepress/.temp"
|
|
44
|
+
]
|
|
45
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
2
|
+
<path d="M0 0h24v24H0z" fill="none" />
|
|
3
|
+
<path fill="#98989f" d="M19.9 12.66a1 1 0 0 1 0-1.32l1.28-1.44a1 1 0 0 0 .12-1.17l-2-3.46a1 1 0 0 0-1.07-.48l-1.88.38a1 1 0 0 1-1.15-.66l-.61-1.83a1 1 0 0 0-.95-.68h-4a1 1 0 0 0-1 .68l-.56 1.83a1 1 0 0 1-1.15.66L5 4.79a1 1 0 0 0-1 .48L2 8.73a1 1 0 0 0 .1 1.17l1.27 1.44a1 1 0 0 1 0 1.32L2.1 14.1a1 1 0 0 0-.1 1.17l2 3.46a1 1 0 0 0 1.07.48l1.88-.38a1 1 0 0 1 1.15.66l.61 1.83a1 1 0 0 0 1 .68h4a1 1 0 0 0 .95-.68l.61-1.83a1 1 0 0 1 1.15-.66l1.88.38a1 1 0 0 0 1.07-.48l2-3.46a1 1 0 0 0-.12-1.17ZM18.41 14l.8.9l-1.28 2.22l-1.18-.24a3 3 0 0 0-3.45 2L12.92 20h-2.56L10 18.86a3 3 0 0 0-3.45-2l-1.18.24l-1.3-2.21l.8-.9a3 3 0 0 0 0-4l-.8-.9l1.28-2.2l1.18.24a3 3 0 0 0 3.45-2L10.36 4h2.56l.38 1.14a3 3 0 0 0 3.45 2l1.18-.24l1.28 2.22l-.8.9a3 3 0 0 0 0 3.98m-6.77-6a4 4 0 1 0 4 4a4 4 0 0 0-4-4m0 6a2 2 0 1 1 2-2a2 2 0 0 1-2 2" />
|
|
4
|
+
</svg>
|