Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RST writer does not produce grid tables any more #5393

Open
rpuntaie opened this issue Mar 25, 2019 · 12 comments
Open

RST writer does not produce grid tables any more #5393

rpuntaie opened this issue Mar 25, 2019 · 12 comments

Comments

@rpuntaie
Copy link

pandoc 2.7.1

#4750 seems to have changed to simple RST tables by default.

I suggest to retain the original default behavior to produce grid tables
and implement #4750 via extension: pandoc foo.org -t rst+simple_tables -o foo.rst.

@jgm
Copy link
Owner

jgm commented Mar 25, 2019

Simple tables aren't really a syntax extension in RST. RST has a clearly defined syntax, and simple tables are always valid. So I don't think using an extension is the right approach here.

What is wrong with using simple tables when possible?

@rpuntaie
Copy link
Author

Yes. But simple tables are no good, if you have a block of text in a cell. Then it becomes unpredictable whether simple table or grid table is generated. Better always generate grid tables.

From the user's perspective, extension is a mechanism to tell Pandoc what the user wants.

An automatic decision to use simple or grid table is OK, if a +grid_tables forces grid tables, or a +simple_tables forces simple tables, or a +list_tables forces list tables. This would also allow to use Pandoc to convert table styles.

@jgm
Copy link
Owner

jgm commented Mar 26, 2019 via email

@jgm
Copy link
Owner

jgm commented Mar 27, 2019

Then it becomes unpredictable whether simple table or grid table is generated.

It is predictable, actually. A simple table is used when the cell widths are all 0s in the internal representation of the table. The markdown reader generates tables like this for simple tables and narrow-enough pipe tables.

@rpuntaie
Copy link
Author

Different users will have different needs. That is OK. Ideally SW should be widely usable. In this case I think it is possible to make it versatile enough to satisfy more needs. It is not yet so. I was talking about a way it could be done, not about how things work now.

It's about the writer here. "Allowed" would fit to a reader. But for the reader the table is given
and just needs to be read in. For the writer, there are more possibilities. "+grid_tables" could be interpreted as a user selection from these possibilities, extension or not. The CLI interface is a context separate from implementation. "Extension" can have (slightly) different meanings in the two contexts.

@jgm
Copy link
Owner

jgm commented Mar 27, 2019

Extension means the same in both contexts (that's how it has always been, and I don't want to change that). You can force pipe tables in markdown output, for example, but you have to do it by disabling the extensions for other table types, not by enabling pipe tables. (After all, other kinds of tables are enabled too.)

@jgm
Copy link
Owner

jgm commented Mar 27, 2019

I still don't understand why simple tables aren't adequate for your purposes, in the cases where pandoc produces them. Maybe you could say more.

@rpuntaie
Copy link
Author

Actually I want a list table, as that has a line per cell and thus is more easily diffed in a VCS.
rstfromdocx creates it from a grid table. It does not work any more, because now a simple table is produced by pandoc.
In #4750 simple tables can be further processed, in my case grid tables.
It would be great to have some control on which table types are generated.
#4564 (list table option for RST) would help me, too.

@mrdrewkeller
Copy link

+1 to this, the change to simple tables for a default has been great but the option to use grid tables or pipe tables would be nice for instances where cell spans are necessary. The option shown here to specify which type of tables to use does not seem to work for the RST writer https://github.com/jgm/pandoc/wiki/Pandoc-Tricks#convert-between-the-4-table-syntaxes-in-pandoc

@jgm
Copy link
Owner

jgm commented Apr 23, 2019 via email

@mrdrewkeller
Copy link

I see, this may be a pretty specific use case and not worth implementing, but for what it's worth in the past I at least had the option to manually add cell spans after running pandoc when using grid tables. With the simple tables output that doesn't seem to be possible.

@reagle
Copy link

reagle commented Nov 9, 2020

+1 for some way to force the output to grid tables since the default changed as my text editor doesn't know how to edit/reformat simple tables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants