public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Using all the features of tables in pandoc
@ 2016-10-24  5:01 Kolen Cheung
       [not found] ` <8537aab1-b977-4d4f-b487-bcdf2b0e9874-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 13+ messages in thread
From: Kolen Cheung @ 2016-10-24  5:01 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1942 bytes --]



Hi,

I’m in the process of finding *the* way to use tables in pandoc. So I made 
the following table:
pandoc table type multiline block column alignments Omitting header Column 
Width Notes 
simple_tables 0 0 1 1 0 
multiline_tables 1 0 1 1 1 
grid_tables 1 1 0 1 1 
pipe_tables 0 0 1 0 0.5 column width: only when printable content is wider 
than the column width 

The columns are the different features supported by different kind of 
pandoc tables. First, is it accurate and did I miss anything?

Second, if so, it seems that there’s no single table format supporting all 
of pandoc’s internal table feature. Other than writing in pandoc’s AST 
(which probably still requires a filter to embed that in a markdown 
source), how should one use all the features? I’m thinking if 
mb21/pandoc-placetable <https://github.com/mb21/pandoc-placetable> or 
baig/pandoc-csv2table <https://github.com/baig/pandoc-csv2table> might do 
that, but I can’t install it for the moment (I asked in a separate thread 
about that).

And to make the situation more complicated, I actually want to disable 
“column width” feature. I want the width to be figured somewhere else. Will 
it be possible to add more granular control those “extensions of table 
extensions”? *e.g.* multiline_tables-column_width.

Thanks,
Kolen
​

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/8537aab1-b977-4d4f-b487-bcdf2b0e9874%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 11710 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Using all the features of tables in pandoc
       [not found] ` <8537aab1-b977-4d4f-b487-bcdf2b0e9874-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2016-10-24 15:54   ` John MacFarlane
  2016-10-25 11:20   ` 'Jakob Voss' via pandoc-discuss
  2016-11-10 14:38   ` Kolen Cheung
  2 siblings, 0 replies; 13+ messages in thread
From: John MacFarlane @ 2016-10-24 15:54 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

If you don't want pipe tables to get relative column widths,
you can always set --columns to a very high value.

This will mess things up if you ALSO have other tables
where you do care about column widths.  But if you never
care about column widths for any of your tables, this should
be safe.

ALternatively you could write a filter that sets all
column widths in tables to 0 (that is code for a "simple
table").

+++ Kolen Cheung [Oct 23 16 22:01 ]:
>   Hi,
>
>   I’m in the process of finding the way to use tables in pandoc. So I
>   made the following table:
>   pandoc table type multiline block column alignments Omitting header
>   Column Width Notes
>   simple_tables 0 0 1 1 0
>   multiline_tables 1 0 1 1 1
>   grid_tables 1 1 0 1 1
>   pipe_tables 0 0 1 0 0.5 column width: only when printable content is
>   wider than the column width
>
>   The columns are the different features supported by different kind of
>   pandoc tables. First, is it accurate and did I miss anything?
>
>   Second, if so, it seems that there’s no single table format supporting
>   all of pandoc’s internal table feature. Other than writing in pandoc’s
>   AST (which probably still requires a filter to embed that in a markdown
>   source), how should one use all the features? I’m thinking if
>   [1]mb21/pandoc-placetable or [2]baig/pandoc-csv2table might do that,
>   but I can’t install it for the moment (I asked in a separate thread
>   about that).
>
>   And to make the situation more complicated, I actually want to disable
>   “column width” feature. I want the width to be figured somewhere else.
>   Will it be possible to add more granular control those “extensions of
>   table extensions”? e.g. multiline_tables-column_width.
>
>   Thanks,
>   Kolen
>   ​
>
>   --
>   You received this message because you are subscribed to the Google
>   Groups "pandoc-discuss" group.
>   To unsubscribe from this group and stop receiving emails from it, send
>   an email to [3]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>   To post to this group, send email to
>   [4]pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>   To view this discussion on the web visit
>   [5]https://groups.google.com/d/msgid/pandoc-discuss/8537aab1-b977-4d4f-
>   b487-bcdf2b0e9874%40googlegroups.com.
>   For more options, visit [6]https://groups.google.com/d/optout.
>
>References
>
>   1. https://github.com/mb21/pandoc-placetable
>   2. https://github.com/baig/pandoc-csv2table
>   3. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   4. mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   5. https://groups.google.com/d/msgid/pandoc-discuss/8537aab1-b977-4d4f-b487-bcdf2b0e9874-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=email&utm_source=footer
>   6. https://groups.google.com/d/optout

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/20161024155417.GB96178%40MacBook-Air-2.home.
For more options, visit https://groups.google.com/d/optout.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Using all the features of tables in pandoc
       [not found] ` <8537aab1-b977-4d4f-b487-bcdf2b0e9874-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2016-10-24 15:54   ` John MacFarlane
@ 2016-10-25 11:20   ` 'Jakob Voss' via pandoc-discuss
       [not found]     ` <54d7e055-aa95-4c4f-99d1-4aaf0efb9055-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2016-11-10 14:38   ` Kolen Cheung
  2 siblings, 1 reply; 13+ messages in thread
From: 'Jakob Voss' via pandoc-discuss @ 2016-10-25 11:20 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1116 bytes --]

Hi Kolen,
 

> First, is it accurate and did I miss anything?
>
Table captions. Since tables don't have attributes (unfortunately) table 
captions are the only place to embed additional information to later 
trigger filtering. An empty span element can be used for this purpose


+----+
| Hi |
+----+

: <span class="simple-table"/> Actual caption, if any

A filter could look for the empty span at first element of a caption and 
set column-with to zero if class "simple-table" is set (just an example) 
and remove the span afterwards.

Jakob

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/54d7e055-aa95-4c4f-99d1-4aaf0efb9055%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 2222 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Using all the features of tables in pandoc
       [not found]     ` <54d7e055-aa95-4c4f-99d1-4aaf0efb9055-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2016-10-29 17:10       ` Kolen Cheung
  0 siblings, 0 replies; 13+ messages in thread
From: Kolen Cheung @ 2016-10-29 17:10 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1251 bytes --]

Another neat trick, thanks!

On Tuesday, October 25, 2016 at 4:20:25 AM UTC-7, Jakob Voss wrote:
>
> Hi Kolen,
>  
>
>> First, is it accurate and did I miss anything?
>>
> Table captions. Since tables don't have attributes (unfortunately) table 
> captions are the only place to embed additional information to later 
> trigger filtering. An empty span element can be used for this purpose
>
>
> +----+
> | Hi |
> +----+
>
> : <span class="simple-table"/> Actual caption, if any
>
> A filter could look for the empty span at first element of a caption and 
> set column-with to zero if class "simple-table" is set (just an example) 
> and remove the span afterwards.
>
> Jakob
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/a339d669-af43-41cd-ba56-b3ff059029ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 2469 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Using all the features of tables in pandoc
       [not found] ` <8537aab1-b977-4d4f-b487-bcdf2b0e9874-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2016-10-24 15:54   ` John MacFarlane
  2016-10-25 11:20   ` 'Jakob Voss' via pandoc-discuss
@ 2016-11-10 14:38   ` Kolen Cheung
       [not found]     ` <0c92d36b-7fbe-4ab4-8a35-f090b7299bea-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2 siblings, 1 reply; 13+ messages in thread
From: Kolen Cheung @ 2016-11-10 14:38 UTC (permalink / raw)
  To: pandoc-discuss

[-- Attachment #1: Type: text/plain, Size: 1130 bytes --]

The orginal motivation of this thread is about seeking a table syntax that support all the features in the AST (where gird table is the most feature-rich one, but lack the support of alignment).

So to put it in other words, is it possible to extend the grid table syntax that borrows the alignment from pip tables? This way, all features supported by the AST has a markdown representation. (And say when the internal AST extends to include span, the gird table can easily be extended, and will still be able to represent everything the AST does).

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/0c92d36b-7fbe-4ab4-8a35-f090b7299bea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Using all the features of tables in pandoc
       [not found]     ` <0c92d36b-7fbe-4ab4-8a35-f090b7299bea-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2016-11-10 16:04       ` John MacFarlane
       [not found]         ` <20161110160402.GA9303-BKjuZOBx5Kn2N3qrpRCZGbhGAdq7xJNKhPhL2mjWHbk@public.gmane.org>
  0 siblings, 1 reply; 13+ messages in thread
From: John MacFarlane @ 2016-11-10 16:04 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

I think it's a good idea.  So, for example,

    +------------+------------+-----------+
    | Header 1   | Header 2   | Header 3  |
    +:==========:+===========:+===========+
    | centered   | right      | default   |
    +------------+------------+-----------+

All current grid tables would still work.

Does anyone see any problems with this?

