Module

PuduLangDocgen.Yaml

View source

YAML read into metadata and metadata written as YAML

Functions

Name Description
decode YAML text decoded as metadata. Block scalars are read here, keeping blank lines and working inside list items, and sequences written at their parent key's indentation are indented, two layouts the standard decoder loses.
encode Metadata written as YAML, keys in their order; nested values indent by two spaces.
scalar A YAML scalar, quoted when plain text would be read differently. Quoting prefers a form without escape sequences, which every YAML reader agrees on.

decode

fn decode(source: Str) -> Result[Docgen.Meta, Str]

YAML text decoded as metadata. Block scalars are read here, keeping blank lines and working inside list items, and sequences written at their parent key's indentation are indented, two layouts the standard decoder loses.

Parameters

source
Str

Returns

Result[Docgen.Meta, Str]

View source

encode

fn encode(value: &Docgen.Meta) -> Str

Metadata written as YAML, keys in their order; nested values indent by two spaces.

Parameters

value
&Docgen.Meta

Returns

Str

View source

scalar

fn scalar(written: Str) -> Str

A YAML scalar, quoted when plain text would be read differently. Quoting prefers a form without escape sequences, which every YAML reader agrees on.

Parameters

written
Str

Returns

Str

View source