mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-19 23:06:09 +01:00
🎨 Built-in Pandoc export .docx template https://github.com/siyuan-note/siyuan/issues/16861
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
1f02650b38
commit
1012d8b486
11 changed files with 44 additions and 4 deletions
|
|
@ -45,6 +45,7 @@ import (
|
|||
"github.com/emirpasic/gods/sets/hashset"
|
||||
"github.com/emirpasic/gods/stacks/linkedliststack"
|
||||
"github.com/imroc/req/v3"
|
||||
shellquote "github.com/kballard/go-shellquote"
|
||||
"github.com/pdfcpu/pdfcpu/pkg/api"
|
||||
"github.com/pdfcpu/pdfcpu/pkg/font"
|
||||
"github.com/pdfcpu/pdfcpu/pkg/pdfcpu"
|
||||
|
|
@ -773,7 +774,12 @@ func ExportDocx(id, savePath string, removeAssets, merge bool) (fullPath string,
|
|||
|
||||
params := util.RemoveInvalid(Conf.Export.PandocParams)
|
||||
if "" != params {
|
||||
args = append(args, strings.Split(params, " ")...)
|
||||
customArgs, parseErr := shellquote.Split(params)
|
||||
if nil != parseErr {
|
||||
logging.LogErrorf("parse pandoc custom params [%s] failed: %s", params, parseErr)
|
||||
} else {
|
||||
args = append(args, customArgs...)
|
||||
}
|
||||
}
|
||||
|
||||
pandoc := exec.Command(Conf.Export.PandocBin, args...)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue