Documentation ¶
Overview ¶
Package yml defines tools for parsing and encoding CPT sources written in YAML.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Encode ¶
func Encode(pv *model.ParsedValue, opts ...EncodeOption) string
Encode serializes a model.ParsedValue to a string according to an optional set of encoding options.
The ParsedValue does not necessarily need to be well-formed in order to be encoded.
func Parse ¶
Parse decodes a YAML source object to a model.ParsedValue.
The decoding step relies on the use of YAML tags to determine the type of each element. Specially, the tags used must align with the ones produced by the Go YAML v3 library.
Errors in the decoding will result in a nil model.ParsedValue.
func RenderDebugIDs ¶
func RenderDebugIDs(enc *encoder) *encoder
RenderDebugIDs modifies the encoding to print out source element ids into the encoded string.
Types ¶
type EncodeOption ¶
type EncodeOption func(*encoder) *encoder
EncodeOption describes a functional argument for configuring the behavior of the encoder.