Documentation
¶
Overview ¶
Package reference renders the Spec pages of funcd and funcdctl from the config struct and the command trees (ADR-0324).
Index ¶
- Constants
- func Cell(text string) string
- func CommandTables(cmds []Command) []byte
- func ConfigTable(keys []ConfigKey) []byte
- func Page(title, description string, sections ...[]byte) []byte
- func Stale(path string, page []byte) error
- func Variables(dirs ...string) ([]string, error)
- type Command
- type ConfigKey
- type Flag
Constants ¶
const DevAnnotation = "build"
DevAnnotation marks, in a command's Annotations, a command that only the -tags dev build registers.
const Marker = "# Generated by just generate from the config struct and the command trees: change the code, not this page."
Marker is the first line of each page's front matter.
Variables ¶
This section is empty.
Functions ¶
func Cell ¶ added in v0.44.2
Cell makes text fit one Markdown table cell of an MDX page; it serves a paragraph too. Outside code spans it escapes a pipe, the characters that open a tag or an expression, every * and ~, and an _ beside anything but a letter or a digit: Markdown reads those as emphasis or strikethrough, while an _ inside a word, as in FUNCD_TOKEN, stays text. Inside a code span only a pipe is escaped. A code span opens with a run of backticks and closes at the next run of the same length, as CommonMark reads it, so a reStructuredText span between two double backticks stays code; a run that nothing closes is text.
func CommandTables ¶
CommandTables renders each command as a heading, its usage line and text, and a table of its flags.
func ConfigTable ¶
ConfigTable renders keys as one Markdown table, laid out as the kinds' Spec pages are (ADR-0323).
func Page ¶
Page renders a Spec page: front matter that starts with Marker, then the sections in order.
Types ¶
type Command ¶
Command is one visible command and its flags.
func Commands ¶
Commands lists every visible command under root, depth first, root first, with cobra's help and completion commands added as --help lists them. It fails, naming the command and the flag, on a text or a flag usage that names an ADR, and on a default that holds the value of a set FUNCD_* variable or has a part, split at "/", equal to the host's runtime.GOOS or runtime.GOARCH (ADR-0324 Decision 3).
type ConfigKey ¶
type ConfigKey struct {
Path, Type, Default, Limits, Env, Description string
}
ConfigKey is one leaf key of funcdconfig.yaml.
func ConfigKeys ¶
ConfigKeys lists every leaf key of config.Config in declaration order, its default taken from defaults.