Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Pretty print for DOM #1329
Pretty print for DOM #1329
Comments
|
This is an entirely valid issue. |
|
Our DOM serialization code is literally generic, see So all that is needed is to write a I believe that it could be done by someone who is not an expert in our code base. Contributions invited. |


Is your feature request related to a problem? Please describe.
There is no way to pretty print a
simdjson::dom::elementto a string (or at least I did not find one). There is only a way to minify it to a string (or a stream).Describe the solution you'd like
A function like
to_pretty_string()or a configurable stream manipulatorprettyor a stand-alone classPrettyPrinter. Whatever fits.Pretty-printing json is a very common task used in various places. Basically, whenever a human needs to take a look on the stored json, it is better to display it with proper structure and indentation.
Describe alternatives you've considered
Using minified version is ok in some cases, but sometimes you really want a pretty verion. I see no other way than writing my own formatter.
** Are you willing to contribute code or documentation toward this new feature? **
Probably, but not sure. Nothing to contribute as of yet.