Documentation
¶
Index ¶
- Variables
- func GetFullColorSequence(color termenv.Color, bg bool) []byte
- type PrettyPrintColors
- type PrettyPrintConfig
- type PrettyPrintWriter
- func (w PrettyPrintWriter) AreRegionsDisabled() bool
- func (w PrettyPrintWriter) EnterPattern() PrettyPrintWriter
- func (w PrettyPrintWriter) EnterRegion(kind RegionKind) Region
- func (w PrettyPrintWriter) IncrDepth() PrettyPrintWriter
- func (w PrettyPrintWriter) IncrDepthWithIndent(indentCount int) PrettyPrintWriter
- func (w PrettyPrintWriter) LeaveRegion(region Region)
- func (w *PrettyPrintWriter) Regions() []Region
- func (w PrettyPrintWriter) WithDepth(depth int) PrettyPrintWriter
- func (w PrettyPrintWriter) WithDepthIndent(depth, indent int) PrettyPrintWriter
- func (w PrettyPrintWriter) WriteAnsiReset()
- func (w PrettyPrintWriter) WriteByte(b byte)
- func (w PrettyPrintWriter) WriteBytes(b []byte)
- func (w PrettyPrintWriter) WriteClosingBracketClosingParen()
- func (w PrettyPrintWriter) WriteClosingbracketClosingParen()
- func (w PrettyPrintWriter) WriteColonSpace()
- func (w PrettyPrintWriter) WriteCommaSpace()
- func (w PrettyPrintWriter) WriteDotOpeningCurlyBracket()
- func (w PrettyPrintWriter) WriteLFCR()
- func (w PrettyPrintWriter) WriteManyBytes(b ...[]byte)
- func (w PrettyPrintWriter) WriteName(str string)
- func (w PrettyPrintWriter) WriteNameF(fmtStr string, args ...any)
- func (w PrettyPrintWriter) WriteString(str string)
- func (w PrettyPrintWriter) WriteStringF(fmtStr string, args ...any)
- func (w PrettyPrintWriter) ZeroDepth() PrettyPrintWriter
- func (w PrettyPrintWriter) ZeroDepthIndent() PrettyPrintWriter
- func (w PrettyPrintWriter) ZeroIndent() PrettyPrintWriter
- type Region
- type RegionFilter
- type RegionKind
- type Regions
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DEFAULT_DARKMODE_PRINT_COLORS = PrettyPrintColors{ ControlKeyword: GetFullColorSequence(termenv.ANSIBrightMagenta, false), OtherKeyword: GetFullColorSequence(termenv.ANSIBlue, false), PatternLiteral: GetFullColorSequence(termenv.ANSIRed, false), StringLiteral: GetFullColorSequence(termenv.ANSI256Color(209), false), PathLiteral: GetFullColorSequence(termenv.ANSI256Color(209), false), IdentifierLiteral: GetFullColorSequence(termenv.ANSIBrightCyan, false), NumberLiteral: GetFullColorSequence(termenv.ANSIBrightGreen, false), Constant: GetFullColorSequence(termenv.ANSIBlue, false), PatternIdentifier: GetFullColorSequence(termenv.ANSIBrightGreen, false), CssTypeSelector: GetFullColorSequence(termenv.ANSIBlack, false), CssOtherSelector: GetFullColorSequence(termenv.ANSIYellow, false), XmlTagName: GetFullColorSequence(termenv.ANSIBlue, false), InvalidNode: GetFullColorSequence(termenv.ANSIBrightRed, false), DiscreteColor: GetFullColorSequence(termenv.ANSIBrightBlack, false), Folder: GetFullColorSequence(termenv.ANSIBlue, false), Executable: GetFullColorSequence(termenv.ANSIBrightGreen, false), SuccessColor: GetFullColorSequence(termenv.ANSIBrightGreen, false), WarnColor: GetFullColorSequence(termenv.ANSIYellow, false), ErrorColor: GetFullColorSequence(termenv.ANSIRed, false), } DEFAULT_LIGHTMODE_PRINT_COLORS = PrettyPrintColors{ ControlKeyword: GetFullColorSequence(termenv.ANSI256Color(90), false), OtherKeyword: GetFullColorSequence(termenv.ANSI256Color(26), false), PatternLiteral: GetFullColorSequence(termenv.ANSI256Color(1), false), StringLiteral: GetFullColorSequence(termenv.ANSI256Color(88), false), PathLiteral: GetFullColorSequence(termenv.ANSI256Color(88), false), IdentifierLiteral: GetFullColorSequence(termenv.ANSI256Color(27), false), NumberLiteral: GetFullColorSequence(termenv.ANSI256Color(28), false), Constant: GetFullColorSequence(termenv.ANSI256Color(21), false), PatternIdentifier: GetFullColorSequence(termenv.ANSI256Color(28), false), CssTypeSelector: GetFullColorSequence(termenv.ANSIBlack, false), CssOtherSelector: GetFullColorSequence(termenv.ANSIYellow, false), XmlTagName: GetFullColorSequence(termenv.ANSIBlue, false), InvalidNode: GetFullColorSequence(termenv.ANSI256Color(160), false), DiscreteColor: GetFullColorSequence(termenv.ANSIBrightBlack, false), Folder: GetFullColorSequence(termenv.ANSI256Color(26), false), Executable: GetFullColorSequence(termenv.ANSI256Color(28), false), SuccessColor: GetFullColorSequence(termenv.ANSIBrightGreen, false), WarnColor: GetFullColorSequence(termenv.ANSIYellow, false), ErrorColor: GetFullColorSequence(termenv.ANSIRed, false), } )
View Source
var ( ANSI_RESET_SEQUENCE = []byte(termenv.CSI + termenv.ResetSeq + "m") LF_CR = []byte{'\n', '\r'} DASH_DASH = []byte{'-', '-'} SHARP_OPENING_PAREN = []byte{'#', '('} COLON_SPACE = []byte{':', ' '} COMMA_SPACE = []byte{',', ' '} CLOSING_BRACKET_CLOSING_PAREN = []byte{']', ')'} CLOSING_CURLY_BRACKET_CLOSING_PAREN = []byte{'}', ')'} THREE_DOTS = []byte{'.', '.', '.'} DOT_OPENING_CURLY_BRACKET = []byte{'.', '{'} )
Functions ¶
Types ¶
type PrettyPrintColors ¶
type PrettyPrintColors struct { //inox code ControlKeyword, OtherKeyword, PatternLiteral, StringLiteral, PathLiteral, IdentifierLiteral, NumberLiteral, Constant, PatternIdentifier, CssTypeSelector, CssOtherSelector, XmlTagName, InvalidNode, DiscreteColor, Folder, Executable, SuccessColor, WarnColor, ErrorColor []byte }
type PrettyPrintConfig ¶
type PrettyPrintWriter ¶
type PrettyPrintWriter struct { Depth int ParentIndentCount int RemovePercentPrefix bool // contains filtered or unexported fields }
func (PrettyPrintWriter) AreRegionsDisabled ¶
func (w PrettyPrintWriter) AreRegionsDisabled() bool
func (PrettyPrintWriter) EnterPattern ¶
func (w PrettyPrintWriter) EnterPattern() PrettyPrintWriter
func (PrettyPrintWriter) EnterRegion ¶
func (w PrettyPrintWriter) EnterRegion(kind RegionKind) Region
func (PrettyPrintWriter) IncrDepth ¶
func (w PrettyPrintWriter) IncrDepth() PrettyPrintWriter
func (PrettyPrintWriter) IncrDepthWithIndent ¶
func (w PrettyPrintWriter) IncrDepthWithIndent(indentCount int) PrettyPrintWriter
func (PrettyPrintWriter) LeaveRegion ¶
func (w PrettyPrintWriter) LeaveRegion(region Region)
func (*PrettyPrintWriter) Regions ¶
func (w *PrettyPrintWriter) Regions() []Region
GetRegions returns the list of regions, this functions should be called after all writes.
func (PrettyPrintWriter) WithDepth ¶
func (w PrettyPrintWriter) WithDepth(depth int) PrettyPrintWriter
func (PrettyPrintWriter) WithDepthIndent ¶
func (w PrettyPrintWriter) WithDepthIndent(depth, indent int) PrettyPrintWriter
func (PrettyPrintWriter) WriteAnsiReset ¶
func (w PrettyPrintWriter) WriteAnsiReset()
func (PrettyPrintWriter) WriteByte ¶
func (w PrettyPrintWriter) WriteByte(b byte)
func (PrettyPrintWriter) WriteBytes ¶
func (w PrettyPrintWriter) WriteBytes(b []byte)
func (PrettyPrintWriter) WriteClosingBracketClosingParen ¶
func (w PrettyPrintWriter) WriteClosingBracketClosingParen()
func (PrettyPrintWriter) WriteClosingbracketClosingParen ¶
func (w PrettyPrintWriter) WriteClosingbracketClosingParen()
func (PrettyPrintWriter) WriteColonSpace ¶
func (w PrettyPrintWriter) WriteColonSpace()
func (PrettyPrintWriter) WriteCommaSpace ¶
func (w PrettyPrintWriter) WriteCommaSpace()
func (PrettyPrintWriter) WriteDotOpeningCurlyBracket ¶
func (w PrettyPrintWriter) WriteDotOpeningCurlyBracket()
func (PrettyPrintWriter) WriteLFCR ¶
func (w PrettyPrintWriter) WriteLFCR()
func (PrettyPrintWriter) WriteManyBytes ¶
func (w PrettyPrintWriter) WriteManyBytes(b ...[]byte)
func (PrettyPrintWriter) WriteName ¶
func (w PrettyPrintWriter) WriteName(str string)
func (PrettyPrintWriter) WriteNameF ¶
func (w PrettyPrintWriter) WriteNameF(fmtStr string, args ...any)
func (PrettyPrintWriter) WriteString ¶
func (w PrettyPrintWriter) WriteString(str string)
func (PrettyPrintWriter) WriteStringF ¶
func (w PrettyPrintWriter) WriteStringF(fmtStr string, args ...any)
func (PrettyPrintWriter) ZeroDepth ¶
func (w PrettyPrintWriter) ZeroDepth() PrettyPrintWriter
func (PrettyPrintWriter) ZeroDepthIndent ¶
func (w PrettyPrintWriter) ZeroDepthIndent() PrettyPrintWriter
func (PrettyPrintWriter) ZeroIndent ¶
func (w PrettyPrintWriter) ZeroIndent() PrettyPrintWriter
type RegionFilter ¶
type RegionFilter struct { ExactDepth int MinimumDepth int //ignored if ExactDepth is set Kind RegionKind //ignored if zero }
type Regions ¶
type Regions []Region
func (Regions) FilteredForEach ¶
func (rs Regions) FilteredForEach(filter RegionFilter, fn func(r Region) error) error
Click to show internal directories.
Click to hide internal directories.