I frequently need to produce Markdown formatted output in Jupyter notebook. The way I do it is:
from IPython.display import display, Markdown
display(Markdown('# This is a Title'))
This will produce a beautiful formatted output. However there also exists a function called display_markdown()
that I would expect to do the same. But apparently it doesn't do anything at all. What is it supposed to do?
IPython provides the following features: Interactive shells (terminal and Qt-based). A browser-based notebook interface with support for code, text, mathematical expressions, inline plots and other media. Support for interactive data visualization and use of GUI toolkits.
show command displays the form within the window that is running the Python script. (See this command used in the Basic Display example below.)
Markdown cell displays text which can be formatted using markdown language. In order to enter a text which should not be treated as code by Notebook server, it must be first converted as markdown cell either from cell menu or by using keyboard shortcut M while in command mode.
Markdown is a simple and popular markup language used for text cells in the Jupyter Notebook. Markdown documents can be edited as text files or rendered inline: Jupyter / IPython.
You need to set raw=True
since it is a raw markdown:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With