treenode

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2023 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DynamicRefTexts = sync.Map{}

Functions

func AutoFlushBlockTree

func AutoFlushBlockTree()

func CeilBlockCount

func CeilBlockCount(count int) int

func CeilTreeCount

func CeilTreeCount(count int) int

func ContainsMarker

func ContainsMarker(str string) bool

func CountBlockNodes

func CountBlockNodes(node *ast.Node) (ret int)

func CountBlocks

func CountBlocks() (ret int)

func CountTrees

func CountTrees() (ret int)

func ExportNodeStdMd

func ExportNodeStdMd(node *ast.Node, luteEngine *lute.Lute) string

func FirstLeafBlock

func FirstLeafBlock(node *ast.Node) (ret *ast.Node)

func FormatNode

func FormatNode(node *ast.Node, luteEngine *lute.Lute) string

func FromAbbrType

func FromAbbrType(abbrType string) string

func GetBlockRef

func GetBlockRef(n *ast.Node) (blockRefID, blockRefText, blockRefSubtype string)

func GetDocTitleImgPath

func GetDocTitleImgPath(root *ast.Node) (ret string)

func GetNodeInTree

func GetNodeInTree(tree *parse.Tree, id string) (ret *ast.Node)

func GetNotExistPaths

func GetNotExistPaths(boxID string, paths []string) (ret []string)

func GetRedundantPaths

func GetRedundantPaths(boxID string, paths []string) (ret []string)

func GetRootUpdated

func GetRootUpdated() (ret map[string]string)

func HeadingChildren

func HeadingChildren(heading *ast.Node) (ret []*ast.Node)

func HeadingLevel

func HeadingLevel(node *ast.Node) int

func HeadingParent

func HeadingParent(node *ast.Node) *ast.Node

func IALStr

func IALStr(n *ast.Node) string

func IndexBlockTree

func IndexBlockTree(tree *parse.Tree)

func InitBlockTree

func InitBlockTree(force bool)

func IsBlockRef

func IsBlockRef(n *ast.Node) bool

func IsChartCodeBlockCode

func IsChartCodeBlockCode(code *ast.Node) bool

func IsInFoldedHeading

func IsInFoldedHeading(node, currentHeading *ast.Node) bool

func IsMarker

func IsMarker(token byte) bool

func MoveFoldHeading

func MoveFoldHeading(updateNode, oldNode *ast.Node)

func NewTree

func NewTree(boxID, p, hp, title string) *parse.Tree

func NodeHash

func NodeHash(node *ast.Node, tree *parse.Tree, luteEngine *lute.Lute) string

func NodeStaticContent

func NodeStaticContent(node *ast.Node, excludeTypes []string) string

func NodeStaticMdContent

func NodeStaticMdContent(node *ast.Node, luteEngine *lute.Lute) (md, content string)

func ParentBlock

func ParentBlock(node *ast.Node) *ast.Node

func ParentNodes

func ParentNodes(node *ast.Node) (parents []*ast.Node)

func ReindexBlockTree

func ReindexBlockTree(tree *parse.Tree)

func RemoveBlockTree

func RemoveBlockTree(id string)

func RemoveBlockTreesByBoxID

func RemoveBlockTreesByBoxID(boxID string) (ids []string)

func RemoveBlockTreesByPath

func RemoveBlockTreesByPath(path string)

func RemoveBlockTreesByPathPrefix

func RemoveBlockTreesByPathPrefix(pathPrefix string)

func RemoveBlockTreesByRootID

func RemoveBlockTreesByRootID(rootID string)

func RootChildIDs

func RootChildIDs(rootID string) (ret []string)

func SaveBlockTree

func SaveBlockTree(force bool)

func SetBlockTreePath

func SetBlockTreePath(tree *parse.Tree)

func SetDynamicBlockRefText

func SetDynamicBlockRefText(blockRef *ast.Node, refText string)

func StatTree

func StatTree(tree *parse.Tree) (ret *util.BlockStatResult)

func SubTypeAbbr

func SubTypeAbbr(n *ast.Node) string

func SuperBlockHeading

func SuperBlockHeading(sb *ast.Node) *ast.Node

func SuperBlockLastHeading

func SuperBlockLastHeading(sb *ast.Node) *ast.Node

func TopHeadingLevel

func TopHeadingLevel(tree *parse.Tree) (ret int)

func TreeRoot

func TreeRoot(node *ast.Node) *ast.Node

func TypeAbbr

func TypeAbbr(nodeType string) string

Types

type BlockTree

type BlockTree struct {
	ID       string // 块 ID
	RootID   string // 根 ID
	ParentID string // 父 ID
	BoxID    string // 笔记本 ID
	Path     string // 文档数据路径
	HPath    string // 文档可读路径
	Updated  string // 更新时间
}

func GetBlockTree

func GetBlockTree(id string) *BlockTree

func GetBlockTreeByPath

func GetBlockTreeByPath(path string) *BlockTree

func GetBlockTreeRootByHPath

func GetBlockTreeRootByHPath(boxID, hPath string) *BlockTree

func GetBlockTreeRootByPath

func GetBlockTreeRootByPath(boxID, path string) *BlockTree

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL