3

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?

joergd
  • 553
  • 4
  • 13
  • 2
    I'm not familiar with Flexmark-Java, but Pandoc is the only Markdown implementation I have ever seen which supports multiline tables. Most any other Markdown implementation which supports tables at all only support Pandoc's pipe tables, which expressly do not support multi-line cells.That is probably because pipe tables are a clone of PHP Markdown Extra's tables, which were the first tables extension anyone every made for Markdown. Most implementations more-or-less copied that with all of it's limitations. – Waylan Jun 01 '19 at 01:25
  • Any specific reason why you cannot stick to pandoc? It's quite customizable with https://pandoc.org/lua-filters.html etc. – mb21 Jun 02 '19 at 08:46
  • @mb21: Although pandoc does a great job at rendering HTML and document formats from Markdown, it does not really integrate well into a platform-independant maven build process. Even if it would be invoked indirectly from a maven plugin just for the rendering, it still requires a local install of a platform-specific binary. Flexmark-Java would be a perfect match for that, but unfortunately does no match up with pandoc in regards of rendering. – joergd Jun 03 '19 at 22:29
  • I can see that... but at least pandoc ships as a self-contained binary... so it's not that hard to integrate... but sure, if it's your first non-jvm dependency in the project it's a pain... – mb21 Jun 04 '19 at 07:15

1 Answers1

1

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

A. M.
  • 384
  • 1
  • 6