JakeWharton / picnic

A Kotlin DSL and Java/Kotlin builder API for constructing HTML-like tables which can be rendered to text

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

calling `renderText` from Java

garfieldnate opened this issue · comments

Hi, thanks for this useful library! I'm using it in a Java project and I wanted to try out the ROUNDED and ASCII styles, but I cannot seem to access Table.renderText (or Table.render). Is this feature meant to be available from Java?

It should be available via TextRendering.render(table, otherArgs..)

🤔 Thanks, I had missed that completely. It's a bit unclear what I should pass as an argument after the table, though. I can't just input TextBorder.ASCII; it expects a function from Cells to TextLayouts, but the only implementation of TextLayout is SimpleLayout, and that's an internal class.

Note that, though I'm interested in checking out the ROUNDED style, I actually need the ASCII style as a workaround for #29.

commented

Can you add java examples?