Documentation
¶
Index ¶
- func Add(root, id string, input NewConcept, force bool) (string, error)
- func CanonicalID(value string) (string, error)
- func IsSingleBundleRoot(root string) (bool, error)
- func Move(root, oldID, newID string) (int, error)
- func UpdateIndexes(root string, checkOnly bool) ([]string, error)
- type Backlink
- type Bundle
- func (b *Bundle) Backlinks(id string) ([]Backlink, error)
- func (b *Bundle) ConceptPath(id string) (string, string, error)
- func (b *Bundle) ConceptsUnder(prefix string, recursive bool) []*Concept
- func (b *Bundle) Get(id string) (*Concept, error)
- func (b *Bundle) Graph(id string, maxDepth int) ([]GraphNode, error)
- func (b *Bundle) Outgoing(id string) ([]Link, error)
- type BundleValidationStats
- type Concept
- type ConceptRef
- type GraphNode
- type Issue
- type Link
- type NewConcept
- type SearchOptions
- type SearchResult
- type SearchResultRef
- type ValidationReport
- type ValidationStats
- type Workspace
- func (w *Workspace) QualifyID(bundleName, localID string) string
- func (w *Workspace) ResolveConcept(value string) (*ConceptRef, error)
- func (w *Workspace) ResolveDirectory(value string) (*Bundle, string, string, error)
- func (w *Workspace) Search(query string, options SearchOptions) ([]SearchResultRef, error)
- func (w *Workspace) Validate(strict bool) (ValidationReport, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanonicalID ¶
func IsSingleBundleRoot ¶
IsSingleBundleRoot reports whether root uses the single-bundle mode.
Types ¶
type Bundle ¶
type Bundle struct {
Root string
Title string
Concepts []*Concept
ByID map[string]*Concept
Markdown map[string]string
}
func (*Bundle) ConceptsUnder ¶
ConceptsUnder returns concepts in a directory, optionally including nested directories.
type BundleValidationStats ¶
type ConceptRef ¶
ConceptRef identifies a concept together with the bundle that owns it.
type NewConcept ¶
type SearchResult ¶
func Search ¶
func Search(bundle *Bundle, query string, options SearchOptions) []SearchResult
type SearchResultRef ¶
SearchResultRef is a workspace-qualified search result.
type ValidationReport ¶
type ValidationReport struct {
Errors []Issue
Warnings []Issue
Stats ValidationStats
Bundles []BundleValidationStats
}
func ValidateWorkspaceRoot ¶
func ValidateWorkspaceRoot(root string, strict bool) (ValidationReport, error)
ValidateWorkspaceRoot validates a single bundle or all direct child bundles without loading concepts into the in-memory Bundle model first.
func (*ValidationReport) AddError ¶
func (r *ValidationReport) AddError(path, message string)
func (*ValidationReport) AddWarning ¶
func (r *ValidationReport) AddWarning(path, message string)
func (ValidationReport) Sort ¶
func (r ValidationReport) Sort()
func (ValidationReport) Valid ¶
func (r ValidationReport) Valid() bool
type ValidationStats ¶
type Workspace ¶
Workspace coordinates one bundle or a directory containing direct child bundles.
func LoadWorkspace ¶
LoadWorkspace loads root as one bundle or discovers its direct child bundles.
func (*Workspace) QualifyID ¶
QualifyID converts a bundle-local ID to the CLI ID for this workspace.
func (*Workspace) ResolveConcept ¶
func (w *Workspace) ResolveConcept(value string) (*ConceptRef, error)
ResolveConcept resolves a local ID in a single bundle or a qualified ID in a workspace.
func (*Workspace) ResolveDirectory ¶
ResolveDirectory resolves a workspace directory path to its owning bundle and local prefix. An empty prefix in workspace mode refers to the workspace itself and returns a nil bundle.
func (*Workspace) Search ¶
func (w *Workspace) Search(query string, options SearchOptions) ([]SearchResultRef, error)
Search searches all bundles, applying a qualified path filter when supplied.