Versions in this module Expand all Collapse all v1 v1.3.0 Apr 15, 2020 Changes in this version + var ErrTreeRootNotFound = errors.New("no tree root found") + var NodeAssetsIgnoreRegexp = regexp.MustCompile(`(?i)^(dsk|dsk\.(json|ya?ml)|AUTHORS\.txt|empty)$`) + var NodeDocsRegexp = regexp.MustCompile(`(?i)^.*\.(md|markdown|html?|txt)$`) + var NodeLookupURLIgnoreChars = regexp.MustCompile(`[\s\-_]+`) + var NodeMetaRegexp = regexp.MustCompile(`(?i)^(index|meta)\.(json|ya?ml)$`) + var NodePathInvalidCharsRegexp = regexp.MustCompile(`[^A-Za-z0-9-_]`) + var NodePathMultipleDashRegexp = regexp.MustCompile(`-+`) + var NodePathTitleRegexp = regexp.MustCompile(`^0?(\d+)[_,-]+(.*)$`) + func AlternateNames(name string) []string + type Node struct + Children []*Node + Parent *Node + Path string + func NewNode(path string, root string, cdb config.DB, mdb meta.DB, adb author.DB) *Node + func (n *Node) Asset(name string) (bool, *NodeAsset, error) + func (n *Node) Assets() ([]*NodeAsset, error) + func (n *Node) Authors() []*author.Author + func (n *Node) CalculateHash() (string, error) + func (n *Node) Create() error + func (n *Node) CreateDoc(name string, contents []byte) error + func (n *Node) CreateMeta(name string, meta *NodeMeta) error + func (n *Node) Crumbs(get NodeGetter) []*Node + func (n *Node) Custom() interface{} + func (n *Node) Description() string + func (n *Node) Docs() ([]*NodeDoc, error) + func (n *Node) Keywords() []string + func (n *Node) Load() error + func (n *Node) LookupURL() string + func (n *Node) Modified() (time.Time, error) + func (n *Node) Name() string + func (n *Node) Order() uint64 + func (n *Node) Related(get NodeGetter) []*Node + func (n *Node) Tags() []string + func (n *Node) Title() string + func (n *Node) URL() string + func (n *Node) UnnormalizedURL() string + func (n *Node) Version() string + type NodeAsset struct + Path string + URL string + func NewNodeAsset(path string, URL string, mdb meta.DB) *NodeAsset + func (a NodeAsset) As(targetExt string) (bool, io.ReadSeeker, error) + func (a NodeAsset) Dimensions() (ok bool, w int, h int, err error) + func (a NodeAsset) Modified() (time.Time, error) + func (a NodeAsset) Name() string + func (a NodeAsset) Size() (int64, error) + func (a NodeAsset) Title() string + type NodeDoc struct + func (d NodeDoc) CleanText() ([]byte, error) + func (d NodeDoc) Components() ([]*NodeDocComponent, error) + func (d NodeDoc) HTML(treePrefix string, nodeURL string, nodeGet NodeGetter, nodeSource string) ([]byte, error) + func (d NodeDoc) Name() string + func (d NodeDoc) Order() uint64 + func (d NodeDoc) Raw() ([]byte, error) + func (d NodeDoc) Title() string + type NodeDocComponent struct + Id int + Length int + Level int + Position int + Raw string + func NewNodeDocComponent(raw string, level int, position int) *NodeDocComponent + func (c *NodeDocComponent) Placeholder() string + type NodeDocTransformer struct + func NewNodeDocTransformer(treePrefix string, nodeURL string, nodeGet NodeGetter, nodeSource string) (*NodeDocTransformer, error) + func (dt NodeDocTransformer) ProcessHTML(contents []byte) ([]byte, error) + type NodeGetter func(url string) (ok bool, n *Node, err error) + type NodeMeta struct + Authors []string + Custom interface{} + Description string + Keywords []string + Related []string + Tags []string + Version string + func (m *NodeMeta) Create() error + func (m *NodeMeta) Load() error + type NodesGetter func() []*Node + type Tree struct + Path string + Root *Node + func NewTree(path string, cdb config.DB, adb author.DB, mdb meta.DB, b *bus.Broker) (*Tree, error) + func (t *Tree) CalculateHash() (string, error) + func (t *Tree) Get(url string) (ok bool, n *Node, err error) + func (t *Tree) GetAll() []*Node + func (t *Tree) NeighborNodes(current *Node) (prev *Node, next *Node, err error) + func (t *Tree) String() string + func (t *Tree) Sync() error + func (t *Tree) TotalNodes() uint16 v1.3.0-alpha Nov 25, 2019