help

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: GPL-3.0, LGPL-3.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package help holds the help texts of sind: what its words mean, what each action of sind ui does, what each page shows and how to do common things. The texts are YAML files in this directory, embedded in the binary. sind help TOPIC prints them and sind ui shows them as hint cards, in its help pane and in the jump box, so that both say the same.

Load checks the files for the faults that a program cannot repair: an empty field, an id twice, a reference to an id that does not exist. The tests of this package and of cmd/sind check the rest: that every action and page of sind ui has an entry, that each docs link exists and that each command in the texts is one that sind has.

Index

Constants

View Source
const DocsURL = "https://gsi-hpc.github.io/sind/"

DocsURL is where the Hugo docs of sind are published; the doc fields are paths below its root.

Variables

This section is empty.

Functions

func DocURL

func DocURL(doc string) string

DocURL returns the URL of a doc path, such as usage/progress#event-log.

func UIDocURL

func UIDocURL(doc string) string

UIDocURL returns the URL of a doc path for a reader of sind ui: the page then shows the steps for the web UI, and keeps showing them.

Types

type Action

type Action struct {
	ID      string `yaml:"id"`
	Title   string `yaml:"title"`
	Summary string `yaml:"summary"`
	// Command is the sind command that the action runs, with placeholders
	// in capitals.
	Command string `yaml:"command"`
	// Undo says how to take the action back, or that nobody can.
	Undo string `yaml:"undo"`
	// Irreversible marks an action that cannot be undone.
	Irreversible bool     `yaml:"irreversible"`
	Doc          string   `yaml:"doc"`
	Words        []string `yaml:"words"`
}

Action is a button of sind ui that changes something.

func (Action) UndoText

func (a Action) UndoText() string

UndoText says how to take the action back, as a sentence that says so ("To undo: delete the workers."), or that nobody can.

type Help

type Help struct {
	// contains filtered or unexported fields
}

Help is the set of all help texts.

func Default

func Default() *Help

Default returns the embedded texts, loaded once. It panics when they are faulty, which a test of this package prevents.

func Load

func Load(fsys fs.FS) (*Help, error)

Load reads words.yaml, actions.yaml, pages.yaml and howtos.yaml from fsys and checks them.

func (*Help) Action

func (h *Help) Action(id string) (Action, bool)

Action returns the action with id.

func (*Help) Actions

func (h *Help) Actions() []Action

Actions returns all actions, in file order.

func (*Help) Commands

func (h *Help) Commands() []string

Commands returns every command line in the texts, for the tests that check them against the command tree.

func (*Help) Howto

func (h *Help) Howto(id string) (Howto, bool)

Howto returns the how-to with id.

func (*Help) Howtos

func (h *Help) Howtos() []Howto

Howtos returns all how-tos, in file order.

func (*Help) Index

func (h *Help) Index() string

Index returns the list of topics that sind help can print.

func (*Help) Page

func (h *Help) Page(id string) (Page, bool)

Page returns the page with id.

func (*Help) PageFor

func (h *Help) PageFor(path string) (Page, bool)

PageFor returns the page that serves the URL path, such as /clusters/sind/dev. A route's {wildcard} matches one segment.

func (*Help) Pages

func (h *Help) Pages() []Page

Pages returns all pages, in file order.

func (*Help) Search

func (h *Help) Search(q string) []Hit

Search finds the entries that match every word of q, best first: a title that starts with the query, then a title that holds it, then the rest. Pages are not searched, as the jump box lists them itself.

func (*Help) Text

func (h *Help) Text(id string) (string, bool)

Text returns the topic id as plain text for a terminal, as sind help ID prints it.

func (*Help) Topic

func (h *Help) Topic(id string) (Kind, bool)

Topic returns the kind of the word, action or how-to with id, the topics of sind help.

func (*Help) Word

func (h *Help) Word(id string) (Word, bool)

Word returns the word with id.

func (*Help) Words

func (h *Help) Words() []Word

Words returns all words, in file order.

type Hit

type Hit struct {
	Kind    Kind
	ID      string
	Title   string
	Summary string
}

Hit is an entry that a search finds.

type Howto

type Howto struct {
	ID       string   `yaml:"id"`
	Title    string   `yaml:"title"`
	Summary  string   `yaml:"summary"`
	Steps    []string `yaml:"steps"`
	Commands []string `yaml:"commands"`
	Doc      string   `yaml:"doc"`
	Words    []string `yaml:"words"`
}

Howto is a way to reach a goal, step by step.

type Kind

type Kind string

Kind is what a topic is.

const (
	KindWord   Kind = "word"
	KindAction Kind = "action"
	KindPage   Kind = "page"
	KindHowto  Kind = "howto"
)

The kinds of topics.

type Page

type Page struct {
	ID      string `yaml:"id"`
	Title   string `yaml:"title"`
	Summary string `yaml:"summary"`
	// Route is the path of the page, with {wildcards}.
	Route  string   `yaml:"route"`
	Doc    string   `yaml:"doc"`
	Words  []string `yaml:"words"`
	Howtos []string `yaml:"howtos"`
}

Page is a page of sind ui.

type Word

type Word struct {
	ID      string   `yaml:"id"`
	Title   string   `yaml:"title"`
	Summary string   `yaml:"summary"`
	Command string   `yaml:"command"`
	Doc     string   `yaml:"doc"`
	See     []string `yaml:"see"`
}

Word is a term that sind and sind ui use.

Jump to

Keyboard shortcuts

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