Jupyter-book: Support for Markdown in Jupyter Notebook outputs

Created on 6 Jul 2020  路  6Comments  路  Source: executablebooks/jupyter-book

The older version of Jupyter Book supported Markdown in Jupyter Notebook outputs, but it seems like the newer version of Jupyter Book no longer does. It would be great to add back support for Markdown in cell outputs.

For example, running code like this would generate Markdown that would be displayed in a published Jupyter Book:

from IPython.display import Markdown, display

def display_bolded_topic_words_in_context(topic_number=3):

    display(Markdown(original_text))

    return 

Example of older version of Jupyter Book rendering Markdown output

Screen Shot 2020-07-06 at 4 24 50 PM

Example of older version of Jupyter Book rendering Markdown output

Screen Shot 2020-07-06 at 4 24 57 PM

Example of newer version of Jupyter Book not rendering Markdown output

Screen Shot 2020-07-06 at 4 25 06 PM

Example of newer version of Jupyter Book not rendering Markdown output

Screen Shot 2020-07-06 at 4 25 12 PM

enhancement

All 6 comments

ahh yes - good catch. I believe that this will be supported once https://github.com/executablebooks/MyST-NB/pull/198 gets merged!

@choldgraf Awesome, thanks!

Actually, there's a distinct difference between executablebooks/MyST-NB#198 and what it appears was offered by the old jupyter book:

  • the former is attempting to inject the output markdown into the surrounding documentation, so it would not have its own output box and e.g. footnotes would appear at the bottom of the document
  • the latter treats the output markdown as an isolated piece of text, e.g. footnotes would appear at the bottom of this text, and wraps it in an output box

These are two distinct use cases, and we should consider if/how we support one or both.

BTW @choldgraf it looks like you have an outstanding question to answer in that PR 馃槈

this is now available in https://myst-nb.readthedocs.io/en/latest/use/formatting_outputs.html#markdown, coming to jupyter-book very soon 馃槃

This should be closed in v0.8.0 馃槃, but feel free to re-open/open another issue if anything is outstanding: https://jupyterbook.org/reference/_changelog.html#v0-8-0-2020-09-01

Was this page helpful?
0 / 5 - 0 ratings