Re: [HACKERS] Other formats in pset like markdown, rst, mediawiki - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [HACKERS] Other formats in pset like markdown, rst, mediawiki
Date
Msg-id 20170223150636.7mvaa72fyrch6pob@alvherre.pgsql
Whole thread Raw
In response to [HACKERS] Other formats in pset like markdown, rst, mediawiki  (Jan Michálek <godzilalalala@gmail.com>)
Responses Re: [HACKERS] Other formats in pset like markdown, rst, mediawiki
List pgsql-hackers
Jan Michálek wrote:

> Is there posibility, that support for some others formats will be added in
> the future? Or id posible to create some of this formats by manipulating
> with pset? Or I need use xml for export and use some xslt templates, or
> lxml etc. to create format that I will be able to copy on wiki page or in
> github issue.

I would love to have something that generates Markdown tables.  One of
the goals of psql is to make common tasks easy, and IMO generating
tables in formats commonly used in documents is one such task.

I think we discussed the idea of Markdown awhile ago, and eventually
found out that you absolutely need to align things following some crazy
rules, or the markdown processor just gives up on them.  (It works fine
for simple table contents, but if you have to escape a character
somewhere, then the alignment needs to subtract the escaping character,
or something like that)

The pandoc document http://pandoc.org/MANUAL.html#tables appears to
suggest we could use "pipe tables" to get rid of the alignment
requirement, but then the result is ugly.  It's a pity that multiline
rows don't work in that mode, also.

If you come up with code to generate good pandoc Markdown tables, I am
happy to help.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Corey Huinker
Date:
Subject: Re: [HACKERS] \if, \elseif, \else, \endif (was Re: PSQL commands:\quit_if, \quit_unless)
Next
From: Dilip Kumar
Date:
Subject: Re: [HACKERS] Enabling parallelism for queries coming from SQL orother PL functions