Sfoglia il codice sorgente

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

Vanessa 2 anni fa
parent
commit
cc613f7d57

+ 1 - 1
app/appearance/langs/en_US.json

@@ -951,7 +951,7 @@
     "12": "Query asset failed [%s]",
     "13": "Cannot create a file starting with .",
     "14": "Export failed: %s",
-    "15": "Content block with id [%s] not found, please try again later",
+    "15": "Content block with id [%s] not found",
     "16": "Please enter the doc name",
     "17": "The initial synchronization failed at startup. Unpredictable data overwriting may occur if you continue to operate. Please perform a synchronization first",
     "18": "Get community user account failed",

+ 1 - 1
app/appearance/langs/es_ES.json

@@ -951,7 +951,7 @@
     "12": "Fallo en la consulta de activos [%s]",
     "13": "No se puede crear un archivo que empiece por .",
     "14": "Exportación fallida: %s",
-    "15": "No se encontró el bloque de contenido con id [%s], inténtelo de nuevo más tarde",
+    "15": "No se encontró el bloque de contenido con id [%s]",
     "16": "Por favor, introduzca el nombre del documento",
     "17": "La sincronización inicial falló en el arranque. Puede producirse una sobreescritura de datos imprevisible si continúa operando. Por favor, realice primero una sincronización",
     "18": "Falló la obtención de la cuenta de usuario de la comunidad",

+ 1 - 1
app/appearance/langs/fr_FR.json

@@ -951,7 +951,7 @@
     "12": "Échec de la requête asset [%s]",
     "13": "Impossible de créer un fichier commençant par .",
     "14": "L'exportation a échoué : %s",
-    "15": "Bloc de contenu avec l'identifiant [%s] introuvable, veuillez réessayer plus tard",
+    "15": "Bloc de contenu avec l'identifiant [%s] introuvable",
     "16": "Veuillez entrer le nom du fichier",
     "17": "La synchronisation initiale a échoué au démarrage. Un écrasement imprévisible des données peut se produire si vous continuez à fonctionner. Veuillez d'abord effectuer une synchronisation.",
     "18": "Échec de la récupération du compte utilisateur communautaire",

+ 1 - 1
app/appearance/langs/zh_CHT.json

@@ -951,7 +951,7 @@
     "12": "查詢資料檔失敗 [%s]",
     "13": "無法創建 . 開頭的文件",
     "14": "匯出失敗:%s",
-    "15": "未找到 ID 為 [%s] 的內容塊,請稍後再試",
+    "15": "未找到 ID 為 [%s] 的內容塊",
     "16": "請輸入文檔名",
     "17": "啟動時初次同步失敗,繼續操作可能會發生無法預測的數據覆蓋,請先執行一次同步",
     "18": "獲取社區用戶帳號失敗",

+ 1 - 1
app/appearance/langs/zh_CN.json

@@ -953,7 +953,7 @@
     "12": "查询资源文件失败 [%s]",
     "13": "无法创建 . 开头的文件",
     "14": "导出失败:%s",
-    "15": "未找到 ID 为 [%s] 的内容块,请稍后再试",
+    "15": "未找到 ID 为 [%s] 的内容块",
     "16": "请输入文档名",
     "17": "启动时初次同步失败,继续操作可能会发生无法预测的数据覆盖,请先执行一次同步",
     "18": "获取社区用户账号失败",

+ 110 - 6
app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100950-9op5xi1.sy

@@ -7,7 +7,7 @@
 		"id": "20200924100950-9op5xi1",
 		"title": "Shortcuts",
 		"type": "doc",
-		"updated": "20230503141906"
+		"updated": "20230517155934"
 	},
 	"Children": [
 		{
@@ -9977,13 +9977,14 @@
 			"ID": "20220619002135-vggu3cg",
 			"Type": "NodeTable",
 			"TableAligns": [
+				0,
 				0,
 				0
 			],
 			"Properties": {
-				"colgroup": "|",
+				"colgroup": "||",
 				"id": "20220619002135-vggu3cg",
-				"updated": "20220619002856"
+				"updated": "20230517155934"
 			},
 			"Children": [
 				{
@@ -10021,6 +10022,16 @@
 											"Data": "br"
 										}
 									]
+								},
+								{
+									"Type": "NodeTableCell",
+									"Data": "th",
+									"Children": [
+										{
+											"Type": "NodeText",
+											"Data": "Memo"
+										}
+									]
 								}
 							]
 						}
