🎨 文档信息统计增加超链接数、图片数、引用数和大小 https://github.com/siyuan-note/siyuan/issues/6037

This commit is contained in:
Liang Ding 2022-10-01 13:00:39 +08:00
parent a772b47287
commit 5e09d72fab
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
16 changed files with 86 additions and 86 deletions

View file

@ -31,9 +31,15 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
func TreeStat(tree *parse.Tree) (runeCount, wordCount int) {
runeCount, wordCount = tree.Root.ContentLen()
return
func StatTree(tree *parse.Tree) (ret *util.BlockStatResult) {
runeCnt, wordCnt, linkCnt, imgCnt, refCnt := tree.Root.Stat()
return &util.BlockStatResult{
RuneCount: runeCnt,
WordCount: wordCnt,
LinkCount: linkCnt,
ImageCount: imgCnt,
RefCount: refCnt,
}
}
func NodeHash(node *ast.Node, tree *parse.Tree, luteEngine *lute.Lute) string {