思源 0 篇文章

圣诞快乐 css

圣诞快乐 css
seehttps://ld246.com/article/1734435831275#barWorkspace{position:relative;}#barWorkspacespan.toolbar__text{font-weight:bold;font-size:14px;/*彩虹文字颜色*/animation:rainbow4sinfinitelinear;}#barWorkspacespan

编辑器 toolbar 被添加事件

toolbar 被添加事件(async()=>{observeToolbar((el)=>{console.log(el,'toolbar');});//监听 toolbar 被添加 functionobserveToolbar(callback){//创建一个观察者实例并传入回调函数 constobserver=newMutationObserver((mutationsList,observer)=>{f

css 大全

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('_

监听打开 URL 事件

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

SQL 大全

查询某一个子文档下面不含标签的文档 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

思源笔记丨目前我用过的数据库 API 整理

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

Sprig 模板全局变量示例

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 块语法
推荐教程:思源模板功能新人指南:模板语法 + 函数 +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

查看文档的正向链接

seehttps://ld246.com/article/1733727390265Imuvux•3 分钟前订阅者​付费者 SQL 查询当前文档引用块:select*fromblockswhereidin(selectdef_block_idfromrefswhereroot_id='文档 ID')​文档层级导航插件,设置启用显示正向链接,可以查看文档级正链反链过滤面板插件,设置定义块范围=引用其他文档的定