Bug 697363 - RFE -- better tables in text format
RFE -- better tables in text format
Status: CLOSED CURRENTRELEASE
Product: Publican
Classification: Community
Component: publican (Show other bugs)
2.5
Unspecified Unspecified
unspecified Severity unspecified
: 3.0
: ---
Assigned To: Jeff Fearn
tools-bugs
:
Depends On:
Blocks: 820023
  Show dependency treegraph
 
Reported: 2011-04-17 23:18 EDT by Ruediger Landmann
Modified: 2012-10-30 23:11 EDT (History)
5 users (show)

See Also:
Fixed In Version: 3.0.0
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-10-30 23:11:23 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Ruediger Landmann 2011-04-17 23:18:38 EDT
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 06:13:51 EDT
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-11 21:25:17 EDT
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 00:13:10 EDT
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 19:28:02 EDT
Documentation required for the new parameters. Publican User Guide 3.0 tracking ticket added to this issue.
Comment 5 Jeff Fearn 2012-05-16 21:55:17 EDT
(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 00:09:27 EDT
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-07 21:27:38 EDT
make book with table.

build with publican 2.8

build with publican 3.0

compare output.
Comment 8 Cheryn Tan 2012-06-15 21:18:32 EDT
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-19 23:35:13 EDT
(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-25 23:07:17 EDT
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-26 20:54:32 EDT
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 00:33:19 EDT
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.