Flask Markdown Tables 🐍
2024-09-05
The Struggle 🕳️
I was trying to use a markdown syntax to put some tables in my posts and it was just rendering the raw text 🤔
| Name | Age | |-------|-----| | Alice | 24 | | Bob | 19 | | Charlie | 32 |
Let the googling ensue. But, I was running into brick wall 🧱 after brick wall. Variations on syntax, put an empty line, don't put an empty line etc ♾️.
Solution 🧮
Turns out that the markdown
plugin Flask needs an extension to render tables.
Once you know you know 🧠.
Easy as Pie 🥧
Now it is as simple as telling your markdown renderer to use the tables
extension. Just add
1 |
|
to your app.config
and you are good to go 🚀. like so:
1 2 3 4 5 6 7 8 9 10 11 |
|
for example 🐍. Now we can render tables easy as pie 🥧:
Name | Age |
---|---|
Alice | 24 |
Bob | 19 |
Charlie | 32 |
woot; 🎉