Re: Markdown format output for psql, design notes - Mailing list pgsql-hackers

From Vik Fearing
Subject Re: Markdown format output for psql, design notes
Date
Msg-id 00bcfb2a-289a-52c0-8b9d-7fe2f526f3ea@2ndquadrant.com
Whole thread Raw
In response to Markdown format output for psql, design notes  (Lætitia Avrot <laetitia.avrot@gmail.com>)
Responses Re: Markdown format output for psql, design notes  (Lætitia Avrot <laetitia.avrot@gmail.com>)
List 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


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [PROPOSAL] extend the object names to the qualified names inpg_stat_statements
Next
From: Thomas Munro
Date:
Subject: Re: Python versions (was Re: RHEL 8.0 build)