mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 00:38:49 +01:00
♻️ Extract method util.GetTreeID
This commit is contained in:
parent
c295a496d7
commit
6f7e106be4
11 changed files with 26 additions and 27 deletions
|
|
@ -20,7 +20,6 @@ import (
|
|||
"crypto/sha256"
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"strings"
|
||||
|
|
@ -61,7 +60,7 @@ func TreeRoot(node *ast.Node) *ast.Node {
|
|||
}
|
||||
|
||||
func NewTree(boxID, p, hp, title string) *parse.Tree {
|
||||
id := strings.TrimSuffix(path.Base(p), ".sy")
|
||||
id := util.GetTreeID(p)
|
||||
root := &ast.Node{Type: ast.NodeDocument, ID: id, Spec: "1", Box: boxID, Path: p}
|
||||
root.SetIALAttr("title", title)
|
||||
root.SetIALAttr("id", id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue