doc

package
Version: v3.5.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2018 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ListFormat       = "{{.Path}}"
	MarkdownTemplate = `#### <a name="{{.Link}}">{{.Path}}</a>` + "\n\n" +
		"**Description**:\n\n{{.Description}}\n\n" +
		"**Example**:\n\n{{.Example}}\n\n" +
		"**Flags**:\n\n" +
		"| Short | Name | Usage | Default value |\n" +
		"| ----- | ---- | ----- | ------------- |\n" +
		"{{range .Flags}}" +
		"| {{if .Short}}-{{.Short}}{{end}} " +
		"| --{{.Name}} " +
		"| {{.Usage}} " +
		"| {{if ne .DefValue \"[]\"}}{{.DefValue}}{{end}} " +
		"|\n" +
		"{{end}}\n\n" +
		"**Subcommands**:\n\n" +
		"{{range .Subcommands}}" +
		"* **[{{.Name}}](#{{.Link}})** {{.ShortDescription}}\n" +
		"{{end}}\n\n"
	TextTamplate = "Command: {{.Path}}\n" +
		"Description:\n{{.Description}}\n" +
		"Example:\n{{.Example}}\n" +
		"Flags:\n" +
		"{{range .Flags}}" +
		"{{if .Short}}-{{.Short}}{{else}}  {{end}} " +
		"--{{.Name}} " +
		"{{.Usage}} " +
		"{{if ne .DefValue \"[]\"}}{{.DefValue}}{{end}} " +
		"\n" +
		"{{end}}\n"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	cobra.Command
}

func (Command) Doc

func (cmd Command) Doc() Doc

func (Command) Format

func (cmd Command) Format(format string) (string, error)

func (Command) Markdown

func (cmd Command) Markdown() string

func (Command) String

func (cmd Command) String() string

type Doc

type Doc struct {
	Link        string        `json:"link"`
	Path        string        `json:"path"`
	Name        string        `json:"name"`
	Description string        `json:"help"`
	Example     string        `json:"example"`
	Flags       []sflags.Flag `json:"flags"`
	Subcommands []SubCommand  `json:"subcommands,omitempty"`
}

type SubCommand

type SubCommand struct {
	Link             string `json:"link"`
	Name             string `json:"name"`
	ShortDescription string `json:"short_description"`
}

Source Files

Jump to

Keyboard shortcuts

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