提交 eb464464 编写于 作者: M Mars Liu

keywords override

上级 bbee7577
{
"node_id": "pg-11d131b2d01b40be90b23f096d4852cc",
"keywords": [],
"keywords": ["关系型数据库", "database", "relational", "rdbms"],
"children": [],
"export": [
"relation.json"
......
{
"node_id": "pg-cf0e5cb243a247e2a0b812c5798cdba4",
"keywords": [],
"keywords": ["server", "client", "数据库服务器", "数据库客户端"],
"children": [],
"export": [
"client.json",
......
{
"node_id": "pg-940afa6d71af44f689011ded8fd91a98",
"keywords": [],
"keywords": ["安装", "PostgreSQL"],
"children": [],
"export": ["install.json"]
}
\ No newline at end of file
{
"node_id": "pg-ee5c6d4a073b45a7995ba351ab9de46e",
"keywords": [],
"keywords": ["sql", "psql", " 数据库客户端"],
"children": [],
"export": ["psql.json"]
}
\ No newline at end of file
{
"node_id": "pg-806d3976e8764d4f8e26c197c53d45a8",
"keywords": [],
"keywords": ["表", "table"],
"children": [],
"export": [
"table.json",
......
{
"node_id": "pg-f371b91ef63a4ce08f80b92bc8580196",
"keywords": [],
"keywords": ["函数", "function"],
"children": [],
"export": ["function.json"]
}
\ No newline at end of file
{
"node_id": "pg-cb942198b3a84d5398d73d558a241543",
"keywords": [],
"keywords": ["role", "login", "user", "用户", "角色", "权限", "privilege"],
"children": [],
"export": [
"grant.json",
......
{
"node_id": "pg-a0cb78d68d814f5e935b41922b88e085",
"keywords": [],
"keywords": ["trigger", "触发器"],
"children": [],
"export": ["trigger.json"]
}
\ No newline at end of file
{
"node_id": "pg-d2b6e840cfad44a2aa357cfee56d437d",
"keywords": [],
"keywords": ["数据库扩展", "数据库插件", "extension"],
"children": [],
"export": []
}
\ No newline at end of file
{
"node_id": "pg-3a87b0dbead643e58f1ff1d93acd80cc",
"keywords": [],
"keywords": ["group by", "分组"],
"children": [],
"export": []
}
\ No newline at end of file
{
"node_id": "pg-458d5d590ea64188847b45d8e6343f83",
"keywords": [],
"keywords": ["join", "连接查询"],
"children": [],
"export": []
}
\ No newline at end of file
{
"node_id": "pg-55fd213f919d411c9b572241c4bb7807",
"keywords": [],
"keywords": ["子查询", "subquery"],
"children": [],
"export": [
"subquery.json"
......
{
"node_id": "pg-69d3a1c646004e1da497fed2af57806c",
"keywords": [],
"keywords": ["分页", "limit", "offset"],
"children": [],
"export": ["paged.json"]
}
\ No newline at end of file
{
"node_id": "pg-6beb084543204f4f9d87930c0a6c5707",
"keywords": [],
"keywords": ["common table expression", "cte", "recursive"],
"children": [],
"export": []
}
\ No newline at end of file
{
"node_id": "pg-eb4048b7dfd3469f8049330ba78427b5",
"keywords": [],
"keywords": ["plsql", "过程化"],
"children": [],
"export": ["loop.json"]
}
\ No newline at end of file
{
"node_id": "pg-58e924e93b564a24abb1e6b9cdfbc094",
"keywords": [],
"keywords": ["standby", "热备份", "高可用", "流复制"],
"children": [],
"export": [
"standby.json",
......
{
"node_id": "pg-7eff3dcf68644c23bd89f2a2abe4fac6",
"keywords": [],
"keywords": ["standby", "高可用", "流复制", "wal"],
"children": [],
"export": ["stream.json"]
}
\ No newline at end of file
{
"node_id": "pg-20a433f6ae65429f9b1a7f17c751ac01",
"keywords": [],
"keywords": ["外部数据连接", "fdw"],
"children": [],
"export": []
}
\ No newline at end of file
{
"node_id": "pg-69ad784e39c044d7a115cfd124e49ef1",
"keywords": [],
"keywords": ["json", "jsonb"],
"children": [],
"export": [
"json.json",
......
{
"node_id": "pg-6dbbb44b41d347b58075a9155dfb8356",
"keywords": [],
"keywords": ["函数", "过程", "function", "produce"],
"children": [],
"export": ["distinct.json"]
}
\ No newline at end of file
{
"node_id": "pg-532f8f84ea74493a9581e6bf720ebf78",
"keywords": [],
"keywords": ["视图", "view"],
"children": [],
"export": ["view.json"]
}
\ No newline at end of file
{
"node_id": "pg-2e691ed3a847424eb887b40aca750c4e",
"keywords": [],
"keywords": ["cte", "递归查询", "recursive"],
"children": [],
"export": [
"continuous.json"
......
{
"keywords": [],
"keywords": ["函数", "function"],
"children": [],
"node_id": "pg-cab66a558cda467eabd9587b5a8257bd",
"export": [
......
{
"node_id": "pg-693a81467f444886a199bac681f238b8",
"keywords": [],
"keywords": ["透视表", "交叉透视表", "pivot"],
"children": [],
"export": ["pivot.json"]
}
\ No newline at end of file
{
"node_id": "pg-6ce3520f7a67494a90378e7b194f8720",
"keywords": [],
"keywords": ["conflict", "冲突", "唯一约束"],
"children": [],
"export": ["score.json"]
}
\ No newline at end of file
{
"node_id": "pg-2d547e778fc4453b84feb0a0c6341348",
"keywords": [],
"keywords": ["事务", "transaction"],
"children": [],
"export": ["transaction.json"]
}
\ No newline at end of file
......@@ -16,14 +16,24 @@
{
"关系型数据库": {
"node_id": "pg-11d131b2d01b40be90b23f096d4852cc",
"keywords": [],
"keywords": [
"关系型数据库",
"database",
"relational",
"rdbms"
],
"children": []
}
},
{
"服务器和客户端": {
"node_id": "pg-cf0e5cb243a247e2a0b812c5798cdba4",
"keywords": [],
"keywords": [
"server",
"client",
"数据库服务器",
"数据库客户端"
],
"children": []
}
}
......@@ -38,7 +48,10 @@
{
"安装PostgreSQL": {
"node_id": "pg-940afa6d71af44f689011ded8fd91a98",
"keywords": [],
"keywords": [
"安装",
"PostgreSQL"
],
"children": []
}
},
......@@ -74,7 +87,11 @@
{
"psql": {
"node_id": "pg-ee5c6d4a073b45a7995ba351ab9de46e",
"keywords": [],
"keywords": [
"sql",
"psql",
" 数据库客户端"
],
"children": []
}
},
......@@ -119,42 +136,68 @@
{
"表": {
"node_id": "pg-806d3976e8764d4f8e26c197c53d45a8",
"keywords": [],
"keywords": [
"表",
"table"
],
"children": []
}
},
{
"函数": {
"node_id": "pg-f371b91ef63a4ce08f80b92bc8580196",
"keywords": [],
"keywords": [
"函数",
"function"
],
"children": []
}
},
{
"用户和权限": {
"node_id": "pg-cb942198b3a84d5398d73d558a241543",
"keywords": [],
"keywords": [
"role",
"login",
"user",
"用户",
"角色",
"权限",
"privilege"
],
"children": []
}
},
{
"索引和约束": {
"node_id": "pg-eeb777ca54434480a06bfe7fc5e7d3ca",
"keywords": [],
"keywords": [
"索引",
" 约束",
"constraints",
"index"
],
"children": []
}
},
{
" 触发器": {
"node_id": "pg-a0cb78d68d814f5e935b41922b88e085",
"keywords": [],
"keywords": [
"trigger",
"触发器"
],
"children": []
}
},
{
"数据库扩展": {
"node_id": "pg-d2b6e840cfad44a2aa357cfee56d437d",
"keywords": [],
"keywords": [
"数据库扩展",
"数据库插件",
"extension"
],
"children": []
}
}
......@@ -169,42 +212,62 @@
{
"聚合和分组": {
"node_id": "pg-3a87b0dbead643e58f1ff1d93acd80cc",
"keywords": [],
"keywords": [
"group by",
"分组"
],
"children": []
}
},
{
"连接查询": {
"node_id": "pg-458d5d590ea64188847b45d8e6343f83",
"keywords": [],
"keywords": [
"join",
"连接查询"
],
"children": []
}
},
{
"子查询": {
"node_id": "pg-55fd213f919d411c9b572241c4bb7807",
"keywords": [],
"keywords": [
"子查询",
"subquery"
],
"children": []
}
},
{
"分页查询": {
"node_id": "pg-69d3a1c646004e1da497fed2af57806c",
"keywords": [],
"keywords": [
"分页",
"limit",
"offset"
],
"children": []
}
},
{
"CTE": {
"node_id": "pg-6beb084543204f4f9d87930c0a6c5707",
"keywords": [],
"keywords": [
"common table expression",
"cte",
"recursive"
],
"children": []
}
},
{
"过程化编程": {
"node_id": "pg-eb4048b7dfd3469f8049330ba78427b5",
"keywords": [],
"keywords": [
"plsql",
"过程化"
],
"children": []
}
},
......@@ -238,21 +301,34 @@
{
"standby": {
"node_id": "pg-58e924e93b564a24abb1e6b9cdfbc094",
"keywords": [],
"keywords": [
"standby",
"热备份",
"高可用",
"流复制"
],
"children": []
}
},
{
"流式复制集群": {
"node_id": "pg-7eff3dcf68644c23bd89f2a2abe4fac6",
"keywords": [],
"keywords": [
"standby",
"高可用",
"流复制",
"wal"
],
"children": []
}
},
{
"fdw": {
"node_id": "pg-20a433f6ae65429f9b1a7f17c751ac01",
"keywords": [],
"keywords": [
"外部数据连接",
"fdw"
],
"children": []
}
}
......@@ -277,21 +353,32 @@
{
"JSON和JSONB": {
"node_id": "pg-69ad784e39c044d7a115cfd124e49ef1",
"keywords": [],
"keywords": [
"json",
"jsonb"
],
"children": []
}
},
{
"函数": {
"node_id": "pg-6dbbb44b41d347b58075a9155dfb8356",
"keywords": [],
"keywords": [
"函数",
"过程",
"function",
"produce"
],
"children": []
}
},
{
"视图": {
"node_id": "pg-532f8f84ea74493a9581e6bf720ebf78",
"keywords": [],
"keywords": [
"视图",
"view"
],
"children": []
}
}
......@@ -306,42 +393,65 @@
{
"递归查询": {
"node_id": "pg-2e691ed3a847424eb887b40aca750c4e",
"keywords": [],
"keywords": [
"cte",
"递归查询",
"recursive"
],
"children": []
}
},
{
"Window Function": {
"node_id": "pg-cab66a558cda467eabd9587b5a8257bd",
"keywords": [],
"keywords": [
"函数",
"function"
],
"children": []
}
},
{
"透视表 ": {
"node_id": "pg-693a81467f444886a199bac681f238b8",
"keywords": [],
"keywords": [
"透视表",
"交叉透视表",
"pivot"
],
"children": []
}
},
{
"写入和冲突": {
"node_id": "pg-6ce3520f7a67494a90378e7b194f8720",
"keywords": [],
"keywords": [
"conflict",
"冲突",
"唯一约束"
],
"children": []
}
},
{
"事务": {
"node_id": "pg-2d547e778fc4453b84feb0a0c6341348",
"keywords": [],
"keywords": [
"事务",
"transaction"
],
"children": []
}
},
{
"索引和优化": {
"node_id": "pg-79fe660f35f4469481db38509343c2b7",
"keywords": [],
"keywords": [
"索引",
"index",
"performance",
"优化"
],
"children": []
}
}
......
......@@ -101,6 +101,7 @@ class TreeWalker:
section_title = list(section_node.keys())[0]
full_path = os.path.join(chapter_path, f"{index + 1}.{section_title}")
if os.path.isdir(full_path):
self.check_section_keywords(full_path)
self.ensure_exercises(full_path)
tree_path = os.path.join(self.root, "tree.json")
......@@ -309,3 +310,9 @@ class TreeWalker:
dump_json(full_name, exercise, True, True)
else:
id_set.add(exercise["exercise_id"])
def check_section_keywords(self, full_path):
config = self.ensure_section_config(full_path)
if not config.get("keywords", []):
self.logger.error(f"节点 [{full_path}] 的关键字为空,请修改配置文件写入关键字")
sys.exit(1)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册