Re: Markdown format output for psql, design notes

Поиск
Список
Период
Сортировка
От Lætitia Avrot
Тема Re: Markdown format output for psql, design notes
Дата
Msg-id CAB_COdhj98eZXh8cBxJmmsErXho4L0FiBpGx14T8tHLaCEzA6A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Markdown format output for psql, design notes  (Vik Fearing <vik.fearing@2ndquadrant.com>)
Ответы Re: Markdown format output for psql, design notes  (Vik Fearing <vik.fearing@2ndquadrant.com>)
Список 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.

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Fixes for missing schema qualifications
Следующее
От: Michael Paquier
Дата:
Сообщение: Add pg_partition_tree to doc index