🎨 Support exporting Markdown after selecting multiple documents https://github.com/siyuan-note/siyuan/issues/12912

This commit is contained in:
Daniel 2024-11-09 14:39:27 +08:00
parent 9371c68ec9
commit a32ceb8e2f
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
4 changed files with 51 additions and 5 deletions

View file

@ -307,7 +307,7 @@ func exportResources(c *gin.Context) {
}
}
func batchExportMd(c *gin.Context) {
func exportNotebookMd(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
@ -318,13 +318,35 @@ func batchExportMd(c *gin.Context) {
notebook := arg["notebook"].(string)
p := arg["path"].(string)
zipPath := model.BatchExportMarkdown(notebook, p)
zipPath := model.ExportNotebookMarkdown(notebook, p)
ret.Data = map[string]interface{}{
"name": path.Base(zipPath),
"zip": zipPath,
}
}
func exportMds(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
arg, ok := util.JsonArg(c, ret)
if !ok {
return
}
idsArg := arg["ids"].([]interface{})
var ids []string
for _, id := range idsArg {
ids = append(ids, id.(string))
}
name, zipPath := model.BatchExportPandocConvertZip(ids, "", ".md")
ret.Data = map[string]interface{}{
"name": name,
"zip": zipPath,
}
}
func exportMd(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)