I am using papermill to parameterize making a bunch of notebooks. These notebooks are meant to be stubs so that not everything is 100% complete in them. One of the things I have for input into Papermill is raw markdown formatted text that I got from a conversion via pandoc. Ultimately I want this raw markdown text to show up as a typical markdown cell in the new notebook. I could get it to display the rendered markdown as output using this but then it cannot be edited further. And of course, I could just use
print() to get the raw markdown to show up as text I could that I can then copy and paste in a new markdown cell in the generated notebook and render as markdown. And that would work, but it sounds tedious for a lot of notebooks and it feels like I am missing a step where I could go direct from markdown text stored as a Python variable to the text as a markdown cell in a new notebook.
Discussing it with Jürgen Hermann (@jhermann), we came up with some options. Options discussed:
https://github.com/transfluxus/magic_markdown (I felt this was mostly similar to having the markdown display as output using the display control)
notedown - what I think I will opt for (see below)
nbreport for hiding the input cells/meta data
My present solution is to insert using notedown to fist make an unrun notebook that puts the markdown as markdown cells and then I can run the notebooks via Papermill to have the required resulting output be added. But I am still curious if there is a more direct way to inject programmatically generated markdown text into a new notebook and have it be in a markdown cell? Suggestions?