Re: printing table in asciidoc with psql

From: Szymon Guz <mabewlun(at)gmail(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: printing table in asciidoc with psql
Date: 2014-10-29 11:23:05
Message-ID: CAFjNrYs49sP5cLyPUeRdbjDPu-E7csvzk7XKMun8xNxkPiX-Pg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 17 October 2014 09:01, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)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.

thanks,
Szymon

Attachment Content-Type Size
asciidoc.3.patch text/x-diff 17.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Petr Jelinek 2014-10-29 11:31:51 Re: WIP: multivariate statistics / proof of concept
Previous Message Tomas Vondra 2014-10-29 11:21:08 Re: WIP: multivariate statistics / proof of concept