loader

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeSectionsJSON added in v1.2.4

func DecodeSectionsJSON(r io.Reader) ([]*model.Section, error)

DecodeSectionsJSON decodes Glazed help export JSON into model sections.

func LoadDir

func LoadDir(ctx context.Context, hs *help.HelpSystem, dir string) error

LoadDir walks a local directory recursively and loads all non-README markdown files into the help store.

func LoadFile

func LoadFile(ctx context.Context, hs *help.HelpSystem, filePath string) error

LoadFile loads one markdown file from disk and upserts the parsed section.

func LoadPaths

func LoadPaths(ctx context.Context, hs *help.HelpSystem, paths []string) error

LoadPaths loads one or more markdown files or directories into the help store. Directories are walked recursively.

func NormalizeStringList added in v1.2.4

func NormalizeStringList(values []string) []string

NormalizeStringList trims values and expands comma-separated entries.

func ReplaceStoreWithPaths

func ReplaceStoreWithPaths(ctx context.Context, hs *help.HelpSystem, paths []string) error

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 (*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 (*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

Jump to

Keyboard shortcuts

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