Re: Markdown format output for psql, design notes

From: Vik Fearing <vik(dot)fearing(at)2ndquadrant(dot)com>
To: Lætitia Avrot <laetitia(dot)avrot(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Markdown format output for psql, design notes
Date: 2018-11-28 21:47:54
Message-ID: 00bcfb2a-289a-52c0-8b9d-7fe2f526f3ea@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 28/11/2018 09:59, Lætitia Avrot wrote:
> First, thanks to have read that whole mail and sorry I didn't mean to
> make it so long...
> Then I'd like to know ***what you think about what I'm about to do***
> before heading in a wrong direction.

I'm a little bit reluctant for us to write and maintain more and more
format styles, especially one as subjective and varied as markdown. I
imagine we will constantly be bombarded with "this isn't quite right" or
"this isn't compatible with github".

What I personally use is the excellent pandoc tool (https://pandoc.org/)
which can convert formats we already output into a multitude of other
formats.

psql -qHc "values (E'hello\nworld', 42), ('single line', 5), ('another',
null)" | pandoc -f html -t markdown

-----------------------
column1 column2
------------- ---------
hello\ 42
world

single line 5

another  
-----------------------

(3 rows)\

This handles both column alignment and the multiline issue Daniel raised.
--
Vik Fearing +33 6 46 75 15 36
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2018-11-28 21:52:33 Re: Python versions (was Re: RHEL 8.0 build)
Previous Message Alvaro Herrera 2018-11-28 21:46:49 Re: [PROPOSAL] extend the object names to the qualified names in pg_stat_statements