jupyter-book icon indicating copy to clipboard operation
jupyter-book copied to clipboard

display(Markdown('# my markdown')) notebook outputs not displaying in built HTML output

Open jgunstone opened this issue 2 years ago • 1 comments

Describe the bug

context When I build a jupyterbook with a notebook displaying Markdown outputs the output isn't displayed.

note while i'm describing only markdown here, i have found inconsistency behaviour when display simple ipywidget output also.

expectation I expected the markdown output to be displayed in the built book. as described here: https://myst-nb.readthedocs.io/en/latest/render/format_code_cells.html#markdown

bug But instead the markdown is not showing in the HTML output input notebook:

from IPython.display import display, Markdown
class Doc:
    title = 'asdf'
    icon = 'table-icon.png'

doc = Doc()
display(Markdown(f"""## {doc.title}

```{{image}} {str(doc.icon)}
:height: 150px
:name: icon
title: "Configure Space Schedules"
author: "Oliver Hensby"
tooltip: |
  Import space parameters to all spaces.

  Parameters are defined in space data template that exists in the 
  Max Fordham database.

"""))


![image](https://user-images.githubusercontent.com/21370980/176446495-5cbc663c-ddd2-44fe-9630-de7c7f9b380e.png)
 --> 

![image](https://user-images.githubusercontent.com/21370980/176446583-fb0cacb0-330e-4f80-8e94-061b5efd936b.png)
jupyterbook html output

**problem**
This is a problem for people using notebooks for making books.


### Reproduce the bug

1. create a notebook called `test.ipynb`
2. copy in the code:
```py
from IPython.display import display, Markdown
class Doc:
    title = 'asdf'
    icon = 'table-icon.png'

doc = Doc()
display(Markdown(f"""## {doc.title}

```{{image}} {str(doc.icon)}
:height: 150px
:name: icon
  1. set up toc.yml, _config.yml etc . and generate conf.py
  2. build with jupyter book

jb build . --all or sphinx-build . _build/html -b html

List your environment

Jupyter Book      : 0.12.3
External ToC      : 0.2.4
MyST-Parser       : 0.15.2
MyST-NB           : 0.13.2
Sphinx Book Theme : 0.1.10
Jupyter-Cache     : 0.4.3
NbClient          : 0.5.13

jgunstone avatar Jun 29 '22 13:06 jgunstone

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

welcome[bot] avatar Jun 29 '22 13:06 welcome[bot]