@@ -10044,12 +10055,24 @@
 							"Type": "NodeTableCell",
 							"Data": "td",
 							"Children": [
+								{
+									"Type": "NodeText",
+									"Data": "​"
+								},
 								{
 									"Type": "NodeTextMark",
 									"TextMarkType": "kbd",
 									"TextMarkTextContent": "Click"
+								},
+								{
+									"Type": "NodeText",
+									"Data": "​"
 								}
 							]
+						},
+						{
+							"Type": "NodeTableCell",
+							"Data": "td"
 						}
 					]
 				},
@@ -10071,6 +10094,10 @@
 							"Type": "NodeTableCell",
 							"Data": "td",
 							"Children": [
+								{
+									"Type": "NodeText",
+									"Data": "​"
+								},
 								{
 									"Type": "NodeTextMark",
 									"TextMarkType": "kbd",
@@ -10078,14 +10105,22 @@
 								},
 								{
 									"Type": "NodeText",
-									"Data": " / "
+									"Data": " / "
 								},
 								{
 									"Type": "NodeTextMark",
 									"TextMarkType": "kbd",
 									"TextMarkTextContent": "⌘Click"
+								},
+								{
+									"Type": "NodeText",
+									"Data": "​"
 								}
 							]
+						},
+						{
+							"Type": "NodeTableCell",
+							"Data": "td"
 						}
 					]
 				},
@@ -10107,6 +10142,10 @@
 							"Type": "NodeTableCell",
 							"Data": "td",
 							"Children": [
+								{
+									"Type": "NodeText",
+									"Data": "​"
+								},
 								{
 									"Type": "NodeTextMark",
 									"TextMarkType": "kbd",
@@ -10114,14 +10153,22 @@
 								},
 								{
 									"Type": "NodeText",
-									"Data": " / "
+									"Data": " / "
 								},
 								{
 									"Type": "NodeTextMark",
 									"TextMarkType": "kbd",
 									"TextMarkTextContent": "⌥Click"
+								},
+								{
+									"Type": "NodeText",
+									"Data": "​"
 								}
 							]
+						},
+						{
+							"Type": "NodeTableCell",
+							"Data": "td"
 						}
 					]
 				},
@@ -10143,6 +10190,10 @@
 							"Type": "NodeTableCell",
 							"Data": "td",
 							"Children": [
+								{
+									"Type": "NodeText",
+									"Data": "​"
+								},
 								{
 									"Type": "NodeTextMark",
 									"TextMarkType": "kbd",
@@ -10150,12 +10201,65 @@
 								},
 								{
 									"Type": "NodeText",
-									"Data": " / "
+									"Data": " / "
 								},
 								{
 									"Type": "NodeTextMark",
 									"TextMarkType": "kbd",
 									"TextMarkTextContent": "⇧Click"
+								},
+								{
+									"Type": "NodeText",
+									"Data": "​"
+								}
+							]
+						},
+						{
+							"Type": "NodeTableCell",
+							"Data": "td"
+						}
+					]
+				},
+				{
+					"Type": "NodeTableRow",
+					"Data": "tr",
+					"Children": [
+						{
+							"Type": "NodeTableCell",
+							"Data": "td",
+							"Children": [
+								{
+									"Type": "NodeText",
+									"Data": "View all references to the definition block"
+								}
+							]
+						},
+						{
+							"Type": "NodeTableCell",
+							"Data": "td",
+							"Children": [
+								{
+									"Type": "NodeText",
+									"Data": "​"
+								},
+								{
+									"Type": "NodeTextMark",
+									"TextMarkType": "kbd",
+									"TextMarkTextContent": "Shift+Hover"
+								},
+								{
+									"Type": "NodeText",
+									"Data": "​"
+								}
+							]
+						},
+						{
+							"Type": "NodeTableCell",
+							"Data": "td",
+							"Children": [
+								{
+									"Type": "NodeText",
+									"Data": "Only supported on reference elements"
 								}
 							]
 						}

+ 110 - 6
app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200813004551-gm0pbn1.sy

@@ -7,7 +7,7 @@
 		"id": "20200813004551-gm0pbn1",
 		"title": "快捷键",
 		"type": "doc",
-		"updated": "20230503141637"
+		"updated": "20230517155522"
 	},
 	"Children": [
 		{
@@ -9998,13 +9998,14 @@
 			"ID": "20220619000401-peit222",
 			"Type": "NodeTable",
 			"TableAligns": [
+				0,
 				0,
 				0
 			],
 			"Properties": {
-				"colgroup": "|",
+				"colgroup": "||",
 				"id": "20220619000401-peit222",
-				"updated": "20220904093137"
+				"updated": "20230517155522"
 			},
 			"Children": [
 				{
@@ -10034,6 +10035,16 @@
 											"Data": "操作"
 										}
 									]
+								},
+								{
+									"Type": "NodeTableCell",
+									"Data": "th",
+									"Children": [
+										{
+											"Type": "NodeText",
+											"Data": "备注"
+										}
+									]
 								}
 							]
 						}
