Tables in Literate.jl

I would like to display a computed table in a file marked up with Literate.jl. I managed to do it with

using Tables, PrettyTables, DisplayAs

tab = [(a = 1, b = 2), (a = 3, b = 4)];
pretty_table(String, tab; tf = tf_markdown) |> Vector{UInt8} |> DisplayAs.Raw.MD #hide

which injects

|     a |     b |
| Int64 | Int64 |
|-------|-------|
|     1 |     2 |
|     3 |     4 |

into the resulting Markdown, but I am wondering if there is something simpler.

(In any case, I can make a simple utility function for this).

There is now

using MarkdownTables
tab |> markdown_table()

with

3 Likes