question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ipython Markdown Display Widget doesn't render in Jupyter-book

See original GitHub issue

The ipython display widget doesn’t render in my jupyter book HTML output. It does in my sphinx material.

To Reproduce

Steps to reproduce the behavior:

Create a markdown table and try to display it with the ipython widget.

from jinja2 import Environment, BaseLoader

rendered_report_header_table="""# Report

## Sample-1

---

|  |  |  |  |
| --- | --- | --- | --- |
| **Patient Name:** | Smith, Todd | **Ordered By:** | Dr. Who |
| **Date of Birth:** | 12/11/1977 | **Sample Collection Date:** | 12/9/2020 | 
| **Gender**: | Male | **Sample Accession Date:** | 12/9/2020 |
| **Sample Type:** | blood | **Report Data:** | 12/9/2020 |
| **Sample ID/MRN:** | 1234567 | | |
| **Test Accession:** | BRCA122345 | | | 
| **Test Ordered:** | BRCA2 sequencing & Deletion/Duplication analysis | | | 
| **Test Code:** | ABCD | | |
| **Test Indictation** | Patient has family history of breast cancer. | | |

---

## Result: Postitive

---

| Gene   | Variant   | Zygosity     | Variant Classification   |
|:-------|:----------|:-------------|:-------------------------|
| BRCA2  | c.10G>T   | Heterozygous | Likely Pathogenic        |
| BRCA2  | c.-172A>G | Heterozygous | Unknown                  |
"""

# This doesn't work in the jupyterhub output
from IPython.display import display, Markdown, Latex, HTML
display(Markdown(rendered_report_header_table))
Screen Shot 2020-11-18 at 10 13 03 AM

Expected behavior

I expect the Markdown widget to display. It does display correctly when using sphinx + nbsphinx +the sphinx-material theme. It also displays correctly in the jupyter notebook itself.

Screen Shot 2020-11-18 at 9 22 15 AM

A link to your documentation repository.

Github Repo Link to Docs in Sphinx

$ jupyter-book build mybook
ERROR ...

Environment

  • Python Version [e.g. 3.7.1]:
  • Package versions or output of jupyter-book --version:
  • Operating System:
OS: Linux
Python 3.7.5
Jupyter Book: 0.8.3
MyST-NB: 0.10.1
Sphinx Book Theme: 0.0.39
MyST-Parser: 0.12.10
Jupyter-Cache: 0.4.1
NbClient: 0.5.1

Additional context

Nothing else really.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
chrisjsewellcommented, Jan 9, 2021

Note that background-color: transparent has already been removed in a previous request

2reactions
jerowecommented, Jan 7, 2021

@dirkroorda have you tried using sphinx and nbsphinx? That’s what I’m using for my project that requires displaying the markdown widgets. I’m sure jupyter-book will be able to display IPython display widgets.

@chrisjsewell , I’m not sure if this is an option (or just a stupid suggestion 😉 ) but is it possible to use nbsphinx for the ipynb notebooks and the myst-parser for markdown files? Then my markdown widgets would display correctly in the notebooks, and I would get the nice markdown syntax!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Formatting code outputs - Jupyter Book
The formatting of code outputs is highly configurable. ... Click to show ... from IPython.display import display, Markdown display(Markdown('**_some_ ...
Read more >
Module: display — IPython 8.7.0 documentation
Create an audio object. When this object is returned by an input cell or passed to the display function, it will result in...
Read more >
How to embed HTML into IPython output? - Stack Overflow
from IPython.core.display import display, HTML display(HTML('<h1>Hello, world! ... The Jupyter IFrame function does not take a data or srcdoc attribute.
Read more >
Jupyter notebook tutorial in Python - Plotly
Jupyter has a beautiful notebook that lets you write and execute code, ... Jupyter Notebook (previously referred to as IPython Notebook) allows you...
Read more >
JupyterLab - Quarto
Quarto can render Jupyter notebooks represented as plain text (.qmd) or as a ... Note that if you are authoring a book or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found