mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 18:10:12 +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
|
|
@ -157,11 +157,7 @@ func getContentWordCount(c *gin.Context) {
|
|||
}
|
||||
|
||||
content := arg["content"].(string)
|
||||
runeCount, wordCount := model.ContentWordCount(content)
|
||||
ret.Data = map[string]interface{}{
|
||||
"runeCount": runeCount,
|
||||
"wordCount": wordCount,
|
||||
}
|
||||
ret.Data = model.ContentStat(content)
|
||||
}
|
||||
|
||||
func getBlocksWordCount(c *gin.Context) {
|
||||
|
|
@ -178,14 +174,10 @@ func getBlocksWordCount(c *gin.Context) {
|
|||
for _, id := range idsArg {
|
||||
ids = append(ids, id.(string))
|
||||
}
|
||||
runeCount, wordCount := model.BlocksWordCount(ids)
|
||||
ret.Data = map[string]interface{}{
|
||||
"runeCount": runeCount,
|
||||
"wordCount": wordCount,
|
||||
}
|
||||
ret.Data = model.BlocksWordCount(ids)
|
||||
}
|
||||
|
||||
func getBlockWordCount(c *gin.Context) {
|
||||
func getTreeStat(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
|
|
@ -195,13 +187,7 @@ func getBlockWordCount(c *gin.Context) {
|
|||
}
|
||||
|
||||
id := arg["id"].(string)
|
||||
blockRuneCount, blockWordCount, rootBlockRuneCount, rootBlockWordCount := model.BlockWordCount(id)
|
||||
ret.Data = map[string]interface{}{
|
||||
"blockRuneCount": blockRuneCount,
|
||||
"blockWordCount": blockWordCount,
|
||||
"rootBlockRuneCount": rootBlockRuneCount,
|
||||
"rootBlockWordCount": rootBlockWordCount,
|
||||
}
|
||||
ret.Data = model.StatTree(id)
|
||||
}
|
||||
|
||||
func getRefText(c *gin.Context) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue