Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2024-10-09 11:56:00 +08:00
commit a66cdff4f2
8 changed files with 89 additions and 41 deletions

View file

@ -6,7 +6,7 @@
"id": "20201204184532-3qm9l8n",
"title": "Template snippet",
"type": "doc",
"updated": "20240921122726"
"updated": "20241008202623"
},
"Children": [
{
@ -57,7 +57,7 @@
"HeadingLevel": 2,
"Properties": {
"id": "20210104091444-jy56z0p",
"updated": "20240921122726"
"updated": "20241008202623"
},
"Children": [
{
@ -117,12 +117,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20210104091444-c7gg3ak",
"updated": "20230820185644"
"updated": "20241008202623"
},
"Children": [
{
"Type": "NodeText",
"Data": "We have built-in variables and functions to enrich the template through the open source project Sprig (github repo: Masterminds/sprig). For example, you can use "
"Data": "We have built-in variables and functions to enrich the template through the open source project Sprig (GitHub repo: Masterminds/sprig). For example, you can use "
},
{
"Type": "NodeTextMark",

View file

@ -6,7 +6,7 @@
"id": "20210110181011-fbhoesf",
"title": "Daily notes",
"type": "doc",
"updated": "20210110181011"
"updated": "20241008202033"
},
"Children": [
{
@ -14,12 +14,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20210110181041-j47iwxx",
"updated": "20210302223722"
"updated": "20241008201757"
},
"Children": [
{
"Type": "NodeText",
"Data": "We can quickly create a document through the daily note. The entry of the daily note function in the top toolbar looks like a calendar button."
"Data": "We can quickly create a document through the daily note, and the daily note function entrance is in the top main menu."
}
]
},
@ -28,12 +28,21 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20210110181041-dnap16f",
"updated": "20210303230545"
"updated": "20241008202033"
},
"Children": [
{
"Type": "NodeText",
"Data": "But before using the daily note, you need to select settings in the right-click drop-down menu of the notebook, and configure in the new diary settings:"
"Data": "Before using the daily note, you need to open "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Settings"
},
{
"Type": "NodeText",
"Data": " in the notebook right-click menu, and configure in the new diary settings:"
}
]
},
@ -48,7 +57,8 @@
"Num": -1
},
"Properties": {
"id": "20210110181041-24ejxr4"
"id": "20210110181041-24ejxr4",
"updated": "20241008202018"
},
"Children": [
{
@ -63,19 +73,21 @@
"Num": -1
},
"Properties": {
"id": "20210110181041-3dq1cg4"
"id": "20210110181041-3dq1cg4",
"updated": "20241008202018"
},
"Children": [
{
"ID": "20210302223720-m8ekt02",
"Type": "NodeParagraph",
"Properties": {
"id": "20210302223720-m8ekt02"
"id": "20210302223720-m8ekt02",
"updated": "20241008202018"
},
"Children": [
{
"Type": "NodeText",
"Data": "Storage path: the path under the notebook, support "
"Data": "Save path: the path under the notebook, support "
},
{
"Type": "NodeTextMark",

View file

@ -6,7 +6,7 @@
"id": "20201204181006-7bkppue",
"title": "模板片段",
"type": "doc",
"updated": "20240921122737"
"updated": "20241008201610"
},
"Children": [
{
@ -69,7 +69,7 @@
"HeadingLevel": 2,
"Properties": {
"id": "20210104091309-fhb549c",
"updated": "20240921122737"
"updated": "20241008201610"
},
"Children": [
{
@ -129,12 +129,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20210104091309-mvyh081",
"updated": "20240308161634"
"updated": "20241008201610"
},
"Children": [
{
"Type": "NodeText",
"Data": "我们通过开源项目 Sprig (github repo: Masterminds/sprig) 内置了一些变量和函数来丰富模板。比如可通过 "
"Data": "我们通过开源项目 Sprig (GitHub repo: Masterminds/sprig) 内置了一些变量和函数来丰富模板。比如可通过 "
},
{
"Type": "NodeTextMark",

View file

@ -6,19 +6,20 @@
"id": "20210110175347-2xrwoiq",
"title": "日记",
"type": "doc",
"updated": "20210110175347"
"updated": "20241008201419"
},
"Children": [
{
"ID": "20210110175347-jvtq2ap",
"Type": "NodeParagraph",
"Properties": {
"id": "20210110175347-jvtq2ap"
"id": "20210110175347-jvtq2ap",
"updated": "20241008201121"
},
"Children": [
{
"Type": "NodeText",
"Data": "我们可以通过日记来快速创建文档,日记功能入口在顶部工具栏形似日历的按钮。"
"Data": "我们可以通过日记来快速创建文档,日记功能入口在顶部主菜单中。"
}
]
},
@ -27,12 +28,21 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20210110175631-umo8b4h",
"updated": "20210303230529"
"updated": "20241008201419"
},
"Children": [
{
"Type": "NodeText",
"Data": "但在使用日记前,需要在笔记本右键下拉菜单中选择设置,在新建日记设置中配置:"
"Data": "使用日记前,需要在笔记本右键菜单中打开 "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "设置"
},
{
"Type": "NodeText",
"Data": " ,在新建日记设置中配置:"
}
]
},

View file

@ -6,7 +6,7 @@
"id": "20211226123004-dplpw0o",
"title": "範本片段",
"type": "doc",
"updated": "20240921122732"
"updated": "20241008201617"
},
"Children": [
{
@ -53,7 +53,7 @@
"HeadingLevel": 2,
"Properties": {
"id": "20211226123024-eyagqur",
"updated": "20240921122732"
"updated": "20241008201617"
},
"Children": [
{
@ -109,12 +109,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20211226123024-eurqp4g",
"updated": "20230820185634"
"updated": "20241008201617"
},
"Children": [
{
"Type": "NodeText",
"Data": "我們通過開原專案 Sprig (github repo: Masterminds/sprig) 內置了一些變量和函數來豐富範本。比如可通過 "
"Data": "我們通過開原專案 Sprig (GitHub repo: Masterminds/sprig) 內置了一些變量和函數來豐富範本。比如可通過 "
},
{
"Type": "NodeTextMark",

View file

@ -5,7 +5,8 @@
"Properties": {
"id": "20211226123154-fd5e001",
"title": "日記",
"updated": "20230630130311"
"type": "doc",
"updated": "20241008201536"
},
"Children": [
{
@ -13,12 +14,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20211226123205-0lxrjll",
"updated": "20230630130311"
"updated": "20241008201536"
},
"Children": [
{
"Type": "NodeText",
"Data": "我們可以通過日記來快速建立文檔,日記功能入口在頂部工具欄形似日曆的按鈕。"
"Data": "我們可以通過日記來快速建立文檔,日記功能入口在頂部主菜單中。"
}
]
},
@ -27,12 +28,21 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20211226123205-aik13in",
"updated": "20211226014151"
"updated": "20241008201420"
},
"Children": [
{
"Type": "NodeText",
"Data": "但在使用日記前,需要在筆記本右鍵下拉菜單中選擇設置,在新建日記設置中配置:"
"Data": "使用日記前,需要在筆記本右鍵菜單中開啟 "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "設置"
},
{
"Type": "NodeText",
"Data": " ,在新建日記設置中配置:"
}
]
},

View file

@ -7,21 +7,20 @@
"id": "20240530101000-scr2p21",
"title": "デイリーノート",
"type": "doc",
"updated": "20240530101000"
"updated": "20241008202730"
},
"Children": [
{
"ID": "20240530101000-bzkce2v",
"Type": "NodeParagraph",
"Properties": {
"ID": "20240530101000-6y7pqdq",
"id": "20240530101000-bzkce2v",
"updated": "20240530101000"
"updated": "20241008202730"
},
"Children": [
{
"Type": "NodeText",
"Data": "メインメニューからデイリーノートを作成できます。"
"Data": "デイリーノートを通じて素早く文書を作成できる、デイリーノート機能への入り口は上部のメインメニュにあります。"
}
]
},
@ -29,9 +28,8 @@
"ID": "20240530101000-efq2rys",
"Type": "NodeParagraph",
"Properties": {
"ID": "20240530101000-xwijoqj",
"id": "20240530101000-efq2rys",
"updated": "20240530101000"
"updated": "20241008202721"
},
"Children": [
{

View file

@ -24,6 +24,7 @@ import (
"strings"
"time"
"github.com/88250/gulu"
"github.com/88250/lute/ast"
"github.com/88250/lute/parse"
"github.com/open-spaced-repetition/go-fsrs/v3"
@ -859,13 +860,30 @@ func getEmbeddedBlock(trees map[string]*parse.Tree, sqlBlock *sql.Block, heading
// 嵌入块查询结果中显示块引用计数 https://github.com/siyuan-note/siyuan/issues/7191
var defIDs []string
for _, n := range nodes {
defIDs = append(defIDs, n.ID)
ast.Walk(n, func(n *ast.Node, entering bool) ast.WalkStatus {
if !entering {
return ast.WalkContinue
}
if n.IsBlock() {
defIDs = append(defIDs, n.ID)
}
return ast.WalkContinue
})
}
defIDs = gulu.Str.RemoveDuplicatedElem(defIDs)
refCount := sql.QueryRefCount(defIDs)
for _, n := range nodes {
if cnt := refCount[n.ID]; 0 < cnt {
n.SetIALAttr("refcount", strconv.Itoa(cnt))
}
ast.Walk(n, func(n *ast.Node, entering bool) ast.WalkStatus {
if !entering || !n.IsBlock() {
return ast.WalkContinue
}
if cnt := refCount[n.ID]; 0 < cnt {
n.SetIALAttr("refcount", strconv.Itoa(cnt))
}
return ast.WalkContinue
})
}
luteEngine := NewLute()