Bug 697363 - RFE -- better tables in text format
Summary: RFE -- better tables in text format
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Publican
Classification: Community
Component: publican
Version: 2.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 3.0
Assignee: Jeff Fearn 🐞
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks: 820023
TreeView+ depends on / blocked
 
Reported: 2011-04-18 03:18 UTC by Ruediger Landmann
Modified: 2012-10-31 03:11 UTC (History)
5 users (show)

Fixed In Version: 3.0.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-10-31 03:11:23 UTC
Embargoed:


Attachments (Terms of Use)

Description Ruediger Landmann 2011-04-18 03:18:38 UTC
At present, tables are presented as space-separated columns in text. Tables with more visual markup would be more readable.

Comment 1 Jeff Fearn 🐞 2011-06-25 10:13:51 UTC
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.

Comment 2 Jeff Fearn 🐞 2012-03-12 01:25:17 UTC
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.

Comment 3 Scott Mumford 2012-05-04 04:13:10 UTC
Jeff,
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

Technology

Version in JBoss EAP 5.1

Version in JBoss EAP 4.3

Java EE

5.0

1.4

JavaBean Activation Framework (JAF)

1.1

1.1

Java API for XML-based RPC (JAX-RPC)

1.1

1.1

SOAP with Attachments API for Java (SAAJ)

1.3

1.3
...
...
...

Comment 4 Jared MORGAN 2012-05-08 23:28:02 UTC
Documentation required for the new parameters. Publican User Guide 3.0 tracking ticket added to this issue.

Comment 5 Jeff Fearn 🐞 2012-05-17 01:55:17 UTC
(In reply to comment #3)
> Jeff,
> 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.

txt_formater: links

This is a slightly better layout, for complete doco run:

man HTML::FormatText::WithLinks

txt_formater: tables

Is a different layout engine again, seems to work better with simple tables but fails on more complex ones.

man HTML::FormatText::WithLinks::AndTables

I think for this bug we should verify that the options work and then people can raise particular issues against the text formatters themselves.

Comment 6 Scott Mumford 2012-05-17 04:09:27 UTC
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.

Comment 7 Michael Hideo 2012-06-08 01:27:38 UTC
make book with table.

build with publican 2.8

build with publican 3.0

compare output.

Comment 8 Cheryn Tan 2012-06-16 01:18:32 UTC
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.

Comment 9 Andrew Ross 2012-07-20 03:35:13 UTC
(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

3. Build:
publican build --format txt --lang en-US

4. Examine the txt file in your editor:

gedit tmp/en-US/txt/Test_Book.txt

5. Output as per comment#3

---snip---

Table 1.1. Sample Table

Horizontal Span

a3

a4

a5

f1

f2

f3

f4

f5

b1

b2

b3

b4

Vertical Span

[...]

Comment 10 Jeff Fearn 🐞 2012-07-26 03:07:17 UTC
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.

Comment 11 Ruediger Landmann 2012-07-27 00:54:32 UTC
I still get the cells displayed vertically as per comment 9 when I build with:

publican-3.0-0.fc17.t213.noarch
perl-HTML-FormatText-WithLinks-AndTables-0.02-2.fc17.noarch
perl-HTML-FormatText-WithLinks-0.14-4.fc17.noarch

==================================================

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

Comment 12 Ruediger Landmann 2012-07-27 04:33:19 UTC
Oops; forgot to set txt_formater :)

With:
txt_formater: tables
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.

output.


Note You need to log in before you can comment on or make changes to this bug.