🔄 卡若AI 同步 2026-03-15 07:18 | 更新:火炬、火种知识模型、运营中枢参考资料、运营中枢工作台 | 排除 >20MB: 11 个
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
读书笔记写入 XMind 脚本
|
||||
将五行结构化的读书笔记写入 XMind 文件
|
||||
读书笔记写入 XMind 脚本(五行模板格式 v2)
|
||||
中心红色 + 五行橙色浮动节点 + 五方位布局
|
||||
|
||||
用法:
|
||||
python write_to_xmind.py "书名" "作者" "分类" [--test]
|
||||
@@ -16,52 +16,155 @@ import shutil
|
||||
import zipfile
|
||||
import uuid
|
||||
import sys
|
||||
import random
|
||||
import string
|
||||
from datetime import datetime
|
||||
|
||||
# XMind 文件路径
|
||||
XMIND_PATH = "/Users/karuo/Documents/我的脑图/5 学习/读书笔记.xmind"
|
||||
|
||||
# 分类映射
|
||||
CATEGORIES = {
|
||||
"个人提升": "一、个人提升",
|
||||
"人际关系": "二、人际关系",
|
||||
"人际关系": "二、人际关系",
|
||||
"创业": "三、创业",
|
||||
"商业思维": "四、商业思维",
|
||||
"投资": "五、投资"
|
||||
}
|
||||
|
||||
# 五行颜色标记
|
||||
MARKERS = {
|
||||
"金": "flag-yellow",
|
||||
"水": "flag-blue",
|
||||
"木": "flag-green",
|
||||
"火": "flag-red",
|
||||
"土": "flag-orange"
|
||||
WUXING_THEME = {
|
||||
"subTopic": {
|
||||
"id": str(uuid.uuid4()),
|
||||
"properties": {
|
||||
"fo:font-size": "11pt",
|
||||
"fo:color": "#434B54",
|
||||
"fo:text-align": "left"
|
||||
}
|
||||
},
|
||||
"summary": {
|
||||
"id": str(uuid.uuid4()),
|
||||
"properties": {"line-color": "#F0B67F"}
|
||||
},
|
||||
"boundary": {
|
||||
"id": str(uuid.uuid4()),
|
||||
"properties": {
|
||||
"fo:font-size": "14pt", "fo:font-weight": "700",
|
||||
"fo:font-style": "normal", "fo:color": "#F0B67F",
|
||||
"svg:fill": "#FEF1E4", "line-color": "#F0B67F"
|
||||
}
|
||||
},
|
||||
"importantTopic": {
|
||||
"id": str(uuid.uuid4()),
|
||||
"properties": {
|
||||
"fo:font-weight": "bold", "fo:color": "#FFFFFF", "svg:fill": "#FF4600"
|
||||
}
|
||||
},
|
||||
"calloutTopic": {
|
||||
"id": str(uuid.uuid4()),
|
||||
"properties": {
|
||||
"fo:font-size": "14pt", "fo:font-weight": "600",
|
||||
"fo:font-style": "normal", "fo:color": "#775D44",
|
||||
"svg:fill": "#F0B67F", "border-line-width": "0"
|
||||
}
|
||||
},
|
||||
"centralTopic": {
|
||||
"id": str(uuid.uuid4()),
|
||||
"properties": {
|
||||
"fo:font-size": "20pt", "fo:font-weight": "600",
|
||||
"fo:font-style": "normal", "svg:fill": "#e4705c",
|
||||
"line-color": "#434B54", "border-line-width": "0"
|
||||
}
|
||||
},
|
||||
"mainTopic": {
|
||||
"id": str(uuid.uuid4()),
|
||||
"properties": {
|
||||
"fo:font-size": "14pt", "fo:color": "#FFFFFF",
|
||||
"svg:fill": "#434B54", "line-width": "1pt",
|
||||
"border-line-width": "0",
|
||||
"line-class": "org.xmind.branchConnection.curve"
|
||||
}
|
||||
},
|
||||
"floatingTopic": {
|
||||
"id": str(uuid.uuid4()),
|
||||
"properties": {
|
||||
"fo:font-weight": "600", "fo:font-style": "normal",
|
||||
"fo:color": "#775D44", "svg:fill": "#F0B67F",
|
||||
"line-width": "1pt", "line-color": "#F0B67F",
|
||||
"border-line-color": "#F0B67F", "border-line-width": "0",
|
||||
"line-class": "org.xmind.branchConnection.curve"
|
||||
}
|
||||
},
|
||||
"summaryTopic": {
|
||||
"id": str(uuid.uuid4()),
|
||||
"properties": {
|
||||
"fo:font-weight": "600", "fo:font-style": "normal",
|
||||
"fo:color": "#775D44", "svg:fill": "#F0B67F",
|
||||
"line-width": "1pt", "line-color": "#F0B67F",
|
||||
"border-line-color": "#F0B67F", "border-line-width": "2pt",
|
||||
"line-class": "org.xmind.branchConnection.curve"
|
||||
}
|
||||
},
|
||||
"relationship": {
|
||||
"id": str(uuid.uuid4()),
|
||||
"properties": {
|
||||
"fo:font-weight": "600", "fo:font-style": "normal",
|
||||
"fo:color": "#F0B67F", "line-width": "3pt",
|
||||
"line-color": "#F0B67F", "line-pattern": "solid"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
WUXING_POSITIONS = {
|
||||
"金": {"x": -8, "y": -252},
|
||||
"水": {"x": 271, "y": -113},
|
||||
"木": {"x": 196, "y": 191},
|
||||
"火": {"x": -175, "y": 197},
|
||||
"土": {"x": -260, "y": -83},
|
||||
}
|
||||
|
||||
WUXING_DESCRIPTIONS = {
|
||||
"金": "定位与角色:是谁、给谁、站在什么位置上",
|
||||
"水": "经历与路径:事情是怎么发生的",
|
||||
"木": "方法与产出:具体怎么干、能产出什么",
|
||||
"火": "认知与判断:为什么这么想、怎么判断对错",
|
||||
"土": "系统与沉淀:如何长期稳定、不崩盘",
|
||||
}
|
||||
|
||||
ELEMENT_KEY_MAP = {
|
||||
"金": "gold", "水": "water", "木": "wood", "火": "fire", "土": "earth"
|
||||
}
|
||||
|
||||
|
||||
def gen_id():
|
||||
"""生成 XMind 节点 ID(26位混合字母数字格式)"""
|
||||
import random
|
||||
import string
|
||||
chars = string.ascii_lowercase + string.digits
|
||||
return ''.join(random.choice(chars) for _ in range(26))
|
||||
|
||||
|
||||
def _make_element_node(name, items, note_text=""):
|
||||
"""创建五行浮动节点(detached 定位模式)"""
|
||||
children = []
|
||||
if WUXING_DESCRIPTIONS.get(name):
|
||||
children.append({"id": gen_id(), "title": WUXING_DESCRIPTIONS[name]})
|
||||
for item in items:
|
||||
children.append({"id": gen_id(), "title": item})
|
||||
|
||||
node = {
|
||||
"id": gen_id(),
|
||||
"title": name,
|
||||
"position": WUXING_POSITIONS[name],
|
||||
"children": {"attached": children} if children else {}
|
||||
}
|
||||
if note_text:
|
||||
node["notes"] = {"plain": {"content": note_text}}
|
||||
return node
|
||||
|
||||
|
||||
def create_book_sheet(book_name, author, note_data=None):
|
||||
"""
|
||||
创建书籍标签页结构
|
||||
|
||||
Args:
|
||||
book_name: 书名
|
||||
author: 作者
|
||||
note_data: 笔记数据字典(可选,用于填充内容)
|
||||
|
||||
Returns:
|
||||
tuple: (sheet结构, sheet_id, root_id) # 返回root_id用于链接
|
||||
创建书籍标签页(五行模板格式 v2)
|
||||
中心红色节点 + 五行橙色浮动节点(detached)+ 补充信息(attached)
|
||||
"""
|
||||
sheet_id = str(uuid.uuid4()) # sheet用标准UUID格式
|
||||
root_id = gen_id() # rootTopic用26位格式
|
||||
|
||||
# 默认笔记数据
|
||||
sheet_id = str(uuid.uuid4())
|
||||
root_id = gen_id()
|
||||
|
||||
if note_data is None:
|
||||
note_data = {
|
||||
"summary": "待填写一句话总结",
|
||||
@@ -70,113 +173,87 @@ def create_book_sheet(book_name, author, note_data=None):
|
||||
"wood": ["木-1:待填写", "木-2:待填写", "木-3:待填写", "木-4:待填写"],
|
||||
"fire": ["火-1:待填写", "火-2:待填写", "火-3:待填写", "火-4:待填写"],
|
||||
"earth": ["土-1:待填写", "土-2:待填写", "土-3:待填写", "土-4:待填写"],
|
||||
"questions": [],
|
||||
"characters": [],
|
||||
"quotes": [],
|
||||
"keywords": [],
|
||||
"process": "",
|
||||
"rules": ""
|
||||
"questions": [], "characters": [], "quotes": [],
|
||||
"keywords": [], "process": "", "rules": ""
|
||||
}
|
||||
|
||||
def create_element_node(name, marker, items, description=""):
|
||||
"""创建五行元素节点"""
|
||||
children = []
|
||||
if description:
|
||||
children.append({
|
||||
"id": gen_id(),
|
||||
"title": description
|
||||
})
|
||||
for item in items:
|
||||
children.append({
|
||||
"id": gen_id(),
|
||||
"title": item
|
||||
})
|
||||
return {
|
||||
"id": gen_id(),
|
||||
"title": name,
|
||||
"markers": [{"markerId": marker}],
|
||||
"children": {"attached": children} if children else {}
|
||||
}
|
||||
|
||||
|
||||
detached_nodes = []
|
||||
for name in ["金", "水", "木", "火", "土"]:
|
||||
key = ELEMENT_KEY_MAP[name]
|
||||
items = note_data.get(key, [])
|
||||
detached_nodes.append(_make_element_node(name, items))
|
||||
|
||||
attached_nodes = [
|
||||
{
|
||||
"id": gen_id(), "title": "一句话总结",
|
||||
"children": {"attached": [
|
||||
{"id": gen_id(), "title": note_data.get("summary", "待填写")}
|
||||
]}
|
||||
},
|
||||
{
|
||||
"id": gen_id(), "title": "问题与解答",
|
||||
"children": {"attached": [
|
||||
{"id": gen_id(), "title": q}
|
||||
for q in (note_data.get("questions") or ["待填写"])
|
||||
]}
|
||||
},
|
||||
{
|
||||
"id": gen_id(), "title": "人物分析",
|
||||
"children": {"attached": [
|
||||
{"id": gen_id(), "title": c}
|
||||
for c in (note_data.get("characters") or ["待填写"])
|
||||
]}
|
||||
},
|
||||
{
|
||||
"id": gen_id(), "title": "金句与关键词",
|
||||
"children": {"attached": [
|
||||
{"id": gen_id(), "title": "金句", "children": {"attached": [
|
||||
{"id": gen_id(), "title": q}
|
||||
for q in (note_data.get("quotes") or ["待填写"])
|
||||
]}},
|
||||
{"id": gen_id(), "title": "关键词", "children": {"attached": [
|
||||
{"id": gen_id(), "title": k}
|
||||
for k in (note_data.get("keywords") or ["待填写"])
|
||||
]}}
|
||||
]}
|
||||
},
|
||||
{
|
||||
"id": gen_id(), "title": "流程图示",
|
||||
"children": {"attached": [
|
||||
{"id": gen_id(), "title": note_data.get("process") or "待填写"}
|
||||
]}
|
||||
},
|
||||
{
|
||||
"id": gen_id(), "title": "使用规则",
|
||||
"children": {"attached": [
|
||||
{"id": gen_id(), "title": note_data.get("rules") or "待填写"}
|
||||
]}
|
||||
},
|
||||
]
|
||||
|
||||
sheet = {
|
||||
"id": sheet_id,
|
||||
"class": "sheet",
|
||||
"title": f"《{book_name}》- {author}",
|
||||
"theme": WUXING_THEME,
|
||||
"rootTopic": {
|
||||
"id": root_id,
|
||||
"class": "topic",
|
||||
"title": f"《{book_name}》- {author}",
|
||||
"structureClass": "org.xmind.ui.map.unbalanced",
|
||||
"title": f"《{book_name}》\n{author}",
|
||||
"structureClass": "org.xmind.ui.map.clockwise",
|
||||
"extensions": [
|
||||
{
|
||||
"provider": "org.xmind.ui.map.unbalanced",
|
||||
"content": [{"name": "right-number", "content": "-1"}]
|
||||
}
|
||||
],
|
||||
"children": {
|
||||
"attached": [
|
||||
# 一句话总结
|
||||
{
|
||||
"id": gen_id(),
|
||||
"title": "一句话总结",
|
||||
"children": {
|
||||
"attached": [
|
||||
{"id": gen_id(), "title": note_data.get("summary", "待填写")}
|
||||
]
|
||||
}
|
||||
},
|
||||
# 金
|
||||
create_element_node("金", MARKERS["金"], note_data.get("gold", []), "定位与角色:是谁、给谁、站在什么位置上"),
|
||||
# 水
|
||||
create_element_node("水", MARKERS["水"], note_data.get("water", []), "经历与路径:事情是怎么发生的"),
|
||||
# 木
|
||||
create_element_node("木", MARKERS["木"], note_data.get("wood", []), "方法与产出:具体怎么干、能产出什么"),
|
||||
# 火
|
||||
create_element_node("火", MARKERS["火"], note_data.get("fire", []), "认知与判断:为什么这么想、怎么判断对错"),
|
||||
# 土
|
||||
create_element_node("土", MARKERS["土"], note_data.get("earth", []), "系统与沉淀:如何长期稳定、不崩盘"),
|
||||
# 问题与解答
|
||||
{
|
||||
"id": gen_id(),
|
||||
"title": "问题与解答",
|
||||
"children": {
|
||||
"attached": [{"id": gen_id(), "title": q} for q in note_data.get("questions", ["待填写"])]
|
||||
}
|
||||
},
|
||||
# 人物分析
|
||||
{
|
||||
"id": gen_id(),
|
||||
"title": "人物分析",
|
||||
"children": {
|
||||
"attached": [{"id": gen_id(), "title": c} for c in note_data.get("characters", ["待填写"])]
|
||||
}
|
||||
},
|
||||
# 金句与关键词
|
||||
{
|
||||
"id": gen_id(),
|
||||
"title": "金句与关键词",
|
||||
"children": {
|
||||
"attached": [
|
||||
{"id": gen_id(), "title": "金句", "children": {"attached": [{"id": gen_id(), "title": q} for q in note_data.get("quotes", ["待填写"])]}},
|
||||
{"id": gen_id(), "title": "关键词", "children": {"attached": [{"id": gen_id(), "title": k} for k in note_data.get("keywords", ["待填写"])]}}
|
||||
]
|
||||
}
|
||||
},
|
||||
# 流程图示
|
||||
{
|
||||
"id": gen_id(),
|
||||
"title": "流程图示",
|
||||
"children": {
|
||||
"attached": [{"id": gen_id(), "title": note_data.get("process", "待填写")}]
|
||||
}
|
||||
},
|
||||
# 使用规则
|
||||
{
|
||||
"id": gen_id(),
|
||||
"title": "使用规则",
|
||||
"children": {
|
||||
"attached": [{"id": gen_id(), "title": note_data.get("rules", "待填写")}]
|
||||
}
|
||||
}
|
||||
]
|
||||
"attached": attached_nodes,
|
||||
"detached": detached_nodes,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return sheet, sheet_id, root_id
|
||||
|
||||
def add_link_to_category(topics, category_title, book_name, author, sheet_id):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
读书笔记写入 XMind 脚本
|
||||
将五行结构化的读书笔记写入 XMind 文件
|
||||
读书笔记写入 XMind 脚本(五行模板格式 v2)
|
||||
中心红色 + 五行橙色浮动节点 + 五方位布局
|
||||
|
||||
用法:
|
||||
python write_to_xmind.py "书名" "作者" "分类" [--test]
|
||||
@@ -16,52 +16,155 @@ import shutil
|
||||
import zipfile
|
||||
import uuid
|
||||
import sys
|
||||
import random
|
||||
import string
|
||||
from datetime import datetime
|
||||
|
||||
# XMind 文件路径
|
||||
XMIND_PATH = "/Users/karuo/Documents/我的脑图/5 学习/读书笔记.xmind"
|
||||
|
||||
# 分类映射
|
||||
CATEGORIES = {
|
||||
"个人提升": "一、个人提升",
|
||||
"人际关系": "二、人际关系",
|
||||
"人际关系": "二、人际关系",
|
||||
"创业": "三、创业",
|
||||
"商业思维": "四、商业思维",
|
||||
"投资": "五、投资"
|
||||
}
|
||||
|
||||
# 五行颜色标记
|
||||
MARKERS = {
|
||||
"金": "flag-yellow",
|
||||
"水": "flag-blue",
|
||||
"木": "flag-green",
|
||||
"火": "flag-red",
|
||||
"土": "flag-orange"
|
||||
WUXING_THEME = {
|
||||
"subTopic": {
|
||||
"id": str(uuid.uuid4()),
|
||||
"properties": {
|
||||
"fo:font-size": "11pt",
|
||||
"fo:color": "#434B54",
|
||||
"fo:text-align": "left"
|
||||
}
|
||||
},
|
||||
"summary": {
|
||||
"id": str(uuid.uuid4()),
|
||||
"properties": {"line-color": "#F0B67F"}
|
||||
},
|
||||
"boundary": {
|
||||
"id": str(uuid.uuid4()),
|
||||
"properties": {
|
||||
"fo:font-size": "14pt", "fo:font-weight": "700",
|
||||
"fo:font-style": "normal", "fo:color": "#F0B67F",
|
||||
"svg:fill": "#FEF1E4", "line-color": "#F0B67F"
|
||||
}
|
||||
},
|
||||
"importantTopic": {
|
||||
"id": str(uuid.uuid4()),
|
||||
"properties": {
|
||||
"fo:font-weight": "bold", "fo:color": "#FFFFFF", "svg:fill": "#FF4600"
|
||||
}
|
||||
},
|
||||
"calloutTopic": {
|
||||
"id": str(uuid.uuid4()),
|
||||
"properties": {
|
||||
"fo:font-size": "14pt", "fo:font-weight": "600",
|
||||
"fo:font-style": "normal", "fo:color": "#775D44",
|
||||
"svg:fill": "#F0B67F", "border-line-width": "0"
|
||||
}
|
||||
},
|
||||
"centralTopic": {
|
||||
"id": str(uuid.uuid4()),
|
||||
"properties": {
|
||||
"fo:font-size": "20pt", "fo:font-weight": "600",
|
||||
"fo:font-style": "normal", "svg:fill": "#e4705c",
|
||||
"line-color": "#434B54", "border-line-width": "0"
|
||||
}
|
||||
},
|
||||
"mainTopic": {
|
||||
"id": str(uuid.uuid4()),
|
||||
"properties": {
|
||||
"fo:font-size": "14pt", "fo:color": "#FFFFFF",
|
||||
"svg:fill": "#434B54", "line-width": "1pt",
|
||||
"border-line-width": "0",
|
||||
"line-class": "org.xmind.branchConnection.curve"
|
||||
}
|
||||
},
|
||||
"floatingTopic": {
|
||||
"id": str(uuid.uuid4()),
|
||||
"properties": {
|
||||
"fo:font-weight": "600", "fo:font-style": "normal",
|
||||
"fo:color": "#775D44", "svg:fill": "#F0B67F",
|
||||
"line-width": "1pt", "line-color": "#F0B67F",
|
||||
"border-line-color": "#F0B67F", "border-line-width": "0",
|
||||
"line-class": "org.xmind.branchConnection.curve"
|
||||
}
|
||||
},
|
||||
"summaryTopic": {
|
||||
"id": str(uuid.uuid4()),
|
||||
"properties": {
|
||||
"fo:font-weight": "600", "fo:font-style": "normal",
|
||||
"fo:color": "#775D44", "svg:fill": "#F0B67F",
|
||||
"line-width": "1pt", "line-color": "#F0B67F",
|
||||
"border-line-color": "#F0B67F", "border-line-width": "2pt",
|
||||
"line-class": "org.xmind.branchConnection.curve"
|
||||
}
|
||||
},
|
||||
"relationship": {
|
||||
"id": str(uuid.uuid4()),
|
||||
"properties": {
|
||||
"fo:font-weight": "600", "fo:font-style": "normal",
|
||||
"fo:color": "#F0B67F", "line-width": "3pt",
|
||||
"line-color": "#F0B67F", "line-pattern": "solid"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
WUXING_POSITIONS = {
|
||||
"金": {"x": -8, "y": -252},
|
||||
"水": {"x": 271, "y": -113},
|
||||
"木": {"x": 196, "y": 191},
|
||||
"火": {"x": -175, "y": 197},
|
||||
"土": {"x": -260, "y": -83},
|
||||
}
|
||||
|
||||
WUXING_DESCRIPTIONS = {
|
||||
"金": "定位与角色:是谁、给谁、站在什么位置上",
|
||||
"水": "经历与路径:事情是怎么发生的",
|
||||
"木": "方法与产出:具体怎么干、能产出什么",
|
||||
"火": "认知与判断:为什么这么想、怎么判断对错",
|
||||
"土": "系统与沉淀:如何长期稳定、不崩盘",
|
||||
}
|
||||
|
||||
ELEMENT_KEY_MAP = {
|
||||
"金": "gold", "水": "water", "木": "wood", "火": "fire", "土": "earth"
|
||||
}
|
||||
|
||||
|
||||
def gen_id():
|
||||
"""生成 XMind 节点 ID(26位混合字母数字格式)"""
|
||||
import random
|
||||
import string
|
||||
chars = string.ascii_lowercase + string.digits
|
||||
return ''.join(random.choice(chars) for _ in range(26))
|
||||
|
||||
|
||||
def _make_element_node(name, items, note_text=""):
|
||||
"""创建五行浮动节点(detached 定位模式)"""
|
||||
children = []
|
||||
if WUXING_DESCRIPTIONS.get(name):
|
||||
children.append({"id": gen_id(), "title": WUXING_DESCRIPTIONS[name]})
|
||||
for item in items:
|
||||
children.append({"id": gen_id(), "title": item})
|
||||
|
||||
node = {
|
||||
"id": gen_id(),
|
||||
"title": name,
|
||||
"position": WUXING_POSITIONS[name],
|
||||
"children": {"attached": children} if children else {}
|
||||
}
|
||||
if note_text:
|
||||
node["notes"] = {"plain": {"content": note_text}}
|
||||
return node
|
||||
|
||||
|
||||
def create_book_sheet(book_name, author, note_data=None):
|
||||
"""
|
||||
创建书籍标签页结构
|
||||
|
||||
Args:
|
||||
book_name: 书名
|
||||
author: 作者
|
||||
note_data: 笔记数据字典(可选,用于填充内容)
|
||||
|
||||
Returns:
|
||||
tuple: (sheet结构, sheet_id, root_id) # 返回root_id用于链接
|
||||
创建书籍标签页(五行模板格式 v2)
|
||||
中心红色节点 + 五行橙色浮动节点(detached)+ 补充信息(attached)
|
||||
"""
|
||||
sheet_id = str(uuid.uuid4()) # sheet用标准UUID格式
|
||||
root_id = gen_id() # rootTopic用26位格式
|
||||
|
||||
# 默认笔记数据
|
||||
sheet_id = str(uuid.uuid4())
|
||||
root_id = gen_id()
|
||||
|
||||
if note_data is None:
|
||||
note_data = {
|
||||
"summary": "待填写一句话总结",
|
||||
@@ -70,113 +173,87 @@ def create_book_sheet(book_name, author, note_data=None):
|
||||
"wood": ["木-1:待填写", "木-2:待填写", "木-3:待填写", "木-4:待填写"],
|
||||
"fire": ["火-1:待填写", "火-2:待填写", "火-3:待填写", "火-4:待填写"],
|
||||
"earth": ["土-1:待填写", "土-2:待填写", "土-3:待填写", "土-4:待填写"],
|
||||
"questions": [],
|
||||
"characters": [],
|
||||
"quotes": [],
|
||||
"keywords": [],
|
||||
"process": "",
|
||||
"rules": ""
|
||||
"questions": [], "characters": [], "quotes": [],
|
||||
"keywords": [], "process": "", "rules": ""
|
||||
}
|
||||
|
||||
def create_element_node(name, marker, items, description=""):
|
||||
"""创建五行元素节点"""
|
||||
children = []
|
||||
if description:
|
||||
children.append({
|
||||
"id": gen_id(),
|
||||
"title": description
|
||||
})
|
||||
for item in items:
|
||||
children.append({
|
||||
"id": gen_id(),
|
||||
"title": item
|
||||
})
|
||||
return {
|
||||
"id": gen_id(),
|
||||
"title": name,
|
||||
"markers": [{"markerId": marker}],
|
||||
"children": {"attached": children} if children else {}
|
||||
}
|
||||
|
||||
|
||||
detached_nodes = []
|
||||
for name in ["金", "水", "木", "火", "土"]:
|
||||
key = ELEMENT_KEY_MAP[name]
|
||||
items = note_data.get(key, [])
|
||||
detached_nodes.append(_make_element_node(name, items))
|
||||
|
||||
attached_nodes = [
|
||||
{
|
||||
"id": gen_id(), "title": "一句话总结",
|
||||
"children": {"attached": [
|
||||
{"id": gen_id(), "title": note_data.get("summary", "待填写")}
|
||||
]}
|
||||
},
|
||||
{
|
||||
"id": gen_id(), "title": "问题与解答",
|
||||
"children": {"attached": [
|
||||
{"id": gen_id(), "title": q}
|
||||
for q in (note_data.get("questions") or ["待填写"])
|
||||
]}
|
||||
},
|
||||
{
|
||||
"id": gen_id(), "title": "人物分析",
|
||||
"children": {"attached": [
|
||||
{"id": gen_id(), "title": c}
|
||||
for c in (note_data.get("characters") or ["待填写"])
|
||||
]}
|
||||
},
|
||||
{
|
||||
"id": gen_id(), "title": "金句与关键词",
|
||||
"children": {"attached": [
|
||||
{"id": gen_id(), "title": "金句", "children": {"attached": [
|
||||
{"id": gen_id(), "title": q}
|
||||
for q in (note_data.get("quotes") or ["待填写"])
|
||||
]}},
|
||||
{"id": gen_id(), "title": "关键词", "children": {"attached": [
|
||||
{"id": gen_id(), "title": k}
|
||||
for k in (note_data.get("keywords") or ["待填写"])
|
||||
]}}
|
||||
]}
|
||||
},
|
||||
{
|
||||
"id": gen_id(), "title": "流程图示",
|
||||
"children": {"attached": [
|
||||
{"id": gen_id(), "title": note_data.get("process") or "待填写"}
|
||||
]}
|
||||
},
|
||||
{
|
||||
"id": gen_id(), "title": "使用规则",
|
||||
"children": {"attached": [
|
||||
{"id": gen_id(), "title": note_data.get("rules") or "待填写"}
|
||||
]}
|
||||
},
|
||||
]
|
||||
|
||||
sheet = {
|
||||
"id": sheet_id,
|
||||
"class": "sheet",
|
||||
"title": f"《{book_name}》- {author}",
|
||||
"theme": WUXING_THEME,
|
||||
"rootTopic": {
|
||||
"id": root_id,
|
||||
"class": "topic",
|
||||
"title": f"《{book_name}》- {author}",
|
||||
"structureClass": "org.xmind.ui.map.unbalanced",
|
||||
"title": f"《{book_name}》\n{author}",
|
||||
"structureClass": "org.xmind.ui.map.clockwise",
|
||||
"extensions": [
|
||||
{
|
||||
"provider": "org.xmind.ui.map.unbalanced",
|
||||
"content": [{"name": "right-number", "content": "-1"}]
|
||||
}
|
||||
],
|
||||
"children": {
|
||||
"attached": [
|
||||
# 一句话总结
|
||||
{
|
||||
"id": gen_id(),
|
||||
"title": "一句话总结",
|
||||
"children": {
|
||||
"attached": [
|
||||
{"id": gen_id(), "title": note_data.get("summary", "待填写")}
|
||||
]
|
||||
}
|
||||
},
|
||||
# 金
|
||||
create_element_node("金", MARKERS["金"], note_data.get("gold", []), "定位与角色:是谁、给谁、站在什么位置上"),
|
||||
# 水
|
||||
create_element_node("水", MARKERS["水"], note_data.get("water", []), "经历与路径:事情是怎么发生的"),
|
||||
# 木
|
||||
create_element_node("木", MARKERS["木"], note_data.get("wood", []), "方法与产出:具体怎么干、能产出什么"),
|
||||
# 火
|
||||
create_element_node("火", MARKERS["火"], note_data.get("fire", []), "认知与判断:为什么这么想、怎么判断对错"),
|
||||
# 土
|
||||
create_element_node("土", MARKERS["土"], note_data.get("earth", []), "系统与沉淀:如何长期稳定、不崩盘"),
|
||||
# 问题与解答
|
||||
{
|
||||
"id": gen_id(),
|
||||
"title": "问题与解答",
|
||||
"children": {
|
||||
"attached": [{"id": gen_id(), "title": q} for q in note_data.get("questions", ["待填写"])]
|
||||
}
|
||||
},
|
||||
# 人物分析
|
||||
{
|
||||
"id": gen_id(),
|
||||
"title": "人物分析",
|
||||
"children": {
|
||||
"attached": [{"id": gen_id(), "title": c} for c in note_data.get("characters", ["待填写"])]
|
||||
}
|
||||
},
|
||||
# 金句与关键词
|
||||
{
|
||||
"id": gen_id(),
|
||||
"title": "金句与关键词",
|
||||
"children": {
|
||||
"attached": [
|
||||
{"id": gen_id(), "title": "金句", "children": {"attached": [{"id": gen_id(), "title": q} for q in note_data.get("quotes", ["待填写"])]}},
|
||||
{"id": gen_id(), "title": "关键词", "children": {"attached": [{"id": gen_id(), "title": k} for k in note_data.get("keywords", ["待填写"])]}}
|
||||
]
|
||||
}
|
||||
},
|
||||
# 流程图示
|
||||
{
|
||||
"id": gen_id(),
|
||||
"title": "流程图示",
|
||||
"children": {
|
||||
"attached": [{"id": gen_id(), "title": note_data.get("process", "待填写")}]
|
||||
}
|
||||
},
|
||||
# 使用规则
|
||||
{
|
||||
"id": gen_id(),
|
||||
"title": "使用规则",
|
||||
"children": {
|
||||
"attached": [{"id": gen_id(), "title": note_data.get("rules", "待填写")}]
|
||||
}
|
||||
}
|
||||
]
|
||||
"attached": attached_nodes,
|
||||
"detached": detached_nodes,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return sheet, sheet_id, root_id
|
||||
|
||||
def add_link_to_category(topics, category_title, book_name, author, sheet_id):
|
||||
|
||||
126
运营中枢/参考资料/XMind五行模板格式规范.md
Normal file
126
运营中枢/参考资料/XMind五行模板格式规范.md
Normal file
@@ -0,0 +1,126 @@
|
||||
# XMind 五行模板格式规范
|
||||
|
||||
> 所有项目脑图、读书笔记脑图统一采用此格式,不再使用旧版 flag-marker 平铺格式。
|
||||
|
||||
## 布局结构
|
||||
|
||||
| 要素 | 规格 |
|
||||
|------|------|
|
||||
| **中心节点** | 珊瑚红 `#e4705c`,20pt 粗体,`org.xmind.ui.map.clockwise` |
|
||||
| **五行节点** | 橙色浮动 `#F0B67F`,棕色文字 `#775D44`,用 `detached` + `position` 定位 |
|
||||
| **子节点** | 深灰 `#434B54`,白色文字,11pt |
|
||||
| **边框** | 奶油底 `#FEF1E4`,橙色边线 `#F0B67F` |
|
||||
| **连线** | 曲线 `org.xmind.branchConnection.curve`,1pt |
|
||||
|
||||
## 五行方位坐标(固定)
|
||||
|
||||
```
|
||||
金 (-8, -252)
|
||||
↑
|
||||
土 (-260, -83) 水 (271, -113)
|
||||
●
|
||||
火 (-175, 197) 木 (196, 191)
|
||||
```
|
||||
|
||||
| 元素 | X | Y | 方位 | 含义 |
|
||||
|------|-----|------|------|------|
|
||||
| 金 | -8 | -252 | 正上 | 定位/架构/资源 |
|
||||
| 水 | 271 | -113 | 右上 | 流程/路径/规划 |
|
||||
| 木 | 196 | 191 | 右下 | 执行/产品/落地 |
|
||||
| 火 | -175 | 197 | 左下 | 运营/数据/迭代 |
|
||||
| 土 | -260 | -83 | 左上 | 增长/裂变/沉淀 |
|
||||
|
||||
## 主题定义(Theme JSON)
|
||||
|
||||
```json
|
||||
{
|
||||
"centralTopic": {
|
||||
"properties": {
|
||||
"fo:font-size": "20pt",
|
||||
"fo:font-weight": "600",
|
||||
"svg:fill": "#e4705c",
|
||||
"line-color": "#434B54",
|
||||
"border-line-width": "0"
|
||||
}
|
||||
},
|
||||
"floatingTopic": {
|
||||
"properties": {
|
||||
"fo:font-weight": "600",
|
||||
"fo:color": "#775D44",
|
||||
"svg:fill": "#F0B67F",
|
||||
"line-width": "1pt",
|
||||
"line-color": "#F0B67F",
|
||||
"border-line-color": "#F0B67F",
|
||||
"border-line-width": "0",
|
||||
"line-class": "org.xmind.branchConnection.curve"
|
||||
}
|
||||
},
|
||||
"mainTopic": {
|
||||
"properties": {
|
||||
"fo:font-size": "14pt",
|
||||
"fo:color": "#FFFFFF",
|
||||
"svg:fill": "#434B54",
|
||||
"line-width": "1pt",
|
||||
"border-line-width": "0",
|
||||
"line-class": "org.xmind.branchConnection.curve"
|
||||
}
|
||||
},
|
||||
"subTopic": {
|
||||
"properties": {
|
||||
"fo:font-size": "11pt",
|
||||
"fo:color": "#434B54",
|
||||
"fo:text-align": "left"
|
||||
}
|
||||
},
|
||||
"boundary": {
|
||||
"properties": {
|
||||
"fo:font-size": "14pt",
|
||||
"fo:font-weight": "700",
|
||||
"fo:color": "#F0B67F",
|
||||
"svg:fill": "#FEF1E4",
|
||||
"line-color": "#F0B67F"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 节点结构规范
|
||||
|
||||
### 项目脑图
|
||||
|
||||
```
|
||||
中心: 项目名 + 一句话描述(换行)
|
||||
├── [detached] 金 — 定位/架构/团队/资源
|
||||
├── [detached] 水 — 流程/SOP/通道/规划
|
||||
├── [detached] 木 — 产品/执行/铺货/交付
|
||||
├── [detached] 火 — 运营/数据/代理/复盘
|
||||
└── [detached] 土 — 分佣/裂变/营收/增长
|
||||
```
|
||||
|
||||
### 读书笔记脑图
|
||||
|
||||
```
|
||||
中心: 《书名》+ 作者(换行)
|
||||
├── [detached] 金 — 定位与角色
|
||||
├── [detached] 水 — 经历与路径
|
||||
├── [detached] 木 — 方法与产出
|
||||
├── [detached] 火 — 认知与判断
|
||||
├── [detached] 土 — 系统与沉淀
|
||||
├── [attached] 一句话总结
|
||||
├── [attached] 问题与解答
|
||||
├── [attached] 人物分析
|
||||
├── [attached] 金句与关键词
|
||||
├── [attached] 流程图示
|
||||
└── [attached] 使用规则
|
||||
```
|
||||
|
||||
## 相关脚本
|
||||
|
||||
- 读书笔记:`04_卡火(火)/火种_知识模型/读书笔记/脚本/write_to_xmind.py`
|
||||
- 项目脑图:按本规范手动或脚本生成,参考龙虾项目 restyle 脚本
|
||||
|
||||
## 变更记录
|
||||
|
||||
| 日期 | 内容 |
|
||||
|------|------|
|
||||
| 2026-03-15 | v2.0 — 从 flag-marker 平铺格式升级为 detached 浮动五方位格式 |
|
||||
@@ -355,3 +355,4 @@
|
||||
| 2026-03-14 09:31:21 | 🔄 卡若AI 同步 2026-03-14 09:31 | 更新:水溪整理归档、运营中枢工作台 | 排除 >20MB: 11 个 |
|
||||
| 2026-03-14 10:36:14 | 🔄 卡若AI 同步 2026-03-14 10:36 | 更新:水桥平台对接、水溪整理归档、火炬、运营中枢工作台 | 排除 >20MB: 11 个 |
|
||||
| 2026-03-15 07:05:48 | 🔄 卡若AI 同步 2026-03-15 07:05 | 更新:水桥平台对接、运营中枢、运营中枢工作台 | 排除 >20MB: 11 个 |
|
||||
| 2026-03-15 07:12:23 | 🔄 卡若AI 同步 2026-03-15 07:12 | 更新:运营中枢工作台 | 排除 >20MB: 11 个 |
|
||||
|
||||
@@ -358,3 +358,4 @@
|
||||
| 2026-03-14 09:31:21 | 成功 | 成功 | 🔄 卡若AI 同步 2026-03-14 09:31 | 更新:水溪整理归档、运营中枢工作台 | 排除 >20MB: 11 个 | [仓库](http://open.quwanzhi.com:3000/fnvtk/karuo-ai) [百科](http://open.quwanzhi.com:3000/fnvtk/karuo-ai/wiki) |
|
||||
| 2026-03-14 10:36:14 | 成功 | 成功 | 🔄 卡若AI 同步 2026-03-14 10:36 | 更新:水桥平台对接、水溪整理归档、火炬、运营中枢工作台 | 排除 >20MB: 11 个 | [仓库](http://open.quwanzhi.com:3000/fnvtk/karuo-ai) [百科](http://open.quwanzhi.com:3000/fnvtk/karuo-ai/wiki) |
|
||||
| 2026-03-15 07:05:48 | 成功 | 成功 | 🔄 卡若AI 同步 2026-03-15 07:05 | 更新:水桥平台对接、运营中枢、运营中枢工作台 | 排除 >20MB: 11 个 | [仓库](http://open.quwanzhi.com:3000/fnvtk/karuo-ai) [百科](http://open.quwanzhi.com:3000/fnvtk/karuo-ai/wiki) |
|
||||
| 2026-03-15 07:12:23 | 成功 | 成功 | 🔄 卡若AI 同步 2026-03-15 07:12 | 更新:运营中枢工作台 | 排除 >20MB: 11 个 | [仓库](http://open.quwanzhi.com:3000/fnvtk/karuo-ai) [百科](http://open.quwanzhi.com:3000/fnvtk/karuo-ai/wiki) |
|
||||
|
||||
Reference in New Issue
Block a user