jx: github.com/jenkins-x/jx/pkg/cmd/templates Index | Files

package templates

import "github.com/jenkins-x/jx/pkg/cmd/templates"


Package Files

command_groups.go markdown.go normalizers.go templater.go templates.go


const (
    SectionVars = `{{$isRootCmd := isRootCmd .}}` +
        `{{$rootCmd := rootCmd .}}` +
        `{{$visibleFlags := visibleFlags (flagsNotIntersected .LocalFlags .PersistentFlags)}}` +
        `{{$explicitlyExposedFlags := exposed .}}` +
        `{{$optionsCmdFor := optionsCmdFor .}}` +
        `{{$usageLine := usageLine .}}`

    SectionAliases = `{{if gt .Aliases 0}}Aliases:

    SectionExamples = `{{if .HasExample}}Examples:
{{trimRight .Example}}

    SectionSubcommands = `{{if .HasAvailableSubCommands}}{{cmdGroupsString .}}

    SectionFlags = "" /* 261 byte string literal not displayed */

    SectionUsage = `{{if and .Runnable (ne .UseLine "") (ne .UseLine $rootCmd)}}Usage:

    SectionTipsHelp = `{{if .HasSubCommands}}Use "{{$rootCmd}} <command> --help" for more information about a given command.

    SectionTipsGlobalOptions = `{{if $optionsCmdFor}}Use "{{$optionsCmdFor}}" for a list of global command-line options (applies to all commands).
const Indentation = `  `

func Examples Uses

func Examples(s string) string

Examples normalizes a command's examples to follow the conventions.

func LongDesc Uses

func LongDesc(s string) string

LongDesc normalizes a command's long description to follow the conventions.

func MainHelpTemplate Uses

func MainHelpTemplate() string

MainHelpTemplate if the template for 'help' used by most commands.

func MainUsageTemplate Uses

func MainUsageTemplate() string

MainUsageTemplate if the template for 'usage' used by most commands.

func Normalize Uses

func Normalize(cmd *cobra.Command) *cobra.Command

Normalize perform all required normalizations on a given command.

func NormalizeAll Uses

func NormalizeAll(cmd *cobra.Command) *cobra.Command

NormalizeAll perform all required normalizations in the entire command tree.

func OptionsHelpTemplate Uses

func OptionsHelpTemplate() string

OptionsHelpTemplate if the template for 'help' used by the 'options' command.

func OptionsUsageTemplate Uses

func OptionsUsageTemplate() string

OptionsUsageTemplate if the template for 'usage' used by the 'options' command.

func UseOptionsTemplates Uses

func UseOptionsTemplates(cmd *cobra.Command)

type ASCIIRenderer Uses

type ASCIIRenderer struct {
    Indentation string
    // contains filtered or unexported fields

ASCIIRenderer is a blackfriday.Renderer intended for rendering markdown documents as plain text, well suited for human reading on terminals.

func (r *ASCIIRenderer) AutoLink(out *bytes.Buffer, link []byte, kind int)

func (*ASCIIRenderer) BlockCode Uses

func (r *ASCIIRenderer) BlockCode(out *bytes.Buffer, text []byte, lang string)

BlockCode renders a chunk of text that represents source code.

func (*ASCIIRenderer) BlockHtml Uses

func (r *ASCIIRenderer) BlockHtml(out *bytes.Buffer, text []byte)

func (*ASCIIRenderer) BlockQuote Uses

func (r *ASCIIRenderer) BlockQuote(out *bytes.Buffer, text []byte)

func (*ASCIIRenderer) CodeSpan Uses

func (r *ASCIIRenderer) CodeSpan(out *bytes.Buffer, text []byte)

func (*ASCIIRenderer) DocumentFooter Uses

func (r *ASCIIRenderer) DocumentFooter(out *bytes.Buffer)

func (*ASCIIRenderer) DocumentHeader Uses

func (r *ASCIIRenderer) DocumentHeader(out *bytes.Buffer)

func (*ASCIIRenderer) DoubleEmphasis Uses

func (r *ASCIIRenderer) DoubleEmphasis(out *bytes.Buffer, text []byte)

func (*ASCIIRenderer) Emphasis Uses

func (r *ASCIIRenderer) Emphasis(out *bytes.Buffer, text []byte)

func (*ASCIIRenderer) Entity Uses

func (r *ASCIIRenderer) Entity(out *bytes.Buffer, entity []byte)

func (*ASCIIRenderer) FootnoteItem Uses

func (r *ASCIIRenderer) FootnoteItem(out *bytes.Buffer, name, text []byte, flags int)

func (*ASCIIRenderer) FootnoteRef Uses

func (r *ASCIIRenderer) FootnoteRef(out *bytes.Buffer, ref []byte, id int)

func (*ASCIIRenderer) Footnotes Uses

func (r *ASCIIRenderer) Footnotes(out *bytes.Buffer, text func() bool)

func (*ASCIIRenderer) GetFlags Uses

func (r *ASCIIRenderer) GetFlags() int

func (*ASCIIRenderer) HRule Uses

func (r *ASCIIRenderer) HRule(out *bytes.Buffer)

func (*ASCIIRenderer) Header Uses

func (r *ASCIIRenderer) Header(out *bytes.Buffer, text func() bool, level int, id string)

func (*ASCIIRenderer) Image Uses

func (r *ASCIIRenderer) Image(out *bytes.Buffer, link []byte, title []byte, alt []byte)

func (*ASCIIRenderer) LineBreak Uses

func (r *ASCIIRenderer) LineBreak(out *bytes.Buffer)
func (r *ASCIIRenderer) Link(out *bytes.Buffer, link []byte, title []byte, content []byte)

func (*ASCIIRenderer) List Uses

func (r *ASCIIRenderer) List(out *bytes.Buffer, text func() bool, flags int)

List renders the start and end of a list.

func (*ASCIIRenderer) ListItem Uses

func (r *ASCIIRenderer) ListItem(out *bytes.Buffer, text []byte, flags int)

ListItem renders list items and supports both ordered and unordered lists.

func (*ASCIIRenderer) NormalText Uses

func (r *ASCIIRenderer) NormalText(out *bytes.Buffer, text []byte)

NormalText gets a text chunk *after* the markdown syntax was already processed and does a final cleanup on things we don't expect here, like removing linebreaks on things that are not a paragraph break (auto unwrap).

func (*ASCIIRenderer) Paragraph Uses

func (r *ASCIIRenderer) Paragraph(out *bytes.Buffer, text func() bool)

Paragraph renders the start and end of a paragraph.

func (*ASCIIRenderer) RawHtmlTag Uses

func (r *ASCIIRenderer) RawHtmlTag(out *bytes.Buffer, text []byte)

func (*ASCIIRenderer) Smartypants Uses

func (r *ASCIIRenderer) Smartypants(out *bytes.Buffer, text []byte)

func (*ASCIIRenderer) StrikeThrough Uses

func (r *ASCIIRenderer) StrikeThrough(out *bytes.Buffer, text []byte)

func (*ASCIIRenderer) Table Uses

func (r *ASCIIRenderer) Table(out *bytes.Buffer, header []byte, body []byte, columnData []int)

func (*ASCIIRenderer) TableCell Uses

func (r *ASCIIRenderer) TableCell(out *bytes.Buffer, text []byte, align int)

func (*ASCIIRenderer) TableHeaderCell Uses

func (r *ASCIIRenderer) TableHeaderCell(out *bytes.Buffer, text []byte, align int)

func (*ASCIIRenderer) TableRow Uses

func (r *ASCIIRenderer) TableRow(out *bytes.Buffer, text []byte)

func (*ASCIIRenderer) TitleBlock Uses

func (r *ASCIIRenderer) TitleBlock(out *bytes.Buffer, text []byte)

func (*ASCIIRenderer) TocFinalize Uses

func (r *ASCIIRenderer) TocFinalize()

func (*ASCIIRenderer) TocHeader Uses

func (r *ASCIIRenderer) TocHeader(text []byte, level int)

func (*ASCIIRenderer) TocHeaderWithAnchor Uses

func (r *ASCIIRenderer) TocHeaderWithAnchor(text []byte, level int, anchor string)

func (*ASCIIRenderer) TripleEmphasis Uses

func (r *ASCIIRenderer) TripleEmphasis(out *bytes.Buffer, text []byte)

type CommandGroup Uses

type CommandGroup struct {
    Message  string
    Commands []*cobra.Command

type CommandGroups Uses

type CommandGroups []CommandGroup

func AddAdditionalCommands Uses

func AddAdditionalCommands(g CommandGroups, message string, cmds []*cobra.Command) CommandGroups

func (CommandGroups) Add Uses

func (g CommandGroups) Add(parent *cobra.Command)

func (CommandGroups) Has Uses

func (g CommandGroups) Has(c *cobra.Command) bool

type FlagExposer Uses

type FlagExposer interface {
    ExposeFlags(cmd *cobra.Command, flags ...string) FlagExposer

func ActsAsRootCommand Uses

func ActsAsRootCommand(cmd *cobra.Command, filters []string, getPluginCommandGroups func() (PluginCommandGroups, bool), groups ...CommandGroup) FlagExposer

type PluginCommand Uses

type PluginCommand struct {
    Errors []error

PluginCommand is a reference to a particular Command provided by a Plugin

type PluginCommandGroup Uses

type PluginCommandGroup struct {
    Message  string
    Commands []*PluginCommand

PluginCommandGroup is a group of plugins providing some Commands. The Message is used for describing the group

type PluginCommandGroups Uses

type PluginCommandGroups []PluginCommandGroup

PluginCommandGroups is a slice of PluginCommandGroup

Package templates imports 12 packages (graph) and is imported by 1 packages. Updated 2020-07-03. Refresh now. Tools for package owners.