소스 검색

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

Vanessa 2 년 전
부모
커밋
71a6158f61

+ 8 - 6
app/electron/main.js

@@ -206,11 +206,13 @@ const boot = () => {
         height: defaultHeight,
     }, oldWindowState);
 
+    // writeLog("windowStat [width=" + windowState.width + ", height=" + windowState.height + "], default [width=" + defaultWidth + ", height=" + defaultHeight + "], workArea [width=" + workArea.width + ", height=" + workArea.height + "]");
+
     let x = windowState.x;
     let y = windowState.y;
     if (workArea) {
-        // 窗口大小等同于或大于 workArea 时缩小会隐藏到左下角
-        if (windowState.width >= workArea.width || windowState.height >= workArea.height) {
+        // 窗口大于 workArea 时缩小会隐藏到左下角,这里使用最小值重置
+        if (windowState.width > workArea.width || windowState.height > workArea.height) { // 重启后窗口大小恢复默认问题 https://github.com/siyuan-note/siyuan/issues/7755
             windowState.width = Math.min(defaultWidth, workArea.width);
             windowState.height = Math.min(defaultHeight, workArea.height);
         }
@@ -221,11 +223,11 @@ const boot = () => {
             y = 0;
         }
     }
-    if (windowState.width < 400) {
-        windowState.width = 400;
+    if (windowState.width < 493) {
+        windowState.width = 493;
     }
-    if (windowState.height < 300) {
-        windowState.height = 300;
+    if (windowState.height < 376) {
+        windowState.height = 376;
     }
     if (x < 0) {
         x = 0;

+ 136 - 55
app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20221223221636-ms2b4w9.sy

@@ -5,7 +5,7 @@
 	"Properties": {
 		"id": "20221223221636-ms2b4w9",
 		"title": "Flashcards",
-		"updated": "20230304000717"
+		"updated": "20230324111319"
 	},
 	"Children": [
 		{
@@ -192,61 +192,93 @@
 			]
 		},
 		{
-			"ID": "20230219092249-l3b55a9",
+			"ID": "20230324110955-eznqs9u",
+			"Type": "NodeParagraph",
+			"Properties": {
+				"id": "20230324110955-eznqs9u",
+				"updated": "20230324111043"
+			},
+			"Children": [
+				{
+					"Type": "NodeText",
+					"Data": "Among them, if you don’t need the super block card and list or list item card, you can turn it off in "
+				},
+				{
+					"Type": "NodeTextMark",
+					"TextMarkType": "kbd",
+					"TextMarkTextContent": "Settings"
+				},
+				{
+					"Type": "NodeText",
+					"Data": "​ - "
+				},
+				{
+					"Type": "NodeTextMark",
+					"TextMarkType": "kbd",
+					"TextMarkTextContent": "Flashcard"
+				},
+				{
+					"Type": "NodeText",
+					"Data": "​."
+				}
+			]
+		},
+		{
+			"ID": "20230219092249-3oeqj8o",
 			"Type": "NodeHeading",
 			"HeadingLevel": 3,
 			"Properties": {
-				"id": "20230219092249-l3b55a9",
-				"updated": "20230219092431"
+				"id": "20230219092249-3oeqj8o",
+				"updated": "20230324110951"
 			},
 			"Children": [
 				{
 					"Type": "NodeText",
-					"Data": "Based on card deck"
+					"Data": "Based on doc"
 				}
 			]
 		},
 		{
-			"ID": "20230219092249-4f5q0yn",
+			"ID": "20230219092249-9l69wsr",
 			"Type": "NodeParagraph",
 			"Properties": {
-				"id": "20230219092249-4f5q0yn",
-				"updated": "20230219092602"
+				"id": "20230219092249-9l69wsr",
+				"updated": "20230324110951"
 			},
 			"Children": [
 				{
 					"Type": "NodeText",
-					"Data": "Based on the use of card deck, the content blocks in different documents can be carded and put into a unified card pack for review."
+					"Data": "The document-based usage method does not need to pay attention to the card deck, and supports parent-child document review."
 				}
 			]
 		},
 		{
-			"ID": "20230219092249-adkmzaf",
+			"ID": "20230219092249-wbyos2h",
 			"Type": "NodeList",
 			"ListData": {},
 			"Properties": {
-				"id": "20230219092249-adkmzaf",
-				"updated": "20230219092718"
+				"id": "20230219092249-wbyos2h",
+				"updated": "20230324110951"
 			},
 			"Children": [
 				{
-					"ID": "20230219092249-w4nnmee",
+					"ID": "20230219092249-675n7hy",
 					"Type": "NodeListItem",
 					"ListData": {
 						"BulletChar": 42,
 						"Marker": "Kg=="
 					},
 					"Properties": {
-						"id": "20230219092249-w4nnmee",
-						"updated": "20230219092718"
+						"id": "20230219092249-675n7hy",
+						"updated": "20230219092802"
 					},
 					"Children": [
 						{
-							"ID": "20230219092249-3h4zeve",
+							"ID": "20230219092249-u07ihhi",
 							"Type": "NodeParagraph",
 							"Properties": {
-								"id": "20230219092249-3h4zeve",
-								"updated": "20230219092718"
+								"id": "20230219092249-u07ihhi",
+								"updated": "20230219092802"
 							},
 							"Children": [
 								{
@@ -256,39 +288,39 @@
 								{
 									"Type": "NodeTextMark",
 									"TextMarkType": "kbd",
-									"TextMarkTextContent": "Add to card deck..."
+									"TextMarkTextContent": "Quick make card"
 								},
 								{
 									"Type": "NodeText",
-									"Data": "​ in the block label menu, and then add the content block to a card deck to complete the card making"
+									"Data": "​ in the block icon menu to make a card"
 								}
 							]
 						}
 					]
 				},
 				{
-					"ID": "20230219092249-cf49472",
+					"ID": "20230219092249-omjyd3g",
 					"Type": "NodeListItem",
 					"ListData": {
 						"BulletChar": 42,
 						"Marker": "Kg=="
 					},
 					"Properties": {
-						"id": "20230219092249-cf49472",
-						"updated": "20230219092643"
+						"id": "20230219092249-omjyd3g",
+						"updated": "20230219092822"
 					},
 					"Children": [
 						{
-							"ID": "20230219092249-gtv3hbr",
+							"ID": "20230219092249-2wpj6jk",
 							"Type": "NodeParagraph",
 							"Properties": {
-								"id": "20230219092249-gtv3hbr",
-								"updated": "20230219092643"
+								"id": "20230219092249-2wpj6jk",
+								"updated": "20230219092822"
 							},
 							"Children": [
 								{
 									"Type": "NodeText",
-									"Data": "Access review by clicking "
+									"Data": "Right-click the doc in the document tree panel or click the document block icon "
 								},
 								{
 									"Type": "NodeTextMark",
@@ -297,7 +329,7 @@
 								},
 								{
 									"Type": "NodeText",
-									"Data": "​ in the top bar menu"
+									"Data": "​ in the editor to enter the review"
 								}
 							]
 						}
@@ -306,61 +338,61 @@
 			]
 		},
 		{
-			"ID": "20230219092249-3oeqj8o",
+			"ID": "20230219092249-l3b55a9",
 			"Type": "NodeHeading",
 			"HeadingLevel": 3,
 			"Properties": {
-				"id": "20230219092249-3oeqj8o",
-				"updated": "20230219092505"
+				"id": "20230219092249-l3b55a9",
+				"updated": "20230219092431"
 			},
 			"Children": [
 				{
 					"Type": "NodeText",
-					"Data": "Based on doc"
+					"Data": "Based on card deck"
 				}
 			]
 		},
 		{
-			"ID": "20230219092249-9l69wsr",
+			"ID": "20230219092249-4f5q0yn",
 			"Type": "NodeParagraph",
 			"Properties": {
-				"id": "20230219092249-9l69wsr",
-				"updated": "20230219092712"
+				"id": "20230219092249-4f5q0yn",
+				"updated": "20230219092602"
 			},
 			"Children": [
 				{
 					"Type": "NodeText",
-					"Data": "The document-based usage method does not need to pay attention to the card deck, and supports parent-child document review."
+					"Data": "Based on the use of card deck, the content blocks in different documents can be carded and put into a unified card pack for review."
 				}
 			]
 		},
 		{
-			"ID": "20230219092249-wbyos2h",
+			"ID": "20230219092249-adkmzaf",
 			"Type": "NodeList",
 			"ListData": {},
 			"Properties": {
-				"id": "20230219092249-wbyos2h",
-				"updated": "20230219092822"
+				"id": "20230219092249-adkmzaf",
+				"updated": "20230219092718"
 			},
 			"Children": [
 				{
-					"ID": "20230219092249-675n7hy",
+					"ID": "20230219092249-w4nnmee",
 					"Type": "NodeListItem",
 					"ListData": {
 						"BulletChar": 42,
 						"Marker": "Kg=="
 					},
 					"Properties": {
-						"id": "20230219092249-675n7hy",
-						"updated": "20230219092802"
+						"id": "20230219092249-w4nnmee",
+						"updated": "20230219092718"
 					},
 					"Children": [
 						{
-							"ID": "20230219092249-u07ihhi",
+							"ID": "20230219092249-3h4zeve",
 							"Type": "NodeParagraph",
 							"Properties": {
-								"id": "20230219092249-u07ihhi",
-								"updated": "20230219092802"
+								"id": "20230219092249-3h4zeve",
+								"updated": "20230219092718"
 							},
 							"Children": [
 								{
@@ -370,39 +402,47 @@
 								{
 									"Type": "NodeTextMark",
 									"TextMarkType": "kbd",
-									"TextMarkTextContent": "Quick make card"
+									"TextMarkTextContent": "Add to card deck..."
 								},
 								{
 									"Type": "NodeText",
-									"Data": "​ in the block icon menu to make a card"
+									"Data": "​​ in the block label menu, and then add the "
+								},
+								{
+									"Type": "NodeText",
+									"Data": "content block"
+								},
+								{
+									"Type": "NodeText",
+									"Data": " to a card deck to complete the card making"
 								}
 							]
 						}
 					]
 				},
 				{
-					"ID": "20230219092249-omjyd3g",
+					"ID": "20230219092249-cf49472",
 					"Type": "NodeListItem",
 					"ListData": {
 						"BulletChar": 42,
 						"Marker": "Kg=="
 					},
 					"Properties": {
-						"id": "20230219092249-omjyd3g",
-						"updated": "20230219092822"
+						"id": "20230219092249-cf49472",
+						"updated": "20230219092643"
 					},
 					"Children": [
 						{
-							"ID": "20230219092249-2wpj6jk",
+							"ID": "20230219092249-gtv3hbr",
 							"Type": "NodeParagraph",
 							"Properties": {
-								"id": "20230219092249-2wpj6jk",
-								"updated": "20230219092822"
+								"id": "20230219092249-gtv3hbr",
+								"updated": "20230219092643"
 							},
 							"Children": [
 								{
 									"Type": "NodeText",
-									"Data": "Right-click the doc in the document tree panel or click the document block icon "
+									"Data": "Access review by clicking "
 								},
 								{
 									"Type": "NodeTextMark",
@@ -411,7 +451,7 @@
 								},
 								{
 									"Type": "NodeText",
-									"Data": "​ in the editor to enter the review"
+									"Data": "​​ in the top bar menu"
 								}
 							]
 						}
@@ -419,6 +459,47 @@
 				}
 			]
 		},
+		{
+			"ID": "20230324111120-9sfynhi",
+			"Type": "NodeParagraph",
+			"Properties": {
+				"id": "20230324111120-9sfynhi",
+				"updated": "20230324111319"
+			},
+			"Children": [
+				{
+					"Type": "NodeText",
+					"Data": "This mode of use is disabled by default. If necessary, it can be enabled in "
+				},
+				{
+					"Type": "NodeTextMark",
+					"TextMarkType": "kbd",
+					"TextMarkTextContent": "Settings"
+				},
+				{
+					"Type": "NodeText",
+					"Data": "​ - "
+				},
+				{
+					"Type": "NodeTextMark",
+					"TextMarkType": "kbd",
+					"TextMarkTextContent": "Flashcard"
+				},
+				{
+					"Type": "NodeText",
+					"Data": "​ - "
+				},
+				{
+					"Type": "NodeTextMark",
+					"TextMarkType": "kbd",
+					"TextMarkTextContent": "Deck"
+				},
+				{
+					"Type": "NodeText",
+					"Data": "​. However, it is not recommended to use flashcards based on card deck, because the card deck are fixed and not as flexible as using flashcards based on documents."
+				}
+			]
+		},
 		{
 			"ID": "20221223221639-djlafd4",
 			"Type": "NodeHeading",

+ 127 - 54
app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20221223215557-o6gfsoy.sy

@@ -5,7 +5,7 @@
 	"Properties": {
 		"id": "20221223215557-o6gfsoy",
 		"title": "闪卡",
-		"updated": "20230304000800"
+		"updated": "20230324110708"
 	},
 	"Children": [
 		{
@@ -200,61 +200,93 @@
 			]
 		},
 		{
-			"ID": "20230219084417-qgvd9bn",
+			"ID": "20230324105957-puvmnur",
+			"Type": "NodeParagraph",
+			"Properties": {
+				"id": "20230324105957-puvmnur",
+				"updated": "20230324110110"
+			},
+			"Children": [
+				{
+					"Type": "NodeText",
+					"Data": "其中超级块制卡和列表或者列表项制卡如果不需要的话可以在 "
+				},
+				{
+					"Type": "NodeTextMark",
+					"TextMarkType": "kbd",
+					"TextMarkTextContent": "设置"
+				},
+				{
+					"Type": "NodeText",
+					"Data": "​ - "
+				},
+				{
+					"Type": "NodeTextMark",
+					"TextMarkType": "kbd",
+					"TextMarkTextContent": "闪卡"
+				},
+				{
+					"Type": "NodeText",
+					"Data": "​ 中关闭。"
+				}
+			]
+		},
+		{
+			"ID": "20230219085352-7ma2lg2",
 			"Type": "NodeHeading",
 			"HeadingLevel": 3,
 			"Properties": {
-				"id": "20230219084417-qgvd9bn",
-				"updated": "20230219090057"
+				"id": "20230219085352-7ma2lg2",
+				"updated": "20230219090055"
 			},
 			"Children": [
 				{
 					"Type": "NodeText",
-					"Data": "基于卡包"
+					"Data": "基于文档"
 				}
 			]
 		},
 		{
-			"ID": "20230219090359-1b55hzy",
+			"ID": "20230219090448-88z0ib9",
 			"Type": "NodeParagraph",
 			"Properties": {
-				"id": "20230219090359-1b55hzy",
-				"updated": "20230219092526"
+				"id": "20230219090448-88z0ib9",
+				"updated": "20230324110211"
 			},
 			"Children": [
 				{
 					"Type": "NodeText",
-					"Data": "基于卡包的使用方式可以将不同文档中的内容块制卡后放到统一的卡包中复习。"
+					"Data": "基于文档的使用方式可以不必关注卡包,并且支持父子文档复习。"
 				}
 			]
 		},
 		{
-			"ID": "20221223215834-z8ny593",
+			"ID": "20230219085352-sqkbh7t",
 			"Type": "NodeList",
 			"ListData": {},
 			"Properties": {
-				"id": "20221223215834-z8ny593",
-				"updated": "20230219091828"
+				"id": "20230219085352-sqkbh7t",
+				"updated": "20230219091934"
 			},
 			"Children": [
 				{
-					"ID": "20221229111046-50w42e3",
+					"ID": "20230219085352-ewh3aqy",
 					"Type": "NodeListItem",
 					"ListData": {
 						"BulletChar": 42,
 						"Marker": "Kg=="
 					},
 					"Properties": {
-						"id": "20221229111046-50w42e3",
-						"updated": "20230219091828"
+						"id": "20230219085352-ewh3aqy",
+						"updated": "20230219090109"
 					},
 					"Children": [
 						{
-							"ID": "20221229111046-fh0iyx1",
+							"ID": "20230219085352-0sgkiz2",
 							"Type": "NodeParagraph",
 							"Properties": {
-								"id": "20221229111046-fh0iyx1",
-								"updated": "20230219091828"
+								"id": "20230219085352-0sgkiz2",
+								"updated": "20230219090109"
 							},
 							"Children": [
 								{
@@ -264,39 +296,39 @@
 								{
 									"Type": "NodeTextMark",
 									"TextMarkType": "kbd",
-									"TextMarkTextContent": "添加到卡包..."
+									"TextMarkTextContent": "快速制卡"
 								},
 								{
 									"Type": "NodeText",
-									"Data": "​,然后将该内容块添加到一个卡包中完成制卡"
+									"Data": "​ 完成制卡"
 								}
 							]
 						}
 					]
 				},
 				{
-					"ID": "20221223220710-o4y8jae",
+					"ID": "20230219085352-nd4oy5s",
 					"Type": "NodeListItem",
 					"ListData": {
 						"BulletChar": 42,
 						"Marker": "Kg=="
 					},
 					"Properties": {
-						"id": "20221223220710-o4y8jae",
-						"updated": "20230219085236"
+						"id": "20230219085352-nd4oy5s",
+						"updated": "20230219091934"
 					},
 					"Children": [
 						{
-							"ID": "20221223220710-n98j2n8",
+							"ID": "20230219085352-vl7lwth",
 							"Type": "NodeParagraph",
 							"Properties": {
-								"id": "20221223220710-n98j2n8",
-								"updated": "20230219085236"
+								"id": "20230219085352-vl7lwth",
+								"updated": "20230219091934"
 							},
 							"Children": [
 								{
 									"Type": "NodeText",
-									"Data": "通过点击顶栏菜单中的 "
+									"Data": "在文档树面板中右击文档或者在编辑器中点击文档块标 "
 								},
 								{
 									"Type": "NodeTextMark",
@@ -314,61 +346,61 @@
 			]
 		},
 		{
-			"ID": "20230219085352-7ma2lg2",
+			"ID": "20230219084417-qgvd9bn",
 			"Type": "NodeHeading",
 			"HeadingLevel": 3,
 			"Properties": {
-				"id": "20230219085352-7ma2lg2",
-				"updated": "20230219090055"
+				"id": "20230219084417-qgvd9bn",
+				"updated": "20230324110146"
 			},
 			"Children": [
 				{
 					"Type": "NodeText",
-					"Data": "基于文档"
+					"Data": "基于卡包"
 				}
 			]
 		},
 		{
-			"ID": "20230219090448-88z0ib9",
+			"ID": "20230219090359-1b55hzy",
 			"Type": "NodeParagraph",
 			"Properties": {
-				"id": "20230219090448-88z0ib9",
-				"updated": "20230219090740"
+				"id": "20230219090359-1b55hzy",
+				"updated": "20230324110447"
 			},
 			"Children": [
 				{
 					"Type": "NodeText",
-					"Data": "基于文档的使用方式可以不必关注卡包,并且支持父子文档复习。"
+					"Data": "基于卡包的使用方式可以将不同文档中的内容块制卡后放到统一的卡包中复习。"
 				}
 			]
 		},
 		{
-			"ID": "20230219085352-sqkbh7t",
+			"ID": "20221223215834-z8ny593",
 			"Type": "NodeList",
 			"ListData": {},
 			"Properties": {
-				"id": "20230219085352-sqkbh7t",
-				"updated": "20230219091934"
+				"id": "20221223215834-z8ny593",
+				"updated": "20230219091828"
 			},
 			"Children": [
 				{
-					"ID": "20230219085352-ewh3aqy",
+					"ID": "20221229111046-50w42e3",
 					"Type": "NodeListItem",
 					"ListData": {
 						"BulletChar": 42,
 						"Marker": "Kg=="
 					},
 					"Properties": {
-						"id": "20230219085352-ewh3aqy",
-						"updated": "20230219090109"
+						"id": "20221229111046-50w42e3",
+						"updated": "20230219091828"
 					},
 					"Children": [
 						{
-							"ID": "20230219085352-0sgkiz2",
+							"ID": "20221229111046-fh0iyx1",
 							"Type": "NodeParagraph",
 							"Properties": {
-								"id": "20230219085352-0sgkiz2",
-								"updated": "20230219090109"
+								"id": "20221229111046-fh0iyx1",
+								"updated": "20230219091828"
 							},
 							"Children": [
 								{
@@ -378,39 +410,39 @@
 								{
 									"Type": "NodeTextMark",
 									"TextMarkType": "kbd",
-									"TextMarkTextContent": "快速制卡"
+									"TextMarkTextContent": "添加到卡包..."
 								},
 								{
 									"Type": "NodeText",
-									"Data": "​ 完成制卡"
+									"Data": "​​,然后将该内容块添加到一个卡包中完成制卡"
 								}
 							]
 						}
 					]
 				},
 				{
-					"ID": "20230219085352-nd4oy5s",
+					"ID": "20221223220710-o4y8jae",
 					"Type": "NodeListItem",
 					"ListData": {
 						"BulletChar": 42,
 						"Marker": "Kg=="
 					},
 					"Properties": {
-						"id": "20230219085352-nd4oy5s",
-						"updated": "20230219091934"
+						"id": "20221223220710-o4y8jae",
+						"updated": "20230219085236"
 					},
 					"Children": [
 						{
-							"ID": "20230219085352-vl7lwth",
+							"ID": "20221223220710-n98j2n8",
 							"Type": "NodeParagraph",
 							"Properties": {
-								"id": "20230219085352-vl7lwth",
-								"updated": "20230219091934"
+								"id": "20221223220710-n98j2n8",
+								"updated": "20230219085236"
 							},
 							"Children": [
 								{
 									"Type": "NodeText",
-									"Data": "在文档树面板中右击文档或者在编辑器中点击文档块标 "
+									"Data": "通过点击顶栏菜单中的 "
 								},
 								{
 									"Type": "NodeTextMark",
@@ -419,7 +451,7 @@
 								},
 								{
 									"Type": "NodeText",
-									"Data": "​ 进入复习"
+									"Data": "​ 进入复习"
 								}
 							]
 						}
@@ -427,6 +459,47 @@
 				}
 			]
 		},
+		{
+			"ID": "20230324110448-ows59fl",
+			"Type": "NodeParagraph",
+			"Properties": {
+				"id": "20230324110448-ows59fl",
+				"updated": "20230324110708"
+			},
+			"Children": [
+				{
+					"Type": "NodeText",
+					"Data": "该使用方式默认关闭,如果需要可以在 "
+				},
+				{
+					"Type": "NodeTextMark",
+					"TextMarkType": "kbd",
+					"TextMarkTextContent": "设置"
+				},
+				{
+					"Type": "NodeText",
+					"Data": "​ - "
+				},
+				{
+					"Type": "NodeTextMark",
+					"TextMarkType": "kbd",
+					"TextMarkTextContent": "闪卡"
+				},
+				{
+					"Type": "NodeText",
+					"Data": "​ - "
+				},
+				{
+					"Type": "NodeTextMark",
+					"TextMarkType": "kbd",
+					"TextMarkTextContent": "卡包"
+				},
+				{
+					"Type": "NodeText",
+					"Data": "​ 中开启。但建议不要基于卡包使用闪卡,因为卡包是固定的,没有基于文档使用闪卡灵活。"
+				}
+			]
+		},
 		{
 			"ID": "20221223221214-wr48h8b",
 			"Type": "NodeHeading",

+ 125 - 52
app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20221223221501-mops33i.sy

@@ -5,7 +5,7 @@
 	"Properties": {
 		"id": "20221223221501-mops33i",
 		"title": "閃卡",
-		"updated": "20230304000916"
+		"updated": "20230324110901"
 	},
 	"Children": [
 		{
@@ -196,61 +196,93 @@
 			]
 		},
 		{
-			"ID": "20230219092911-wh5sgd8",
+			"ID": "20230324110806-8rbbppa",
+			"Type": "NodeParagraph",
+			"Properties": {
+				"id": "20230324110806-8rbbppa",
+				"updated": "20230324110821"
+			},
+			"Children": [
+				{
+					"Type": "NodeText",
+					"Data": "其中超級塊制卡和列表或者列表項製卡如果不需要的話可以在 "
+				},
+				{
+					"Type": "NodeTextMark",
+					"TextMarkType": "kbd",
+					"TextMarkTextContent": "設置"
+				},
+				{
+					"Type": "NodeText",
+					"Data": "​ - "
+				},
+				{
+					"Type": "NodeTextMark",
+					"TextMarkType": "kbd",
+					"TextMarkTextContent": "閃卡"
+				},
+				{
+					"Type": "NodeText",
+					"Data": "​ 中關閉。"
+				}
+			]
+		},
+		{
+			"ID": "20230219092911-kawl9n2",
 			"Type": "NodeHeading",
 			"HeadingLevel": 3,
 			"Properties": {
-				"id": "20230219092911-wh5sgd8",
-				"updated": "20230219092911"
+				"id": "20230219092911-kawl9n2",
+				"updated": "20230324110737"
 			},
 			"Children": [
 				{
 					"Type": "NodeText",
-					"Data": "基於卡包"
+					"Data": "基於文檔"
 				}
 			]
 		},
 		{
-			"ID": "20230219092911-ol65uqs",
+			"ID": "20230219092911-vfi7z5z",
 			"Type": "NodeParagraph",
 			"Properties": {
-				"id": "20230219092911-ol65uqs",
-				"updated": "20230219092911"
+				"id": "20230219092911-vfi7z5z",
+				"updated": "20230324110737"
 			},
 			"Children": [
 				{
 					"Type": "NodeText",
-					"Data": "基於卡包的使用方式可以將不同文檔中的內容塊制卡後放到統一的卡包中復習。"
+					"Data": "基於文檔的使用方式可以不必關注卡包,並且支持父子文檔複習。"
 				}
 			]
 		},
 		{
-			"ID": "20230219092911-u7jucj7",
+			"ID": "20230219092911-jluw0db",
 			"Type": "NodeList",
 			"ListData": {},
 			"Properties": {
-				"id": "20230219092911-u7jucj7",
-				"updated": "20230219092928"
+				"id": "20230219092911-jluw0db",
+				"updated": "20230324110737"
 			},
 			"Children": [
 				{
-					"ID": "20230219092911-s4dh6g1",
+					"ID": "20230219092911-4j7zdh5",
 					"Type": "NodeListItem",
 					"ListData": {
 						"BulletChar": 42,
 						"Marker": "Kg=="
 					},
 					"Properties": {
-						"id": "20230219092911-s4dh6g1",
-						"updated": "20230219092922"
+						"id": "20230219092911-4j7zdh5",
+						"updated": "20230219092934"
 					},
 					"Children": [
 						{
-							"ID": "20230219092911-9cn6n81",
+							"ID": "20230219092911-5swg3v3",
 							"Type": "NodeParagraph",
 							"Properties": {
-								"id": "20230219092911-9cn6n81",
-								"updated": "20230219092922"
+								"id": "20230219092911-5swg3v3",
+								"updated": "20230219092934"
 							},
 							"Children": [
 								{
@@ -260,39 +292,39 @@
 								{
 									"Type": "NodeTextMark",
 									"TextMarkType": "kbd",
-									"TextMarkTextContent": "添加到卡包..."
+									"TextMarkTextContent": "快速制卡"
 								},
 								{
 									"Type": "NodeText",
-									"Data": "​,然後將該內容塊添加到一個卡包中完成製卡"
+									"Data": "​ 完成製卡"
 								}
 							]
 						}
 					]
 				},
 				{
-					"ID": "20230219092911-lxrxhy6",
+					"ID": "20230219092911-i1eqodd",
 					"Type": "NodeListItem",
 					"ListData": {
 						"BulletChar": 42,
 						"Marker": "Kg=="
 					},
 					"Properties": {
-						"id": "20230219092911-lxrxhy6",
-						"updated": "20230219092928"
+						"id": "20230219092911-i1eqodd",
+						"updated": "20230219092941"
 					},
 					"Children": [
 						{
-							"ID": "20230219092911-05ghbty",
+							"ID": "20230219092911-5sewtmn",
 							"Type": "NodeParagraph",
 							"Properties": {
-								"id": "20230219092911-05ghbty",
-								"updated": "20230219092928"
+								"id": "20230219092911-5sewtmn",
+								"updated": "20230219092941"
 							},
 							"Children": [
 								{
 									"Type": "NodeText",
-									"Data": "通過點擊頂欄菜單中的 "
+									"Data": "在文檔樹面板中右擊文檔或者在編輯器中點擊文檔塊標 "
 								},
 								{
 									"Type": "NodeTextMark",
@@ -310,61 +342,61 @@
 			]
 		},
 		{
-			"ID": "20230219092911-kawl9n2",
+			"ID": "20230219092911-wh5sgd8",
 			"Type": "NodeHeading",
 			"HeadingLevel": 3,
 			"Properties": {
-				"id": "20230219092911-kawl9n2",
+				"id": "20230219092911-wh5sgd8",
 				"updated": "20230219092911"
 			},
 			"Children": [
 				{
 					"Type": "NodeText",
-					"Data": "基於文檔"
+					"Data": "基於卡包"
 				}
 			]
 		},
 		{
-			"ID": "20230219092911-vfi7z5z",
+			"ID": "20230219092911-ol65uqs",
 			"Type": "NodeParagraph",
 			"Properties": {
-				"id": "20230219092911-vfi7z5z",
+				"id": "20230219092911-ol65uqs",
 				"updated": "20230219092911"
 			},
 			"Children": [
 				{
 					"Type": "NodeText",
-					"Data": "基於文檔的使用方式可以不必關注卡包,並且支持父子文檔複習。"
+					"Data": "基於卡包的使用方式可以將不同文檔中的內容塊制卡後放到統一的卡包中復習。"
 				}
 			]
 		},
 		{
-			"ID": "20230219092911-jluw0db",
+			"ID": "20230219092911-u7jucj7",
 			"Type": "NodeList",
 			"ListData": {},
 			"Properties": {
-				"id": "20230219092911-jluw0db",
-				"updated": "20230219092941"
+				"id": "20230219092911-u7jucj7",
+				"updated": "20230219092928"
 			},
 			"Children": [
 				{
-					"ID": "20230219092911-4j7zdh5",
+					"ID": "20230219092911-s4dh6g1",
 					"Type": "NodeListItem",
 					"ListData": {
 						"BulletChar": 42,
 						"Marker": "Kg=="
 					},
 					"Properties": {
-						"id": "20230219092911-4j7zdh5",
-						"updated": "20230219092934"
+						"id": "20230219092911-s4dh6g1",
+						"updated": "20230219092922"
 					},
 					"Children": [
 						{
-							"ID": "20230219092911-5swg3v3",
+							"ID": "20230219092911-9cn6n81",
 							"Type": "NodeParagraph",
 							"Properties": {
-								"id": "20230219092911-5swg3v3",
-								"updated": "20230219092934"
+								"id": "20230219092911-9cn6n81",
+								"updated": "20230219092922"
 							},
 							"Children": [
 								{
@@ -374,39 +406,39 @@
 								{
 									"Type": "NodeTextMark",
 									"TextMarkType": "kbd",
-									"TextMarkTextContent": "快速制卡"
+									"TextMarkTextContent": "添加到卡包..."
 								},
 								{
 									"Type": "NodeText",
-									"Data": "​ 完成製卡"
+									"Data": "​​,然後將該內容塊添加到一個卡包中完成製卡"
 								}
 							]
 						}
 					]
 				},
 				{
-					"ID": "20230219092911-i1eqodd",
+					"ID": "20230219092911-lxrxhy6",
 					"Type": "NodeListItem",
 					"ListData": {
 						"BulletChar": 42,
 						"Marker": "Kg=="
 					},
 					"Properties": {
-						"id": "20230219092911-i1eqodd",
-						"updated": "20230219092941"
+						"id": "20230219092911-lxrxhy6",
+						"updated": "20230219092928"
 					},
 					"Children": [
 						{
-							"ID": "20230219092911-5sewtmn",
+							"ID": "20230219092911-05ghbty",
 							"Type": "NodeParagraph",
 							"Properties": {
-								"id": "20230219092911-5sewtmn",
-								"updated": "20230219092941"
+								"id": "20230219092911-05ghbty",
+								"updated": "20230219092928"
 							},
 							"Children": [
 								{
 									"Type": "NodeText",
-									"Data": "在文檔樹面板中右擊文檔或者在編輯器中點擊文檔塊標 "
+									"Data": "通過點擊頂欄菜單中的 "
 								},
 								{
 									"Type": "NodeTextMark",
@@ -415,7 +447,7 @@
 								},
 								{
 									"Type": "NodeText",
-									"Data": "​ 進入複習"
+									"Data": "​ 進入複習"
 								}
 							]
 						}
@@ -423,6 +455,47 @@
 				}
 			]
 		},
+		{
+			"ID": "20230324110844-nhwgtq3",
+			"Type": "NodeParagraph",
+			"Properties": {
+				"id": "20230324110844-nhwgtq3",
+				"updated": "20230324110901"
+			},
+			"Children": [
+				{
+					"Type": "NodeText",
+					"Data": "該使用方式默認關閉,如果需要可以在 "
+				},
+				{
+					"Type": "NodeTextMark",
+					"TextMarkType": "kbd",
+					"TextMarkTextContent": "設置"
+				},
+				{
+					"Type": "NodeText",
+					"Data": "​ - "
+				},
+				{
+					"Type": "NodeTextMark",
+					"TextMarkType": "kbd",
+					"TextMarkTextContent": "閃卡"
+				},
+				{
+					"Type": "NodeText",
+					"Data": "​ - "
+				},
+				{
+					"Type": "NodeTextMark",
+					"TextMarkType": "kbd",
+					"TextMarkTextContent": "卡包"
+				},
+				{
+					"Type": "NodeText",
+					"Data": "​ 中開啟。但建議不要基於卡包使用閃卡,因為卡包是固定的,沒有基於文檔使用閃卡靈活。"
+				}
+			]
+		},
 		{
 			"ID": "20221223221502-cqcjal6",
 			"Type": "NodeHeading",

+ 21 - 25
kernel/model/flashcard.go

@@ -64,13 +64,14 @@ func GetNotebookFlashcards(boxID string, page int) (blocks []*Block, total, page
 		rootIDs = append(rootIDs, strings.TrimSuffix(entry.Name(), ".sy"))
 	}
 
-	treeBlockIDs := map[string]bool{}
+	var treeBlockIDs []string
 	for _, rootID := range rootIDs {
 		blockIDs := getTreeSubTreeChildBlocks(rootID)
-		for blockID, _ := range blockIDs {
-			treeBlockIDs[blockID] = true
+		for _, blockID := range blockIDs {
+			treeBlockIDs = append(treeBlockIDs, blockID)
 		}
 	}
+	treeBlockIDs = gulu.Str.RemoveDuplicatedElem(treeBlockIDs)
 
 	deck := Decks[builtinDeckID]
 	if nil == deck {
@@ -80,7 +81,7 @@ func GetNotebookFlashcards(boxID string, page int) (blocks []*Block, total, page
 	var allBlockIDs []string
 	deckBlockIDs := deck.GetBlockIDs()
 	for _, blockID := range deckBlockIDs {
-		if treeBlockIDs[blockID] {
+		if gulu.Str.Contains(blockID, treeBlockIDs) {
 			allBlockIDs = append(allBlockIDs, blockID)
 		}
 	}
@@ -102,7 +103,7 @@ func GetTreeFlashcards(rootID string, page int) (blocks []*Block, total, pageCou
 	deckBlockIDs := deck.GetBlockIDs()
 	treeBlockIDs := getTreeSubTreeChildBlocks(rootID)
 	for _, blockID := range deckBlockIDs {
-		if treeBlockIDs[blockID] {
+		if gulu.Str.Contains(blockID, treeBlockIDs) {
 			allBlockIDs = append(allBlockIDs, blockID)
 		}
 	}
@@ -302,13 +303,14 @@ func GetNotebookDueFlashcards(boxID string, reviewedCardIDs []string) (ret []*Fl
 		rootIDs = append(rootIDs, strings.TrimSuffix(entry.Name(), ".sy"))
 	}
 
-	treeBlockIDs := map[string]bool{}
+	var treeBlockIDs []string
 	for _, rootID := range rootIDs {
 		blockIDs := getTreeSubTreeChildBlocks(rootID)
-		for blockID, _ := range blockIDs {
-			treeBlockIDs[blockID] = true
+		for _, blockID := range blockIDs {
+			treeBlockIDs = append(treeBlockIDs, blockID)
 		}
 	}
+	treeBlockIDs = gulu.Str.RemoveDuplicatedElem(treeBlockIDs)
 
 	deck := Decks[builtinDeckID]
 	if nil == deck {
@@ -316,14 +318,10 @@ func GetNotebookDueFlashcards(boxID string, reviewedCardIDs []string) (ret []*Fl
 		return
 	}
 
-	cards := getDeckDueCards(deck, reviewedCardIDs)
+	cards := getDeckDueCards(deck, reviewedCardIDs, treeBlockIDs)
 	now := time.Now()
 	for _, card := range cards {
 		blockID := card.BlockID()
-		if !treeBlockIDs[blockID] {
-			continue
-		}
-
 		ret = append(ret, newFlashcard(card, blockID, builtinDeckID, now))
 	}
 	if 1 > len(ret) {
@@ -347,14 +345,10 @@ func GetTreeDueFlashcards(rootID string, reviewedCardIDs []string) (ret []*Flash
 	}
 
 	treeBlockIDs := getTreeSubTreeChildBlocks(rootID)
-	cards := getDeckDueCards(deck, reviewedCardIDs)
+	cards := getDeckDueCards(deck, reviewedCardIDs, treeBlockIDs)
 	now := time.Now()
 	for _, card := range cards {
 		blockID := card.BlockID()
-		if !treeBlockIDs[blockID] {
-			continue
-		}
-
 		ret = append(ret, newFlashcard(card, blockID, builtinDeckID, now))
 	}
 	if 1 > len(ret) {
@@ -363,9 +357,7 @@ func GetTreeDueFlashcards(rootID string, reviewedCardIDs []string) (ret []*Flash
 	return
 }
 
-func getTreeSubTreeChildBlocks(rootID string) (treeBlockIDs map[string]bool) {
-	treeBlockIDs = map[string]bool{}
-
+func getTreeSubTreeChildBlocks(rootID string) (treeBlockIDs []string) {
 	tree, err := loadTreeByBlockID(rootID)
 	if nil != err {
 		return
@@ -394,7 +386,7 @@ func getTreeSubTreeChildBlocks(rootID string) (treeBlockIDs map[string]bool) {
 				return ast.WalkContinue
 			}
 
-			treeBlockIDs[n.ID] = true
+			treeBlockIDs = append(treeBlockIDs, n.ID)
 			return ast.WalkContinue
 		})
 	}
@@ -426,7 +418,7 @@ func getDueFlashcards(deckID string, reviewedCardIDs []string) (ret []*Flashcard
 		return
 	}
 
-	cards := getDeckDueCards(deck, reviewedCardIDs)
+	cards := getDeckDueCards(deck, reviewedCardIDs, nil)
 	now := time.Now()
 	for _, card := range cards {
 		blockID := card.BlockID()
@@ -446,7 +438,7 @@ func getDueFlashcards(deckID string, reviewedCardIDs []string) (ret []*Flashcard
 func getAllDueFlashcards(reviewedCardIDs []string) (ret []*Flashcard) {
 	now := time.Now()
 	for _, deck := range Decks {
-		cards := getDeckDueCards(deck, reviewedCardIDs)
+		cards := getDeckDueCards(deck, reviewedCardIDs, nil)
 		for _, card := range cards {
 			blockID := card.BlockID()
 			if nil == treenode.GetBlockTree(blockID) {
@@ -895,7 +887,7 @@ func getDeckIDs() (deckIDs []string) {
 	return
 }
 
-func getDeckDueCards(deck *riff.Deck, reviewedCardIDs []string) (ret []riff.Card) {
+func getDeckDueCards(deck *riff.Deck, reviewedCardIDs, blockIDs []string) (ret []riff.Card) {
 	ret = []riff.Card{}
 	dues := deck.Dues()
 
@@ -906,6 +898,10 @@ func getDeckDueCards(deck *riff.Deck, reviewedCardIDs []string) (ret []riff.Card
 			continue
 		}
 
+		if 0 < len(blockIDs) && !gulu.Str.Contains(c.BlockID(), blockIDs) {
+			continue
+		}
+
 		fsrsCard := c.Impl().(*fsrs.Card)
 		if fsrs.New == fsrsCard.State {
 			newCount++