Docs · API reference · Verso.Abstractions

ICellType Interface#

Defines a cell type by combining a renderer with an optional language kernel. Cell types appear in the cell type picker and determine how a cell is edited, displayed, and optionally executed.

public interface ICellType : Verso.Abstractions.IExtension

Implements IExtension

Properties#

CellTypeId Property#

Unique identifier for this cell type (e.g. "code-csharp", "markdown").

string CellTypeId { get; }

Property Value#

System.String

DisplayName Property#

Human-readable label shown in the cell type picker.

string DisplayName { get; }

Property Value#

System.String

Icon Property#

Optional icon name or path displayed alongside the cell type in menus.

string? Icon { get; }

Property Value#

System.String

IsEditable Property#

Indicates whether the user can edit the cell content. Non-editable cells are read-only.

bool IsEditable { get; }

Property Value#

System.Boolean

Kernel Property#

Optional language kernel used to execute cells of this type. Returns null for non-executable cell types such as Markdown or raw text.

Verso.Abstractions.ILanguageKernel? Kernel { get; }

Property Value#

ILanguageKernel

PersistsOutputs Property#

Indicates whether outputs produced by cells of this type are part of the saved document. Defaults to true. Return false for cell types whose outputs are derived and re-rendered on open (rather than persisted), so that automatically re-rendering them neither writes them to disk nor marks the notebook as edited.

bool PersistsOutputs { get; }

Property Value#

System.Boolean

Renderer Property#

Renderer responsible for producing the visual representation of cells of this type.

Verso.Abstractions.ICellRenderer Renderer { get; }

Property Value#

ICellRenderer

Methods#

GetDefaultContent() Method#

Returns the default source content inserted when a new cell of this type is created.

string GetDefaultContent();

Returns#

System.String
A string containing the default cell content.