This commit is contained in:
Liang Ding 2023-05-10 22:53:23 +08:00
parent 01dff7eb5d
commit c3df45a406
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
6 changed files with 306 additions and 194 deletions

View file

@ -31,6 +31,40 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
func exportAsciiDoc(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
arg, ok := util.JsonArg(c, ret)
if !ok {
return
}
id := arg["id"].(string)
name, zipPath := model.ExportPandocConvertZip(id, "asciidoc", ".adoc")
ret.Data = map[string]interface{}{
"name": name,
"zip": zipPath,
}
}
func exportReStructuredText(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
arg, ok := util.JsonArg(c, ret)
if !ok {
return
}
id := arg["id"].(string)
name, zipPath := model.ExportPandocConvertZip(id, "rst", ".rst")
ret.Data = map[string]interface{}{
"name": name,
"zip": zipPath,
}
}
func export2Liandi(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
@ -115,7 +149,7 @@ func exportMd(c *gin.Context) {
}
id := arg["id"].(string)
name, zipPath := model.ExportMarkdown(id)
name, zipPath := model.ExportPandocConvertZip(id, "", ".md")
ret.Data = map[string]interface{}{
"name": name,
"zip": zipPath,