Page 1 of 1

Turn off pretty print in Author mode

Posted: Wed Jul 15, 2020 9:23 am
by maglid
We have many writers using Oxygen version 22. Authoring of DITA and Docbook files, source files stored in git.

Is there a way to turn off automatic background pretty-printing of XML files that are being authored in Author mode? Sometimes the XML gets reformatted by the pretty-print operation and this makes it hard to see what was actually changed in the file, for example with a git diff.

Many Oxygen users must run into this. How do people handle this?

Thanks,
Mark

Re: Turn off pretty print in Author mode

Posted: Wed Jul 15, 2020 1:46 pm
by Radu
Hi Mark,

By default, with the default settings we provide, only the modified XML elements get re-serialized when saving the XML content. For example if I open an XML document and make a change inside a <p> element, only that element gets pretty printed on save. This is the best we can do.

In the Oxygen Preferences->"Editor / Edit Modes / Author" page there is a "Serialization options" section which has additional settings. Maybe you can find a behavior you like in the "Compatibility with other tools" combo box.

An alternative would be to have a CSS which declares all elements as space preserve:
{code}*{white-space:pre;}{code}
but this would mean that Oxygen would let you insert new lines everywhere, it would not work out well in the end.

Regards,
Radu

Re: Turn off pretty print in Author mode

Posted: Wed Jul 15, 2020 1:47 pm
by Radu
About using Git diff, Oxygen's Git client add-on has visual files comparison and you can also integrate Oxygen's visual files comparison with an external Git tool:

https://www.oxygenxml.com/doc/versions/ ... git-2.html

Regards,
Radu