psych icon indicating copy to clipboard operation
psych copied to clipboard

how to add indentation for array element

Open YK-Unit opened this issue 5 years ago • 1 comments

When psych dump object to yaml file, I hope psych can add indentation for array element, for example:

parent:
  - child
  - child

And yet it is:

parent:
- child
- child

So I wonder how to add indentation for array element. Look forward to your solution, thanks very much.

YK-Unit avatar Mar 13 '20 11:03 YK-Unit

Seconding this, it would be nice to have support for array indentation following the indentation option passed to dump or to_yaml would be ideal. If this already exists I haven't been able to find any sort of documentation referencing it.

If it needs to be implemented then I'd be interested in implementing this feature :+1:

NickHackman avatar Jul 15 '20 03:07 NickHackman

It looks much better with indentation

Paxa avatar Oct 19 '22 18:10 Paxa