Turn off pretty print in Author mode

Oxygen general issues.
maglid
Posts: 75
Joined: Mon Sep 28, 2009 8:10 am

Turn off pretty print in Author mode

Post 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
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Turn off pretty print in Author mode

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Turn off pretty print in Author mode

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply