Embedding calculated values in narrative sections of MTK in IPython

Added by J. Simmons over 8 years ago

My work for this week is to sort out the issues we are having rendering calculated values in the narrative sections of MTK documents. In the IPython implementation we are looking to embed calculated values in Markdown cells. We tried to implement this with a notebook extension (Python-Markdown). However, we found that this solution only worked in the notebook web interface. When we go to export a PDF of the notebook, the resulting narrative sections are left with the Markdown syntax for embedding the calculated values instead of the calculated values. I believe this is because the notebook export function is using the nbconvert library and that library works directly on the notebook source file which means the notebook extensions (which are javascript code interacting with the browser) do not even get executed.

So, what we really need is universal support for embedding calculated values in Markdown cells. Imagine my surprise when I came across a throw away second issue on this stack overflow post (the main issue in the post, suppressing some calculation cells is something else we need for other test cases, but we can come back to that later).

The discussion on the stack overflow comments led me to a Literate programming feature request for IPython. This is so close, but the discussion is closed.... But, scroll down to the bottom, and there is a comment that the conversation continues. And, it continues to this day (the last comment is four days old). I need to digest the conversation a bit more, but it is interesting to see the Python-Markdown extension mentioned near the end of the thread. I am guessing we will need to interact with the IPython community to address this issue. Might as well see how that goes early in the process.

I have a few other links related to formatting and customizing IPython PDFs that I am dumping into this thread until I can come back and sort them out a little better.


Replies (1)

RE: Embedding calculated values in narrative sections of MTK in IPython - Added by Jeremy Wright over 8 years ago

This sounds like a blocker to me. We can interact with the IPython community and contribute code, but there's no short-term fix that will allow this task to be completed in this sprint (and new PBIs will be needed). Is that a correct interpretation?

(1-1/1)