Documentation
¶
Index ¶
- func FormatComments(lines []string) string
- func FormatFileLines(fileLines []string, c *Config) string
- func FormatNode(ast *ExtendedNode, c *Config) (string, bool)
- func FormatOnBuild(n *ExtendedNode, c *Config) string
- func GetFileLines(fileName string) ([]string, error)
- func GetHeredoc(n *ExtendedNode) (string, bool)
- func IndentFollowingLines(lines string, indentSize uint) string
- func Marshal(i interface{}) ([]byte, error)
- func StripWhitespace(lines string, rightOnly bool) string
- type Config
- type ExtendedNode
- type ParseState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatComments ¶
func FormatFileLines ¶
func FormatNode ¶
func FormatNode(ast *ExtendedNode, c *Config) (string, bool)
func FormatOnBuild ¶
func FormatOnBuild(n *ExtendedNode, c *Config) string
func GetFileLines ¶
func GetHeredoc ¶
func GetHeredoc(n *ExtendedNode) (string, bool)
func IndentFollowingLines ¶
func Marshal ¶
Marshal is a UTF-8 friendly marshaler. Go's json.Marshal is not UTF-8 friendly because it replaces the valid UTF-8 and JSON characters "&". "<", ">" with the "slash u" unicode escaped forms (e.g. \u0026). It preemptively escapes for HTML friendliness. Where text may include any of these characters, json.Marshal should not be used. Playground of Go breaking a title: https://play.golang.org/p/o2hiX0c62oN Source: https://stackoverflow.com/a/69502657/5684541
func StripWhitespace ¶
Types ¶
type ExtendedNode ¶
type ExtendedNode struct {
*parser.Node
Children []*ExtendedNode
Next *ExtendedNode
OriginalMultiline string
}
func BuildExtendedNode ¶
func BuildExtendedNode(n *parser.Node, fileLines []string) *ExtendedNode
Click to show internal directories.
Click to hide internal directories.