mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-30 20:25:17 +01:00
🎨 Supports setting Pandoc parameters for export https://github.com/siyuan-note/siyuan/issues/16845
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
7e8a26f230
commit
53c24fff2b
19 changed files with 62 additions and 70 deletions
|
|
@ -721,17 +721,9 @@ func ExportDocx(id, savePath string, removeAssets, merge bool) (fullPath string,
|
|||
"-o", tmpDocxPath,
|
||||
}
|
||||
|
||||
// Pandoc template for exporting docx https://github.com/siyuan-note/siyuan/issues/8740
|
||||
docxTemplate := util.RemoveInvalid(Conf.Export.DocxTemplate)
|
||||
docxTemplate = strings.TrimSpace(docxTemplate)
|
||||
if "" != docxTemplate {
|
||||
if !gulu.File.IsExist(docxTemplate) {
|
||||
logging.LogErrorf("docx template [%s] not found", docxTemplate)
|
||||
err = errors.New(fmt.Sprintf(Conf.Language(197), docxTemplate))
|
||||
return
|
||||
}
|
||||
|
||||
args = append(args, "--reference-doc", docxTemplate)
|
||||
params := util.RemoveInvalid(Conf.Export.PandocParams)
|
||||
if "" != params {
|
||||
args = append(args, strings.Split(params, " ")...)
|
||||
}
|
||||
|
||||
pandoc := exec.Command(Conf.Export.PandocBin, args...)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue