treenode

package
v0.0.0-...-398fdf1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: AGPL-3.0 Imports: 32 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DynamicRefTexts = sync.Map{}

Functions

func CeilBlockCount

func CeilBlockCount(count int) int

func CeilTreeCount

func CeilTreeCount(count int) int

func ChildBlockNodes

func ChildBlockNodes(node *ast.Node) (children []*ast.Node)

func ClearRedundantBlockTrees

func ClearRedundantBlockTrees(boxID string, paths []string)

func ContainsMarker

func ContainsMarker(str string) (ret string)

func CountBlockNodes

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

func CountBlocks

func CountBlocks() (ret int)

func CountTrees

func CountTrees() (ret int)

func ExistBlockTree

func ExistBlockTree(id string) bool

func ExportNodeStdMd

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

func FillAttributeViewTableCellNilValue

func FillAttributeViewTableCellNilValue(tableCell *av.TableCell, rowID, colID 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 GetEmbedBlockRef

func GetEmbedBlockRef(embedNode *ast.Node) (blockRefID string)

func GetHeadingFold

func GetHeadingFold(nodes []*ast.Node) (ret []*ast.Node)

func GetMirrorAttrViewBlockIDs

func GetMirrorAttrViewBlockIDs(avID string) (ret []string)

func GetNodeInTree

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

func GetNodeSrcTokens

func GetNodeSrcTokens(n *ast.Node) (ret string)

func GetNotExistPaths

func GetNotExistPaths(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 IsEmbedBlockRef

func IsEmbedBlockRef(n *ast.Node) bool

func IsFileAnnotationRef

func IsFileAnnotationRef(n *ast.Node) bool

func IsInFoldedHeading

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

func IsMarker

func IsMarker(token byte) bool

func IsNodeOCRed

func IsNodeOCRed(node *ast.Node) (ret bool)

func IsRelativePath

func IsRelativePath(dest []byte) bool

func MoveFoldHeading

func MoveFoldHeading(updateNode, oldNode *ast.Node)

func NewParagraph

func NewParagraph() (ret *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, includeTextMarkATitleURL, includeAssetPath, fullAttrView bool) string

func ParentBlock

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

func ParentNodes

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

func RemoveBlockTree

func RemoveBlockTree(id string)

func RemoveBlockTreesByBoxID

func RemoveBlockTreesByBoxID(boxID string) (ids []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 SaveBlockTreeJob

func SaveBlockTreeJob()

func SetBlockTreePath

func SetBlockTreePath(tree *parse.Tree)

func SetDynamicBlockRefText

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

func SubTypeAbbr

func SubTypeAbbr(n *ast.Node) string

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 AvBlock

type AvBlock struct {
	AvID     string
	BlockIDs []string
}

func BatchGetMirrorAttrViewBlocks

func BatchGetMirrorAttrViewBlocks(avIDs []string) (ret []*AvBlock)

type BlockTree

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

func GetBlockTree

func GetBlockTree(id string) (ret *BlockTree)

func GetBlockTreeByPath

func GetBlockTreeByPath(path string) (ret *BlockTree)

func GetBlockTreeRootByHPath

func GetBlockTreeRootByHPath(boxID, hPath string) (ret *BlockTree)

func GetBlockTreeRootByHPathPreferredParentID

func GetBlockTreeRootByHPathPreferredParentID(boxID, hPath, preferredParentID string) (ret *BlockTree)

func GetBlockTreeRootByPath

func GetBlockTreeRootByPath(boxID, path string) (ret *BlockTree)

func GetBlockTreeRootsByHPath

func GetBlockTreeRootsByHPath(boxID, hPath string) (ret []*BlockTree)

func GetBlockTreesByBoxID

func GetBlockTreesByBoxID(boxID string) (ret []*BlockTree)

func GetBlockTreesByPathPrefix

func GetBlockTreesByPathPrefix(pathPrefix string) (ret []*BlockTree)

func GetBlockTreesByRootID

func GetBlockTreesByRootID(rootID string) (ret []*BlockTree)

func GetBlockTreesByType

func GetBlockTreesByType(typ string) (ret []*BlockTree)

Jump to

Keyboard shortcuts

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