Type Method
makeEncoder(prettyPrint:emitVariantOverrides:assetPrefixComponent:)
Creates a new JSON encoder for render node values.
static func makeEncoder(prettyPrint: Bool = shouldPrettyPrintOutputJSON, emitVariantOverrides: Bool = true, assetPrefixComponent: String? = nil) -> JSONEncoder
Parameters
prettyPrintIf true, the encoder formats its output to make it easy to read; if false, the output is compact.
emitVariantOverridesWhether the encoder should emit the top-level variantOverrides property that holds language-specific documentation data.
assetPrefixComponentA path component to include in destination URLs for local assets (images, videos, downloads, etc.)
Return Value
The new JSON encoder.
Discussion
Returns an encoder that’s configured to encode RenderNode values.
Important
Don’t reuse encoders returned by this function to encode multiple render nodes, as the encoder accumulates state during the encoding process which should not be shared in other encoding units. Instead, call this API to create a new encoder for each render node you want to encode.