---
title: Editor Basics
description: Cell types, toolbar actions, and keyboard shortcuts in the SpiceBook notebook editor.
---

import { Aside } from '@astrojs/starlight/components';

A SpiceBook notebook is a vertical sequence of cells. Each cell has a type that determines how it behaves and renders.

## Cell Types

| Type | Purpose | Editor |
|------|---------|--------|
| **Markdown** | Documentation, headings, LaTeX-style math | Rich text with live preview |
| **SPICE** | Circuit netlists for simulation | Code editor with SPICE syntax highlighting |
| **Python** | Computation and scripting | Code editor (execution planned) |
| **Schematic** | Auto-generated circuit diagrams | Read-only SVG display |

Markdown cells render immediately as you type. SPICE cells require you to click **Run** to execute the netlist and see simulation results.

## Toolbar

The notebook toolbar sits at the top of the editor and provides:

- **Run All** — executes every SPICE cell in order, top to bottom
- **Engine selector** — switch between ngspice and LTspice for the entire notebook
- **Embed** — opens a popover with a ready-to-copy iframe snippet for sharing
- **Tags** — add searchable tags to organize notebooks on the homepage

Each individual SPICE cell also has its own run and schematic buttons in the cell toolbar.

## Adding and Reordering Cells

Click **+ Add Cell** between any two cells to insert a new one. The dropdown lets you choose the cell type.

Cells can be reordered by dragging, or programmatically via the [reorder API endpoint](/api/cells/#reorder-cells).

To delete a cell, use the cell menu (three dots) and select **Delete**.

## Code Editor

SPICE cells use a code editor with:

- **Syntax highlighting** for SPICE netlist keywords (`.tran`, `.ac`, `.op`, etc.)
- **Line numbers** for referencing specific netlist lines
- **Auto-indentation** following SPICE conventions

<Aside type="note">
The editor uses the SpiceBook dark theme by default — slate backgrounds with a blue cursor. The color scheme matches the rest of the application.
</Aside>

## Notebook Metadata

Every notebook tracks:

- **Title** — displayed in the gallery and browser tab
- **Engine** — `ngspice` or `ltspice`, applies to all SPICE cells
- **Tags** — free-form labels for filtering in the notebook gallery
- **Created / Modified** — ISO-8601 timestamps, set automatically
