Red Hat Bugzilla – Bug 697363
RFE -- better tables in text format
Last modified: 2012-10-30 23:11:23 EDT
At present, tables are presented as space-separated columns in text. Tables with more visual markup would be more readable.
I checked in a version with a new option, --NEW_TXT, it requires a patched HTML::FormatText::WithLinks::AndTables which I'll get to you soon. Not 100% happy with it ATM, but it's not too bad.
Not greatly happy with the new formatter when use on complex tables. I've added a new parameter, txt_formater, which allows controlling which formatter to use.
Default is current formatter.
'links' is HTML::FormatText::WithLinks
'tables' is HTML::FormatText::WithLinks::AndTables
Requires lots of testing.
Please advise if one of the above-mentioned parameters is required in the command for a text build.
I just built a text version of a book with Publican 3.0 (publican build --formats=txt --langs=en-US) and the tables are rendering as:
Table 1.1. Java EE Standards
Version in JBoss EAP 5.1
Version in JBoss EAP 4.3
JavaBean Activation Framework (JAF)
Java API for XML-based RPC (JAX-RPC)
SOAP with Attachments API for Java (SAAJ)
Documentation required for the new parameters. Publican User Guide 3.0 tracking ticket added to this issue.
(In reply to comment #3)
> Please advise if one of the above-mentioned parameters is required in the
> command for a text build.
Controlling which text formatter is used requires setting txt_formater in the publican.cfg file.
Unset is the old behaviour.
This is a slightly better layout, for complete doco run:
Is a different layout engine again, seems to work better with simple tables but fails on more complex ones.
I think for this bug we should verify that the options work and then people can raise particular issues against the text formatters themselves.
Jeff, I rebuilt the document using both 'txt_formater: links' and 'txt_formater: tables' in the publican.cfg file.
I also purged the tmp/ directory before each build, just to be sure.
In both instances the table rendered as it is shown in my comment above (i.e. vertically).
tl,dnr: It doesn't seem to be working.
make book with table.
build with publican 2.8
build with publican 3.0
Checked on publican-3.0-0.fc16.t180
Added following parameters to publican.cfg file:
Table rows render in alternate colours, providing a better visual distinction between rows. Behaviour in comment 6 was not observed.
(In reply to comment #8)
> Checked on publican-3.0-0.fc16.t180
> Added following parameters to publican.cfg file:
> txt_formater: links
> txt_formater: tables
> Table rows render in alternate colours, providing a better visual
> distinction between rows. Behaviour in comment 6 was not observed.
Had a chat with Cheryn and comment#8 may have been based upon the html output not the text output.
Same behaviour as comment#6 / comment#3 was observed in publican-3.0-0.fc17.t210.noarch.
Steps to reproduce:
1. Create a book:
publican create --name Test_Book --lang en-US
2. Add txt_formater to publican.cfg
echo "txt_formater: tables" >> publican.cfg
2. Edit Chapter.xml and copy in the table example from http://docbook.org/tdg/en/html/table.html
publican build --format txt --lang en-US
4. Examine the txt file in your editor:
5. Output as per comment#3
Table 1.1. Sample Table
Fixed typo where txt_formatters wasn't being checked properly. This revealed a bug in HTML::FormatText::WithLinks::AndTables, which I patched and updated from 0.01 to 0.02. Contacted package maintainer to get package updated in Fedora.
We will need to document that the patches in the new package will need to be carried to support the modified txt layout.
I still get the cells displayed vertically as per comment 9 when I build with:
Table 4.1. 'Fedora' in Czech
the subject of a sentence
the direct object of a sentence
the indirect object of a sentence
the subject of direct address
relates to a location
relates to a method
Oops; forgot to set txt_formater :)
the book builds and a simple table is rendered usefully:
Table 4.1. 'Fedora' in Czech
Case Usage Form
Nominative the subject of a sentence Fedora
Genitive indicates possession Fedory
Accusative the direct object of a sentence Fedoru
Dative the indirect object of a sentence Fedoře
Vocative the subject of direct address Fedoro
Locative relates to a location Fedoře
Instrumental relates to a method Fedorou
During the build though, there are multiple lines of:
Use of uninitialized value $tag in concatenation (.) or string at /usr/share/perl5/vendor_perl/HTML/Formatter.pm line 150, <FH> line 12.