Data::Format::Pretty::YAML - Pretty-print data structure as YAML
This document describes version 0.08 of Data::Format::Pretty::YAML (from Perl distribution Data-Format-Pretty-YAML), released on 2014-12-10.
use Data::Format::Pretty::YAML qw(format_pretty); print format_pretty($data);
Some example output:
format_pretty({a=>1, b=>2})
a: 1 b: 2
This module uses YAML::Syck to encode data as YAML.
Return formatted data structure as YAML. Currently there are no known options. YAML::Syck's settings are optimized for prettiness, currently as follows:
$YAML::Syck::ImplicitTyping = 1; $YAML::Syck::SortKeys = 1; $YAML::Syck::Headless = 1;
Options:
color => BOOL (default: from env or 1)
Whether to enable coloring. The default is the enable only when running interactively.
pretty => BOOL (default: 1)
Whether to focus on prettyness. If set to 0, will focus on producing valid YAML instead of prettiness.
linum => BOOL (default: from env or 0)
Whether to enable line numbering.
Return text/yaml.
text/yaml
Set color option (if unset).
color
Set linum option (if unset).
linum
Data::Format::Pretty
Please visit the project's homepage at https://metacpan.org/release/Data-Format-Pretty-YAML.
Source repository is at https://github.com/perlancar/perl-Data-Format-Pretty-YAML.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Data-Format-Pretty-YAML
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
perlancar <perlancar@cpan.org>
This software is copyright (c) 2014 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Data::Format::Pretty::YAML, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Format::Pretty::YAML
CPAN shell
perl -MCPAN -e shell install Data::Format::Pretty::YAML
For more information on module installation, please visit the detailed CPAN module installation guide.