Documentation
¶
Index ¶
- Variables
- func LoadSectionFromMarkdown(markdownBytes []byte) (*model.Section, error)
- func RenderToMarkdown(t *template.Template, data interface{}, output io.Writer) (string, error)
- type HelpError
- type HelpPage
- type HelpSystem
- func (hs *HelpSystem) AddSection(section *model.Section)
- func (hs *HelpSystem) ComputeRenderData(options *RenderOptions) (map[string]interface{}, bool)
- func (hs *HelpSystem) GetSectionWithSlug(slug string) (*model.Section, error)
- func (hs *HelpSystem) GetTopLevelHelpPage() *HelpPage
- func (hs *HelpSystem) LoadSectionsFromFS(f fs.FS, dir string) error
- func (hs *HelpSystem) PrintQueryDebug(queryDSL string, printQuery, printSQL bool) error
- func (hs *HelpSystem) QuerySections(query string) ([]*model.Section, error)
- func (hs *HelpSystem) RenderTopicHelp(topicSection *model.Section, options *RenderOptions) (string, error)
- func (hs *HelpSystem) RenderTopicHelpWithWriter(topicSection *model.Section, options *RenderOptions, output io.Writer) (string, error)
- type RenderOptions
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 ¶
Types ¶
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 ¶
type HelpSystem ¶
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
}
Click to show internal directories.
Click to hide internal directories.