mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
fa2ec80cb1
4 changed files with 33 additions and 9 deletions
|
@ -279,6 +279,7 @@ export class Preview {
|
||||||
fetchPost("/api/lute/copyStdMarkdown", {
|
fetchPost("/api/lute/copyStdMarkdown", {
|
||||||
id: protyle.block.id || protyle.options.blockId || protyle.block.parentID,
|
id: protyle.block.id || protyle.options.blockId || protyle.block.parentID,
|
||||||
assetsDestSpace2Underscore: true,
|
assetsDestSpace2Underscore: true,
|
||||||
|
fillCSSVar: true,
|
||||||
adjustHeadingLevel: true,
|
adjustHeadingLevel: true,
|
||||||
}, (response) => {
|
}, (response) => {
|
||||||
writeText(response.data);
|
writeText(response.data);
|
||||||
|
|
|
@ -49,12 +49,17 @@ func copyStdMarkdown(c *gin.Context) {
|
||||||
assetsDestSpace2Underscore = arg["assetsDestSpace2Underscore"].(bool)
|
assetsDestSpace2Underscore = arg["assetsDestSpace2Underscore"].(bool)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fillCSSVar := false
|
||||||
|
if nil != arg["fillCSSVar"] {
|
||||||
|
fillCSSVar = arg["fillCSSVar"].(bool)
|
||||||
|
}
|
||||||
|
|
||||||
adjustHeadingLevel := false
|
adjustHeadingLevel := false
|
||||||
if nil != arg["adjustHeadingLevel"] {
|
if nil != arg["adjustHeadingLevel"] {
|
||||||
adjustHeadingLevel = arg["adjustHeadingLevel"].(bool)
|
adjustHeadingLevel = arg["adjustHeadingLevel"].(bool)
|
||||||
}
|
}
|
||||||
|
|
||||||
ret.Data = model.ExportStdMarkdown(id, assetsDestSpace2Underscore, adjustHeadingLevel)
|
ret.Data = model.ExportStdMarkdown(id, assetsDestSpace2Underscore, fillCSSVar, adjustHeadingLevel)
|
||||||
}
|
}
|
||||||
|
|
||||||
func html2BlockDOM(c *gin.Context) {
|
func html2BlockDOM(c *gin.Context) {
|
||||||
|
|
|
@ -1588,7 +1588,7 @@ func genAttrViewViewGroups(view *av.View, attrView *av.AttributeView) {
|
||||||
items = append(items, item)
|
items = append(items, item)
|
||||||
}
|
}
|
||||||
|
|
||||||
groupKey, _ := attrView.GetKey(group.Field)
|
groupKey := view.GetGroupKey(attrView)
|
||||||
if nil == groupKey {
|
if nil == groupKey {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -1611,9 +1611,19 @@ func genAttrViewViewGroups(view *av.View, attrView *av.AttributeView) {
|
||||||
return items[i].GetValue(group.Field).Number.Content < items[j].GetValue(group.Field).Number.Content
|
return items[i].GetValue(group.Field).Number.Content < items[j].GetValue(group.Field).Number.Content
|
||||||
})
|
})
|
||||||
case av.GroupMethodDateDay, av.GroupMethodDateWeek, av.GroupMethodDateMonth, av.GroupMethodDateYear, av.GroupMethodDateRelative:
|
case av.GroupMethodDateDay, av.GroupMethodDateWeek, av.GroupMethodDateMonth, av.GroupMethodDateYear, av.GroupMethodDateRelative:
|
||||||
sort.SliceStable(items, func(i, j int) bool {
|
if av.KeyTypeCreated == groupKey.Type {
|
||||||
return items[i].GetValue(group.Field).Date.Content < items[j].GetValue(group.Field).Date.Content
|
sort.SliceStable(items, func(i, j int) bool {
|
||||||
})
|
return items[i].GetValue(group.Field).Created.Content < items[j].GetValue(group.Field).Created.Content
|
||||||
|
})
|
||||||
|
} else if av.KeyTypeUpdated == groupKey.Type {
|
||||||
|
sort.SliceStable(items, func(i, j int) bool {
|
||||||
|
return items[i].GetValue(group.Field).Updated.Content < items[j].GetValue(group.Field).Updated.Content
|
||||||
|
})
|
||||||
|
} else if av.KeyTypeDate == groupKey.Type {
|
||||||
|
sort.SliceStable(items, func(i, j int) bool {
|
||||||
|
return items[i].GetValue(group.Field).Date.Content < items[j].GetValue(group.Field).Date.Content
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var groupName string
|
var groupName string
|
||||||
|
@ -3986,7 +3996,11 @@ func updateAttributeViewColumn(operation *Operation) (err error) {
|
||||||
|
|
||||||
if changeType {
|
if changeType {
|
||||||
for _, view := range attrView.Views {
|
for _, view := range attrView.Views {
|
||||||
removeAttributeViewGroup0(view)
|
if nil != view.Group {
|
||||||
|
if groupKey := view.GetGroupKey(attrView); nil != groupKey && groupKey.ID == operation.ID {
|
||||||
|
removeAttributeViewGroup0(view)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4111,7 +4125,11 @@ func RemoveAttributeViewKey(avID, keyID string, removeRelationDest bool) (err er
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, view := range attrView.Views {
|
for _, view := range attrView.Views {
|
||||||
removeAttributeViewGroup0(view)
|
if nil != view.Group {
|
||||||
|
if groupKey := view.GetGroupKey(attrView); nil != groupKey && groupKey.ID == keyID {
|
||||||
|
removeAttributeViewGroup0(view)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err = av.SaveAttributeView(attrView)
|
err = av.SaveAttributeView(attrView)
|
||||||
|
|
|
@ -1457,7 +1457,7 @@ func processPDFLinkEmbedAssets(pdfCtx *model.Context, assetDests []string, remov
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func ExportStdMarkdown(id string, assetsDestSpace2Underscore, adjustHeadingLevel bool) string {
|
func ExportStdMarkdown(id string, assetsDestSpace2Underscore, fillCSSVar, adjustHeadingLevel bool) string {
|
||||||
bt := treenode.GetBlockTree(id)
|
bt := treenode.GetBlockTree(id)
|
||||||
if nil == bt {
|
if nil == bt {
|
||||||
logging.LogErrorf("block tree [%s] not found", id)
|
logging.LogErrorf("block tree [%s] not found", id)
|
||||||
|
@ -1500,7 +1500,7 @@ func ExportStdMarkdown(id string, assetsDestSpace2Underscore, adjustHeadingLevel
|
||||||
".md", Conf.Export.BlockRefMode, Conf.Export.BlockEmbedMode, Conf.Export.FileAnnotationRefMode,
|
".md", Conf.Export.BlockRefMode, Conf.Export.BlockEmbedMode, Conf.Export.FileAnnotationRefMode,
|
||||||
Conf.Export.TagOpenMarker, Conf.Export.TagCloseMarker,
|
Conf.Export.TagOpenMarker, Conf.Export.TagCloseMarker,
|
||||||
Conf.Export.BlockRefTextLeft, Conf.Export.BlockRefTextRight,
|
Conf.Export.BlockRefTextLeft, Conf.Export.BlockRefTextRight,
|
||||||
Conf.Export.AddTitle, Conf.Export.InlineMemo, defBlockIDs, true, false, &map[string]*parse.Tree{})
|
Conf.Export.AddTitle, Conf.Export.InlineMemo, defBlockIDs, true, fillCSSVar, &map[string]*parse.Tree{})
|
||||||
}
|
}
|
||||||
|
|
||||||
func ExportPandocConvertZip(ids []string, pandocTo, ext string) (name, zipPath string) {
|
func ExportPandocConvertZip(ids []string, pandocTo, ext string) (name, zipPath string) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue