mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Subdocuments created by the database are not displayed in the doc tree https://github.com/siyuan-note/siyuan/issues/9091
This commit is contained in:
parent
09f91258a1
commit
f80ae732b9
3 changed files with 14 additions and 14 deletions
|
|
@ -33,7 +33,7 @@ import (
|
|||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
func createDocsByHPath(boxID, hPath, content, parentID string, showInDocTree bool) (id string, existed bool, err error) {
|
||||
func createDocsByHPath(boxID, hPath, content, parentID string, hidden bool) (id string, existed bool, err error) {
|
||||
hPath = strings.TrimSuffix(hPath, ".sy")
|
||||
pathBuilder := bytes.Buffer{}
|
||||
pathBuilder.WriteString("/")
|
||||
|
|
@ -51,7 +51,7 @@ func createDocsByHPath(boxID, hPath, content, parentID string, showInDocTree boo
|
|||
// 如果父文档存在且 ID 一致,则直接在父文档下创建
|
||||
id = ast.NewNodeID()
|
||||
p := strings.TrimSuffix(preferredParent.Path, ".sy") + "/" + id + ".sy"
|
||||
if _, err = createDoc(boxID, p, name, content, showInDocTree); nil != err {
|
||||
if _, err = createDoc(boxID, p, name, content, hidden); nil != err {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
@ -68,11 +68,11 @@ func createDocsByHPath(boxID, hPath, content, parentID string, showInDocTree boo
|
|||
pathBuilder.WriteString(id)
|
||||
docP := pathBuilder.String() + ".sy"
|
||||
if isNotLast {
|
||||
if _, err = createDoc(boxID, docP, part, "", showInDocTree); nil != err {
|
||||
if _, err = createDoc(boxID, docP, part, "", hidden); nil != err {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if _, err = createDoc(boxID, docP, part, content, showInDocTree); nil != err {
|
||||
if _, err = createDoc(boxID, docP, part, content, hidden); nil != err {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue