# Force Jupyter kernel rendering result as markdown

**URL:** <https://discourse.jupyter.org/t/force-jupyter-kernel-rendering-result-as-markdown/20963>\
**Category:** Kernels\
**Tags:** how-to\
**Created:** [August 19, 2023, 2:50am UTC](https://discourse.jupyter.org/t/force-jupyter-kernel-rendering-result-as-markdown/20963 "2023-08-19T02:50:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![systakineko.tfs](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/systakineko.tfs/32/13271_2.png) [@systakineko.tfs](https://discourse.jupyter.org/u/systakineko.tfs)\
**Post date:** [August 19, 2023, 2:50am UTC](https://discourse.jupyter.org/t/force-jupyter-kernel-rendering-result-as-markdown/20963/1 "2023-08-19T02:50:03Z")

</div>

I’m writing a new Jupyter kernel. The default output of the code cell is text, like this one:

```plaintext
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/CU7S_yTVLpE\" allowfullscreen></iframe>"
     ]
    }
   ]

```

However, I want to render the result as the markdown. Is there any chance to do this?

---

<div class="post-metadata">

**Author:** ![systakineko.tfs](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/systakineko.tfs/32/13271_2.png) [@systakineko.tfs](https://discourse.jupyter.org/u/systakineko.tfs)\
**Post date:** [August 19, 2023, 12:56pm UTC](https://discourse.jupyter.org/t/force-jupyter-kernel-rendering-result-as-markdown/20963/2 "2023-08-19T12:56:09Z")

</div>

Sorry for being annoying.

Actually, I just changed this piece of code when printing out the result

```python
self.send_response(self.iopub_socket, "stream", {"name": "stdout", "text": contents})

```

to

```python
send_response(self.iopub_socket, 
                           'display_data',
                           {
                            'data':{
                               'text/markdown': contents
                                },
                            'metadata': {}
                           }
                          )

```
