Red Hat Bugzilla – Bug 543794
xi:included code samples that use tab indentation have excessive indenting
Last modified: 2015-08-09 21:21:56 EDT
Description of problem:
For xi:included code block samples enclosed in <programlisting> elements, the default indentation is h u g e.
Version-Release number of selected component (if applicable):
Publican Version 1.2
Steps to Reproduce:
1. svn co https://svn.devel.redhat.com/repos/ecs/JBoss_Documentation_Guide/
2. Publish the book to HTML/HTML-Single.
3. Look at "Appendix A Pom.xml multi profile".
When published, indentation used to nest elements in the included file looks like about 8 spaces per tab stop.
Less indentation, for example two spaces per tab stop. Even 4 spaces is quite large when you are dealing with Java code samples with a lot of nesting.
It renders exactly what you have in your example pom file, this is correct for verbatim tags. If you want 4 spaces in the output then you need to use that in the source.
(Jeff, this isn't necessarily for you, but I wanted to add this to the ticket as a "laymans" explanation why spaces are better than tabs with regard to publican and code samples)
I was going to write a huge diatribe about tabs blah blah blah, but I understand now that because tab settings for ASCII (plain text) can not be saved as metadata in plain text, the way tabs are interpreted by different systems and text editors is variable.
Because spaces are "just spaces", they are consistently interpreted by all systems, and you are "guaranteed" that your nesting will be preserved as nature intended.
If you still want to use the Tab key to indent your code, change the settings in your text editor to insert X number of spaces for each tab press. You may also want to specify in your code how may tab spaces are inserted for each level of indent.