public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Is it possible to extend pandoc table model to support colspans and rowspans?
@ 2015-01-26  9:17 zozlak
       [not found] ` <9a58c476-9917-4dfc-b4d5-ced95433e88c-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: zozlak @ 2015-01-26  9:17 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


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

Most of formats supported by Pandoc supports table cells spanning across 
multiple columns and/or rows but unfortunately Pandoc table model does not.
Is there any possibility to include support for that in Pandoc?

For me the most demanding is to add support for any markdown input format 
(for example as another one optional markdown extension) and HTML/HTML5 and 
PDF output formats.

-- 
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/9a58c476-9917-4dfc-b4d5-ced95433e88c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: Is it possible to extend pandoc table model to support colspans and rowspans?
       [not found] ` <9a58c476-9917-4dfc-b4d5-ced95433e88c-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2015-01-27 16:11   ` John MacFarlane
       [not found]     ` <20150127161139.GF91984-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: John MacFarlane @ 2015-01-27 16:11 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

+++ zozlak [Jan 26 15 01:17 ]:
>Most of formats supported by Pandoc supports table cells spanning across
>multiple columns and/or rows but unfortunately Pandoc table model does not.
>Is there any possibility to include support for that in Pandoc?
>
>For me the most demanding is to add support for any markdown input format
>(for example as another one optional markdown extension) and HTML/HTML5 and
>PDF output formats.

Figuring out how to do row/colspans in Markdown is the hard part.


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

* Re: Is it possible to extend pandoc table model to support colspans and rowspans?
       [not found]     ` <20150127161139.GF91984-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
@ 2015-01-27 16:25       ` Matthew Pickering
       [not found]         ` <CALuQ0m8ZAHuoRD1BgHa0iV45j78MTk+D5mD7CYtvPEFj6vgz9w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2015-01-27 16:26       ` Shahbaz Youssefi
  2015-02-17 16:46       ` russurquhart1
  2 siblings, 1 reply; 8+ messages in thread
From: Matthew Pickering @ 2015-01-27 16:25 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Is there not an argument for creating a richer document model so that
information is only thrown away when rendering? A simpler interface
can be provided by abstraction.

On Tue, Jan 27, 2015 at 4:11 PM, John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> wrote:
> +++ zozlak [Jan 26 15 01:17 ]:
>>
>> Most of formats supported by Pandoc supports table cells spanning across
>> multiple columns and/or rows but unfortunately Pandoc table model does
>> not.
>> Is there any possibility to include support for that in Pandoc?
>>
>> For me the most demanding is to add support for any markdown input format
>> (for example as another one optional markdown extension) and HTML/HTML5
>> and
>> PDF output formats.
>
>
> Figuring out how to do row/colspans in Markdown is the hard part.
>
> --
> 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/20150127161139.GF91984%40localhost.hsd1.ca.comcast.net.
>
> For more options, visit https://groups.google.com/d/optout.


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

* Re: Is it possible to extend pandoc table model to support colspans and rowspans?
       [not found]     ` <20150127161139.GF91984-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
  2015-01-27 16:25       ` Matthew Pickering
@ 2015-01-27 16:26       ` Shahbaz Youssefi
  2015-02-17 16:46       ` russurquhart1
  2 siblings, 0 replies; 8+ messages in thread
From: Shahbaz Youssefi @ 2015-01-27 16:26 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

Before I came to know pandoc and its table extensions, I had an idea for
generic tables in markdown which would support row/colspan as well as
column widths etc. I liked the simplicity of pandoc tables (mostly
regarding typing them), so I never brought it up here.

Anyway, here's how I had imagined the markdown tables:

- Each horizontal table line is a line consisting of `-`
- Each vertical table line is a line consisting of `|`
- Each top or non-vertically-terminating cross-point is a `+`
- Each vertically terminating cross-point is a `*`

Here are a few examples:

  +----------+--------+
  |   very   | simple |
  +----------*--------+
  |       table       |
  *-------------------*

  +--------+-------------+
  | a bit  |   more      |
  |        +-------------+
  +--------+ complicated |
  | than   |             |
  +--------+-------------+
  |  the   |   other     |
  *--------*-------------*

  +--------+------------+---------------+
  |   A    |   _more_   |               |
  +--------*            |   `general`   |
  |              +------+               |
  |              |      |               |
  +----+---------+      +--------+------+
  |    |  form   |      |        |      |
  +----*---------*------+--------*------+
  |                     |               |
  *---------------------*---------------*

  +---------------------------+
  |                           |
  |   +--------+---------+    |
  |   | table  | within  |    |
  |   +--------*---------+    |
  |   |  another table   |    |
  |   *------------------*    |
  |                           |
  *---------------------------*

Inside the tables, you recursively have Markdown text, with all its
features. So basically the parser for the table would keep the text inside
each cell separately (with its own leading whitespaces) and recursively
parse them as if they were standalone texts. Given the layout of the table,
the code generator would know how to manage `colspan`, `rowspan` etc.

Would it be hell parsing this? I had thought about it at the time and I
believe not. The `+` and `*` marks are essential for keeping track of where
`|` is expected on the next line, dividing cells. So the parser would
generally go over the first line, remember the `+` positions, and go
through each subsequent line and divide up the text in different blocks
(unparsed). It would continue like this and add or remove blocks as it sees
`-----`s, `+`s and `*`s.  Once the table is completely read, as I already
said. it recursively parses each cell as if it was a markdown text on its
own.


On Tue, Jan 27, 2015 at 5:11 PM, John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> wrote:

> +++ zozlak [Jan 26 15 01:17 ]:
>
>> Most of formats supported by Pandoc supports table cells spanning across
>> multiple columns and/or rows but unfortunately Pandoc table model does
>> not.
>> Is there any possibility to include support for that in Pandoc?
>>
>> For me the most demanding is to add support for any markdown input format
>> (for example as another one optional markdown extension) and HTML/HTML5
>> and
>> PDF output formats.
>>
>
> Figuring out how to do row/colspans in Markdown is the hard part.
>
> --
> 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/20150127161139.GF91984%40localhost.hsd1.ca.comcast.
> net.
>
> 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/CALeOzZ85qaZJnGsgRFN5ar6-3CpXTtpqma7qC_ojJAwoR2ptig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: Is it possible to extend pandoc table model to support colspans and rowspans?
       [not found]         ` <CALuQ0m8ZAHuoRD1BgHa0iV45j78MTk+D5mD7CYtvPEFj6vgz9w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-01-27 18:06           ` John MacFarlane
       [not found]             ` <20150127180658.GA5844-nFAEphtLEs/fysO+viCLMa55KtNWUUjk@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: John MacFarlane @ 2015-01-27 18:06 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Sure, I think it would make sense to have a richer model for
tables.  Though there's a question how you would render a
table with a col/rowspan in a format that does not support
them.

+++ Matthew Pickering [Jan 27 15 16:25 ]:
>Is there not an argument for creating a richer document model so that
>information is only thrown away when rendering? A simpler interface
>can be provided by abstraction.
>
>On Tue, Jan 27, 2015 at 4:11 PM, John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> wrote:
>> +++ zozlak [Jan 26 15 01:17 ]:
>>>
>>> Most of formats supported by Pandoc supports table cells spanning across
>>> multiple columns and/or rows but unfortunately Pandoc table model does
>>> not.
>>> Is there any possibility to include support for that in Pandoc?
>>>
>>> For me the most demanding is to add support for any markdown input format
>>> (for example as another one optional markdown extension) and HTML/HTML5
>>> and
>>> PDF output formats.
>>
>>
>> Figuring out how to do row/colspans in Markdown is the hard part.
>>
>> --
>> 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/20150127161139.GF91984%40localhost.hsd1.ca.comcast.net.
>>
>> 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/CALuQ0m8ZAHuoRD1BgHa0iV45j78MTk%2BD5mD7CYtvPEFj6vgz9w%40mail.gmail.com.
>For more options, visit https://groups.google.com/d/optout.


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

* Re: Is it possible to extend pandoc table model to support colspans and rowspans?
       [not found]             ` <20150127180658.GA5844-nFAEphtLEs/fysO+viCLMa55KtNWUUjk@public.gmane.org>
@ 2015-02-17 14:40               ` zozlak .
  0 siblings, 0 replies; 8+ messages in thread
From: zozlak . @ 2015-02-17 14:40 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

> Though there's a question how you would render a
> table with a col/rowspan in a format that does not support
> them.

1st alternative - In the same way it is done now when the input has a table
with col/rowspans ("table grid" is skipped and the content of each cell is
simply rendered as a new line in the output)
+ simple implementation
- output is not even similar to the input table

2nd alternative - Generate "missing cells" with no content.
+ output is similar to the input
+ implementation should not be very complicated (especially comparing to
time needed to implement a new internal table model and input parsers)
- in many cases output formatting can be ugly (especially if col/rowspans
cells contained a lot of text); anyway this would be "the best, what can be
achieved"

2015-01-27 19:06 GMT+01:00 John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>:

> Sure, I think it would make sense to have a richer model for
> tables.  Though there's a question how you would render a
> table with a col/rowspan in a format that does not support
> them.
>
> +++ Matthew Pickering [Jan 27 15 16:25 ]:
>
>> Is there not an argument for creating a richer document model so that
>> information is only thrown away when rendering? A simpler interface
>> can be provided by abstraction.
>>
>> On Tue, Jan 27, 2015 at 4:11 PM, John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
>> wrote:
>>
>>> +++ zozlak [Jan 26 15 01:17 ]:
>>>
>>>>
>>>> Most of formats supported by Pandoc supports table cells spanning across
>>>> multiple columns and/or rows but unfortunately Pandoc table model does
>>>> not.
>>>> Is there any possibility to include support for that in Pandoc?
>>>>
>>>> For me the most demanding is to add support for any markdown input
>>>> format
>>>> (for example as another one optional markdown extension) and HTML/HTML5
>>>> and
>>>> PDF output formats.
>>>>
>>>
>>>
>>> Figuring out how to do row/colspans in Markdown is the hard part.
>>>
>>> --
>>> 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/20150127161139.GF91984%
>>> 40localhost.hsd1.ca.comcast.net.
>>>
>>> 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/CALuQ0m8ZAHuoRD1BgHa0iV45j78MT
>> k%2BD5mD7CYtvPEFj6vgz9w%40mail.gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "pandoc-discuss" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/pandoc-discuss/aibux0lO8yM/unsubscribe.
> To unsubscribe from this group and all its topics, 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/20150127180658.GA5844%40protagoras.berkeley.edu.
>
> 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/CAP%3D39gjssY5otH0PHSOXQonifApuu8KQGemPQQmr7AGaCMLokQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: Is it possible to extend pandoc table model to support colspans and rowspans?
       [not found]     ` <20150127161139.GF91984-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
  2015-01-27 16:25       ` Matthew Pickering
  2015-01-27 16:26       ` Shahbaz Youssefi
@ 2015-02-17 16:46       ` russurquhart1
       [not found]         ` <8e83416f-f9c3-4fe3-a6cf-d6983f83a442-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2 siblings, 1 reply; 8+ messages in thread
From: russurquhart1 @ 2015-02-17 16:46 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


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


Hi,

This may not be germaine, but we use a LOT of tables having cells that span 
rows and columns. I too have wondered about how to markup text for such a 
table.

the best thing i have seen so far, is the ASCIIDoc markup for such tables. 

http://www.methods.co.nz/asciidoc/userguide.html#_example_tables

(See example 10 at this location.)

Once you understand what is going on here, it seems pretty parseable, and 
using AsciiDocfx, it previews the table also and generates accurate DocBook 
xml for the tables.

fwiw,


Russ
On Tuesday, January 27, 2015 at 10:11:54 AM UTC-6, John MacFarlane wrote:
>
>
>
> Figuring out how to do row/colspans in Markdown is the hard part. 
>
>

-- 
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/8e83416f-f9c3-4fe3-a6cf-d6983f83a442%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: Is it possible to extend pandoc table model to support colspans and rowspans?
       [not found]         ` <8e83416f-f9c3-4fe3-a6cf-d6983f83a442-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2015-02-17 16:57           ` John MacFarlane
  0 siblings, 0 replies; 8+ messages in thread
From: John MacFarlane @ 2015-02-17 16:57 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Unfortunately the asciidoc format violates a key principle of
Markdown, that the source should be readable as is.  Example from
asciidoc user's guide:

```
[cols="e,m,^,>s",width="25%"]
|============================
|1 >s|2 |3 |4
^|5 2.2+^.^|6 .3+<.>m|7
^|8
|9 2+>|10
|============================
```


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

end of thread, other threads:[~2015-02-17 16:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-26  9:17 Is it possible to extend pandoc table model to support colspans and rowspans? zozlak
     [not found] ` <9a58c476-9917-4dfc-b4d5-ced95433e88c-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-01-27 16:11   ` John MacFarlane
     [not found]     ` <20150127161139.GF91984-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
2015-01-27 16:25       ` Matthew Pickering
     [not found]         ` <CALuQ0m8ZAHuoRD1BgHa0iV45j78MTk+D5mD7CYtvPEFj6vgz9w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-27 18:06           ` John MacFarlane
     [not found]             ` <20150127180658.GA5844-nFAEphtLEs/fysO+viCLMa55KtNWUUjk@public.gmane.org>
2015-02-17 14:40               ` zozlak .
2015-01-27 16:26       ` Shahbaz Youssefi
2015-02-17 16:46       ` russurquhart1
     [not found]         ` <8e83416f-f9c3-4fe3-a6cf-d6983f83a442-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-02-17 16:57           ` John MacFarlane

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