Re: printing table in asciidoc with psql

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Szymon Guz <mabewlun(at)gmail(dot)com>, 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: 2015-03-20 14:10:17
Message-ID: 20150320141017.GL6317@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 3, 2014 at 03:52:30PM +0900, Michael Paquier wrote:
> > I see a trailing spaces, but I don't see a described effect. Please, can you
> > send some more specific test case?
>
> This formatting problem is trivial to reproduce:
> =# create table "foo" ();
>
> CREATE TABLE
> Time: 9.826 ms
> =# \d
>
> .List of relations
> [options="header",cols="<l,<l,
> <l,<l",frame="none"]
> |====
> ^l| Schema ^l| Name ^l| Type ^l| Owner
> | public | foo | table | ioltas
> |====
>
> ....
> (1 row)
> ....
>
> I just tested this patch, and yes I agree with Alvaro that it would be
> good to minimize the extra spaces around the table separators '|'. Now
> we need to be careful as well, and I think that we should just remove
> the separators on the right of the separators as cells values
> controlling for example spans would result in incorrect output, stuff
> like that:
> 5 2.2+^.^
> 9 2+>
>
> Also, something a bit surprising is that this format produces always
> one newline for each command, for example in the case of a DDL:
> =# create table foo ();
>
> CREATE TABLE
> I think that this extra space should be removed as well, no?
>
> This patch has been marked as "Waiting on Author" for a couple of
> weeks, and the problems mentioned before have not been completely
> addressed, hence marking this patch as returned with feedback. It
> would be nice to see progress for the next CF.

I was able to fix all the reported problems with the attached patch.
I used this for testing the output:

https://asciidoclive.com/

Is it OK now?

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

Attachment Content-Type Size
asciidoc.diff text/x-diff 19.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thom Brown 2015-03-20 14:24:05 Re: assessing parallel-safety
Previous Message Max Filippov 2015-03-20 14:05:21 [PATCH] Compare linker/compiler output with their default output