Anki add-on: Anki 双向链接 / Obsidian Export--harel

Anki 双向链接插件，用于在 Anki note 之间建立稳定双链，查看入链、出链和关系图谱，并把 Anki 笔记导出为 Obsidian 友好的 Markdown 文件。 公众号：折耳猫的神奇口袋 WeChat Official Account: 折耳猫的神奇口袋 Anki add-on for building stable bidirectional links between Anki notes, viewing backlinks / outgoing links / linked-note graphs, and exporting Anki notes to Obsidian-friendly Markdown files. 这个插件适合那些会在复习时写思考笔记的 Anki 用户。比如你在刷卡时，会在「思，经验感悟」这类字段里写自己的理解、经验、行动计划，并希望这些卡片之间的关系能继续进入 Obsidian，形成 wikilinks、backlinks、图谱和 LLM 可读的个人 Markdown Wiki。 This add-on is designed for Anki users who write thinking notes while reviewing cards. For example, you may write reflections, experience notes, or action plans in a field such as 思，经验感悟 , then want those note relationships to survive inside Obsidian as wikilinks, backlinks, graph connections, and an LLM-readable personal Markdown wiki. 主要功能 / Main Features 支持用 ccid://nid 创建稳定 note 链接。 Create stable note links with ccid://nid . 尽量兼容历史写法，例如 ciddnid 。 Recognize legacy shorthand such as ciddnid where possible. 查看当前 note 的出链和入链。 Show outgoing links and backlinks for Anki notes. 基于真实链接构建图谱，而不是默认展示大量无关系孤立节点。 Build a graph from real note relationships instead of displaying unrelated isolated notes by default. 点击图谱节点时，直接打开对应 Anki 卡片 / note。 Open the corresponding Anki card / note directly from graph nodes. 导出 note 为 Obsidian 兼容 Markdown。 Export notes to Obsidian-compatible Markdown. 将内部 ccid/cidd 引用转换为 Obsidian wikilink，例如 [[folder/title|title]] 。 Convert internal ccid/cidd references into Obsidian wikilinks such as [[folder/title|title]] . 尽量保留标题、字段、图片、cloze 样式和隐藏 Anki 元数据。 Preserve useful exported content including titles, fields, images, cloze styling, and hidden Anki metadata where supported. 导出时复制媒体文件到 assets 目录。 Copy media assets to an assets folder during export. 推荐工作流 / Intended Workflow 像平时一样在 Anki 里复习卡片。 Review cards in Anki as usual. 在类似「思，经验感悟」的字段里写自己的理解。 Write your own thoughts in a field such as 思，经验感悟 . 用 ccid://nid 或兼容的历史写法 ciddnid 链接相关 note。 Add links to related notes with ccid://nid or compatible legacy ciddnid text. 需要时重建双向链接索引。 Rebuild the bidirectional link index when needed. 用双向链接浏览功能查看出链和入链。 Use the link browser to inspect outgoing links and backlinks. 用图谱视图探索已经连接起来的 note。 Use the graph view to explore connected notes. 将选中的牌组或 note 导出到 Obsidian vault。 Export selected decks or notes to an Obsidian vault. 在 Obsidian 中打开导出的 Markdown 文件，使用原生 backlinks 和 graph view。 Open the exported Markdown files in Obsidian and use native backlinks / graph view. 可选，让 LLM 读取导出的 Markdown vault，用来总结主题、生成 MOC 或重组关联笔记。 Optionally let an LLM read the exported Markdown vault to summarize topics, generate MOCs, or reorganize linked notes. 菜单位置 / Menu 安装后，从 Anki 的工具菜单打开插件。 After installation, open the add-on from the Anki tools menu. 常见菜单入口 / Typical menu entry, 🔗 Anki 双向链接 常用操作 / Common actions, 重建链接索引 / Rebuild link index 浏览双向链接 / Browse bidirectional links 打开双向图谱 / Open bidirectional graph 插入或使用 note 链接 / Insert or use note links 导出到 Obsidian / Export to Obsidian 具体菜单名称可能会随版本略有变化。 Exact menu names may vary by version. Obsidian 导出 / Obsidian Export 导出器的目标不是简单导出纯文本，而是尽量保留 note 之间的关系。 The exporter is designed to preserve relationships, not just dump plain text. 写入文件前，插件会先计算每个导出 note 最终对应的 Markdown 路径，然后把 note 引用转换为 Obsidian wikilinks。 Before writing files, it computes the final Markdown path for each exported note. Then it converts note references into Obsidian wikilinks. 示例 / Example, cidd1746675491943 可能会变成 / may become, [[学习/快速变强/每天做一点积累|每天做一点积累]] 如果目标 note 不在本次导出范围内，Obsidian 可能会显示为未创建链接。这是正常情况，也有助于你发现关系存在但目标文件尚未导出。 If the target note is not included in the export scope, Obsidian may show it as an unresolved link. This is expected and can be useful, because the relationship is still visible instead of being silently discarded. 兼容性说明 / Compatibility Notes 插件针对现代 Anki 25.x 行为进行开发和测试，包括 Anki 25.02 上观察到的 PyQt 6 兼容问题。 This add-on has been developed and tested against modern Anki 25.x behavior, including PyQt 6 compatibility issues observed on Anki 25.02. 导出器会尽量规范化 Anki 牌组分隔符，包括部分 Anki 版本内部使用的不可见 \x1f 分隔符。 The exporter normalizes Anki deck separators where possible, including the invisible \x1f separator used internally by some Anki versions. 由于 Anki add-on API 和 Qt 行为可能随版本变化，测试新版本前建议先备份 Anki collection。 Because Anki add-on APIs and Qt behavior can change between versions, please keep backups of your collection before testing new versions. 已知限制 / Known Limitations Obsidian 回导 Anki 还没有完整实现。 Obsidian to Anki round-trip import is not fully complete. 推荐使用一卡一文件导出，以获得更好的 Obsidian 兼容性。 One-note-one-file export is recommended for best Obsidian compatibility. 牌组合并导出可以使用，但链接和图谱工作流通常更适合一张 note 一个 Markdown 文件。 Merged deck export may work, but link and graph workflows are usually cleaner with one Markdown file per note. 很老或高度自定义的卡片模板，可能包含无法完美转换的 HTML。 Very old or highly customized card templates may contain HTML that cannot be perfectly converted. Obsidian 中出现未解析链接，不一定是错误，也可能只是目标 note 不在本次导出范围里。 Some unresolved Obsidian links may simply mean the target note was outside the selected export scope. 适合人群 / Recommended Use 如果你已经用 Anki 做长期学习，并且会在 note 字段里写自己的理解，这个插件会更有用。 This add-on is most useful if you already use Anki for long-term learning and write your own thoughts inside note fields. 特别适合这些工作流 / It is especially useful for workflows like, 把书籍笔记转换成 Anki 卡片 / book notes converted into Anki cards 学习方法卡片 / learning-method cards 概念之间有关联的卡片 / connected concept notes 复习时写反思字段 / review-time reflection fields Anki 到 Obsidian 知识库导出 / Anki to Obsidian knowledge base export LLM 可读的个人 Markdown Wiki / LLM-readable personal Markdown wiki 如果你只是把 Anki 当作简单单词卡或纯记忆题工具，这个插件可能不是刚需。 If you only use Anki for simple flashcards or vocabulary drills, the add-on may be more than you need. 安全说明 / Safety 插件会读取本地 Anki collection，并把 Markdown 文件写入你选择的导出目录。 The add-on reads your local Anki collection and writes exported Markdown files to the folder you choose. 在大规模导出或批量操作前，请确认你有可用的 Anki 备份。 Before large exports or batch operations, make sure you have a current Anki backup. 反馈问题 / Feedback 如果你遇到导出失败、图谱异常、链接缺失或特定版本 Qt 报错，请尽量提供这些信息。 If you encounter export failures, graph issues, missing links, or version-specific Qt errors, please report the following information. Anki 版本 / Anki version 操作系统 / operating system 插件版本或 commit / add-on version or commit 触发问题的具体操作 / exact action performed 错误 traceback，如果有 / error traceback if available 最小可复现的 note / link 格式示例 / a minimal example of the note or link format that failed