mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-16 20:18:06 +01:00
🎨 The Microsoft Store version no longer automatically sets Pandoc parameters https://github.com/siyuan-note/siyuan/issues/17044
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
2d2ef40a7c
commit
f7e82816fd
1 changed files with 19 additions and 19 deletions
|
|
@ -321,20 +321,6 @@ func InitConf() {
|
|||
Conf.Export.PandocBin = util.PandocBinPath
|
||||
}
|
||||
|
||||
docxTemplate := util.RemoveInvalid(Conf.Export.DocxTemplate)
|
||||
if "" != docxTemplate {
|
||||
params := util.RemoveInvalid(Conf.Export.PandocParams)
|
||||
if gulu.File.IsExist(docxTemplate) && !strings.Contains(params, "--reference-doc") {
|
||||
if !strings.HasPrefix(docxTemplate, "\"") {
|
||||
docxTemplate = "\"" + docxTemplate + "\""
|
||||
}
|
||||
params += " --reference-doc " + docxTemplate
|
||||
Conf.Export.PandocParams = strings.TrimSpace(params)
|
||||
}
|
||||
Conf.Export.DocxTemplate = ""
|
||||
Conf.Save()
|
||||
}
|
||||
|
||||
if nil == Conf.Graph || nil == Conf.Graph.Local || nil == Conf.Graph.Global {
|
||||
Conf.Graph = conf.NewGraph()
|
||||
}
|
||||
|
|
@ -373,10 +359,6 @@ func InitConf() {
|
|||
Conf.System.DisabledFeatures = []string{}
|
||||
}
|
||||
|
||||
if nil == Conf.Snippet {
|
||||
Conf.Snippet = conf.NewSnpt()
|
||||
}
|
||||
|
||||
Conf.System.AppDir = util.WorkingDir
|
||||
Conf.System.ConfDir = util.ConfDir
|
||||
Conf.System.HomeDir = util.HomeDir
|
||||
|
|
@ -390,6 +372,24 @@ func InitConf() {
|
|||
Conf.System.OS = runtime.GOOS
|
||||
Conf.System.OSPlatform = util.GetOSPlatform()
|
||||
|
||||
docxTemplate := util.RemoveInvalid(Conf.Export.DocxTemplate)
|
||||
if "" != docxTemplate {
|
||||
params := util.RemoveInvalid(Conf.Export.PandocParams)
|
||||
if gulu.File.IsExist(docxTemplate) && !strings.Contains(params, "--reference-doc") && !Conf.System.IsMicrosoftStore {
|
||||
if !strings.HasPrefix(docxTemplate, "\"") {
|
||||
docxTemplate = "\"" + docxTemplate + "\""
|
||||
}
|
||||
params += " --reference-doc " + docxTemplate
|
||||
Conf.Export.PandocParams = strings.TrimSpace(params)
|
||||
}
|
||||
Conf.Export.DocxTemplate = ""
|
||||
Conf.Save()
|
||||
}
|
||||
|
||||
if nil == Conf.Snippet {
|
||||
Conf.Snippet = conf.NewSnpt()
|
||||
}
|
||||
|
||||
if "" != Conf.UserData {
|
||||
Conf.SetUser(loadUserFromConf())
|
||||
}
|
||||
|
|
@ -1267,7 +1267,7 @@ func subscribeConfEvents() {
|
|||
Conf.Export.PandocBin = util.PandocBinPath
|
||||
|
||||
params := util.RemoveInvalid(Conf.Export.PandocParams)
|
||||
if !strings.Contains(params, "--reference-doc") && "" != util.PandocTemplatePath {
|
||||
if !strings.Contains(params, "--reference-doc") && "" != util.PandocTemplatePath && !Conf.System.IsMicrosoftStore {
|
||||
params += " --reference-doc"
|
||||
params += " \"" + util.PandocTemplatePath + "\""
|
||||
Conf.Export.PandocParams = strings.TrimSpace(params)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue