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.

NotebookCellData.mime

See original GitHub issue

Problem

The notebooks api has the concept of markup cells. The intent is that these cells are rendered as html by default, unlike code cells which are displayed as editors by default with their rendered output below them.

Currently we only support markdown markup cells. However we’d also like to support other markup languages, including ones that an extension may invent. However there’s currently no way to set the mime type of a markup cell, which is needed for a custom renderer to be able to support it

Proposal

Add a new NotebookCellData.mime field. If not explicitly provided, this would default to text/plain (or text/markdown it the cell’s language is markdown)

The mime field would only be used when rendering the cell. The existing language field would still be used to determine which type of editor to display for the cell

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
mjbvzcommented, Jun 17, 2021

We could also exploring having markup cells use outputs.

Basically this would be a function executeMarkup(markupCell: NotebookCell): NotebookCellOutputItem that maps markup cells to a single output. This output item would then replace the cell when it is not being edited. VS Code could provide a default implementation that handles markdown, but extensions would need to handle more advanced cases

Needs more thought

1reaction
mjbvzcommented, Jun 15, 2021

@DonJayamanne Yes, you could do that (although for images, you probably just want to use markdown)

In the future we may explore allowing binary cells as well, but for now the big limitation is that you must have text data. Right now though our focus is very much on the cases you listed, such as latex and more traditional markup languages

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Notebook file format — nbformat 5.1 documentation
A code cell can have a variety of outputs (stream data or rich mime-type output). These correspond to messages produced as a result...
Read more >
Notebook Cell-Type Generalisation - Jupyter Community Forum
Whilst we support a huge range of code-cell output MIME types in the various Jupyter Notebook frontends (e.g. JupyterLab), the notebook ...
Read more >
MIME type warning when plotting data with R in a Jupyter ...
MIME type warning when plotting data with R in a Jupyter notebook ... changing the MIME type to png and svg+xml in the...
Read more >
Notebook API | Visual Studio Code Extension API
Cells in a notebook are read and written to the file system by a NotebookSerializer , which handles reading data from the file...
Read more >
Formatting code outputs - Jupyter Book
The traditional Jupyter Notebook interface allows you to toggle output scrolling for your cells. This allows you to visualize part of a long...
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