mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🎨 Support for exporting Org-Mode Fix https://github.com/siyuan-note/siyuan/issues/8136
This commit is contained in:
parent
af938cc41d
commit
1e20ccdd72
3 changed files with 29 additions and 0 deletions
|
|
@ -678,6 +678,17 @@ export const exportMd = (id: string) => {
|
||||||
openByMobile(response.data.zip);
|
openByMobile(response.data.zip);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
label: "Org-Mode",
|
||||||
|
click: () => {
|
||||||
|
const msgId = showMessage(window.siyuan.languages.exporting, -1);
|
||||||
|
fetchPost("/api/export/exportOrgMode", {
|
||||||
|
id,
|
||||||
|
}, response => {
|
||||||
|
hideMessage(msgId);
|
||||||
|
openByMobile(response.data.zip);
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,23 @@ import (
|
||||||
"github.com/siyuan-note/siyuan/kernel/util"
|
"github.com/siyuan-note/siyuan/kernel/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func exportOrgMode(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, "org", ".org")
|
||||||
|
ret.Data = map[string]interface{}{
|
||||||
|
"name": name,
|
||||||
|
"zip": zipPath,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func exportOPML(c *gin.Context) {
|
func exportOPML(c *gin.Context) {
|
||||||
ret := gulu.Ret.NewResult()
|
ret := gulu.Ret.NewResult()
|
||||||
defer c.JSON(http.StatusOK, ret)
|
defer c.JSON(http.StatusOK, ret)
|
||||||
|
|
|
||||||
|
|
@ -249,6 +249,7 @@ func ServeAPI(ginServer *gin.Engine) {
|
||||||
ginServer.Handle("POST", "/api/export/exportAsciiDoc", model.CheckAuth, exportAsciiDoc)
|
ginServer.Handle("POST", "/api/export/exportAsciiDoc", model.CheckAuth, exportAsciiDoc)
|
||||||
ginServer.Handle("POST", "/api/export/exportTextile", model.CheckAuth, exportTextile)
|
ginServer.Handle("POST", "/api/export/exportTextile", model.CheckAuth, exportTextile)
|
||||||
ginServer.Handle("POST", "/api/export/exportOPML", model.CheckAuth, exportOPML)
|
ginServer.Handle("POST", "/api/export/exportOPML", model.CheckAuth, exportOPML)
|
||||||
|
ginServer.Handle("POST", "/api/export/exportOrgMode", model.CheckAuth, exportOrgMode)
|
||||||
|
|
||||||
ginServer.Handle("POST", "/api/import/importStdMd", model.CheckAuth, model.CheckReadonly, importStdMd)
|
ginServer.Handle("POST", "/api/import/importStdMd", model.CheckAuth, model.CheckReadonly, importStdMd)
|
||||||
ginServer.Handle("POST", "/api/import/importData", model.CheckAuth, model.CheckReadonly, importData)
|
ginServer.Handle("POST", "/api/import/importData", model.CheckAuth, model.CheckReadonly, importData)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue