Skip to content
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 Printing when saving a xml #46

Open
wbiker opened this issue May 11, 2017 · 3 comments
Open

Pretty Printing when saving a xml #46

wbiker opened this issue May 11, 2017 · 3 comments

Comments

@wbiker
Copy link

wbiker commented May 11, 2017

Hi, first thank you for the module.

I use it to dynamical update my Visual Studio project file and it works great. One think I think could be improved. After saving the project file the xml is all in one line. It does not be a problem, but in git and if you look at the file with a editor it is not very readable.

it is possible to implement a pretty printing parameter which adds new lines to the xml string when saving it?

Thanks

@supernovus
Copy link
Collaborator

I am not actively working on my Perl 6 modules at the moment, but I don't think it would be too difficult to add some form of pretty printing option when serializing. It's been a while since I looked at the code though, so I'm not sure exactly what it would entail. If I have a chance in the near future, I will take a look and see if I can add something.

@wbiker
Copy link
Author

wbiker commented May 19, 2017

Cool thanks. I would do it by myself but my perl6 foo is not great.

@mikkelstb
Copy link

I tried to alter save function in order to write in pretty print. Though I stumbled upon one challenge.
I see that when loading a file with indentations, the format is preserved when saving as another file. But if I add elements, these are not indented. I would prefer that when loading, all indentation would be discarded altogether, or at least have an option for doing so. Writing back to file with pretty print, would then be a bit easier i think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants