Ryan Malloy 844088aa29 Add Starlight docs site with API reference, guides, and embedding docs
Starlight site at docs-site/ following warehack.ing cookie-cutter pattern
(3-compose split, Caddy prod stage, Makefile targets). 15 content pages
covering simulation engines, waveform viewer, schematics, embedding with
postMessage theme sync, and full REST API reference adapted from llms.txt.
Blue accent theme matching SpiceBook's application palette. Adds docs link
to homepage reference section.
2026-03-06 11:55:21 -07:00

60 lines
2.3 KiB
Plaintext

---
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