How to render multi-line tables with flexmark-java?

622 views Asked by At

I would like to move over to Flexmark-Java for rendering Markdown documents, which have been previously used with Pandoc.

Unfortunately, Flexmark does not come with any //ParserEmulationProfile// for the particular Pandoc markdown style, so there will be definitely some reformatting effort necessary. But for that to do, every particular Pandoc syntax needs to find a counterpart in something Flexmark does understand.

While not having this analyzed exhaustively yet, one particular challenge are tables. In contrast to other Markdown dialects, Pandoc comes with a quite sophisticated set of table syntaxes, that cope with various requirements for writing documents.

One particular feature, I'm currently trying to find a Flexmark counterpart syntax are multi-line tables:

-------------------------------------------------------------
 Centered   Default           Right Left
  Header    Aligned         Aligned Aligned
----------- ------- --------------- -------------------------
   First    row                12.0 Example of a row that
                                    spans multiple lines.

  Second    row                 5.0 Here's another one. Note
                                    the blank line between
                                    rows.
-------------------------------------------------------------

Flexmark comes with a Table Extension that already covers some of what pandoc provides, but I was unable to figure out, if (and how) multi-line tables are supported. I didn't find any hint in the (rather sparse) documentation, but believe to remember, that I read it in a discussion forum post while researching (sorry no reference available currently).

So, can anybody shed some light on how multi-line table parsing/rendering is available with Flexmark-Java?

1

There are 1 answers

0
A. M. On

If your problem lies in integrating pandoc with your maven build, have you thought about using a docker image with pandoc for it?

It's quite common to go the docker route whenever you need extra dependencies in your CI builds.

There are a few pandoc images out there, and it's pretty simple to build your own.

You can get the official ones at https://hub.docker.com/u/pandoc or a sample with additional tools at https://hub.docker.com/r/agusmba/pandocomatic