help

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: MIT Imports: 18 Imported by: 92

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HELP_LIST_TEMPLATE string
View Source
var HELP_LONG_SECTION_TEMPLATE string
View Source
var HELP_SHORT_SECTION_TEMPLATE string
View Source
var HELP_SHORT_TOPIC_TEMPLATE string
View Source
var HELP_TOPIC_TEMPLATE string

Functions

func LoadSectionFromMarkdown

func LoadSectionFromMarkdown(markdownBytes []byte) (*model.Section, error)

func RenderToMarkdown

func RenderToMarkdown(t *template.Template, data interface{}, output io.Writer) (string, error)

Types

type HelpError

type HelpError int
const (
	ErrSectionNotFound HelpError = iota
)

func (HelpError) Error

func (e HelpError) Error() string

type HelpPage

type HelpPage struct {
	DefaultGeneralTopics []*model.Section
	OtherGeneralTopics   []*model.Section
	// this is just the concatenation of default and others
	AllGeneralTopics []*model.Section

	DefaultExamples []*model.Section
	OtherExamples   []*model.Section
	AllExamples     []*model.Section

	DefaultApplications []*model.Section
	OtherApplications   []*model.Section
	AllApplications     []*model.Section

	DefaultTutorials []*model.Section
	OtherTutorials   []*model.Section
	AllTutorials     []*model.Section
}

HelpPage contains all the sections related to a command

func NewHelpPage

func NewHelpPage(sections []*model.Section) *HelpPage

type HelpSystem

type HelpSystem struct {
	Store *store.Store // Store backend
}

func NewHelpSystem

func NewHelpSystem() *HelpSystem

func NewHelpSystemWithStore added in v0.5.53

func NewHelpSystemWithStore(st *store.Store) *HelpSystem

NewHelpSystemWithStore creates a HelpSystem with store backend support

func (*HelpSystem) AddSection

func (hs *HelpSystem) AddSection(section *model.Section)

func (*HelpSystem) ComputeRenderData

func (hs *HelpSystem) ComputeRenderData(options *RenderOptions) (map[string]interface{}, bool)

func (*HelpSystem) GetSectionWithSlug

func (hs *HelpSystem) GetSectionWithSlug(slug string) (*model.Section, error)

func (*HelpSystem) GetTopLevelHelpPage

func (hs *HelpSystem) GetTopLevelHelpPage() *HelpPage

func (*HelpSystem) LoadSectionsFromFS added in v0.2.4

func (hs *HelpSystem) LoadSectionsFromFS(f fs.FS, dir string) error

func (*HelpSystem) PrintQueryDebug added in v0.5.53

func (hs *HelpSystem) PrintQueryDebug(queryDSL string, printQuery, printSQL bool) error

PrintQueryDebug prints debug information about a query

func (*HelpSystem) QuerySections added in v0.5.53

func (hs *HelpSystem) QuerySections(query string) ([]*model.Section, error)

QuerySections performs a DSL query on the current help system with boolean logic support

func (*HelpSystem) RenderTopicHelp

func (hs *HelpSystem) RenderTopicHelp(
	topicSection *model.Section,
	options *RenderOptions) (string, error)

func (*HelpSystem) RenderTopicHelpWithWriter added in v0.7.1

func (hs *HelpSystem) RenderTopicHelpWithWriter(
	topicSection *model.Section,
	options *RenderOptions,
	output io.Writer,
) (string, error)

RenderTopicHelpWithWriter renders a topic's help content using the provided writer to detect terminal characteristics when applying Glamour styles.

type RenderOptions

type RenderOptions struct {
	Predicate             store.Predicate
	RelaxNoQueryPredicate store.Predicate
	RelaxNoTypesPredicate store.Predicate
	RelaxBroadPredicate   store.Predicate
	HasOnlyQueries        bool
	HasRestrictedTypes    bool
	QueryString           string
	RequestedTypes        string
	ShowAllSections       bool
	ShowShortTopic        bool
	HelpCommand           string
	LongHelp              bool
	ListSections          bool
	OnlyTopLevel          bool
	ShowDocumentationList bool
}

Directories

Path Synopsis
Package server provides an HTTP API surface for browsing Glazed help sections.
Package server provides an HTTP API surface for browsing Glazed help sections.

Jump to

Keyboard shortcuts

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