-
关于 SiYuan 移动端 UI 的优化 - 退出按键
2024-02-29 16:43这个的作用主要是提醒新用户,因为老用户一般都知道,但新用户又不可能为此专门去下载一个插件或者添加一个代码片段。所以还是应该请 V 姐看看
-
模板是否支持 sub 语法?
2024-02-29 13:18问 GPT 花了我 2 块钱,这个应该可以。要是还有什么问题你就自己看着修好了,问 GPT 实在烧钱:
weekday 模板.zip (解压后的 .md 文件放到 工作空间\data\templates 目录下)
.action{$ng_duration := (toDate "2006-01-02" "2021-12-26").Sub now} .action{$weekhours:=mul 7 24} .action{$duration:=sub 0 $ng_duration.Hours } .action{$week := add (div (div (now.Sub (toDate "2006-01-02" "2024-01-01")).Hours 24) 7) 1} .action{$today:= (now | date "2006-01")} .action{$weekResult:= (list $today "Week" $week| join " ")} # 📅 .action{$weekResult} --- .action{/*今天距离周一有几天*/} .action{$ng_week := (mod (div ((toDate "2006-01-02" "2021-06-28").Sub now).Hours 24) 7) } .action{/*用于range循环,表示循环7次, 没什么实际意义*/} .action{$days := list "星期日" "星期六" "星期五" "星期四" "星期三" "星期二" "星期一"} .action{/*循环生成星期列表*/} .action{/*生成周一日期所需要修正的时长*/} .action{$monday:= mul 24 $ng_week} {{{col .action{range $index,$day:=$days} .action{/*布局*/} .action{$setColum:= mod (add $index 1) 3 } .action{if eq $setColum 1} {{{ .action{end} .action{/*迭代 每次增加24*/} .action{$after := mul 24 (sub 6 $index)} .action{/*在周一的基础上,附加的时间*/} .action{$realdate:= add $monday $after} .action{/*生成以 h 为单位的 字符串*/} .action{$result:=(list $realdate "h" | join "")} .action{/*获取列表项*/} .action{$days_list := now | date_modify $result | date "2006-01-02"} # .action{$days_list} .action{$day} .action{/*布局*/} .action{$setColum:= mod (add $index 1) 1 } .action{if eq $setColum 2} }}} .action{else if eq $index 3} }}} .action{end} .action{$index := add $index 2} .action{end} }}}