mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 15:10:12 +01:00
🎨 Support exporting Markdown after selecting multiple documents https://github.com/siyuan-note/siyuan/issues/12912
This commit is contained in:
parent
9371c68ec9
commit
a32ceb8e2f
4 changed files with 51 additions and 5 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue