mk-fg / pretty-yaml

PyYAML-based module to produce a bit more pretty and readable YAML-serialized data
Do What The F*ck You Want To Public License
135 stars 29 forks source link

yaml.composer.ComposerError: expected a single document in the stream #29

Closed u2mejc closed 5 years ago

u2mejc commented 5 years ago

Are concatenated yaml docs supported? I know that pyyaml supports them being delimited by three dashes, but I couldn't figure out if this is supported by looking at pretty-yaml's docs.

mk-fg commented 5 years ago

No, there wasn't a yaml.dump_all() method equivalent. But since yaml.dump_all was used internally anyway, added pyaml.dump_all([doc1, doc2, doc3]), as well as multiple_docs=False keyword to all dump methods which is equivalent to that. Note that it passes explicit_start=True by default, which can be disabled by passing False there instead.