Documentation
¶
Overview ¶
Copyright (c) 2025 Reliant Labs
Index ¶
- func FormatComponentList(entries []Entry) string
- type Category
- type Entry
- type Library
- func (l *Library) ByName() map[string]*Entry
- func (l *Library) FindSimilar(name string) []string
- func (l *Library) Get(name string) (string, error)
- func (l *Library) GetEntry(name string) (*Entry, bool)
- func (l *Library) List(tag, category string) []Entry
- func (l *Library) Registry() []Entry
- func (l *Library) Search(query string) []Entry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatComponentList ¶
FormatComponentList formats a list of entries into a human-readable string grouped by category.
Types ¶
type Category ¶
type Category string
Category groups components by type.
const ( CategoryLayouts Category = "layouts" CategoryCharts Category = "charts" CategoryDiagrams Category = "diagrams" CategoryDeck Category = "deck" CategoryUI Category = "ui" )
Category enum values. Each value tags a component template with the kind of artifact it produces (HTML layout, SVG chart, diagram, deck slide, or generic UI primitive).
type Entry ¶
type Entry struct {
Name string `json:"name"`
Category Category `json:"category"`
Description string `json:"description"`
Tags []string `json:"tags"`
FilePath string `json:"-"` // internal embed path
}
Entry describes a single component in the library.
type Library ¶
type Library struct{}
Library provides access to the component library.
func (*Library) FindSimilar ¶
FindSimilar returns up to 5 component names similar to the given name.
func (*Library) Search ¶
Search finds components using unified keyword search. The query string is split into words and each word is matched against the component's name, tags, category, and description. A component matches if ALL words match (each word can match in any field — bag-of-words AND semantics). An empty query returns all components.