feat: add knowledge point retrieval function, file placed in plugin/k… - #1190
Open
LucasandElliot wants to merge 1 commit into
Open
feat: add knowledge point retrieval function, file placed in plugin/k…#1190LucasandElliot wants to merge 1 commit into
LucasandElliot wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR: 知识点检索插件 (knowledgePoint)
Summary
knowledgePoint,通过@@知识点名@@语法在 Markdown 文档中标记和检索知识点@@输入自动补全等完整功能plugin/knowledgePoint.js,之前实现形式是自定义插件形式,因此设置如下,原本插件代码位于plugin/custom/plugins/,配置位于plugin/global/settings/,但因为提交pr,所以删除了plugin/global/settings/和plugin/custom/plugins/,只更新了和提交了plugin/knowledgePoint.js。背景
当前仓库的 Typora 插件框架支持通过
plugin/custom/plugins/目录添加自定义插件,配置文件放在plugin/global/settings/custom_plugin.user.toml。本插件完全遵循此架构,无需修改框架核心代码。功能清单
@@name@@标记语法@@)@@,知识点名以紫色字体 + 淡紫荧光笔底色显示.md文件,首次出现为定义,后续为引用Ctrl+Shift+K触发,可拖拽调整宽度(240-600px)@@弹出下拉列表,↑↓循环选择,Enter/Tab插入Esc关闭面板(搜索框 Esc 先清空再关闭)custom_plugin.user.toml配置项核心设计
[cid]元素,将索引条目映射到实际 DOM 节点textContent而非innerHTML已知限制
@@...@@)File.editor.library.openFile),不同版本可能有差异Test plan
typoraPluginWriting文件夹作为工作目录.md文件中输入@@测试知识点@@并保存Ctrl+Shift+K打开侧边栏,确认知识点出现在列表中@@隐藏和紫色荧光笔样式@@,验证自动补全下拉列表出现↑↓导航、Enter选择,验证补全插入Esc键行为:先清空搜索框,再关闭面板