diff --git a/app/guide/20210808180117-6v0mkxr/20200923234731-h3zkwm2.sy b/app/guide/20210808180117-6v0mkxr/20200923234731-h3zkwm2.sy index 0092886cb..e9f420056 100644 --- a/app/guide/20210808180117-6v0mkxr/20200923234731-h3zkwm2.sy +++ b/app/guide/20210808180117-6v0mkxr/20200923234731-h3zkwm2.sy @@ -6,7 +6,7 @@ "id": "20200923234731-h3zkwm2", "title": "FAQ", "type": "doc", - "updated": "20220711123705" + "updated": "20220808132857" }, "Children": [ { @@ -704,7 +704,7 @@ "ListData": {}, "Properties": { "id": "20220526112843-xbvl2ni", - "updated": "20220615152228" + "updated": "20220808132857" }, "Children": [ { @@ -846,7 +846,7 @@ }, "Properties": { "id": "20220526112843-rnr85gt", - "updated": "20220526112843" + "updated": "20220808132857" }, "Children": [ { @@ -854,39 +854,9 @@ "Type": "NodeParagraph", "Properties": { "id": "20220526112843-mj4iy0b", - "updated": "20220615152201" + "updated": "20220808132857" }, "Children": [ - { - "Type": "NodeLink", - "Data": "span", - "Children": [ - { - "Type": "NodeOpenBracket" - }, - { - "Type": "NodeLinkText", - "Data": "Data Parser" - }, - { - "Type": "NodeCloseBracket" - }, - { - "Type": "NodeOpenParen" - }, - { - "Type": "NodeLinkDest", - "Data": "https://github.com/88250/protyle" - }, - { - "Type": "NodeCloseParen" - } - ] - }, - { - "Type": "NodeText", - "Data": " and " - }, { "Type": "NodeLink", "Data": "span", diff --git a/app/guide/20210808180117-6v0mkxr/20201121224345-rc27qvo.sy b/app/guide/20210808180117-6v0mkxr/20201121224345-rc27qvo.sy index 09be989f3..e35fa4289 100644 --- a/app/guide/20210808180117-6v0mkxr/20201121224345-rc27qvo.sy +++ b/app/guide/20210808180117-6v0mkxr/20201121224345-rc27qvo.sy @@ -6,7 +6,7 @@ "id": "20201121224345-rc27qvo", "title": "Acknowledgements", "type": "doc", - "updated": "20220716105832" + "updated": "20220522101213" }, "Children": [ { @@ -29,7 +29,7 @@ "ListData": {}, "Properties": { "id": "20220522101213-z3hokh2", - "updated": "20220716105832" + "updated": "20220522101213" }, "Children": [ { @@ -592,76 +592,6 @@ } ] }, - { - "ID": "20220522101213-yje0526", - "Type": "NodeListItem", - "ListData": { - "BulletChar": 42, - "Marker": "Kg==" - }, - "Properties": { - "id": "20220522101213-yje0526", - "updated": "20220522101213" - }, - "Children": [ - { - "ID": "20220522101213-523nxnk", - "Type": "NodeParagraph", - "Properties": { - "id": "20220522101213-523nxnk", - "updated": "20220522101213" - }, - "Children": [ - { - "Type": "NodeLink", - "Data": "span", - "Children": [ - { - "Type": "NodeOpenBracket" - }, - { - "Type": "NodeLinkText", - "Data": "https://github.com/88250/protyle" - }, - { - "Type": "NodeCloseBracket" - }, - { - "Type": "NodeOpenParen" - }, - { - "Type": "NodeLinkDest", - "Data": "https://github.com/88250/protyle" - }, - { - "Type": "NodeCloseParen" - } - ] - }, - { - "Type": "NodeText", - "Data": " " - }, - { - "Type": "NodeCodeSpan", - "Data": "code", - "Children": [ - { - "Type": "NodeCodeSpanOpenMarker" - }, - { - "Type": "NodeCodeSpanContent", - "Data": "Mulan PSL v2" - }, - { - "Type": "NodeCodeSpanCloseMarker" - } - ] - } - ] - } - ] - }, { "ID": "20220522101213-7w3dt83", "Type": "NodeListItem", diff --git a/app/guide/20210808180117-czj9bvb/20200813093015-u6bopdt.sy b/app/guide/20210808180117-czj9bvb/20200813093015-u6bopdt.sy index fee1d7af6..a3bbca596 100644 --- a/app/guide/20210808180117-czj9bvb/20200813093015-u6bopdt.sy +++ b/app/guide/20210808180117-czj9bvb/20200813093015-u6bopdt.sy @@ -6,7 +6,7 @@ "id": "20200813093015-u6bopdt", "title": "常见问题", "type": "doc", - "updated": "20220711123431" + "updated": "20220808132829" }, "Children": [ { @@ -802,7 +802,7 @@ "ListData": {}, "Properties": { "id": "20220526112824-mw30a1z", - "updated": "20220615151956" + "updated": "20220808132829" }, "Children": [ { @@ -944,7 +944,7 @@ }, "Properties": { "id": "20220526112824-w23ystc", - "updated": "20220526112824" + "updated": "20220808132829" }, "Children": [ { @@ -952,39 +952,9 @@ "Type": "NodeParagraph", "Properties": { "id": "20220526112824-8p1ws46", - "updated": "20220615151918" + "updated": "20220808132829" }, "Children": [ - { - "Type": "NodeLink", - "Data": "span", - "Children": [ - { - "Type": "NodeOpenBracket" - }, - { - "Type": "NodeLinkText", - "Data": "数据解析器" - }, - { - "Type": "NodeCloseBracket" - }, - { - "Type": "NodeOpenParen" - }, - { - "Type": "NodeLinkDest", - "Data": "https://github.com/88250/protyle" - }, - { - "Type": "NodeCloseParen" - } - ] - }, - { - "Type": "NodeText", - "Data": "和" - }, { "Type": "NodeLink", "Data": "span", diff --git a/app/guide/20210808180117-czj9bvb/20201121212605-9td1a62.sy b/app/guide/20210808180117-czj9bvb/20201121212605-9td1a62.sy index 416cc69db..7abbac0de 100644 --- a/app/guide/20210808180117-czj9bvb/20201121212605-9td1a62.sy +++ b/app/guide/20210808180117-czj9bvb/20201121212605-9td1a62.sy @@ -6,7 +6,7 @@ "id": "20201121212605-9td1a62", "title": "致谢", "type": "doc", - "updated": "20220716105842" + "updated": "20220522101224" }, "Children": [ { @@ -29,7 +29,7 @@ "ListData": {}, "Properties": { "id": "20220522101224-ctmcj3d", - "updated": "20220716105842" + "updated": "20220522101224" }, "Children": [ { @@ -592,76 +592,6 @@ } ] }, - { - "ID": "20220522101224-sadobhd", - "Type": "NodeListItem", - "ListData": { - "BulletChar": 42, - "Marker": "Kg==" - }, - "Properties": { - "id": "20220522101224-sadobhd", - "updated": "20220522101224" - }, - "Children": [ - { - "ID": "20220522101224-yzy9201", - "Type": "NodeParagraph", - "Properties": { - "id": "20220522101224-yzy9201", - "updated": "20220522101224" - }, - "Children": [ - { - "Type": "NodeLink", - "Data": "span", - "Children": [ - { - "Type": "NodeOpenBracket" - }, - { - "Type": "NodeLinkText", - "Data": "https://github.com/88250/protyle" - }, - { - "Type": "NodeCloseBracket" - }, - { - "Type": "NodeOpenParen" - }, - { - "Type": "NodeLinkDest", - "Data": "https://github.com/88250/protyle" - }, - { - "Type": "NodeCloseParen" - } - ] - }, - { - "Type": "NodeText", - "Data": " " - }, - { - "Type": "NodeCodeSpan", - "Data": "code", - "Children": [ - { - "Type": "NodeCodeSpanOpenMarker" - }, - { - "Type": "NodeCodeSpanContent", - "Data": "Mulan PSL v2" - }, - { - "Type": "NodeCodeSpanCloseMarker" - } - ] - } - ] - } - ] - }, { "ID": "20220522101224-2z5veif", "Type": "NodeListItem", diff --git a/app/guide/20211226090932-5lcq56f/20211226114929-08ap1r0.sy b/app/guide/20211226090932-5lcq56f/20211226114929-08ap1r0.sy index 0811393cb..b1dc49fa7 100644 --- a/app/guide/20211226090932-5lcq56f/20211226114929-08ap1r0.sy +++ b/app/guide/20211226090932-5lcq56f/20211226114929-08ap1r0.sy @@ -5,7 +5,7 @@ "icon": "1f64f", "id": "20211226114929-08ap1r0", "title": "致謝", - "updated": "20220716105852" + "updated": "20220326092650" }, "Children": [ { @@ -28,7 +28,7 @@ "ListData": {}, "Properties": { "id": "20220326092650-r61gazd", - "updated": "20220716105852" + "updated": "20220326092650" }, "Children": [ { @@ -591,76 +591,6 @@ } ] }, - { - "ID": "20220326092650-tl3kn7t", - "Type": "NodeListItem", - "ListData": { - "BulletChar": 42, - "Marker": "Kg==" - }, - "Properties": { - "id": "20220326092650-tl3kn7t", - "updated": "20220326092650" - }, - "Children": [ - { - "ID": "20220326092650-u4hhbgb", - "Type": "NodeParagraph", - "Properties": { - "id": "20220326092650-u4hhbgb", - "updated": "20220326092650" - }, - "Children": [ - { - "Type": "NodeLink", - "Data": "span", - "Children": [ - { - "Type": "NodeOpenBracket" - }, - { - "Type": "NodeLinkText", - "Data": "https://github.com/88250/protyle" - }, - { - "Type": "NodeCloseBracket" - }, - { - "Type": "NodeOpenParen" - }, - { - "Type": "NodeLinkDest", - "Data": "https://github.com/88250/protyle" - }, - { - "Type": "NodeCloseParen" - } - ] - }, - { - "Type": "NodeText", - "Data": " " - }, - { - "Type": "NodeCodeSpan", - "Data": "code", - "Children": [ - { - "Type": "NodeCodeSpanOpenMarker" - }, - { - "Type": "NodeCodeSpanContent", - "Data": "Mulan PSL v2" - }, - { - "Type": "NodeCodeSpanCloseMarker" - } - ] - } - ] - } - ] - }, { "ID": "20220326092650-s3miqvl", "Type": "NodeListItem", diff --git a/app/guide/20211226090932-5lcq56f/20211226115227-r1rty9v.sy b/app/guide/20211226090932-5lcq56f/20211226115227-r1rty9v.sy index 1faf77c43..076c2521d 100644 --- a/app/guide/20211226090932-5lcq56f/20211226115227-r1rty9v.sy +++ b/app/guide/20211226090932-5lcq56f/20211226115227-r1rty9v.sy @@ -5,7 +5,7 @@ "icon": "2753", "id": "20211226115227-r1rty9v", "title": "常見問題", - "updated": "20220711123511" + "updated": "20220808132844" }, "Children": [ { @@ -700,7 +700,7 @@ "ListData": {}, "Properties": { "id": "20220526112905-4lumsx2", - "updated": "20220615152136" + "updated": "20220808132844" }, "Children": [ { @@ -842,7 +842,7 @@ }, "Properties": { "id": "20220526112905-25zib8i", - "updated": "20220526112905" + "updated": "20220808132844" }, "Children": [ { @@ -850,39 +850,9 @@ "Type": "NodeParagraph", "Properties": { "id": "20220526112905-lg3tfv2", - "updated": "20220615152035" + "updated": "20220808132844" }, "Children": [ - { - "Type": "NodeLink", - "Data": "span", - "Children": [ - { - "Type": "NodeOpenBracket" - }, - { - "Type": "NodeLinkText", - "Data": "數據解析器" - }, - { - "Type": "NodeCloseBracket" - }, - { - "Type": "NodeOpenParen" - }, - { - "Type": "NodeLinkDest", - "Data": "https://github.com/88250/protyle" - }, - { - "Type": "NodeCloseParen" - } - ] - }, - { - "Type": "NodeText", - "Data": "和" - }, { "Type": "NodeLink", "Data": "span", diff --git a/kernel/api/attr.go b/kernel/api/attr.go index 0c1d2dbcc..09373b1ec 100644 --- a/kernel/api/attr.go +++ b/kernel/api/attr.go @@ -22,6 +22,7 @@ import ( "github.com/88250/gulu" "github.com/gin-gonic/gin" "github.com/siyuan-note/siyuan/kernel/model" + "github.com/siyuan-note/siyuan/kernel/treenode" "github.com/siyuan-note/siyuan/kernel/util" ) @@ -56,6 +57,14 @@ func setBlockAttrs(c *gin.Context) { id := arg["id"].(string) attrs := arg["attrs"].(map[string]interface{}) + if 1 == len(attrs) && "" != attrs["scroll"] && "dev" == util.Mode { + // 开发环境不记录用户指南滚动位置 + b := treenode.GetBlockTree(id) + if nil != b && (model.IsUserGuide(b.BoxID)) { + attrs["scroll"] = "" + } + } + nameValues := map[string]string{} for name, value := range attrs { if nil == value { // API `setBlockAttrs` 中如果存在属性值设置为 `null` 时移除该属性 https://github.com/siyuan-note/siyuan/issues/5577 diff --git a/kernel/model/box.go b/kernel/model/box.go index 3b93df69a..fe75748dd 100644 --- a/kernel/model/box.go +++ b/kernel/model/box.go @@ -85,7 +85,7 @@ func ListNotebooks() (ret []*Box, err error) { boxConf := conf.NewBoxConf() boxConfPath := filepath.Join(util.DataDir, dir.Name(), ".siyuan", "conf.json") if !gulu.File.IsExist(boxConfPath) { - if isUserGuide(dir.Name()) { + if IsUserGuide(dir.Name()) { filelock.ReleaseAllFileLocks() os.RemoveAll(filepath.Join(util.DataDir, dir.Name())) logging.LogWarnf("not found user guid box conf [%s], removed it", boxConfPath) diff --git a/kernel/model/mount.go b/kernel/model/mount.go index b6fab600a..d2e997e75 100644 --- a/kernel/model/mount.go +++ b/kernel/model/mount.go @@ -89,7 +89,7 @@ func RemoveBox(boxID string) (err error) { } filelock.ReleaseFileLocks(localPath) - if !isUserGuide(boxID) { + if !IsUserGuide(boxID) { var historyDir string historyDir, err = util.GetHistoryDir("delete") if nil != err { @@ -148,7 +148,7 @@ func Mount(boxID string) (alreadyMount bool, err error) { localPath := filepath.Join(util.DataDir, boxID) var reMountGuide bool - if isUserGuide(boxID) { + if IsUserGuide(boxID) { // 重新挂载帮助文档 guideBox := Conf.Box(boxID) @@ -214,6 +214,6 @@ func Mount(boxID string) (alreadyMount bool, err error) { return false, nil } -func isUserGuide(boxID string) bool { +func IsUserGuide(boxID string) bool { return "20210808180117-czj9bvb" == boxID || "20210808180117-6v0mkxr" == boxID || "20211226090932-5lcq56f" == boxID }