-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Emitting styles (and removing extra new lines) #29
Comments
Sorry, there's no such functionality.
Absolutely, the newline shouldn't be there. So that's a bug indeed. I was under the impression that this was ok, but currently there is no unit test covering formatting, as the focus has been on semantic correctness. I'll have to verify what's going on. I'll start by adding some unit tests for formatting, and looking at the current emitter code (which is admittedly not very nice) to verify how to refactor to make it easier to customize emission. |
Simplified the cyclomatic complexity of the emitter code, which was needlessly complex.
@leoetlino The bug causing the newline was fixed. I'm going to open a separate issue to track emit formatting. |
@leoetlino I opened #37 to start work on emit formatting. You seem to have some ideas (or requirements) and I'd be happy to have your input there. |
Is it possible to configure the emitting style (block/flow and newlines)?
Currently, I have a bunch of existing YAML documents that look like this:
Nice and readable, with the flow (inline) style being used for simple maps that don't contain nested maps (which is the PyYAML default).
Emitting the same document with ryml currently results in the following:
which isn't that bad but it's comparatively harder to read and it's also a bit too long.
So to get back to the questions:
Is it possible to get rid of the new line that is emitted for maps that are sequence items? For some reason, this only affects maps that are sequence items.
Does ryml make it possible to set the flow style (block/inline) for maps and sequences? I was unable to find any such functionality in the API but it's possible I've missed something.
The text was updated successfully, but these errors were encountered: