mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-30 13:28:48 +01:00
🎨 文档信息统计增加超链接数、图片数、引用数和大小 https://github.com/siyuan-note/siyuan/issues/6037
This commit is contained in:
parent
a772b47287
commit
5e09d72fab
16 changed files with 86 additions and 86 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue