思源
0 篇文章
//获取光标所在元素的上级标题,当不存在时显示文档标题//seehttps://ld246.com/article/1734576044332//seehttps://ld246.com/article/1729605574188//see(()=>{//添加样式 addStyle(`.fn__flex-1.dock__item--space{display:flex;justify-content:
圣诞快乐 css
seehttps://ld246.com/article/1734435831275#barWorkspace{position:relative;}#barWorkspacespan.toolbar__text{font-weight:bold;font-size:14px;/*彩虹文字颜色*/animation:rainbow4sinfinitelinear;}#barWorkspacespan
toolbar 被添加事件(async()=>{observeToolbar((el)=>{console.log(el,'toolbar');});//监听 toolbar 被添加 functionobserveToolbar(callback){//创建一个观察者实例并传入回调函数 constobserver=newMutationObserver((mutationsList,observer)=>{f
css 选择 xlink:href 属性 seehttps://ld246.com/article/1734427196426@namespacexlink'http://www.w3.org/1999/xlink';.protyle-breadcrumb__item:has(use[xlink|href*=iconListItem]).protyle-breadcrumb__text{display:no
seehttps://ld246.com/article/1734407382742/comment/1734440753272?r=wilsons#comments//!jsreturn(async()=>{//等待时长,默认 60 秒 constwaitForTime=60;getWeather();asyncfunctiongetWeather(){constweather=awaitfetch('
seehttps://ld246.com/article/1734430072051//启动时最小化到托盘//seehttps://github.com/siyuan-note/siyuan/blob/5129ad926a21176a352cf5f630e0651011bf9c83/app/src/boot/onGetConfig.ts#L115if(!localStorage.getItem('_
seehttps://github.com/siyuan-note/siyuan/blob/5129ad926a21176a352cf5f630e0651011bf9c83/app/src/boot/onGetConfig.ts#L167require('electron').ipcRenderer.on('siyuan-open-url',(event,url)=>{console.log(eve
查询某一个子文档下面不含标签的文档 seehttps://ld246.com/article/1723590423117SELECT*FROMblockswheretype='d'andpathlike'%20240725203634-j3t72jv/%'andtag=''andidnotin(SELECTroot_idFROMblockswheretype<>'d'andpathlike'%2024
seehttps://ld246.com/article/1734263645595//调用示例,当 callback 返回 true 时退出,返回 false 时取消退出 functionsleep(ms){returnnewPromise(resolve=>setTimeout(resolve,ms));}listenExit(async()=>{console.log('waiting');awaitsle
思源如何给日记模板添加天气
seehttps://ld246.com/article/1734002304855 一,日记模板由于思源模板中无法执行 js,也就无法调用天气 api 了。所以这里可以利用 sql 查询模板变相执行 js 实现。比如这个示例模板,只需要把这段 js 放到模板里,然后模板加载时就可以显示天气了。//!jsreturn(async()=>{//获取天气 getWeather();asyncfunctiongetWeathe
在数据库中实现 js 与 Sprig 模板的交互
seehttps://ld246.com/article/1734002304855 在数据库模板中可以利用 img 标签实现 js 与 Sprig 模板的交互,利用 js 来处理数据,就更方便了。比如:.action{$blocks:=queryBlocks"select*fromblockslimit1"}<span><imgsrc=""data-result='.action{toJson$blocks}'st
seehttps://ld246.com/article/1733365731025 数据库添加非绑定的块和属性值/api/av/appendAttributeViewDetachedBlocksWithValueavID:数据库 id,非块 idblocksValueslist,数据库要添加的行 blocksValues 是个二维数组,对应表格视图的行列参数中的值可以参考源码 kernel/av/value.
日志模板//!jsreturn(async()=>{//获取天气 getWeather();asyncfunctiongetWeather(){//天气 apiconstweather=awaitfetch('https://wttr.in/?format=1');consttext=awaitweather.text();//显示当时的天气 render(text);//始终显示今天的天气//rende
seehttps://ld246.com/article/1733962469913seehttps://ld246.com/article/1729676228605url 后面加参数?id=xxx&focus=true,focus是带聚焦
seehttps://ld246.com/article/1733921523331.action{$total:=0}.action{$id:=.id}.action{$blocks:=queryBlocks"select*fromblockswhereroot_id='?'andid!='?'"$id$id}.action{range$v:=$blocks}.action{$len:=len$v
思源模板功能新人指南:模板语法 + 函数 + md 块语法
推荐教程:思源模板功能新人指南:模板语法 + 函数 +md 块语法手把手数据库模板列简单使用指南快速预览 https://docs.siyuan-note.club/zh-Hans/reference/template/sprig/函数手册 https://docs.siyuan-note.club/zh-Hans/reference/template/siyuan.html 思源专有 https://www.to
seehttps://ld246.com/article/1733636224439//思源 alt+ 单击图片打开本地图片编辑器//特色:打开编辑器后会等待编辑器的关闭,关闭后自动刷新思源文档//仅支持 electron 端,及 Windows 和 Mac 系统//windows 调用画图,Mac 调用预览//seehttps://ld246.com/article/1733636224439(()=>{if(isE
https://ld246.com/article/1733722543125
seehttps://ld246.com/article/1733727390265Imuvux•3 分钟前订阅者付费者 SQL 查询当前文档引用块:select*fromblockswhereidin(selectdef_block_idfromrefswhereroot_id='文档 ID')文档层级导航插件,设置启用显示正向链接,可以查看文档级正链反链过滤面板插件,设置定义块范围=引用其他文档的定
记录精彩的程序人生
开始使用
分类
标签