Documentation
¶
Overview ¶
nolint:golint
Index ¶
- Constants
- Variables
- func Bold(text string) string
- func Color(w io.Writer) aurora.Aurora
- func ColorizeJSON(json string, darkStyle bool, w io.Writer) string
- func ColorizeStatus(status int) aurora.Value
- func Faint(text string) string
- func Italic(text string) string
- func Linkify(text, url string, w io.Writer) string
- func MarkdownTermRenderer(flags int) blackfriday.Renderer
- func StartSpinner(msg string, w io.Writer) *spinner.Spinner
- func StopSpinner(s *spinner.Spinner, msg string, w io.Writer)
- func StrikeThrough(text string) string
- type MarkdownTerm
- func (options *MarkdownTerm) AutoLink(out *bytes.Buffer, link []byte, kind int)
- func (options *MarkdownTerm) BlockCode(out *bytes.Buffer, text []byte, info string)
- func (options *MarkdownTerm) BlockHtml(out *bytes.Buffer, text []byte)
- func (options *MarkdownTerm) BlockQuote(out *bytes.Buffer, text []byte)
- func (options *MarkdownTerm) CodeSpan(out *bytes.Buffer, text []byte)
- func (options *MarkdownTerm) DocumentFooter(out *bytes.Buffer)
- func (options *MarkdownTerm) DocumentHeader(out *bytes.Buffer)
- func (options *MarkdownTerm) DoubleEmphasis(out *bytes.Buffer, text []byte)
- func (options *MarkdownTerm) Emphasis(out *bytes.Buffer, text []byte)
- func (options *MarkdownTerm) Entity(out *bytes.Buffer, entity []byte)
- func (options *MarkdownTerm) FootnoteItem(out *bytes.Buffer, name, text []byte, flags int)
- func (options *MarkdownTerm) FootnoteRef(out *bytes.Buffer, ref []byte, id int)
- func (options *MarkdownTerm) Footnotes(out *bytes.Buffer, text func() bool)
- func (options *MarkdownTerm) GetFlags() int
- func (options *MarkdownTerm) HRule(out *bytes.Buffer)
- func (options *MarkdownTerm) Header(out *bytes.Buffer, text func() bool, level int, id string)
- func (options *MarkdownTerm) Image(out *bytes.Buffer, link []byte, title []byte, alt []byte)
- func (options *MarkdownTerm) LineBreak(out *bytes.Buffer)
- func (options *MarkdownTerm) Link(out *bytes.Buffer, link []byte, title []byte, content []byte)
- func (options *MarkdownTerm) List(out *bytes.Buffer, text func() bool, flags int)
- func (options *MarkdownTerm) ListItem(out *bytes.Buffer, text []byte, flags int)
- func (options *MarkdownTerm) NormalText(out *bytes.Buffer, text []byte)
- func (options *MarkdownTerm) Paragraph(out *bytes.Buffer, text func() bool)
- func (options *MarkdownTerm) RawHtmlTag(out *bytes.Buffer, tag []byte)
- func (options *MarkdownTerm) StrikeThrough(out *bytes.Buffer, text []byte)
- func (options *MarkdownTerm) Table(out *bytes.Buffer, header []byte, body []byte, columnData []int)
- func (options *MarkdownTerm) TableCell(out *bytes.Buffer, text []byte, align int)
- func (options *MarkdownTerm) TableHeaderCell(out *bytes.Buffer, text []byte, align int)
- func (options *MarkdownTerm) TableRow(out *bytes.Buffer, text []byte)
- func (options *MarkdownTerm) TitleBlock(out *bytes.Buffer, text []byte)
- func (options *MarkdownTerm) TripleEmphasis(out *bytes.Buffer, text []byte)
Constants ¶
const (
MDTERM_USE_ANSI = 1 << iota // use ANSI sequences
)
Markdown terminal renderer configuration options.
Variables ¶
var DisableColors = false
DisableColors disables all colors and other ANSI sequences.
var EnvironmentOverrideColors = true
EnvironmentOverrideColors overs coloring based on `CLICOLOR` and `CLICOLOR_FORCE`. Cf. https://bixense.com/clicolors/
var ForceColors = false
ForceColors forces the use of colors and other ANSI sequences.
Functions ¶
func Color ¶
Color returns an aurora.Aurora instance with colors enabled or disabled depending on whether the writer supports colors.
func ColorizeJSON ¶
ColorizeJSON returns a colorized version of the input JSON, if the writer supports colors.
func ColorizeStatus ¶ added in v0.6.3
ColorizeStatus returns a colorized number for HTTP status code
func Linkify ¶
Linkify returns an ANSI escape sequence with an hyperlink, if the writer supports colors.
func MarkdownTermRenderer ¶ added in v0.5.2
func MarkdownTermRenderer(flags int) blackfriday.Renderer
MarkdownTermRenderer creates and configures a MarkdownTerm object, which satisfies the Renderer interface.
flags is a set of MDTERM_* options ORed together.
func StartSpinner ¶
StartSpinner starts a spinner with the given message. If the writer doesn't support colors, it simply prints the message.
func StopSpinner ¶
StopSpinner stops a spinner with the given message. If the writer doesn't support colors, it simply prints the message.
func StrikeThrough ¶ added in v0.5.2
StrikeThrough returns struck though text if the writer supports colors
Types ¶
type MarkdownTerm ¶ added in v0.5.2
type MarkdownTerm struct {
// contains filtered or unexported fields
}
MarkdownTerm is a type that implements the blackfriday.Renderer interface for terminal output.
Note that it only supports a small subset of Markdown features. It should only be used for rendering documentation strings from Stripe's OpenAPI specification file.
Do not create this directly, instead use the MarkdownTermRenderer function.
func (*MarkdownTerm) AutoLink ¶ added in v0.5.2
func (options *MarkdownTerm) AutoLink(out *bytes.Buffer, link []byte, kind int)
func (*MarkdownTerm) BlockCode ¶ added in v0.5.2
func (options *MarkdownTerm) BlockCode(out *bytes.Buffer, text []byte, info string)
func (*MarkdownTerm) BlockHtml ¶ added in v0.5.2
func (options *MarkdownTerm) BlockHtml(out *bytes.Buffer, text []byte)
func (*MarkdownTerm) BlockQuote ¶ added in v0.5.2
func (options *MarkdownTerm) BlockQuote(out *bytes.Buffer, text []byte)
func (*MarkdownTerm) CodeSpan ¶ added in v0.5.2
func (options *MarkdownTerm) CodeSpan(out *bytes.Buffer, text []byte)
func (*MarkdownTerm) DocumentFooter ¶ added in v0.5.2
func (options *MarkdownTerm) DocumentFooter(out *bytes.Buffer)
func (*MarkdownTerm) DocumentHeader ¶ added in v0.5.2
func (options *MarkdownTerm) DocumentHeader(out *bytes.Buffer)
func (*MarkdownTerm) DoubleEmphasis ¶ added in v0.5.2
func (options *MarkdownTerm) DoubleEmphasis(out *bytes.Buffer, text []byte)
func (*MarkdownTerm) Emphasis ¶ added in v0.5.2
func (options *MarkdownTerm) Emphasis(out *bytes.Buffer, text []byte)
func (*MarkdownTerm) Entity ¶ added in v0.5.2
func (options *MarkdownTerm) Entity(out *bytes.Buffer, entity []byte)
func (*MarkdownTerm) FootnoteItem ¶ added in v0.5.2
func (options *MarkdownTerm) FootnoteItem(out *bytes.Buffer, name, text []byte, flags int)
func (*MarkdownTerm) FootnoteRef ¶ added in v0.5.2
func (options *MarkdownTerm) FootnoteRef(out *bytes.Buffer, ref []byte, id int)
func (*MarkdownTerm) Footnotes ¶ added in v0.5.2
func (options *MarkdownTerm) Footnotes(out *bytes.Buffer, text func() bool)
func (*MarkdownTerm) GetFlags ¶ added in v0.5.2
func (options *MarkdownTerm) GetFlags() int
func (*MarkdownTerm) HRule ¶ added in v0.5.2
func (options *MarkdownTerm) HRule(out *bytes.Buffer)
func (*MarkdownTerm) LineBreak ¶ added in v0.5.2
func (options *MarkdownTerm) LineBreak(out *bytes.Buffer)
func (*MarkdownTerm) List ¶ added in v0.5.2
func (options *MarkdownTerm) List(out *bytes.Buffer, text func() bool, flags int)
func (*MarkdownTerm) ListItem ¶ added in v0.5.2
func (options *MarkdownTerm) ListItem(out *bytes.Buffer, text []byte, flags int)
func (*MarkdownTerm) NormalText ¶ added in v0.5.2
func (options *MarkdownTerm) NormalText(out *bytes.Buffer, text []byte)
func (*MarkdownTerm) Paragraph ¶ added in v0.5.2
func (options *MarkdownTerm) Paragraph(out *bytes.Buffer, text func() bool)
func (*MarkdownTerm) RawHtmlTag ¶ added in v0.5.2
func (options *MarkdownTerm) RawHtmlTag(out *bytes.Buffer, tag []byte)
func (*MarkdownTerm) StrikeThrough ¶ added in v0.5.2
func (options *MarkdownTerm) StrikeThrough(out *bytes.Buffer, text []byte)
func (*MarkdownTerm) TableCell ¶ added in v0.5.2
func (options *MarkdownTerm) TableCell(out *bytes.Buffer, text []byte, align int)
func (*MarkdownTerm) TableHeaderCell ¶ added in v0.5.2
func (options *MarkdownTerm) TableHeaderCell(out *bytes.Buffer, text []byte, align int)
func (*MarkdownTerm) TableRow ¶ added in v0.5.2
func (options *MarkdownTerm) TableRow(out *bytes.Buffer, text []byte)
func (*MarkdownTerm) TitleBlock ¶ added in v0.5.2
func (options *MarkdownTerm) TitleBlock(out *bytes.Buffer, text []byte)
func (*MarkdownTerm) TripleEmphasis ¶ added in v0.5.2
func (options *MarkdownTerm) TripleEmphasis(out *bytes.Buffer, text []byte)