-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add plugin event bus open-siyuan-url-plugin
and open-siyuan-url-block
#8927
Add plugin event bus open-siyuan-url-plugin
and open-siyuan-url-block
#8927
Conversation
萌佬牛哇,请求一个需求,现在的自定义协议链接的逻辑是,点击参数符合规范的思源超链接,就直接调用openFile()打开指定插件了,但是有时候,这样太粗暴了。 后期options内可以携带更多的参数,适配更多的功能 |
自己定义一个 URL 自己解析就可以了 |
那有可能是我理解错误,等到pr合并上去,我再试试看看~~ |
open-siyuan-url
, open-siyuan-url-blocks
and open-siyuan-url-plugins
open-siyuan-url
open-siyuan-url
open-siyuan-url-plugin
and open-siyuan-url-block
…to open the `siyuan://plugins` link. REF: siyuan-note/siyuan#8927
…to open the `siyuan://plugins` link. REF: siyuan-note/siyuan#8927
现有的open-siyuan-url-plugins逻辑看起来似乎是如果匹配到指定插件,就必定会走到openFile这一步,也就是必定会打开tab页。但是有时候外部调用自定义协议链接并不仅仅是想要打开tab页,而是希望做其它的事情 :比如说可以根据传入的参数打开文档或者新建文档之类的。类似的需求描述可以看看这个#6875 监听open-siyuan-url这个事件倒是可以实现上述需求,但是我看这个功能并没有被合并上去。。。 如果萌佬有空的话,可否再次提交一下open-siyuan-url的PR,或者给open-siyuan-url-plugins加上一个额外的解析参数,如果携带了这个参数,就不走openFile的逻辑了。 |
…to open the `siyuan://plugins` link. REF: siyuan-note/siyuan#8927
Add some plugin event buses
添加插件事件总线
open-siyuan-url
siyuan://foo
open
siyuan://foo
open-siyuan-url-blocks
siyuan://blocks/<块 ID>
open
siyuan://blocks/<block ID>
open-siyuan-url-plugins
siyuan://plugins/<插件名>
open
siyuan://plugins/<plugin name>
This event only send to the plugin with the same name
已通过测试 (Windows 11)
Tested passed (Windows 11)