@@ -10057,12 +10068,24 @@
 							"Type": "NodeTableCell",
 							"Data": "td",
 							"Children": [
+								{
+									"Type": "NodeText",
+									"Data": "​"
+								},
 								{
 									"Type": "NodeTextMark",
 									"TextMarkType": "kbd",
 									"TextMarkTextContent": "Click"
+								},
+								{
+									"Type": "NodeText",
+									"Data": "​"
 								}
 							]
+						},
+						{
+							"Type": "NodeTableCell",
+							"Data": "td"
 						}
 					]
 				},
@@ -10084,6 +10107,10 @@
 							"Type": "NodeTableCell",
 							"Data": "td",
 							"Children": [
+								{
+									"Type": "NodeText",
+									"Data": "​"
+								},
 								{
 									"Type": "NodeTextMark",
 									"TextMarkType": "kbd",
@@ -10091,14 +10118,22 @@
 								},
 								{
 									"Type": "NodeText",
-									"Data": " / "
+									"Data": " / "
 								},
 								{
 									"Type": "NodeTextMark",
 									"TextMarkType": "kbd",
 									"TextMarkTextContent": "⌘Click"
+								},
+								{
+									"Type": "NodeText",
+									"Data": "​"
 								}
 							]
+						},
+						{
+							"Type": "NodeTableCell",
+							"Data": "td"
 						}
 					]
 				},
@@ -10120,6 +10155,10 @@
 							"Type": "NodeTableCell",
 							"Data": "td",
 							"Children": [
+								{
+									"Type": "NodeText",
+									"Data": "​"
+								},
 								{
 									"Type": "NodeTextMark",
 									"TextMarkType": "kbd",
@@ -10127,14 +10166,22 @@
 								},
 								{
 									"Type": "NodeText",
-									"Data": " / "
+									"Data": " / "
 								},
 								{
 									"Type": "NodeTextMark",
 									"TextMarkType": "kbd",
 									"TextMarkTextContent": "⌥Click"
+								},
+								{
+									"Type": "NodeText",
+									"Data": "​"
 								}
 							]
+						},
+						{
+							"Type": "NodeTableCell",
+							"Data": "td"
 						}
 					]
 				},
