-
Notifications
You must be signed in to change notification settings - Fork 162
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
Pretty print support #138
Comments
That's nice. Actually, I have been planning to implement almost the same thing. Since, in my plan, all the formatting parameters including line width and precision are integrated in the struct, it introduces breaking changes. So I suspended it until v4. However, as you pointed out, the feature itself can be implemented keeping the current interface. I know the feature is needed, so I will implement it. But it could take some time. |
Great 👍🏻 , thank you in advance. If you implement it with the struct, as suggested, there will be no breaking change since the default constructed struct produces the same output as before and can even be defaulted in the One small performance hint about the |
Right. That is exactly why I have planned almost the same thing, actually.
Yeah, that's true. Well, anyway, I will do those things when I have time. |
4f31b90
It would be great if the
serializer
could also support pretty printing for making the generated toml more readable (the nlohmann::json library supports it as well and it's a feature I don't want to miss for readable serialization).Currently the serializer generates compact toml as shown below:
The readability could easily improved by:
#
when the comment is not empty)Probably this requires minimal implementation effort. Maybe the formatting rules could be configured nicely through a formatting config that is passed to
toml::format
:The text was updated successfully, but these errors were encountered: