ickc / pantable

CSV Tables in Markdown: Pandoc Filter for CSV Tables
https://ickc.github.io/pantable/
BSD 3-Clause "New" or "Revised" License
86 stars 15 forks source link

Supporting pandoc 2.11 #51

Closed ickc closed 3 years ago

ickc commented 4 years ago

See sergiocorreia/panflute#142

Edit:

Warning: after studying the new AST, the decision is to completely rewrite pantable. I'd advice against PR for now, as the current code base is going to be obsolete soon.

Links on new table AST

pandoc reader/writer support status

2.10: add new table AST

2.10.1: add LaTeX reader support: rowspan, colspan

2.11:

alerque commented 3 years ago

Do you have work-in-progress code for the rewrite in a branch somewhere?

ickc commented 3 years ago

No. It probably is quite simple to support panflute>=2 from the current code base. But I've bigger plan for it which basically requires major rewrite and the old code base will becomes obsolete very soon so I don't think it will be time well spent to do that.

That said if anyone want to have a PR for that it would be welcomed. pantable2csv would be a bit strange there but we could assume it was a simple table like in the past and it would at least passes current tests. But I don't know if anyone would spend time on such a PR that would have been overwritten by the major change very soon.

No promise on the time line—but I'd guess by the end of the year.

P.S. The "bigger plan", which is always the goal of pantable, is to be able to write a table with all features supported in pandoc.

ickc commented 3 years ago

C.f. jgm/pandoc-types#86. Because of the potential breaking change, this project will be put on hold indefinitely until a stable pandoc table AST is decided.

alerque commented 3 years ago

Ug :disappointed:. I understand of course, but still ug.

ickc commented 3 years ago

Frankly I have quite a big plan for pantable and it has gotten into a state I quite like it. May be I'm overreacting but knowing the AST may change again really is a wake up call for me to pause a bit and not betting too much in the stability of the pandoc AST.

May be the goal of supporting every feature pandoc table support is too ambitious. (That requires pantable having a lossless representation of pandoc AST and therefore very sensitive to AST change.) But that's really my motivation for pantable from day 1.

alerque commented 3 years ago

While I get that, 0% coverage is a lot worse than 0% < 𝑥 < 100% coverage. For the vast majority of my production use cases I'm just converting CSV data to very basic tables that pose no particular challenges for the AST. I have to imagine the bulk of what other people do with this is in line with those same basic requirements.

ickc commented 3 years ago

I'm considering to use what I have written as is and just make the 2 filters as lossy conversion to my internal structure for now and just pause for my big plan for the moment.

tzok commented 3 years ago

I would like to share my current solution: https://gist.github.com/tzok/3d017b4b35601aa1330adee38e827403

Namely, I have a Docker image with pandoc 2.9.2.1 - the last one compatible with current pantable. There is also a Makefile to show how to use the image.

For simple tables this works just fine.

ickc commented 3 years ago

Unless I did something wrong, pip install pantable==0.13.0 should now supports pandoc 2.11.2+. This is a big release so please be careful on potential regression and open new issues for any that you find.