@@ -10156,6 +10203,10 @@
 							"Type": "NodeTableCell",
 							"Data": "td",
 							"Children": [
+								{
+									"Type": "NodeText",
+									"Data": "​"
+								},
 								{
 									"Type": "NodeTextMark",
 									"TextMarkType": "kbd",
@@ -10163,12 +10214,65 @@
 								},
 								{
 									"Type": "NodeText",
-									"Data": " / "
+									"Data": " / "
 								},
 								{
 									"Type": "NodeTextMark",
 									"TextMarkType": "kbd",
 									"TextMarkTextContent": "⇧Click"
+								},
+								{
+									"Type": "NodeText",
+									"Data": "​"
+								}
+							]
+						},
+						{
+							"Type": "NodeTableCell",
+							"Data": "td"
+						}
+					]
+				},
+				{
+					"Type": "NodeTableRow",
+					"Data": "tr",
+					"Children": [
+						{
+							"Type": "NodeTableCell",
+							"Data": "td",
+							"Children": [
+								{
+									"Type": "NodeText",
+									"Data": "查看定义块的所有引用"
+								}
+							]
+						},
+						{
+							"Type": "NodeTableCell",
+							"Data": "td",
+							"Children": [
+								{
+									"Type": "NodeText",
+									"Data": "​"
+								},
+								{
+									"Type": "NodeTextMark",
+									"TextMarkType": "kbd",
+									"TextMarkTextContent": "Shift+悬浮"
+								},
+								{
+									"Type": "NodeText",
+									"Data": "​"
+								}
+							]
+						},
+						{
+							"Type": "NodeTableCell",
+							"Data": "td",
+							"Children": [
+								{
+									"Type": "NodeText",
+									"Data": "仅在引用元素上支持"
 								}
 							]
 						}

+ 110 - 6
app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122549-jktxego.sy

@@ -6,7 +6,7 @@
 		"icon": "2328",
 		"id": "20211226122549-jktxego",
 		"title": "快捷鍵",
-		"updated": "20230503141751"
+		"updated": "20230517155553"
 	},
 	"Children": [
 		{
@@ -10089,13 +10089,14 @@
 			"ID": "20220619002223-k6apxvm",
 			"Type": "NodeTable",
 			"TableAligns": [
+				0,
 				0,
 				0
 			],
 			"Properties": {
-				"colgroup": "|",
+				"colgroup": "||",
 				"id": "20220619002223-k6apxvm",
-				"updated": "20220904093825"
+				"updated": "20230517155553"
 			},
 			"Children": [
 				{
@@ -10129,6 +10130,16 @@
 											"Data": "操作"
 										}
 									]
+								},
+								{
+									"Type": "NodeTableCell",
+									"Data": "th",
+									"Children": [
+										{
+											"Type": "NodeText",
+											"Data": "備註"
+										}
+									]
 								}
 							]
 						}
@@ -10156,12 +10167,24 @@
 							"Type": "NodeTableCell",
 							"Data": "td",
 							"Children": [
+								{
+									"Type": "NodeText",
+									"Data": "​"
+								},
 								{
 									"Type": "NodeTextMark",
 									"TextMarkType": "kbd",
 									"TextMarkTextContent": "Click"
+								},
+								{
+									"Type": "NodeText",
+									"Data": "​"
 								}
 							]
+						},
+						{
+							"Type": "NodeTableCell",
+							"Data": "td"
 						}
 					]
 				},
@@ -10187,6 +10210,10 @@
 							"Type": "NodeTableCell",
 							"Data": "td",
 							"Children": [
+								{
+									"Type": "NodeText",
+									"Data": "​"
+								},
 								{
 									"Type": "NodeTextMark",
 									"TextMarkType": "kbd",
@@ -10194,14 +10221,22 @@
 								},
 								{
 									"Type": "NodeText",
-									"Data": " / "
+									"Data": " / "
 								},
 								{
 									"Type": "NodeTextMark",
 									"TextMarkType": "kbd",
 									"TextMarkTextContent": "⌘Click"
+								},
+								{
+									"Type": "NodeText",
+									"Data": "​"
 								}
 							]
+						},
+						{
+							"Type": "NodeTableCell",
+							"Data": "td"
 						}
 					]
 				},
@@ -10227,6 +10262,10 @@
 							"Type": "NodeTableCell",
 							"Data": "td",
 							"Children": [
+								{
+									"Type": "NodeText",
+									"Data": "​"
+								},
 								{
 									"Type": "NodeTextMark",
 									"TextMarkType": "kbd",
@@ -10234,14 +10273,22 @@
 								},
 								{
 									"Type": "NodeText",
-									"Data": " / "
+									"Data": " / "
 								},
 								{
 									"Type": "NodeTextMark",
 									"TextMarkType": "kbd",
 									"TextMarkTextContent": "⌥Click"
+								},
+								{
+									"Type": "NodeText",
+									"Data": "​"
 								}
 							]
+						},
+						{
+							"Type": "NodeTableCell",
+							"Data": "td"
 						}
 					]
 				},
@@ -10263,6 +10310,10 @@
 							"Type": "NodeTableCell",
 							"Data": "td",
 							"Children": [
+								{
+									"Type": "NodeText",
+									"Data": "​"
+								},
 								{
 									"Type": "NodeTextMark",
 									"TextMarkType": "kbd",
@@ -10270,12 +10321,65 @@
 								},
 								{
 									"Type": "NodeText",
-									"Data": " / "
+									"Data": " / "
 								},
 								{
 									"Type": "NodeTextMark",
 									"TextMarkType": "kbd",
 									"TextMarkTextContent": "⇧Click"
+								},
+								{
+									"Type": "NodeText",
+									"Data": "​"
+								}
+							]
+						},
+						{
+							"Type": "NodeTableCell",
+							"Data": "td"
+						}
+					]
+				},
+				{
+					"Type": "NodeTableRow",
+					"Data": "tr",
+					"Children": [
+						{
+							"Type": "NodeTableCell",
+							"Data": "td",
+							"Children": [
+								{
+									"Type": "NodeText",
+									"Data": "查看定義塊的所有引用"
+								}
+							]
+						},
+						{
+							"Type": "NodeTableCell",
+							"Data": "td",
+							"Children": [
+								{
+									"Type": "NodeText",
+									"Data": "​"
+								},
+								{
+									"Type": "NodeTextMark",
+									"TextMarkType": "kbd",
+									"TextMarkTextContent": "Shift+懸浮"
+								},
+								{
+									"Type": "NodeText",
+									"Data": "​"
+								}
+							]
+						},
+						{
+							"Type": "NodeTableCell",
+							"Data": "td",
+							"Children": [
+								{
+									"Type": "NodeText",
+									"Data": "僅在引用元素上支持"
 								}
 							]
 						}

+ 15 - 15
kernel/model/export.go

@@ -1032,7 +1032,7 @@ func BatchExportMarkdown(boxID, folderPath string) (zipPath string) {
 	for _, docFile := range docFiles {
 		docPaths = append(docPaths, docFile.path)
 	}
-	zipPath = exportPandocConvertZip(boxID, baseFolderName, docPaths, "", "md", ".md")
+	zipPath = exportPandocConvertZip(boxID, baseFolderName, docPaths, "", "", ".md")
 	return
 }
 
@@ -2030,20 +2030,6 @@ func exportPandocConvertZip(boxID, baseFolderName string, docPaths []string,
 			continue
 		}
 
-		// 调用 Pandoc 进行格式转换
-		output, err := util.Pandoc(pandocFrom, pandocTo, writePath, md)
-		if nil != err {
-			logging.LogErrorf("pandoc failed: %s", err)
-			continue
-		}
-
-		if "odt" != pandocTo && "epub" != pandocTo && "rtf" != pandocTo {
-			if err := gulu.File.WriteFileSafer(writePath, gulu.Str.ToBytes(output), 0644); nil != err {
-				logging.LogErrorf("write export markdown file [%s] failed: %s", writePath, err)
-				continue
-			}
-		}
-
 		// 解析导出后的标准 Markdown,汇总 assets
 		tree := parse.Parse("", gulu.Str.ToBytes(md), luteEngine.ParseOptions)
 		var assets []string
@@ -2067,6 +2053,20 @@ func exportPandocConvertZip(boxID, baseFolderName string, docPaths []string,
 				continue
 			}
 		}
+
+		// 调用 Pandoc 进行格式转换
+		output, err := util.Pandoc(pandocFrom, pandocTo, writePath, md)
+		if nil != err {
+			logging.LogErrorf("pandoc failed: %s", err)
+			continue
+		}
+
+		if "odt" != pandocTo && "epub" != pandocTo && "rtf" != pandocTo {
+			if err := gulu.File.WriteFileSafer(writePath, gulu.Str.ToBytes(output), 0644); nil != err {
+				logging.LogErrorf("write export markdown file [%s] failed: %s", writePath, err)
+				continue
+			}
+		}
 	}
 
 	zipPath = exportFolder + ".zip"

+ 1 - 0
kernel/util/pandoc.go

@@ -58,6 +58,7 @@ func Pandoc(from, to, o, content string) (ret string, err error) {
 	args := []string{
 		"--from", from,
 		"--to", to,
+		"--resource-path", filepath.Dir(o),
 		"-s",
 	}