+++ Kolen Cheung [Nov 10 16 06:38 ]:
>So to put it in other words, is it possible to extend the grid table syntax that borrows the alignment from pip tables? This way, all features supported by the AST has a markdown representation. (And say when the internal AST extends to include span, the gird table can easily be extended, and will still be able to represent everything the AST does).
>
>-- 
>You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
>To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/0c92d36b-7fbe-4ab4-8a35-f090b7299bea%40googlegroups.com.
>For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/20161110160402.GA9303%40Administrateurs-iMac-3.local.
For more options, visit https://groups.google.com/d/optout.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Using all the features of tables in pandoc
       [not found]         ` <20161110160402.GA9303-BKjuZOBx5Kn2N3qrpRCZGbhGAdq7xJNKhPhL2mjWHbk@public.gmane.org>
@ 2016-11-10 19:51           ` BP Jonsson
       [not found]             ` <CAFC_yuTgx4mjWBsC+CycEZPmkZi0ZCh-sXS2Gnf0bSNvKXxKBA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2016-11-12  1:18           ` Kolen Cheung
  1 sibling, 1 reply; 13+ messages in thread
From: BP Jonsson @ 2016-11-10 19:51 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 3232 bytes --]

On a related note: is there some combination of extension settings which
one can use to get the markdown writer to output only or prefer grid,
multiline or pipe tables? I dimly remember having asked this before but
can't recall the answer.

I'm thinking maybe an option `--tables=STRING` where a value `pipe` would
cause all tables which can be rendered as pipe tables to be so rendered,
and similar for `multi` and `grid`, while a value like `pipe,grid` would
cause all tables which can't be rendered as pipe tables to be rendered as
grid tables, and similar for `simple,grid`.

Den 10 nov 2016 17:04 skrev "John MacFarlane" <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>:

> I think it's a good idea.  So, for example,
>
>    +------------+------------+-----------+
>    | Header 1   | Header 2   | Header 3  |
>    +:==========:+===========:+===========+
>    | centered   | right      | default   |
>    +------------+------------+-----------+
>
> All current grid tables would still work.
>
> Does anyone see any problems with this?
>
> +++ Kolen Cheung [Nov 10 16 06:38 ]:
>
>> So to put it in other words, is it possible to extend the grid table
>> syntax that borrows the alignment from pip tables? This way, all features
>> supported by the AST has a markdown representation. (And say when the
>> internal AST extends to include span, the gird table can easily be
>> extended, and will still be able to represent everything the AST does).
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "pandoc-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>> To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/pandoc-discuss/0c92d36b-7fbe-4ab4-8a35-f090b7299bea%40go
>> oglegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit https://groups.google.com/d/ms
> gid/pandoc-discuss/20161110160402.GA9303%40Administrateurs-iMac-3.local.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAFC_yuTgx4mjWBsC%2BCycEZPmkZi0ZCh-sXS2Gnf0bSNvKXxKBA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #2: Type: text/html, Size: 4961 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Using all the features of tables in pandoc
       [not found]             ` <CAFC_yuTgx4mjWBsC+CycEZPmkZi0ZCh-sXS2Gnf0bSNvKXxKBA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2016-11-10 22:25               ` Kolen Cheung
  2016-11-11  1:19               ` Kolen Cheung
  1 sibling, 0 replies; 13+ messages in thread
From: Kolen Cheung @ 2016-11-10 22:25 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 3941 bytes --]



In a certain sense, yes, by switching off all other markdown extensions 
then add the one you want to force the markdown writer write.

The problem is the target table extension might not support the features 
needed in the source table, so it might backfires and gives you an HTML 
table instead.

I did some tests on this in pandoc-table-test/makefile at master · 
ickc/pandoc-table-test 
<https://github.com/ickc/pandoc-table-test/blob/master/makefile>.

On Thursday, November 10, 2016 at 11:51:26 AM UTC-8, BP Jonsson wrote:

On a related note: is there some combination of extension settings which 
> one can use to get the markdown writer to output only or prefer grid, 
> multiline or pipe tables? I dimly remember having asked this before but 
> can't recall the answer.
>
> I'm thinking maybe an option `--tables=STRING` where a value `pipe` would 
> cause all tables which can be rendered as pipe tables to be so rendered, 
> and similar for `multi` and `grid`, while a value like `pipe,grid` would 
> cause all tables which can't be rendered as pipe tables to be rendered as 
> grid tables, and similar for `simple,grid`.
>
> Den 10 nov 2016 17:04 skrev "John MacFarlane" <j...-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org 
> <javascript:>>:
>
>> I think it's a good idea.  So, for example,
>>
>>    +------------+------------+-----------+
>>    | Header 1   | Header 2   | Header 3  |
>>    +:==========:+===========:+===========+
>>    | centered   | right      | default   |
>>    +------------+------------+-----------+
>>
>> All current grid tables would still work.
>>
>> Does anyone see any problems with this?
>>
>> +++ Kolen Cheung [Nov 10 16 06:38 ]:
>>
>>> So to put it in other words, is it possible to extend the grid table 
>>> syntax that borrows the alignment from pip tables? This way, all features 
>>> supported by the AST has a markdown representation. (And say when the 
>>> internal AST extends to include span, the gird table can easily be 
>>> extended, and will still be able to represent everything the AST does).
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "pandoc-discuss" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>.
>>> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 
>>> <javascript:>.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/pandoc-discuss/0c92d36b-7fbe-4ab4-8a35-f090b7299bea%40googlegroups.com
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "pandoc-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>.
>> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/pandoc-discuss/20161110160402.GA9303%40Administrateurs-iMac-3.local
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> ​

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/7e1091bf-366d-464c-aa6e-d5d9c29d3bfe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 14343 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Using all the features of tables in pandoc
       [not found]             ` <CAFC_yuTgx4mjWBsC+CycEZPmkZi0ZCh-sXS2Gnf0bSNvKXxKBA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2016-11-10 22:25               ` Kolen Cheung
@ 2016-11-11  1:19               ` Kolen Cheung
  1 sibling, 0 replies; 13+ messages in thread
From: Kolen Cheung @ 2016-11-11  1:19 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 3652 bytes --]



I put an example on Pandoc Tricks · jgm/pandoc Wiki 
<https://github.com/jgm/pandoc/wiki/Pandoc-Tricks>. I encourage you to 
expand that page with useful tricks you know too.

On Thursday, November 10, 2016 at 11:51:26 AM UTC-8, BP Jonsson wrote:

On a related note: is there some combination of extension settings which 
> one can use to get the markdown writer to output only or prefer grid, 
> multiline or pipe tables? I dimly remember having asked this before but 
> can't recall the answer.
>
> I'm thinking maybe an option `--tables=STRING` where a value `pipe` would 
> cause all tables which can be rendered as pipe tables to be so rendered, 
> and similar for `multi` and `grid`, while a value like `pipe,grid` would 
> cause all tables which can't be rendered as pipe tables to be rendered as 
> grid tables, and similar for `simple,grid`.
>
> Den 10 nov 2016 17:04 skrev "John MacFarlane" <j...-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org 
> <javascript:>>:
>
>> I think it's a good idea.  So, for example,
>>
>>    +------------+------------+-----------+
>>    | Header 1   | Header 2   | Header 3  |
>>    +:==========:+===========:+===========+
>>    | centered   | right      | default   |
>>    +------------+------------+-----------+
>>
>> All current grid tables would still work.
>>
>> Does anyone see any problems with this?
>>
>> +++ Kolen Cheung [Nov 10 16 06:38 ]:
>>
>>> So to put it in other words, is it possible to extend the grid table 
>>> syntax that borrows the alignment from pip tables? This way, all features 
>>> supported by the AST has a markdown representation. (And say when the 
>>> internal AST extends to include span, the gird table can easily be 
>>> extended, and will still be able to represent everything the AST does).
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "pandoc-discuss" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>.
>>> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 
>>> <javascript:>.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/pandoc-discuss/0c92d36b-7fbe-4ab4-8a35-f090b7299bea%40googlegroups.com
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "pandoc-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>.
>> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/pandoc-discuss/20161110160402.GA9303%40Administrateurs-iMac-3.local
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> ​

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/0b7b1307-0e10-4b2b-a133-64c48407be35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 13743 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Using all the features of tables in pandoc
       [not found]         ` <20161110160402.GA9303-BKjuZOBx5Kn2N3qrpRCZGbhGAdq7xJNKhPhL2mjWHbk@public.gmane.org>
  2016-11-10 19:51           ` BP Jonsson
@ 2016-11-12  1:18           ` Kolen Cheung
       [not found]             ` <43534d02-2bd4-4c9f-9cf5-ea2506ddc56c-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  1 sibling, 1 reply; 13+ messages in thread
From: Kolen Cheung @ 2016-11-12  1:18 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 3063 bytes --]



I found that actually this idea has already been implemented in Syntax | 
kramdown <http://kramdown.gettalong.org/syntax.html#tables>:

|-----------------+------------+-----------------+----------------|
| Default aligned |Left aligned| Center aligned  | Right aligned  |
|-----------------|:-----------|:---------------:|---------------:|
| First body part |Second cell | Third cell      | fourth cell    |
| Second line     |foo         | **strong**      | baz            |
| Third line      |quux        | baz             | bar            |
|-----------------+------------+-----------------+----------------|
| Second body     |            |                 |                |
| 2 line          |            |                 |                |
|=================+============+=================+================|
| Footer row      |            |                 |                |
|-----------------+------------+-----------------+----------------|

On Thursday, November 10, 2016 at 8:04:40 AM UTC-8, John MacFarlane wrote:

I think it's a good idea.  So, for example, 
>
>     +------------+------------+-----------+ 
>     | Header 1   | Header 2   | Header 3  | 
>     +:==========:+===========:+===========+ 
>     | centered   | right      | default   | 
>     +------------+------------+-----------+ 
>
> All current grid tables would still work. 
>
> Does anyone see any problems with this? 
>
> +++ Kolen Cheung [Nov 10 16 06:38 ]: 
> >So to put it in other words, is it possible to extend the grid table 
> syntax that borrows the alignment from pip tables? This way, all features 
> supported by the AST has a markdown representation. (And say when the 
> internal AST extends to include span, the gird table can easily be 
> extended, and will still be able to represent everything the AST does). 
> > 
> >-- 
> >You received this message because you are subscribed to the Google Groups 
> "pandoc-discuss" group. 
> >To unsubscribe from this group and stop receiving emails from it, send an 
> email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>. 
> >To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 
> <javascript:>. 
> >To view this discussion on the web visit 
> https://groups.google.com/d/msgid/pandoc-discuss/0c92d36b-7fbe-4ab4-8a35-f090b7299bea%40googlegroups.com. 
>
> >For more options, visit https://groups.google.com/d/optout. 
>
> ​

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/43534d02-2bd4-4c9f-9cf5-ea2506ddc56c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 12118 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Using all the features of tables in pandoc
       [not found]             ` <43534d02-2bd4-4c9f-9cf5-ea2506ddc56c-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2016-11-15 15:59               ` John MacFarlane
       [not found]                 ` <20161115155902.GA12051-BKjuZOBx5Kn2N3qrpRCZGbhGAdq7xJNKhPhL2mjWHbk@public.gmane.org>
  0 siblings, 1 reply; 13+ messages in thread
From: John MacFarlane @ 2016-11-15 15:59 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

I've implemented this feature in the dev version.

>   On Thursday, November 10, 2016 at 8:04:40 AM UTC-8, John MacFarlane
>   wrote:
>
>     I think it's a good idea.  So, for example,
>         +------------+------------+-----------+
>         | Header 1   | Header 2   | Header 3  |
>         +:==========:+===========:+===========+
>         | centered   | right      | default   |
>         +------------+------------+-----------+
>     All current grid tables would still work.
>     Does anyone see any problems with this?


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Using all the features of tables in pandoc
       [not found]                 ` <20161115155902.GA12051-BKjuZOBx5Kn2N3qrpRCZGbhGAdq7xJNKhPhL2mjWHbk@public.gmane.org>
@ 2016-11-16  3:22                   ` Kolen Cheung
  2016-11-21  1:27                   ` Kolen Cheung
  1 sibling, 0 replies; 13+ messages in thread
From: Kolen Cheung @ 2016-11-16  3:22 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 2920 bytes --]



On Tuesday, November 15, 2016 at 7:59:38 AM UTC-8, John MacFarlane wrote: 
I’ve implemented this feature in the dev version. 

Great news. I am compiling and trying it.

I’m experimenting with the idea of merging pipe_tables and grid_tables 
syntaxes such that both will be valid under this “bigger class”, while 
allowing new possibilities. Part of it is inspired from kramdown’s table 
syntax in Syntax | kramdown 
<http://kramdown.gettalong.org/syntax.html#tables>, that they only have 1 
table syntax, but pipe tables and grid tables (with no block 
element/multiline) in the pandoc sense are both valid under the same syntax.

So I come up with the following rules to combine them:

   1. the column-separator within row-separator can be either | or +. (this 
   one is already partially supported in pandoc when they are not 
   opening/closing) 
   2. opening and closing row-separator is optional 
   3. header-separator line is specified either be (alignment-separator can 
   be allowed)
      1. a row of =, or 
      2. a row of - with at least 1 alignment-separator : (because only 
      when alignment-separator make sense in header-separator), or 
      3. the only row of - in the given table. 
   4. if there’s no row-separator besides the header-separator, then the 
   rows are assumed to be single-line. 

