NotebookCellData.mime
See original GitHub issueProblem
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:
- Created 2 years ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top GitHub Comments
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 casesNeeds more thought
@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