I have a function that generates a big chunk of markdown with embedded newline characters. A simple version would be:
function makemd()
md"# HELLO\n## Some\n * list\n* list\n"
end
That produces a string that prints correctly in the repl, but of course you can’t print to Pluto. So, how can I get the output to render nicely in Pluto, as when you simply type in a chunk of markdown? At present I just see the raw string, with the "\n"s embedded in it.
Indeed that does work, but unfortunately it’s not possible for me to produce my markdown in that way: I’m actually producing quite big md tables line-by-line. Sorry if my example was misleading.
Hello. Apologies if this has in some way made easier, but the accepted solution does not seem to work anymore. I’ll be most grateful for any help I can get.
My MWE:
begin
str = "| a | b |\n"
str *= "| - | - |\n"
for ind in 1:10
str *= "| $(ind) | $(2*ind) |\n"
end
@eval @md_str $str
end
For some reason it seems that Markdown.parse requires at least three dashes (---) per column. Maybe file an issue to change that, or a PR to document this behavior…