mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-27 10:46:09 +01:00
🎨 Improve export to Word .docx format https://github.com/siyuan-note/siyuan/issues/14970
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
a85655eae0
commit
f6dd1a7d7e
11 changed files with 58 additions and 18 deletions
|
|
@ -101,8 +101,9 @@ func Pandoc(from, to, o, content string) (err error) {
|
|||
}
|
||||
|
||||
var (
|
||||
PandocBinPath string // Pandoc 可执行文件路径
|
||||
PandocTemplatePath string // Pandoc Docx 模板文件路径
|
||||
PandocBinPath string // Pandoc 可执行文件路径
|
||||
PandocTemplatePath string // Pandoc Docx 模板文件路径
|
||||
PandocColorFilterPath string // Pandoc 颜色过滤器路径
|
||||
)
|
||||
|
||||
func InitPandoc() {
|
||||
|
|
@ -129,11 +130,11 @@ func InitPandoc() {
|
|||
}
|
||||
}
|
||||
|
||||
PandocTemplatePath = filepath.Join(pandocDir, "pandoc-template.docx")
|
||||
PandocTemplatePath = filepath.Join(pandocDir, "pandoc-resources", "pandoc-template.docx")
|
||||
if !gulu.File.IsExist(PandocTemplatePath) {
|
||||
PandocTemplatePath = filepath.Join(WorkingDir, "pandoc-template.docx")
|
||||
PandocTemplatePath = filepath.Join(WorkingDir, "pandoc-resources", "pandoc-template.docx")
|
||||
if "dev" == Mode || !gulu.File.IsExist(PandocTemplatePath) {
|
||||
PandocTemplatePath = filepath.Join(WorkingDir, "pandoc/pandoc-template.docx")
|
||||
PandocTemplatePath = filepath.Join(WorkingDir, "pandoc", "pandoc-resources", "pandoc-template.docx")
|
||||
}
|
||||
}
|
||||
if !gulu.File.IsExist(PandocTemplatePath) {
|
||||
|
|
@ -141,6 +142,18 @@ func InitPandoc() {
|
|||
logging.LogWarnf("pandoc template file [%s] not found", PandocTemplatePath)
|
||||
}
|
||||
|
||||
PandocColorFilterPath = filepath.Join(pandocDir, "pandoc-resources", "pandoc_color_filter.lua")
|
||||
if !gulu.File.IsExist(PandocColorFilterPath) {
|
||||
PandocColorFilterPath = filepath.Join(WorkingDir, "pandoc-resources", "pandoc_color_filter.lua")
|
||||
if "dev" == Mode || !gulu.File.IsExist(PandocColorFilterPath) {
|
||||
PandocColorFilterPath = filepath.Join(WorkingDir, "pandoc", "pandoc-resources", "pandoc_color_filter.lua")
|
||||
}
|
||||
}
|
||||
if !gulu.File.IsExist(PandocColorFilterPath) {
|
||||
PandocColorFilterPath = ""
|
||||
logging.LogWarnf("pandoc color filter file [%s] not found", PandocColorFilterPath)
|
||||
}
|
||||
|
||||
defer eventbus.Publish(EvtConfPandocInitialized)
|
||||
|
||||
if gulu.OS.IsWindows() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue