mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-20 19:10:49 +08:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
88a2835d5d
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"confirmRemoveRelationField": "Sind Sie sicher, dass Sie das Feld, das mit <b>${x}</b> verknüpft ist, löschen möchten?",
|
"confirmRemoveRelationField": "Sind Sie sicher, dass Sie das Feld, das mit <b>${x}</b> verknüpft ist, löschen möchten?",
|
||||||
"removeButKeepRelationField": "Entfernen, verknüpftes Feld behalten",
|
"removeButKeepRelationField": "Entfernen, aber verknüpftes Feld behalten",
|
||||||
"exportPDFLowMemory": "Nicht genügend verfügbarer Speicher, um dieses PDF zu exportieren, bitte reduzieren Sie den Inhalt oder erhöhen Sie den verfügbaren Speicher und versuchen Sie es erneut",
|
"exportPDFLowMemory": "Nicht genügend verfügbarer Speicher, um dieses PDF zu exportieren, bitte reduzieren Sie den Inhalt oder erhöhen Sie den verfügbaren Speicher und versuchen Sie es erneut",
|
||||||
"exportConf": "Export-Einstellungen",
|
"exportConf": "Export-Einstellungen",
|
||||||
"exportConfTip": "Konto, Zugriffscode, Synchronisation, API-Token und Daten-Repo-Schlüssel werden nicht exportiert",
|
"exportConfTip": "Konto, Zugriffscode, Synchronisation, API-Token und Daten-Repo-Schlüssel werden nicht exportiert",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"confirmRemoveRelationField": "Are you sure you want to delete the field associated with <b>${x}</b>?",
|
"confirmRemoveRelationField": "Are you sure you want to delete the field associated with <b>${x}</b>?",
|
||||||
"removeButKeepRelationField": "Remove, keep related field",
|
"removeButKeepRelationField": "Remove, but keep related field",
|
||||||
"exportPDFLowMemory": "Insufficient available memory to export this PDF, please reduce the content or increase available memory and try exporting again",
|
"exportPDFLowMemory": "Insufficient available memory to export this PDF, please reduce the content or increase available memory and try exporting again",
|
||||||
"exportConf": "Export settings",
|
"exportConf": "Export settings",
|
||||||
"exportConfTip": "Account, access authorization code, synchronization, API token and data repo key will not be exported",
|
"exportConfTip": "Account, access authorization code, synchronization, API token and data repo key will not be exported",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"confirmRemoveRelationField": "¿Está seguro de que desea eliminar el campo asociado a <b>${x}</b>?",
|
"confirmRemoveRelationField": "¿Está seguro de que desea eliminar el campo asociado a <b>${x}</b>?",
|
||||||
"removeButKeepRelationField": "Eliminar, mantener el campo relacionado",
|
"removeButKeepRelationField": "Eliminar, pero mantener el campo relacionado",
|
||||||
"exportPDFLowMemory": "Memoria disponible insuficiente para exportar este PDF, por favor reduzca el contenido o aumente la memoria disponible y vuelva a intentar exportar",
|
"exportPDFLowMemory": "Memoria disponible insuficiente para exportar este PDF, por favor reduzca el contenido o aumente la memoria disponible y vuelva a intentar exportar",
|
||||||
"exportConf": "Configuración de exportación",
|
"exportConf": "Configuración de exportación",
|
||||||
"exportConfTip": "Las cuentas, los códigos de acceso, la sincronización, los tokens API y las claves del almacén de datos no se exportarán",
|
"exportConfTip": "Las cuentas, los códigos de acceso, la sincronización, los tokens API y las claves del almacén de datos no se exportarán",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"confirmRemoveRelationField": "Êtes-vous sûr de vouloir supprimer le champ associé à <b>${x}</b>?",
|
"confirmRemoveRelationField": "Êtes-vous sûr de vouloir supprimer le champ associé à <b>${x}</b>?",
|
||||||
"removeButKeepRelationField": "Supprimer, conserver le champ associé",
|
"removeButKeepRelationField": "Supprimer, mais conserver le champ associé",
|
||||||
"exportPDFLowMemory": "Mémoire disponible insuffisante pour exporter ce PDF, veuillez réduire le contenu ou augmenter la mémoire disponible et réessayer d'exporter",
|
"exportPDFLowMemory": "Mémoire disponible insuffisante pour exporter ce PDF, veuillez réduire le contenu ou augmenter la mémoire disponible et réessayer d'exporter",
|
||||||
"exportConf": "Exporter les paramètres",
|
"exportConf": "Exporter les paramètres",
|
||||||
"exportConfTip": "Les comptes, codes d'accès, synchronisation, tokens API et clés d'entrepôt de données ne seront pas exportés",
|
"exportConfTip": "Les comptes, codes d'accès, synchronisation, tokens API et clés d'entrepôt de données ne seront pas exportés",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"confirmRemoveRelationField": "האם אתה בטוח שברצונך למחוק את השדה המשויך ל-<b>${x}</b>?",
|
"confirmRemoveRelationField": "האם אתה בטוח שברצונך למחוק את השדה המשויך ל-<b>${x}</b>?",
|
||||||
"removeButKeepRelationField": "מחק, שמור על שדה הקשר",
|
"removeButKeepRelationField": "מחק, אך שמור על שדה הקשר",
|
||||||
"exportPDFLowMemory": "אין מספיק זיכרון זמין במערכת כדי לייצא את ה-PDF הזה, נא לצמצם את התוכן או להגדיל את הזיכרון הזמין ולנסות שוב לייצא",
|
"exportPDFLowMemory": "אין מספיק זיכרון זמין במערכת כדי לייצא את ה-PDF הזה, נא לצמצם את התוכן או להגדיל את הזיכרון הזמין ולנסות שוב לייצא",
|
||||||
"exportConf": "הגדרות ייצוא",
|
"exportConf": "הגדרות ייצוא",
|
||||||
"exportConfTip": "פרטי חשבון, קוד אישור גישה, סנכרון, אסימון API ומפתח מאגר נתונים לא ייוצאו",
|
"exportConfTip": "פרטי חשבון, קוד אישור גישה, סנכרון, אסימון API ומפתח מאגר נתונים לא ייוצאו",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"confirmRemoveRelationField": "Sei sicuro di voler eliminare il campo associato a <b>${x}</b>?",
|
"confirmRemoveRelationField": "Sei sicuro di voler eliminare il campo associato a <b>${x}</b>?",
|
||||||
"removeButKeepRelationField": "Rimuovi, mantieni il campo correlato",
|
"removeButKeepRelationField": "Rimuovi, ma mantieni il campo correlato",
|
||||||
"exportPDFLowMemory": "Memoria disponibile insufficiente per esportare questo PDF, riduci il contenuto o aumenta la memoria disponibile e riprova a esportare",
|
"exportPDFLowMemory": "Memoria disponibile insufficiente per esportare questo PDF, riduci il contenuto o aumenta la memoria disponibile e riprova a esportare",
|
||||||
"exportConf": "Impostazioni di esportazione",
|
"exportConf": "Impostazioni di esportazione",
|
||||||
"exportConfTip": "Account, codici di accesso, sincronizzazione, token API e chiavi di data warehouse non verranno esportati",
|
"exportConfTip": "Account, codici di accesso, sincronizzazione, token API e chiavi di data warehouse non verranno esportati",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"confirmRemoveRelationField": "Czy na pewno chcesz usunąć pole powiązane z <b>${x}</b>?",
|
"confirmRemoveRelationField": "Czy na pewno chcesz usunąć pole powiązane z <b>${x}</b>?",
|
||||||
"removeButKeepRelationField": "Usuń, zachowaj powiązane pole",
|
"removeButKeepRelationField": "Usuń, ale zachowaj powiązane pole",
|
||||||
"exportPDFLowMemory": "Za mało dostępnej pamięci, aby wyeksportować ten PDF, proszę zmniejszyć zawartość lub zwiększyć dostępną pamięć i spróbować ponownie",
|
"exportPDFLowMemory": "Za mało dostępnej pamięci, aby wyeksportować ten PDF, proszę zmniejszyć zawartość lub zwiększyć dostępną pamięć i spróbować ponownie",
|
||||||
"exportConf": "Ustawienia eksportu",
|
"exportConf": "Ustawienia eksportu",
|
||||||
"exportConfTip": "Konto, kod autoryzacji dostępu, synchronizacja, token API i klucz repozytorium danych nie będą eksportowane",
|
"exportConfTip": "Konto, kod autoryzacji dostępu, synchronizacja, token API i klucz repozytorium danych nie będą eksportowane",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"confirmRemoveRelationField": "Вы уверены, что хотите удалить поле, связанное с <b>${x}</b>?",
|
"confirmRemoveRelationField": "Вы уверены, что хотите удалить поле, связанное с <b>${x}</b>?",
|
||||||
"removeButKeepRelationField": "Удалить, сохранить связанное поле",
|
"removeButKeepRelationField": "Удалить, но сохранить связанное поле",
|
||||||
"exportPDFLowMemory": "Недостаточно доступной памяти для экспорта этого PDF, пожалуйста, уменьшите содержимое или увеличьте доступную память и повторите попытку экспорта",
|
"exportPDFLowMemory": "Недостаточно доступной памяти для экспорта этого PDF, пожалуйста, уменьшите содержимое или увеличьте доступную память и повторите попытку экспорта",
|
||||||
"exportConf": "Экспорт настроек",
|
"exportConf": "Экспорт настроек",
|
||||||
"exportConfTip": "Учетная запись, код авторизации доступа, синхронизация, API токен и ключ репозитория данных не будут экспортированы",
|
"exportConfTip": "Учетная запись, код авторизации доступа, синхронизация, API токен и ключ репозитория данных не будут экспортированы",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"confirmRemoveRelationField": "確定同時刪除關聯至 <b>${x}</b> 中的字段嗎?",
|
"confirmRemoveRelationField": "確定同時刪除關聯至 <b>${x}</b> 中的字段嗎?",
|
||||||
"removeButKeepRelationField": "刪除,保留關聯字段",
|
"removeButKeepRelationField": "刪除,但保留關聯字段",
|
||||||
"exportPDFLowMemory": "系統可用記憶體不足,無法導出該 PDF,請減少內容或者增加可用記憶體後再嘗試導出",
|
"exportPDFLowMemory": "系統可用記憶體不足,無法導出該 PDF,請減少內容或者增加可用記憶體後再嘗試導出",
|
||||||
"exportConf": "匯出設定",
|
"exportConf": "匯出設定",
|
||||||
"exportConfTip": "帳號、存取授權碼、同步、API token 和資料倉儲金鑰不會被匯出",
|
"exportConfTip": "帳號、存取授權碼、同步、API token 和資料倉儲金鑰不會被匯出",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"confirmRemoveRelationField": "确定同时删除关联至 <b>${x}</b> 中的字段吗?",
|
"confirmRemoveRelationField": "确定同时删除关联至 <b>${x}</b> 中的字段吗?",
|
||||||
"removeButKeepRelationField": "删除,保留关联字段",
|
"removeButKeepRelationField": "删除,但保留关联字段",
|
||||||
"exportPDFLowMemory": "系统可用内存不足,无法导出该 PDF,请减少内容或者增加可用内存后再尝试导出",
|
"exportPDFLowMemory": "系统可用内存不足,无法导出该 PDF,请减少内容或者增加可用内存后再尝试导出",
|
||||||
"exportConf": "导出设置",
|
"exportConf": "导出设置",
|
||||||
"exportConfTip": "账号、访问授权码、同步、API token 和数据仓库密钥不会被导出",
|
"exportConfTip": "账号、访问授权码、同步、API token 和数据仓库密钥不会被导出",
|
||||||
|
@ -46,7 +46,7 @@ func NewExport() *Export {
|
|||||||
return &Export{
|
return &Export{
|
||||||
ParagraphBeginningSpace: false,
|
ParagraphBeginningSpace: false,
|
||||||
AddTitle: true,
|
AddTitle: true,
|
||||||
BlockRefMode: 3,
|
BlockRefMode: 4,
|
||||||
BlockEmbedMode: 1,
|
BlockEmbedMode: 1,
|
||||||
BlockRefTextLeft: "",
|
BlockRefTextLeft: "",
|
||||||
BlockRefTextRight: "",
|
BlockRefTextRight: "",
|
||||||
|
@ -209,28 +209,17 @@ func GetAttributeViewPrimaryKeyValues(avID, keyword string, page, pageSize int)
|
|||||||
databaseBlockIDs = treenode.GetMirrorAttrViewBlockIDs(avID)
|
databaseBlockIDs = treenode.GetMirrorAttrViewBlockIDs(avID)
|
||||||
|
|
||||||
keyValues = attrView.GetBlockKeyValues()
|
keyValues = attrView.GetBlockKeyValues()
|
||||||
// 过滤掉不在视图中的值
|
var values []*av.Value
|
||||||
tmp := map[string]*av.Value{}
|
|
||||||
for _, kv := range keyValues.Values {
|
for _, kv := range keyValues.Values {
|
||||||
for _, view := range attrView.Views {
|
if !kv.IsDetached && !treenode.ExistBlockTree(kv.BlockID) {
|
||||||
switch view.LayoutType {
|
continue
|
||||||
case av.LayoutTypeTable:
|
}
|
||||||
if !kv.IsDetached {
|
|
||||||
if !treenode.ExistBlockTree(kv.BlockID) {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tmp[kv.Block.ID] = kv
|
if strings.Contains(strings.ToLower(kv.String(true)), strings.ToLower(keyword)) {
|
||||||
}
|
values = append(values, kv)
|
||||||
}
|
|
||||||
}
|
|
||||||
keyValues.Values = []*av.Value{}
|
|
||||||
for _, v := range tmp {
|
|
||||||
if strings.Contains(strings.ToLower(v.String(true)), strings.ToLower(keyword)) {
|
|
||||||
keyValues.Values = append(keyValues.Values, v)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
keyValues.Values = values
|
||||||
|
|
||||||
if 1 > pageSize {
|
if 1 > pageSize {
|
||||||
pageSize = 16
|
pageSize = 16
|
||||||
@ -2796,27 +2785,35 @@ func RemoveAttributeViewKey(avID, keyID string, removeRelationDest bool) (err er
|
|||||||
|
|
||||||
if nil != removedKey && av.KeyTypeRelation == removedKey.Type && nil != removedKey.Relation {
|
if nil != removedKey && av.KeyTypeRelation == removedKey.Type && nil != removedKey.Relation {
|
||||||
if removedKey.Relation.IsTwoWay {
|
if removedKey.Relation.IsTwoWay {
|
||||||
if removeRelationDest { // 删除双向关联的目标列
|
var destAv *av.AttributeView
|
||||||
var destAv *av.AttributeView
|
if avID == removedKey.Relation.AvID {
|
||||||
if avID == removedKey.Relation.AvID {
|
destAv = attrView
|
||||||
destAv = attrView
|
} else {
|
||||||
} else {
|
destAv, _ = av.ParseAttributeView(removedKey.Relation.AvID)
|
||||||
destAv, _ = av.ParseAttributeView(removedKey.Relation.AvID)
|
}
|
||||||
|
|
||||||
|
if nil != destAv {
|
||||||
|
oldDestKey, _ := destAv.GetKey(removedKey.Relation.BackKeyID)
|
||||||
|
if nil != oldDestKey && nil != oldDestKey.Relation && oldDestKey.Relation.AvID == attrView.ID && oldDestKey.Relation.IsTwoWay {
|
||||||
|
oldDestKey.Relation.IsTwoWay = false
|
||||||
|
oldDestKey.Relation.BackKeyID = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
if nil != destAv {
|
destAvRelSrcAv := false
|
||||||
destAvRelSrcAv := false
|
for i, keyValues := range destAv.KeyValues {
|
||||||
for i, keyValues := range destAv.KeyValues {
|
if keyValues.Key.ID == removedKey.Relation.BackKeyID {
|
||||||
if keyValues.Key.ID == removedKey.Relation.BackKeyID {
|
if removeRelationDest { // 删除双向关联的目标列
|
||||||
destAv.KeyValues = append(destAv.KeyValues[:i], destAv.KeyValues[i+1:]...)
|
destAv.KeyValues = append(destAv.KeyValues[:i], destAv.KeyValues[i+1:]...)
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
if av.KeyTypeRelation == keyValues.Key.Type && keyValues.Key.Relation.AvID == attrView.ID {
|
|
||||||
destAvRelSrcAv = true
|
|
||||||
}
|
}
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if av.KeyTypeRelation == keyValues.Key.Type && keyValues.Key.Relation.AvID == attrView.ID {
|
||||||
|
destAvRelSrcAv = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if removeRelationDest {
|
||||||
for _, view := range destAv.Views {
|
for _, view := range destAv.Views {
|
||||||
switch view.LayoutType {
|
switch view.LayoutType {
|
||||||
case av.LayoutTypeTable:
|
case av.LayoutTypeTable:
|
||||||
@ -2828,15 +2825,15 @@ func RemoveAttributeViewKey(avID, keyID string, removeRelationDest bool) (err er
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if destAv != attrView {
|
if destAv != attrView {
|
||||||
av.SaveAttributeView(destAv)
|
av.SaveAttributeView(destAv)
|
||||||
ReloadAttrView(destAv.ID)
|
ReloadAttrView(destAv.ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !destAvRelSrcAv {
|
if !destAvRelSrcAv {
|
||||||
av.RemoveAvRel(destAv.ID, attrView.ID)
|
av.RemoveAvRel(destAv.ID, attrView.ID)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,26 +130,8 @@ type BlockTreeInfo struct {
|
|||||||
|
|
||||||
func GetBlockTreeInfos(ids []string) (ret map[string]*BlockTreeInfo) {
|
func GetBlockTreeInfos(ids []string) (ret map[string]*BlockTreeInfo) {
|
||||||
ret = map[string]*BlockTreeInfo{}
|
ret = map[string]*BlockTreeInfo{}
|
||||||
luteEngine := util.NewLute()
|
trees := filesys.LoadTrees(ids)
|
||||||
treeCache := map[string]*parse.Tree{}
|
for id, tree := range trees {
|
||||||
for _, id := range ids {
|
|
||||||
bt := treenode.GetBlockTree(id)
|
|
||||||
if nil == bt {
|
|
||||||
ret[id] = &BlockTreeInfo{ID: id}
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
tree := treeCache[bt.RootID]
|
|
||||||
if nil == tree {
|
|
||||||
tree, _ = filesys.LoadTree(bt.BoxID, bt.Path, luteEngine)
|
|
||||||
if nil == tree {
|
|
||||||
ret[id] = &BlockTreeInfo{ID: id}
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
treeCache[bt.RootID] = tree
|
|
||||||
}
|
|
||||||
|
|
||||||
node := treenode.GetNodeInTree(tree, id)
|
node := treenode.GetNodeInTree(tree, id)
|
||||||
if nil == node {
|
if nil == node {
|
||||||
ret[id] = &BlockTreeInfo{ID: id}
|
ret[id] = &BlockTreeInfo{ID: id}
|
||||||
|
@ -255,8 +255,7 @@ func Export2Liandi(id string) (err error) {
|
|||||||
case 404:
|
case 404:
|
||||||
foundArticle = false
|
foundArticle = false
|
||||||
default:
|
default:
|
||||||
msg := fmt.Sprintf("get liandi article info failed [sc=%d]", resp.StatusCode)
|
err = errors.New(fmt.Sprintf("get liandi article info failed [sc=%d]", resp.StatusCode))
|
||||||
err = errors.New(msg)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -315,8 +314,7 @@ func Export2Liandi(id string) (err error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
msg := fmt.Sprintf(Conf.Language(181), util.GetCloudAccountServer()+"/article/"+articleId)
|
util.PushMsg(fmt.Sprintf(Conf.Language(181), util.GetCloudAccountServer()+"/article/"+articleId), 7000)
|
||||||
util.PushMsg(msg, 7000)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -505,8 +503,7 @@ func exportData(exportFolder string) (zipPath string, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
zipCallback := func(filename string) {
|
zipCallback := func(filename string) {
|
||||||
msg := Conf.language(65) + " " + fmt.Sprintf(Conf.language(70), filename)
|
util.PushEndlessProgress(Conf.language(65) + " " + fmt.Sprintf(Conf.language(70), filename))
|
||||||
util.PushEndlessProgress(msg)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = zip.AddDirectory(baseFolderName, exportFolder, zipCallback); err != nil {
|
if err = zip.AddDirectory(baseFolderName, exportFolder, zipCallback); err != nil {
|
||||||
@ -619,8 +616,7 @@ func ExportDocx(id, savePath string, removeAssets, merge bool) (fullPath string,
|
|||||||
if "" != docxTemplate {
|
if "" != docxTemplate {
|
||||||
if !gulu.File.IsExist(docxTemplate) {
|
if !gulu.File.IsExist(docxTemplate) {
|
||||||
logging.LogErrorf("docx template [%s] not found", docxTemplate)
|
logging.LogErrorf("docx template [%s] not found", docxTemplate)
|
||||||
msg := fmt.Sprintf(Conf.Language(197), docxTemplate)
|
err = errors.New(fmt.Sprintf(Conf.Language(197), docxTemplate))
|
||||||
err = errors.New(msg)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -633,8 +629,7 @@ func ExportDocx(id, savePath string, removeAssets, merge bool) (fullPath string,
|
|||||||
output, err := pandoc.CombinedOutput()
|
output, err := pandoc.CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logging.LogErrorf("export docx failed: %s", gulu.Str.FromBytes(output))
|
logging.LogErrorf("export docx failed: %s", gulu.Str.FromBytes(output))
|
||||||
msg := fmt.Sprintf(Conf.Language(14), gulu.Str.FromBytes(output))
|
err = errors.New(fmt.Sprintf(Conf.Language(14), gulu.Str.FromBytes(output)))
|
||||||
err = errors.New(msg)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1540,23 +1535,22 @@ func exportSYZip(boxID, rootDirPath, baseFolderName string, docPaths []string) (
|
|||||||
|
|
||||||
trees := map[string]*parse.Tree{}
|
trees := map[string]*parse.Tree{}
|
||||||
refTrees := map[string]*parse.Tree{}
|
refTrees := map[string]*parse.Tree{}
|
||||||
treeCache := map[string]*parse.Tree{}
|
luteEngine := util.NewLute()
|
||||||
for i, p := range docPaths {
|
for i, p := range docPaths {
|
||||||
docIAL := box.docIAL(p)
|
tree, err := filesys.LoadTree(boxID, p, luteEngine)
|
||||||
if nil == docIAL {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
msg := Conf.language(65) + " " + fmt.Sprintf(Conf.language(70), fmt.Sprintf("%d/%d %s", i+1, len(docPaths), docIAL["title"]))
|
|
||||||
util.PushEndlessProgress(msg)
|
|
||||||
|
|
||||||
id := docIAL["id"]
|
|
||||||
tree, err := LoadTreeByBlockID(id)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
trees[tree.ID] = tree
|
trees[tree.ID] = tree
|
||||||
|
|
||||||
|
util.PushEndlessProgress(Conf.language(65) + " " + fmt.Sprintf(Conf.language(70), fmt.Sprintf("%d/%d %s", i+1, len(docPaths), tree.Root.IALAttr("title"))))
|
||||||
|
}
|
||||||
|
|
||||||
|
count := 1
|
||||||
|
treeCache := map[string]*parse.Tree{}
|
||||||
|
for _, tree := range trees {
|
||||||
|
util.PushEndlessProgress(Conf.language(65) + " " + fmt.Sprintf(Conf.language(70), fmt.Sprintf("%d/%d %s", count, len(docPaths), tree.Root.IALAttr("title"))))
|
||||||
|
|
||||||
refs := map[string]*parse.Tree{}
|
refs := map[string]*parse.Tree{}
|
||||||
exportRefTrees(tree, &refs, &treeCache)
|
exportRefTrees(tree, &refs, &treeCache)
|
||||||
for refTreeID, refTree := range refs {
|
for refTreeID, refTree := range refs {
|
||||||
@ -1567,9 +1561,9 @@ func exportSYZip(boxID, rootDirPath, baseFolderName string, docPaths []string) (
|
|||||||
}
|
}
|
||||||
|
|
||||||
util.PushEndlessProgress(Conf.Language(65))
|
util.PushEndlessProgress(Conf.Language(65))
|
||||||
|
count = 0
|
||||||
|
|
||||||
// 按文件夹结构复制选择的树
|
// 按文件夹结构复制选择的树
|
||||||
count := 0
|
|
||||||
total := len(trees) + len(refTrees)
|
total := len(trees) + len(refTrees)
|
||||||
for _, tree := range trees {
|
for _, tree := range trees {
|
||||||
readPath := filepath.Join(util.DataDir, tree.Box, tree.Path)
|
readPath := filepath.Join(util.DataDir, tree.Box, tree.Path)
|
||||||
@ -1592,7 +1586,7 @@ func exportSYZip(boxID, rootDirPath, baseFolderName string, docPaths []string) (
|
|||||||
}
|
}
|
||||||
count++
|
count++
|
||||||
|
|
||||||
util.PushEndlessProgress(fmt.Sprintf(Conf.Language(66), fmt.Sprintf("%d/%d ", count, total)+tree.HPath))
|
util.PushEndlessProgress(Conf.language(65) + " " + fmt.Sprintf(Conf.Language(66), fmt.Sprintf("%d/%d ", count, total)+tree.HPath))
|
||||||
}
|
}
|
||||||
|
|
||||||
// 引用树放在导出文件夹根路径下
|
// 引用树放在导出文件夹根路径下
|
||||||
@ -1612,7 +1606,7 @@ func exportSYZip(boxID, rootDirPath, baseFolderName string, docPaths []string) (
|
|||||||
}
|
}
|
||||||
count++
|
count++
|
||||||
|
|
||||||
util.PushEndlessProgress(fmt.Sprintf(Conf.Language(66), fmt.Sprintf("%d/%d ", count, total)+tree.HPath))
|
util.PushEndlessProgress(Conf.language(65) + " " + fmt.Sprintf(Conf.Language(66), fmt.Sprintf("%d/%d ", count, total)+tree.HPath))
|
||||||
}
|
}
|
||||||
|
|
||||||
// 将引用树合并到选择树中,以便后面一次性导出资源文件
|
// 将引用树合并到选择树中,以便后面一次性导出资源文件
|
||||||
@ -1798,8 +1792,7 @@ func exportSYZip(boxID, rootDirPath, baseFolderName string, docPaths []string) (
|
|||||||
}
|
}
|
||||||
|
|
||||||
zipCallback := func(filename string) {
|
zipCallback := func(filename string) {
|
||||||
msg := Conf.language(65) + " " + fmt.Sprintf(Conf.language(70), filename)
|
util.PushEndlessProgress(Conf.language(65) + " " + fmt.Sprintf(Conf.language(70), filename))
|
||||||
util.PushEndlessProgress(msg)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = zip.AddDirectory(baseFolderName, exportFolder, zipCallback); err != nil {
|
if err = zip.AddDirectory(baseFolderName, exportFolder, zipCallback); err != nil {
|
||||||
@ -2735,7 +2728,7 @@ type refAsFootnotes struct {
|
|||||||
refAnchorText string
|
refAnchorText string
|
||||||
}
|
}
|
||||||
|
|
||||||
func exportRefTrees(tree *parse.Tree, retTrees *map[string]*parse.Tree, treeCache *map[string]*parse.Tree) {
|
func exportRefTrees(tree *parse.Tree, retTrees, treeCache *map[string]*parse.Tree) {
|
||||||
if nil != (*retTrees)[tree.ID] {
|
if nil != (*retTrees)[tree.ID] {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,16 @@ func renderOutline(heading *ast.Node, luteEngine *lute.Lute) (ret string) {
|
|||||||
dom := luteEngine.RenderNodeBlockDOM(n)
|
dom := luteEngine.RenderNodeBlockDOM(n)
|
||||||
buf.WriteString(dom)
|
buf.WriteString(dom)
|
||||||
return ast.WalkSkipChildren
|
return ast.WalkSkipChildren
|
||||||
|
case ast.NodeEmoji:
|
||||||
|
dom := luteEngine.RenderNodeBlockDOM(n)
|
||||||
|
buf.WriteString(dom)
|
||||||
|
return ast.WalkSkipChildren
|
||||||
case ast.NodeImage:
|
case ast.NodeImage:
|
||||||
|
// 标题后直接跟图片时图片的提示文本不再渲染到大纲中 https://github.com/siyuan-note/siyuan/issues/6278
|
||||||
|
title := n.ChildByType(ast.NodeLinkTitle)
|
||||||
|
title.Unlink()
|
||||||
|
dom := luteEngine.RenderNodeBlockDOM(n)
|
||||||
|
buf.WriteString(dom)
|
||||||
return ast.WalkSkipChildren
|
return ast.WalkSkipChildren
|
||||||
}
|
}
|
||||||
return ast.WalkContinue
|
return ast.WalkContinue
|
||||||
@ -215,6 +224,10 @@ func resolveEmbedR(n *ast.Node, blockEmbedMode int, luteEngine *lute.Lute, resol
|
|||||||
}
|
}
|
||||||
|
|
||||||
subTree, _ := LoadTreeByBlockID(sqlBlock.ID)
|
subTree, _ := LoadTreeByBlockID(sqlBlock.ID)
|
||||||
|
if nil == subTree {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
var md string
|
var md string
|
||||||
if "d" == sqlBlock.Type {
|
if "d" == sqlBlock.Type {
|
||||||
if 0 == blockEmbedMode {
|
if 0 == blockEmbedMode {
|
||||||
|
Loading…
Reference in New Issue
Block a user