Re: printing table in asciidoc with psql - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: printing table in asciidoc with psql
Date
Msg-id CAFj8pRC-=YejiP_VvxR=hFOZkiKAwL3K7CuqikP=C71S1tEFNQ@mail.gmail.com
Whole thread Raw
In response to Re: printing table in asciidoc with psql  (Szymon Guz <mabewlun@gmail.com>)
Responses Re: printing table in asciidoc with psql
List pgsql-hackers


2014-10-29 12:23 GMT+01:00 Szymon Guz <mabewlun@gmail.com>:


On 17 October 2014 09:01, Pavel Stehule <pavel.stehule@gmail.com> wrote:
Hi Szymon

I found a small bug - it doesn't escape "|" well

postgres=# select * from mytab ;
    a     | numeric_b |     c     
----------+-----------+------------
 Ahoj     |        10 | 2014-10-17
 Hello    |        20 | 2014-10-18
 Hi       |        30 | 2014-10-19
 aaa|aaaa |      2222 | 2014-10-17
(4 rows)


result

[options="header",cols="<literal,>literal,<literal",frame="all",grid="all"]
|====
^| +++a+++ ^| +++numeric_b+++ ^| +++c+++
| Ahoj | 10 | 2014-10-17
| Hello | 20 | 2014-10-18
| Hi | 30 | 2014-10-19
| aaa|aaaa | 2222 | 2014-10-17
|====


Next, I tested it with asciidoc and asciidoctor and I have a problem with asciidoctor - it doesn't respect aligning .. so numbers are aligned to left instead to right.

When you use a option "header" then a formatting "+++xxxx++++" is useless.

Hi Pavel,
thanks for the remarks. I've attached another version of the pach. It works a little better now, including escaping | and asciidoctor alignment support.

it is fixed. Thank you.

I fixed formatting - please, recheck it.

I don't see any issue - it should be ready for commiter

Regards

Pavel




 

thanks,
Szymon

Attachment

pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: TAP test breakage on MacOS X
Next
From: Michael Paquier
Date:
Subject: Re: REINDEX CONCURRENTLY 2.0