فهرست منبع

:art: 记录文档浏览位置 https://github.com/siyuan-note/siyuan/issues/4042

Liang Ding 3 سال پیش
والد
کامیت
effb602c62

+ 4 - 34
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",

+ 2 - 72
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",

+ 4 - 34
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",

+ 2 - 72
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",

+ 2 - 72
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",

+ 4 - 34
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",

+ 9 - 0
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

+ 1 - 1
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)

+ 3 - 3
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
 }