2025 年 03 月
0 篇文章
seehttps://github.com/siyuan-note/siyuan/issues/10243protyle.reloadthis.protyleSlash=[{filter:["insertemoji\u{1F60A}","\u63D2\u5165\u8868\u60C5\u{1F60A}","crbqwx"],html:`<divclass="b3-list-item__first"
seehttps://github.com/siyuan-note/siyuan/issues/5719 这个接口暂时不加入 API 文档中;使用方式如下:POSThttp://127.0.0.1:6806/api/filetree/reindexTree{"path":"/data/20210808180117-czj9bvb/20200812220555-lj3enxa.sy"}
seehttps://ld246.com/article/1741359650489pc 端//第一步调用 listDocsByPath 获取文档树文档信息//fetchSyncPost('/api/filetree/listDocsByPath',{notebook:'20240723175050-336994k',path:'/20240728220858-adaleye'})//第二步调用 genFi
思源事件原理
思源把插件名称生成注释 dom 结点,然后把相关事件绑定其上,在需要触发的地方通过遍历所有插件,调用 emit 进行触发。seehttps://github.com/siyuan-note/siyuan/blob/0b0c27b0bad3e2a073f61ed28c6ce76d2f2b4b07/app/src/plugin/EventBus.ts#L7 示例:seehttps://ld246.com/arti
seehttps://github.com/siyuan-note/siyuan/issues/14276
行内自定义元素和属性
seehttps://github.com/siyuan-note/siyuan/issues/13325 关联:块自定义元素和属性只能用 span,且不能嵌套,只能叠加自定义属性 custom-xxx 和 data-type 值修改或生成后,需要调用 input 事件触发比如:letmemoELement=document.querySelector(`span[data-id="${newBlockId}"]`
seehttps://ld246.com/article/1741777522652 参考这个:https://github.com/frostime/siyuan-plugin-kits/blob/667c2621ebc6fa11028e4e53e447afc5f00639ea/src/dailynote.ts#L72 不想自己实现也可以手动安装 npminstall@frostime/siyuan-p
文档树和大纲显示不全自动换行
seehttps://ld246.com/article/1727826244841seehttps://ld246.com/article/1741790614241.b3-list-item{line-height:160%;}.b3-list-item__text{word-wrap:break-word;-webkit-line-clamp:inherit;word-break:inheri
seehttps://ld246.com/article/1729773295142 必须设置快捷键 ctrl+f才行(()=>{//等待元素渲染完成后执行 functionwhenElementExist(selector){returnnewPromise(resolve=>{constcheckForElement=()=>{letisExist=false;if(typeofselector==
给图片添加右侧菜单
图片子菜单宽度 25% 调整到主菜单 seehttps://ld246.com/article/1735472731026https://gitee.com/wish163/mysoft/blob/main/%E6%80%9D%E6%BA%90/%E5%A4%8D%E5%88%B6%E6%88%96%E7%A7%BB%E5%8A%A8%E5%AD%90%E8%8F%9C%E5%8D%95%E5%88%B0
表格和数据库联动
seehttps://ld246.com/article/1741622377103//!js//数据库块 idconstavBlockId='20250311063435-9066xpv';//表格块 idconsttableBlockId='20250311063452-p03kxva';//数据库变更后自动更新延迟,单位是毫秒,默认是 1 秒,0 则不自动更新//注意:更新该参数后需要刷新页面才能生效 c
图表和数据库联动
seehttps://ld246.com/article/1722828811581 类似 https://ld246.com/article/1740558177875 类似 https://ld246.com/article/1741622377103 表格和数据库联动当数据库更新数据时,图表会自动更新数据哦。效果如下原理:通过 echarts 中的脚本,动态获取数据库块的数据,然后把数据再格式化为图表的数据
seehttps://github.com/siyuan-note/siyuan/blob/2d2420794c89a86e9cbbddbd05fc5edf17c26a7b/app/src/window/openNewWindow.ts#L36
seehttps://github.com/siyuan-note/siyuan/issues/14310seehttps://ld246.com/article/1741527865453调用方式:getLute().Md2BlockDOM(xxxxx);封装函数如下:functiongetLute(){constsetLute=(options)=>{constlute=window.Lut
记录精彩的程序人生
开始使用
分类
标签