Documentation
¶
Index ¶
- func DecodeSectionsJSON(r io.Reader) ([]*model.Section, error)
- func LoadDir(ctx context.Context, hs *help.HelpSystem, dir string) error
- func LoadFile(ctx context.Context, hs *help.HelpSystem, filePath string) error
- func LoadPaths(ctx context.Context, hs *help.HelpSystem, paths []string) error
- func NormalizeStringList(values []string) []string
- func ReplaceStoreWithPaths(ctx context.Context, hs *help.HelpSystem, paths []string) error
- type ContentLoader
- type GlazedCommandLoader
- type JSONFileLoader
- type MarkdownPathLoader
- type SQLiteLoader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeSectionsJSON ¶ added in v1.2.4
DecodeSectionsJSON decodes Glazed help export JSON into model sections.
func LoadDir ¶
LoadDir walks a local directory recursively and loads all non-README markdown files into the help store.
func LoadPaths ¶
LoadPaths loads one or more markdown files or directories into the help store. Directories are walked recursively.
func NormalizeStringList ¶ added in v1.2.4
NormalizeStringList trims values and expands comma-separated entries.
func ReplaceStoreWithPaths ¶
ReplaceStoreWithPaths clears any preloaded sections and reloads the help store from the provided files or directories.
Types ¶
type ContentLoader ¶ added in v1.2.4
type ContentLoader interface {
Load(ctx context.Context, hs *help.HelpSystem) error
String() string
}
ContentLoader loads help sections from an external source into a HelpSystem.
type GlazedCommandLoader ¶ added in v1.2.4
type GlazedCommandLoader struct {
Binaries []string
}
GlazedCommandLoader runs '<binary> help export --output json' for each binary.
func (*GlazedCommandLoader) Load ¶ added in v1.2.4
func (l *GlazedCommandLoader) Load(ctx context.Context, hs *help.HelpSystem) error
func (*GlazedCommandLoader) String ¶ added in v1.2.4
func (l *GlazedCommandLoader) String() string
type JSONFileLoader ¶ added in v1.2.4
type JSONFileLoader struct {
Paths []string
}
JSONFileLoader loads help sections from JSON export files. A path of "-" reads stdin.
func (*JSONFileLoader) Load ¶ added in v1.2.4
func (l *JSONFileLoader) Load(ctx context.Context, hs *help.HelpSystem) error
func (*JSONFileLoader) String ¶ added in v1.2.4
func (l *JSONFileLoader) String() string
type MarkdownPathLoader ¶ added in v1.2.4
type MarkdownPathLoader struct {
Paths []string
}
MarkdownPathLoader loads markdown help sections from files or directories.
func (*MarkdownPathLoader) Load ¶ added in v1.2.4
func (l *MarkdownPathLoader) Load(ctx context.Context, hs *help.HelpSystem) error
func (*MarkdownPathLoader) String ¶ added in v1.2.4
func (l *MarkdownPathLoader) String() string
type SQLiteLoader ¶ added in v1.2.4
type SQLiteLoader struct {
Paths []string
}
SQLiteLoader loads help sections from exported Glazed help SQLite databases.
func (*SQLiteLoader) Load ¶ added in v1.2.4
func (l *SQLiteLoader) Load(ctx context.Context, hs *help.HelpSystem) error
func (*SQLiteLoader) String ¶ added in v1.2.4
func (l *SQLiteLoader) String() string