Re: Markdown format output for psql, design notes

From: Lætitia Avrot <laetitia(dot)avrot(at)gmail(dot)com>
To: vik(dot)fearing(at)2ndquadrant(dot)com
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Markdown format output for psql, design notes
Date: 2018-11-29 07:26:49
Message-ID: CAB_COdhj98eZXh8cBxJmmsErXho4L0FiBpGx14T8tHLaCEzA6A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
> 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".
>
>
I understand your concern. It's a pretty good point.

> 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.
>

Well, pandoc doesn't handle line breaks for Markdown Extra.

~~~
psql -qHc "values (E'hello world', 42), ('single line', 5), ('another',
null)" log | pandoc -f html -t markdown_phpextra
| column1 | column2 |
|-------------|---------|
| hello world | 42 |
| single line | 5 |
| another | |
~~~
But with a `\n`, the output is simply html without transformation (even
with option --wrap=none)...

# What stays in my mind

* It's pretty difficult to handle line breaks
* Markdown is not standardised and several flavours exist for table
implementation (so why favor one over the others?)

# The question I'd like to ask you
So now, I think we need to ask that fundamental question :

***Is it worth it ?***

Cheers,

Lætitia
--
*Think! Do you really need to print this email ? *
*There is no Planet B.*

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-11-29 07:27:19 Add pg_partition_tree to doc index
Previous Message Michael Paquier 2018-11-29 07:20:24 Re: Fixes for missing schema qualifications