concept-atlas-dense-explain 0.2.0 → 0.2.2
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/package.json +12 -3
- package/skill/SKILL.md +84 -59
- package/skill/assets/template/content/compile-runtime.mdx +158 -158
- package/skill/assets/template/index.html +16 -16
- package/skill/assets/template/package.json +20 -20
- package/skill/assets/template/scripts/build.mjs +37 -37
- package/skill/assets/template/scripts/clean-temp.mjs +27 -27
- package/skill/assets/template/src/app/App.jsx +239 -239
- package/skill/assets/template/src/components/MDXComponents.jsx +503 -477
- package/skill/assets/template/src/components/index.js +1 -1
- package/skill/assets/template/src/main.jsx +16 -16
- package/skill/assets/template/src/model/concept-schema.js +169 -169
- package/skill/assets/template/src/model/normalize-content.js +241 -236
- package/skill/assets/template/src/model/relation-types.js +90 -90
- package/skill/assets/template/src/styles/concept-explain.css +290 -9
- package/skill/assets/template/src/views/NodeExplorer.jsx +59 -20
- package/skill/assets/template/src/views/RelationGraph.jsx +16 -1
- package/skill/assets/template/vite.config.js +21 -21
- package/skill/references/components.md +74 -64
- package/skill/references/prompting.md +77 -77
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="zh-CN">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<title>Concept Atlas · 概念缩放式知识图谱</title>
|
|
7
|
-
<!-- Google Fonts for Academic / Editorial Knowledge style -->
|
|
8
|
-
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
9
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
10
|
-
<link href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=Lora:ital,wght@0,500;0,600;0,700;1,400&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Noto+Serif+SC:wght@500;600;700;900&display=swap" rel="stylesheet">
|
|
11
|
-
</head>
|
|
12
|
-
<body>
|
|
13
|
-
<div id="root"></div>
|
|
14
|
-
<script type="module" src="/src/main.jsx"></script>
|
|
15
|
-
</body>
|
|
16
|
-
</html>
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>Concept Atlas · 概念缩放式知识图谱</title>
|
|
7
|
+
<!-- Google Fonts for Academic / Editorial Knowledge style -->
|
|
8
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
9
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
10
|
+
<link href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=Lora:ital,wght@0,500;0,600;0,700;1,400&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Noto+Serif+SC:wght@500;600;700;900&display=swap" rel="stylesheet">
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
<div id="root"></div>
|
|
14
|
+
<script type="module" src="/src/main.jsx"></script>
|
|
15
|
+
</body>
|
|
16
|
+
</html>
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "my-concept-atlas",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "0.1.0",
|
|
5
|
-
"type": "module",
|
|
1
|
+
{
|
|
2
|
+
"name": "my-concept-atlas",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"type": "module",
|
|
6
6
|
"scripts": { "dev": "vite", "validate": "node scripts/validate-content.mjs", "build": "npm run validate && node scripts/build.mjs", "clean:temp": "node scripts/clean-temp.mjs" },
|
|
7
|
-
"dependencies": {
|
|
8
|
-
"@mdx-js/rollup": "^3.0.1",
|
|
9
|
-
"clsx": "^2.1.1",
|
|
10
|
-
"d3": "^7.9.0",
|
|
11
|
-
"lucide-react": "^0.475.0",
|
|
12
|
-
"mermaid": "^11.17.2",
|
|
13
|
-
"react": "^18.3.1",
|
|
14
|
-
"react-dom": "^18.3.1"
|
|
15
|
-
},
|
|
16
|
-
"devDependencies": {
|
|
17
|
-
"@vitejs/plugin-react": "^4.3.4",
|
|
18
|
-
"vite": "^5.4.14",
|
|
19
|
-
"vite-plugin-singlefile": "^2.1.0"
|
|
20
|
-
}
|
|
21
|
-
}
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"@mdx-js/rollup": "^3.0.1",
|
|
9
|
+
"clsx": "^2.1.1",
|
|
10
|
+
"d3": "^7.9.0",
|
|
11
|
+
"lucide-react": "^0.475.0",
|
|
12
|
+
"mermaid": "^11.17.2",
|
|
13
|
+
"react": "^18.3.1",
|
|
14
|
+
"react-dom": "^18.3.1"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
18
|
+
"vite": "^5.4.14",
|
|
19
|
+
"vite-plugin-singlefile": "^2.1.0"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { build } from 'vite';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import fs from 'fs';
|
|
4
|
-
import { fileURLToPath } from 'url';
|
|
5
|
-
|
|
6
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = path.dirname(__filename);
|
|
8
|
-
const rootDir = path.resolve(__dirname, '..');
|
|
9
|
-
|
|
10
|
-
async function runBuild() {
|
|
11
|
-
console.log('🚀 开始构建 Concept Atlas 知识讲解页面...');
|
|
12
|
-
|
|
13
|
-
try {
|
|
14
|
-
// 确保 dist 目录存在
|
|
15
|
-
const distDir = path.resolve(rootDir, 'dist');
|
|
16
|
-
if (!fs.existsSync(distDir)) {
|
|
17
|
-
fs.mkdirSync(distDir, { recursive: true });
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// 执行 Vite 构建
|
|
21
|
-
await build({
|
|
22
|
-
root: rootDir,
|
|
23
|
-
build: {
|
|
24
|
-
outDir: 'dist',
|
|
25
|
-
// Always remove stale assets so dist is a self-contained release.
|
|
26
|
-
emptyOutDir: true,
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
console.log('✅ 构建成功!产物已生成到 dist/ 目录。');
|
|
31
|
-
} catch (err) {
|
|
32
|
-
console.error('❌ 构建失败:', err);
|
|
33
|
-
process.exit(1);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
runBuild();
|
|
1
|
+
import { build } from 'vite';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import fs from 'fs';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = path.dirname(__filename);
|
|
8
|
+
const rootDir = path.resolve(__dirname, '..');
|
|
9
|
+
|
|
10
|
+
async function runBuild() {
|
|
11
|
+
console.log('🚀 开始构建 Concept Atlas 知识讲解页面...');
|
|
12
|
+
|
|
13
|
+
try {
|
|
14
|
+
// 确保 dist 目录存在
|
|
15
|
+
const distDir = path.resolve(rootDir, 'dist');
|
|
16
|
+
if (!fs.existsSync(distDir)) {
|
|
17
|
+
fs.mkdirSync(distDir, { recursive: true });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// 执行 Vite 构建
|
|
21
|
+
await build({
|
|
22
|
+
root: rootDir,
|
|
23
|
+
build: {
|
|
24
|
+
outDir: 'dist',
|
|
25
|
+
// Always remove stale assets so dist is a self-contained release.
|
|
26
|
+
emptyOutDir: true,
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
console.log('✅ 构建成功!产物已生成到 dist/ 目录。');
|
|
31
|
+
} catch (err) {
|
|
32
|
+
console.error('❌ 构建失败:', err);
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
runBuild();
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import { fileURLToPath } from 'url';
|
|
4
|
-
|
|
5
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
-
const __dirname = path.dirname(__filename);
|
|
7
|
-
const rootDir = path.resolve(__dirname, '..');
|
|
8
|
-
const tempDir = path.resolve(rootDir, 'tmp', 'dense-explain');
|
|
9
|
-
|
|
10
|
-
function cleanTemp() {
|
|
11
|
-
console.log(`🧹 检查并清理临时目录: ${tempDir}`);
|
|
12
|
-
if (fs.existsSync(tempDir)) {
|
|
13
|
-
const files = fs.readdirSync(tempDir);
|
|
14
|
-
files.forEach(file => {
|
|
15
|
-
const p = path.join(tempDir, file);
|
|
16
|
-
if (fs.lstatSync(p).isFile()) {
|
|
17
|
-
fs.unlinkSync(p);
|
|
18
|
-
console.log(`已清理: ${file}`);
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
console.log('✅ 临时解释任务产物清理完成。');
|
|
22
|
-
} else {
|
|
23
|
-
console.log('ℹ️ 临时目录不存在或无需清理。');
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
cleanTemp();
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = path.dirname(__filename);
|
|
7
|
+
const rootDir = path.resolve(__dirname, '..');
|
|
8
|
+
const tempDir = path.resolve(rootDir, 'tmp', 'dense-explain');
|
|
9
|
+
|
|
10
|
+
function cleanTemp() {
|
|
11
|
+
console.log(`🧹 检查并清理临时目录: ${tempDir}`);
|
|
12
|
+
if (fs.existsSync(tempDir)) {
|
|
13
|
+
const files = fs.readdirSync(tempDir);
|
|
14
|
+
files.forEach(file => {
|
|
15
|
+
const p = path.join(tempDir, file);
|
|
16
|
+
if (fs.lstatSync(p).isFile()) {
|
|
17
|
+
fs.unlinkSync(p);
|
|
18
|
+
console.log(`已清理: ${file}`);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
console.log('✅ 临时解释任务产物清理完成。');
|
|
22
|
+
} else {
|
|
23
|
+
console.log('ℹ️ 临时目录不存在或无需清理。');
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
cleanTemp();
|