Tables output with Literate.jl

2022-09-28 julia markdown announcement

I recently wrote a very lightweight package called MarkdownTables.jl that makes it easy to embed tables using Literate.jl. It handles anything that works with Tables.jl:

using MarkdownTables
my_table = [(animal = "cat", legs = 4),
            (animal = "catfish", legs = 0),
            (animal = "canary", legs = 2)]
my_table |> markdown_table()
animallegs
cat4
catfish0
canary2

Under the hood, it just wraps some basic Markdown with DisplayAs.jl:

my_table |> markdown_table(String) |> print
| animal  | legs |
|---------|------|
|     cat |    4 |
| catfish |    0 |
|  canary |    2 |

The default output is pretty basic — while the function has some options for formatting, it is recommended that you use CSS instead.

I expect that this pretty much rounds out the tooling I need for blogging with Franklin.jl. Feedback and PRs are of course welcome, but I intend to keep this package very basic.