yamerl provides two modes for document output:
Simple Mode (Default)
Outputs documents using standard Erlang types. Mappings are represented as proplists (e.g., [{"key", "value"}]). This is ideal for most application logic where you only care about the data.
Detailed Mode
Triggered by passing [{detailed_constr, true}] as the second argument to yamerl_constr:file/2.
It outputs complex records (e.g., yamerl_doc, yamerl_seq, yamerl_map, yamerl_str) that include:
- Line and Column numbers
- Tag URIs (e.g.,
tag:yaml.org,2002:map) - YAML node types
- Module information
This mode is useful for building tools like linters, formatters, or debuggers that need to know exactly where in the source file a piece of data originated.
% Simple mode
yamerl_constr:file("system.yaml").
% Detailed mode
yamerl_constr:file("system.yaml", [{detailed_constr, true}]).