<#>Illustrations 

All the followings has 1 header row and 2 other rows:
<#>Grid Tables: rule 1, 2, 3,1 

+-----+-------+
| One | Two   |
+=====+=======+
| my  | table |
+-----+-------+
| is  | nice  |  
+-----+-------+

<#>Pipe Tables: Rule 1, 2, 3.3, 4 

| One | Two   |
|-----|-------|
| my  | table |
| is  | nice  |

<#>Crossover Tables: <#>Rule 1, 2, 3.1, 4 

| One | Two   |
|=====+=======|
| my  | table |
| is  | nice  |

<#>Rule 1, 2, 3.2 

|-----|-------|
| One | Two   |
|-----|:-----:|
| my  | table |
|-----|-------|
| is  | nice  |  
|-----|-------|

One important feature I didn’t touch above is pipe_tables allows the 
column-separators to be not aligning to the others in terms of no. of 
characters (either because of tab character or laziness). I’m not sure if 
it will break anything in such a general syntax. But it will be great if it 
is possible, such that one can also write lazy grid_tables.
​

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/6b04b5c3-9711-455c-9df0-9ba5fe5b9161%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 21962 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Using all the features of tables in pandoc
       [not found]                 ` <20161115155902.GA12051-BKjuZOBx5Kn2N3qrpRCZGbhGAdq7xJNKhPhL2mjWHbk@public.gmane.org>
  2016-11-16  3:22                   ` Kolen Cheung
@ 2016-11-21  1:27                   ` Kolen Cheung
  1 sibling, 0 replies; 13+ messages in thread
From: Kolen Cheung @ 2016-11-21  1:27 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1355 bytes --]

I tried the new feature, it's nice, thanks! (and it works with my filter 
automatically, a great advantage of pandoc's filter system.)

On Tuesday, November 15, 2016 at 7:59:38 AM UTC-8, John MacFarlane wrote:
>
> I've implemented this feature in the dev version. 
>
> >   On Thursday, November 10, 2016 at 8:04:40 AM UTC-8, John MacFarlane 
> >   wrote: 
> > 
> >     I think it's a good idea.  So, for example, 
> >         +------------+------------+-----------+ 
> >         | Header 1   | Header 2   | Header 3  | 
> >         +:==========:+===========:+===========+ 
> >         | centered   | right      | default   | 
> >         +------------+------------+-----------+ 
> >     All current grid tables would still work. 
> >     Does anyone see any problems with this? 
>
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/302d24d9-b22d-4460-b3bb-921b51da1097%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 2030 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-11-21  1:27 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-24  5:01 Using all the features of tables in pandoc Kolen Cheung
     [not found] ` <8537aab1-b977-4d4f-b487-bcdf2b0e9874-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-10-24 15:54   ` John MacFarlane
2016-10-25 11:20   ` 'Jakob Voss' via pandoc-discuss
     [not found]     ` <54d7e055-aa95-4c4f-99d1-4aaf0efb9055-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-10-29 17:10       ` Kolen Cheung
2016-11-10 14:38   ` Kolen Cheung
     [not found]     ` <0c92d36b-7fbe-4ab4-8a35-f090b7299bea-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-11-10 16:04       ` John MacFarlane
     [not found]         ` <20161110160402.GA9303-BKjuZOBx5Kn2N3qrpRCZGbhGAdq7xJNKhPhL2mjWHbk@public.gmane.org>
2016-11-10 19:51           ` BP Jonsson
     [not found]             ` <CAFC_yuTgx4mjWBsC+CycEZPmkZi0ZCh-sXS2Gnf0bSNvKXxKBA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-11-10 22:25               ` Kolen Cheung
2016-11-11  1:19               ` Kolen Cheung
2016-11-12  1:18           ` Kolen Cheung
     [not found]             ` <43534d02-2bd4-4c9f-9cf5-ea2506ddc56c-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-11-15 15:59               ` John MacFarlane
     [not found]                 ` <20161115155902.GA12051-BKjuZOBx5Kn2N3qrpRCZGbhGAdq7xJNKhPhL2mjWHbk@public.gmane.org>
2016-11-16  3:22                   ` Kolen Cheung
2016-11-21  1:27                   ` Kolen Cheung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).